├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── LICENSE ├── README.md ├── libs ├── antlr4-4.8-1.jar └── antlr4-runtime-4.8-1.jar ├── pom.xml └── src └── main ├── java └── org │ └── luapp │ └── language │ ├── Luapp.java │ ├── Main.java │ ├── generator │ ├── luapp.interp │ ├── luapp.tokens │ ├── luappBaseListener.java │ ├── luappBaseVisitor.java │ ├── luappLexer.interp │ ├── luappLexer.java │ ├── luappLexer.tokens │ ├── luappListener.java │ ├── luappParser.java │ └── luappVisitor.java │ ├── handlers │ ├── AbstractClassNameHandler.java │ ├── ClassBodyHandler.java │ ├── ClassFunctionHandler.java │ ├── ClassGetSetHandler.java │ ├── ClassNameHandler.java │ ├── ClassStaticFunctionHandler.java │ ├── ConstructorHandler.java │ ├── SafeHandler.java │ └── StatementHandler.java │ ├── listeners │ ├── LuaPPFileWatchingService.java │ ├── LuaPPListener.java │ └── MasterLuaPPListener.java │ ├── loader │ └── ListenerManager.java │ ├── parser │ └── luapp.g4 │ ├── test.lpp │ ├── test.lua │ └── watcher │ └── FileWatcher.java └── resources └── META-INF └── MANIFEST.MF /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Lua++ version:** x.x.x 11 | 12 | **Lua++ Code:** 13 | 14 | **Transpiled Code:** 15 | 16 | **Describe the bug** 17 | 18 | **Steps To Reproduce** 19 | 20 | 1. Go to '...' 21 | 2. Click on '....' 22 | 3. Scroll down to '....' 23 | 4. See an error 24 | 25 | **Expected behavior A clear and concise description of what you expected to happen.** 26 | 27 | **Screenshots If applicable, add screenshots to help explain your problem.** 28 | 29 | **Additional context Add any other context about the problem here.** 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | 12 | **Describe the solution you'd like** 13 | 14 | **Describe alternatives you've considered** 15 | 16 | **Additional context** 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | target/** 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lua++ 2 | ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/LuaPlusPlus/lua-plus-plus?label=Version&style=flat-square) 3 |
Join the [Lua++ Discord](https://discord.gg/s5NDfSH)
4 | The documentation can be found on the [wiki](https://github.com/LuaPlusPlus/lua-plus-plus/wiki) 5 | 6 | #### [Changelog](https://github.com/LuaPlusPlus/lua-plus-plus/wiki/Changelog) 7 | 8 | *moonscript stinky* 9 | -------------------------------------------------------------------------------- /libs/antlr4-4.8-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaPlusPlus/lua-plus-plus/ae2623b2a0739eb7dfba6ca2af672391307413b2/libs/antlr4-4.8-1.jar -------------------------------------------------------------------------------- /libs/antlr4-runtime-4.8-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LuaPlusPlus/lua-plus-plus/ae2623b2a0739eb7dfba6ca2af672391307413b2/libs/antlr4-runtime-4.8-1.jar -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 4.0.0 7 | 8 | org.luapp 9 | lpp 10 | 1.0-SNAPSHOT 11 | jar 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | org.antlr 22 | antlr4-runtime 23 | 4.8-1 24 | 25 | 26 | 27 | org.antlr 28 | antlr 29 | 3.5.2 30 | 31 | 32 | org.reflections 33 | reflections 34 | 0.9.12 35 | 36 | 37 | 38 | 39 | 40 | luapp 41 | 42 | 43 | 44 | org.apache.maven.plugins 45 | maven-compiler-plugin 46 | 3.1 47 | 48 | 1.8 49 | 1.8 50 | 51 | 52 | 53 | 54 | maven-assembly-plugin 55 | 2.2-beta-5 56 | 57 | 58 | 59 | org.luapp.language.Main 60 | 61 | 62 | 63 | jar-with-dependencies 64 | 65 | 66 | 67 | 68 | make-assembly 69 | package 70 | 71 | single 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/Luapp.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language; 2 | 3 | import org.antlr.v4.runtime.*; 4 | import org.antlr.v4.runtime.misc.Interval; 5 | import org.antlr.v4.runtime.tree.ParseTree; 6 | import org.antlr.v4.runtime.tree.ParseTreeListener; 7 | import org.antlr.v4.runtime.tree.ParseTreeWalker; 8 | import org.antlr.v4.runtime.tree.TerminalNode; 9 | import org.luapp.language.generator.luappLexer; 10 | import org.luapp.language.generator.luappParser; 11 | import org.luapp.language.listeners.LuaPPListener; 12 | import org.luapp.language.listeners.MasterLuaPPListener; 13 | import org.luapp.language.loader.ListenerManager; 14 | 15 | import java.io.File; 16 | import java.io.FileWriter; 17 | import java.io.IOException; 18 | 19 | public class Luapp { 20 | 21 | public ListenerManager listenerManager; 22 | 23 | public String currentResult; 24 | public String raw; 25 | public String path; 26 | public String currentClass; 27 | public String currentAbstract; 28 | 29 | public CommonTokenStream commonTokenStream; 30 | 31 | /** 32 | * 33 | * @param path The path to the file. 34 | */ 35 | public Luapp(String path){ 36 | 37 | this.currentResult = ""; 38 | this.path = path; 39 | 40 | } 41 | 42 | public void load(){ 43 | try { 44 | this.listenerManager = new ListenerManager(); 45 | this.listenerManager.Load(); 46 | luappLexer lexer = new luappLexer(new ANTLRFileStream(this.path)); 47 | this.commonTokenStream = new CommonTokenStream(lexer); 48 | luappParser parser = new luappParser(this.commonTokenStream); 49 | ParseTree tree = parser.chunk(); 50 | ParseTreeWalker walker = new ParseTreeWalker(); 51 | walker.walk(new MasterLuaPPListener(), tree); 52 | 53 | String newPath = this.path.substring(0, this.path.length()-3) + "lua"; 54 | File newFile = new File(newPath); 55 | newFile.createNewFile(); 56 | FileWriter writeFile = new FileWriter(newPath); 57 | writeFile.write("--[[\nWritten with Lua++.\n" + 58 | "Don't remove this notice please\n" + 59 | "\nhttps://github.com/LuaPlusPlus/lua-plus-plus\n]]--" + this.currentResult); 60 | writeFile.close(); 61 | }catch(IOException ex){ 62 | ex.printStackTrace(); 63 | } 64 | 65 | } 66 | 67 | public ListenerManager getListenerManager() { 68 | return listenerManager; 69 | } 70 | 71 | public String getCurrentAbstract() { 72 | return currentAbstract; 73 | } 74 | 75 | public String getCurrentClass() { 76 | return currentClass; 77 | } 78 | 79 | public String getCurrentResult() { 80 | return currentResult; 81 | } 82 | 83 | public void handleEnterContext(ParserRuleContext context){ 84 | this.listenerManager.listeners.forEach((LuaPPListener listener)->{ 85 | 86 | listener.handleEnterContext(context); 87 | }); 88 | } 89 | 90 | public void handleExitContext(ParserRuleContext context){ 91 | this.listenerManager.listeners.forEach((LuaPPListener listener)->{ 92 | listener.handleExitContext(context); 93 | }); 94 | } 95 | 96 | public String getRaw(){ 97 | return this.raw; 98 | } 99 | 100 | public String getRawFromContext(ParserRuleContext context){ 101 | int startToken = context.start.getStartIndex(); 102 | int stopToken = context.stop.getStopIndex(); 103 | return context.getStart().getInputStream().getText(new Interval(startToken, stopToken)); 104 | } 105 | 106 | public void appendToResult(String target){ 107 | this.currentResult += "\n" + target; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/Main.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.util.Scanner; 6 | 7 | public class Main { 8 | 9 | public static Luapp luaPPInstance; 10 | 11 | public static String output = ""; 12 | 13 | public static boolean debug = false; 14 | 15 | public static void main(String[] args){ 16 | String path = debug ? System.getProperty("user.dir") + "/src/main/java/org/luapp/language/test.lpp" : args[0]; 17 | Main.luaPPInstance = new Luapp(path); 18 | Main.luaPPInstance.load(); 19 | } 20 | 21 | public static String readPath(String path){ 22 | try { 23 | File myObj = new File(path); 24 | Scanner myReader = new Scanner(myObj); 25 | StringBuilder data2 = new StringBuilder(); 26 | while (myReader.hasNextLine()) { 27 | String data = myReader.nextLine(); 28 | data2.append(data+="\n"); 29 | } 30 | System.out.println("Converting: \n" + data2.toString()); 31 | myReader.close(); 32 | return data2.toString(); 33 | 34 | } catch (FileNotFoundException e) { 35 | System.out.println("An error occurred."); 36 | e.printStackTrace(); 37 | } 38 | return ""; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luapp.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | ';' 4 | '=' 5 | 'break' 6 | 'goto' 7 | 'do' 8 | 'end' 9 | 'while' 10 | 'repeat' 11 | 'until' 12 | 'if' 13 | 'then' 14 | 'elseif' 15 | 'else' 16 | 'for' 17 | ',' 18 | 'in' 19 | 'function' 20 | 'class' 21 | 'extends' 22 | 'local' 23 | 'safe' 24 | 'return' 25 | '::' 26 | '.' 27 | ':' 28 | 'nil' 29 | 'false' 30 | 'true' 31 | '...' 32 | '(' 33 | ')' 34 | '[' 35 | ']' 36 | '{' 37 | '}' 38 | 'or' 39 | 'and' 40 | '<' 41 | '>' 42 | '<=' 43 | '>=' 44 | '~=' 45 | '==' 46 | '..' 47 | '+' 48 | '-' 49 | '*' 50 | '/' 51 | '%' 52 | '//' 53 | '&' 54 | '|' 55 | '~' 56 | '<<' 57 | '>>' 58 | 'not' 59 | '#' 60 | '^' 61 | 'static' 62 | 'get' 63 | 'set' 64 | 'constructor' 65 | '++' 66 | '+=' 67 | '*=' 68 | '/=' 69 | '-=' 70 | null 71 | null 72 | null 73 | null 74 | null 75 | null 76 | null 77 | null 78 | null 79 | null 80 | null 81 | null 82 | 83 | token symbolic names: 84 | null 85 | null 86 | null 87 | null 88 | null 89 | null 90 | null 91 | null 92 | null 93 | null 94 | null 95 | null 96 | null 97 | null 98 | null 99 | null 100 | null 101 | null 102 | null 103 | null 104 | null 105 | null 106 | null 107 | null 108 | null 109 | null 110 | null 111 | null 112 | null 113 | null 114 | null 115 | null 116 | null 117 | null 118 | null 119 | null 120 | null 121 | null 122 | null 123 | null 124 | null 125 | null 126 | null 127 | null 128 | null 129 | null 130 | null 131 | null 132 | null 133 | null 134 | null 135 | null 136 | null 137 | null 138 | null 139 | null 140 | null 141 | null 142 | null 143 | null 144 | null 145 | null 146 | null 147 | null 148 | null 149 | null 150 | null 151 | null 152 | NAME 153 | NORMALSTRING 154 | CHARSTRING 155 | LONGSTRING 156 | INT 157 | HEX 158 | FLOAT 159 | HEX_FLOAT 160 | COMMENT 161 | LINE_COMMENT 162 | WS 163 | SHEBANG 164 | 165 | rule names: 166 | chunk 167 | block 168 | stat 169 | retstat 170 | label 171 | funcname 172 | classname 173 | abstractclassname 174 | varlist 175 | namelist 176 | explist 177 | exp 178 | prefixexp 179 | functioncall 180 | varOrExp 181 | var 182 | varSuffix 183 | nameAndArgs 184 | args 185 | functiondef 186 | funcbody 187 | parlist 188 | tableconstructor 189 | fieldlist 190 | field 191 | fieldsep 192 | operatorOr 193 | operatorAnd 194 | operatorComparison 195 | operatorStrcat 196 | operatorAddSub 197 | operatorMulDivMod 198 | operatorBitwise 199 | operatorUnary 200 | operatorPower 201 | number 202 | string 203 | classdef 204 | classfunction 205 | classstaticfunction 206 | classgetorset 207 | classgetset 208 | constructor 209 | classmember 210 | classbody 211 | addOne 212 | plusEqual 213 | multiplyEqual 214 | divEqual 215 | minusEqual 216 | safeOperator 217 | 218 | 219 | atn: 220 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 3, 81, 531, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 3, 2, 3, 2, 3, 2, 3, 3, 7, 3, 109, 10, 3, 12, 3, 14, 3, 112, 11, 3, 3, 3, 5, 3, 115, 10, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 7, 4, 151, 10, 4, 12, 4, 14, 4, 154, 11, 4, 3, 4, 3, 4, 5, 4, 158, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 170, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 192, 10, 4, 3, 4, 3, 4, 3, 4, 5, 4, 197, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 203, 10, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 4, 215, 10, 4, 3, 4, 3, 4, 3, 4, 5, 4, 220, 10, 4, 3, 4, 3, 4, 5, 4, 224, 10, 4, 3, 5, 3, 5, 5, 5, 228, 10, 5, 3, 5, 5, 5, 231, 10, 5, 3, 6, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 7, 7, 240, 10, 7, 12, 7, 14, 7, 243, 11, 7, 3, 7, 3, 7, 5, 7, 247, 10, 7, 3, 8, 3, 8, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 7, 10, 256, 10, 10, 12, 10, 14, 10, 259, 11, 10, 3, 11, 3, 11, 3, 11, 7, 11, 264, 10, 11, 12, 11, 14, 11, 267, 11, 11, 3, 12, 3, 12, 3, 12, 7, 12, 272, 10, 12, 12, 12, 14, 12, 275, 11, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 5, 13, 290, 10, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 7, 13, 324, 10, 13, 12, 13, 14, 13, 327, 11, 13, 3, 14, 3, 14, 7, 14, 331, 10, 14, 12, 14, 14, 14, 334, 11, 14, 3, 15, 3, 15, 6, 15, 338, 10, 15, 13, 15, 14, 15, 339, 3, 16, 3, 16, 3, 16, 3, 16, 3, 16, 5, 16, 347, 10, 16, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 3, 17, 5, 17, 355, 10, 17, 3, 17, 7, 17, 358, 10, 17, 12, 17, 14, 17, 361, 11, 17, 3, 18, 7, 18, 364, 10, 18, 12, 18, 14, 18, 367, 11, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 5, 18, 375, 10, 18, 3, 19, 3, 19, 5, 19, 379, 10, 19, 3, 19, 3, 19, 3, 20, 3, 20, 5, 20, 385, 10, 20, 3, 20, 3, 20, 3, 20, 5, 20, 390, 10, 20, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 5, 22, 397, 10, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 5, 23, 406, 10, 23, 3, 23, 5, 23, 409, 10, 23, 3, 24, 3, 24, 5, 24, 413, 10, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 25, 3, 25, 7, 25, 421, 10, 25, 12, 25, 14, 25, 424, 11, 25, 3, 25, 5, 25, 427, 10, 25, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 3, 26, 5, 26, 439, 10, 26, 3, 27, 3, 27, 3, 28, 3, 28, 3, 29, 3, 29, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 38, 3, 38, 3, 39, 3, 39, 3, 39, 3, 39, 3, 40, 3, 40, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 6, 43, 483, 10, 43, 13, 43, 14, 43, 484, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 5, 44, 492, 10, 44, 3, 44, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 5, 45, 501, 10, 45, 3, 46, 3, 46, 3, 46, 3, 46, 7, 46, 507, 10, 46, 12, 46, 14, 46, 510, 11, 46, 3, 46, 3, 46, 3, 47, 3, 47, 3, 47, 3, 48, 3, 48, 3, 48, 3, 49, 3, 49, 3, 49, 3, 50, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 52, 2, 3, 24, 53, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 2, 11, 4, 2, 3, 3, 17, 17, 3, 2, 40, 45, 3, 2, 47, 48, 3, 2, 49, 52, 3, 2, 53, 57, 5, 2, 48, 48, 55, 55, 58, 59, 3, 2, 74, 77, 3, 2, 71, 73, 3, 2, 62, 63, 2, 558, 2, 104, 3, 2, 2, 2, 4, 110, 3, 2, 2, 2, 6, 223, 3, 2, 2, 2, 8, 225, 3, 2, 2, 2, 10, 232, 3, 2, 2, 2, 12, 236, 3, 2, 2, 2, 14, 248, 3, 2, 2, 2, 16, 250, 3, 2, 2, 2, 18, 252, 3, 2, 2, 2, 20, 260, 3, 2, 2, 2, 22, 268, 3, 2, 2, 2, 24, 289, 3, 2, 2, 2, 26, 328, 3, 2, 2, 2, 28, 335, 3, 2, 2, 2, 30, 346, 3, 2, 2, 2, 32, 354, 3, 2, 2, 2, 34, 365, 3, 2, 2, 2, 36, 378, 3, 2, 2, 2, 38, 389, 3, 2, 2, 2, 40, 391, 3, 2, 2, 2, 42, 394, 3, 2, 2, 2, 44, 408, 3, 2, 2, 2, 46, 410, 3, 2, 2, 2, 48, 416, 3, 2, 2, 2, 50, 438, 3, 2, 2, 2, 52, 440, 3, 2, 2, 2, 54, 442, 3, 2, 2, 2, 56, 444, 3, 2, 2, 2, 58, 446, 3, 2, 2, 2, 60, 448, 3, 2, 2, 2, 62, 450, 3, 2, 2, 2, 64, 452, 3, 2, 2, 2, 66, 454, 3, 2, 2, 2, 68, 456, 3, 2, 2, 2, 70, 458, 3, 2, 2, 2, 72, 460, 3, 2, 2, 2, 74, 462, 3, 2, 2, 2, 76, 464, 3, 2, 2, 2, 78, 468, 3, 2, 2, 2, 80, 472, 3, 2, 2, 2, 82, 477, 3, 2, 2, 2, 84, 479, 3, 2, 2, 2, 86, 488, 3, 2, 2, 2, 88, 500, 3, 2, 2, 2, 90, 508, 3, 2, 2, 2, 92, 513, 3, 2, 2, 2, 94, 516, 3, 2, 2, 2, 96, 519, 3, 2, 2, 2, 98, 522, 3, 2, 2, 2, 100, 525, 3, 2, 2, 2, 102, 528, 3, 2, 2, 2, 104, 105, 5, 4, 3, 2, 105, 106, 7, 2, 2, 3, 106, 3, 3, 2, 2, 2, 107, 109, 5, 6, 4, 2, 108, 107, 3, 2, 2, 2, 109, 112, 3, 2, 2, 2, 110, 108, 3, 2, 2, 2, 110, 111, 3, 2, 2, 2, 111, 114, 3, 2, 2, 2, 112, 110, 3, 2, 2, 2, 113, 115, 5, 8, 5, 2, 114, 113, 3, 2, 2, 2, 114, 115, 3, 2, 2, 2, 115, 5, 3, 2, 2, 2, 116, 224, 7, 3, 2, 2, 117, 118, 5, 18, 10, 2, 118, 119, 7, 4, 2, 2, 119, 120, 5, 22, 12, 2, 120, 224, 3, 2, 2, 2, 121, 224, 5, 28, 15, 2, 122, 224, 5, 10, 6, 2, 123, 224, 7, 5, 2, 2, 124, 125, 7, 6, 2, 2, 125, 224, 7, 70, 2, 2, 126, 127, 7, 7, 2, 2, 127, 128, 5, 4, 3, 2, 128, 129, 7, 8, 2, 2, 129, 224, 3, 2, 2, 2, 130, 131, 7, 9, 2, 2, 131, 132, 5, 24, 13, 2, 132, 133, 7, 7, 2, 2, 133, 134, 5, 4, 3, 2, 134, 135, 7, 8, 2, 2, 135, 224, 3, 2, 2, 2, 136, 137, 7, 10, 2, 2, 137, 138, 5, 4, 3, 2, 138, 139, 7, 11, 2, 2, 139, 140, 5, 24, 13, 2, 140, 224, 3, 2, 2, 2, 141, 142, 7, 12, 2, 2, 142, 143, 5, 24, 13, 2, 143, 144, 7, 13, 2, 2, 144, 152, 5, 4, 3, 2, 145, 146, 7, 14, 2, 2, 146, 147, 5, 24, 13, 2, 147, 148, 7, 13, 2, 2, 148, 149, 5, 4, 3, 2, 149, 151, 3, 2, 2, 2, 150, 145, 3, 2, 2, 2, 151, 154, 3, 2, 2, 2, 152, 150, 3, 2, 2, 2, 152, 153, 3, 2, 2, 2, 153, 157, 3, 2, 2, 2, 154, 152, 3, 2, 2, 2, 155, 156, 7, 15, 2, 2, 156, 158, 5, 4, 3, 2, 157, 155, 3, 2, 2, 2, 157, 158, 3, 2, 2, 2, 158, 159, 3, 2, 2, 2, 159, 160, 7, 8, 2, 2, 160, 224, 3, 2, 2, 2, 161, 162, 7, 16, 2, 2, 162, 163, 7, 70, 2, 2, 163, 164, 7, 4, 2, 2, 164, 165, 5, 24, 13, 2, 165, 166, 7, 17, 2, 2, 166, 169, 5, 24, 13, 2, 167, 168, 7, 17, 2, 2, 168, 170, 5, 24, 13, 2, 169, 167, 3, 2, 2, 2, 169, 170, 3, 2, 2, 2, 170, 171, 3, 2, 2, 2, 171, 172, 7, 7, 2, 2, 172, 173, 5, 4, 3, 2, 173, 174, 7, 8, 2, 2, 174, 224, 3, 2, 2, 2, 175, 176, 7, 16, 2, 2, 176, 177, 5, 20, 11, 2, 177, 178, 7, 18, 2, 2, 178, 179, 5, 22, 12, 2, 179, 180, 7, 7, 2, 2, 180, 181, 5, 4, 3, 2, 181, 182, 7, 8, 2, 2, 182, 224, 3, 2, 2, 2, 183, 184, 7, 19, 2, 2, 184, 185, 5, 12, 7, 2, 185, 186, 5, 42, 22, 2, 186, 224, 3, 2, 2, 2, 187, 188, 7, 20, 2, 2, 188, 191, 5, 14, 8, 2, 189, 190, 7, 21, 2, 2, 190, 192, 5, 16, 9, 2, 191, 189, 3, 2, 2, 2, 191, 192, 3, 2, 2, 2, 192, 193, 3, 2, 2, 2, 193, 194, 5, 90, 46, 2, 194, 224, 3, 2, 2, 2, 195, 197, 7, 22, 2, 2, 196, 195, 3, 2, 2, 2, 196, 197, 3, 2, 2, 2, 197, 198, 3, 2, 2, 2, 198, 199, 7, 20, 2, 2, 199, 202, 5, 14, 8, 2, 200, 201, 7, 21, 2, 2, 201, 203, 5, 16, 9, 2, 202, 200, 3, 2, 2, 2, 202, 203, 3, 2, 2, 2, 203, 204, 3, 2, 2, 2, 204, 205, 5, 90, 46, 2, 205, 224, 3, 2, 2, 2, 206, 207, 7, 22, 2, 2, 207, 208, 7, 19, 2, 2, 208, 209, 7, 70, 2, 2, 209, 224, 5, 42, 22, 2, 210, 211, 7, 22, 2, 2, 211, 214, 5, 20, 11, 2, 212, 213, 7, 4, 2, 2, 213, 215, 5, 22, 12, 2, 214, 212, 3, 2, 2, 2, 214, 215, 3, 2, 2, 2, 215, 224, 3, 2, 2, 2, 216, 217, 7, 23, 2, 2, 217, 224, 5, 102, 52, 2, 218, 220, 7, 22, 2, 2, 219, 218, 3, 2, 2, 2, 219, 220, 3, 2, 2, 2, 220, 221, 3, 2, 2, 2, 221, 222, 7, 70, 2, 2, 222, 224, 5, 100, 51, 2, 223, 116, 3, 2, 2, 2, 223, 117, 3, 2, 2, 2, 223, 121, 3, 2, 2, 2, 223, 122, 3, 2, 2, 2, 223, 123, 3, 2, 2, 2, 223, 124, 3, 2, 2, 2, 223, 126, 3, 2, 2, 2, 223, 130, 3, 2, 2, 2, 223, 136, 3, 2, 2, 2, 223, 141, 3, 2, 2, 2, 223, 161, 3, 2, 2, 2, 223, 175, 3, 2, 2, 2, 223, 183, 3, 2, 2, 2, 223, 187, 3, 2, 2, 2, 223, 196, 3, 2, 2, 2, 223, 206, 3, 2, 2, 2, 223, 210, 3, 2, 2, 2, 223, 216, 3, 2, 2, 2, 223, 219, 3, 2, 2, 2, 224, 7, 3, 2, 2, 2, 225, 227, 7, 24, 2, 2, 226, 228, 5, 22, 12, 2, 227, 226, 3, 2, 2, 2, 227, 228, 3, 2, 2, 2, 228, 230, 3, 2, 2, 2, 229, 231, 7, 3, 2, 2, 230, 229, 3, 2, 2, 2, 230, 231, 3, 2, 2, 2, 231, 9, 3, 2, 2, 2, 232, 233, 7, 25, 2, 2, 233, 234, 7, 70, 2, 2, 234, 235, 7, 25, 2, 2, 235, 11, 3, 2, 2, 2, 236, 241, 7, 70, 2, 2, 237, 238, 7, 26, 2, 2, 238, 240, 7, 70, 2, 2, 239, 237, 3, 2, 2, 2, 240, 243, 3, 2, 2, 2, 241, 239, 3, 2, 2, 2, 241, 242, 3, 2, 2, 2, 242, 246, 3, 2, 2, 2, 243, 241, 3, 2, 2, 2, 244, 245, 7, 27, 2, 2, 245, 247, 7, 70, 2, 2, 246, 244, 3, 2, 2, 2, 246, 247, 3, 2, 2, 2, 247, 13, 3, 2, 2, 2, 248, 249, 5, 32, 17, 2, 249, 15, 3, 2, 2, 2, 250, 251, 5, 32, 17, 2, 251, 17, 3, 2, 2, 2, 252, 257, 5, 32, 17, 2, 253, 254, 7, 17, 2, 2, 254, 256, 5, 32, 17, 2, 255, 253, 3, 2, 2, 2, 256, 259, 3, 2, 2, 2, 257, 255, 3, 2, 2, 2, 257, 258, 3, 2, 2, 2, 258, 19, 3, 2, 2, 2, 259, 257, 3, 2, 2, 2, 260, 265, 7, 70, 2, 2, 261, 262, 7, 17, 2, 2, 262, 264, 7, 70, 2, 2, 263, 261, 3, 2, 2, 2, 264, 267, 3, 2, 2, 2, 265, 263, 3, 2, 2, 2, 265, 266, 3, 2, 2, 2, 266, 21, 3, 2, 2, 2, 267, 265, 3, 2, 2, 2, 268, 273, 5, 24, 13, 2, 269, 270, 7, 17, 2, 2, 270, 272, 5, 24, 13, 2, 271, 269, 3, 2, 2, 2, 272, 275, 3, 2, 2, 2, 273, 271, 3, 2, 2, 2, 273, 274, 3, 2, 2, 2, 274, 23, 3, 2, 2, 2, 275, 273, 3, 2, 2, 2, 276, 277, 8, 13, 1, 2, 277, 290, 7, 28, 2, 2, 278, 290, 7, 29, 2, 2, 279, 290, 7, 30, 2, 2, 280, 290, 5, 72, 37, 2, 281, 290, 5, 74, 38, 2, 282, 290, 7, 31, 2, 2, 283, 290, 5, 40, 21, 2, 284, 290, 5, 26, 14, 2, 285, 290, 5, 46, 24, 2, 286, 287, 5, 68, 35, 2, 287, 288, 5, 24, 13, 10, 288, 290, 3, 2, 2, 2, 289, 276, 3, 2, 2, 2, 289, 278, 3, 2, 2, 2, 289, 279, 3, 2, 2, 2, 289, 280, 3, 2, 2, 2, 289, 281, 3, 2, 2, 2, 289, 282, 3, 2, 2, 2, 289, 283, 3, 2, 2, 2, 289, 284, 3, 2, 2, 2, 289, 285, 3, 2, 2, 2, 289, 286, 3, 2, 2, 2, 290, 325, 3, 2, 2, 2, 291, 292, 12, 11, 2, 2, 292, 293, 5, 70, 36, 2, 293, 294, 5, 24, 13, 11, 294, 324, 3, 2, 2, 2, 295, 296, 12, 9, 2, 2, 296, 297, 5, 64, 33, 2, 297, 298, 5, 24, 13, 10, 298, 324, 3, 2, 2, 2, 299, 300, 12, 8, 2, 2, 300, 301, 5, 62, 32, 2, 301, 302, 5, 24, 13, 9, 302, 324, 3, 2, 2, 2, 303, 304, 12, 7, 2, 2, 304, 305, 5, 60, 31, 2, 305, 306, 5, 24, 13, 7, 306, 324, 3, 2, 2, 2, 307, 308, 12, 6, 2, 2, 308, 309, 5, 58, 30, 2, 309, 310, 5, 24, 13, 7, 310, 324, 3, 2, 2, 2, 311, 312, 12, 5, 2, 2, 312, 313, 5, 56, 29, 2, 313, 314, 5, 24, 13, 6, 314, 324, 3, 2, 2, 2, 315, 316, 12, 4, 2, 2, 316, 317, 5, 54, 28, 2, 317, 318, 5, 24, 13, 5, 318, 324, 3, 2, 2, 2, 319, 320, 12, 3, 2, 2, 320, 321, 5, 66, 34, 2, 321, 322, 5, 24, 13, 4, 322, 324, 3, 2, 2, 2, 323, 291, 3, 2, 2, 2, 323, 295, 3, 2, 2, 2, 323, 299, 3, 2, 2, 2, 323, 303, 3, 2, 2, 2, 323, 307, 3, 2, 2, 2, 323, 311, 3, 2, 2, 2, 323, 315, 3, 2, 2, 2, 323, 319, 3, 2, 2, 2, 324, 327, 3, 2, 2, 2, 325, 323, 3, 2, 2, 2, 325, 326, 3, 2, 2, 2, 326, 25, 3, 2, 2, 2, 327, 325, 3, 2, 2, 2, 328, 332, 5, 30, 16, 2, 329, 331, 5, 36, 19, 2, 330, 329, 3, 2, 2, 2, 331, 334, 3, 2, 2, 2, 332, 330, 3, 2, 2, 2, 332, 333, 3, 2, 2, 2, 333, 27, 3, 2, 2, 2, 334, 332, 3, 2, 2, 2, 335, 337, 5, 30, 16, 2, 336, 338, 5, 36, 19, 2, 337, 336, 3, 2, 2, 2, 338, 339, 3, 2, 2, 2, 339, 337, 3, 2, 2, 2, 339, 340, 3, 2, 2, 2, 340, 29, 3, 2, 2, 2, 341, 347, 5, 32, 17, 2, 342, 343, 7, 32, 2, 2, 343, 344, 5, 24, 13, 2, 344, 345, 7, 33, 2, 2, 345, 347, 3, 2, 2, 2, 346, 341, 3, 2, 2, 2, 346, 342, 3, 2, 2, 2, 347, 31, 3, 2, 2, 2, 348, 355, 7, 70, 2, 2, 349, 350, 7, 32, 2, 2, 350, 351, 5, 24, 13, 2, 351, 352, 7, 33, 2, 2, 352, 353, 5, 34, 18, 2, 353, 355, 3, 2, 2, 2, 354, 348, 3, 2, 2, 2, 354, 349, 3, 2, 2, 2, 355, 359, 3, 2, 2, 2, 356, 358, 5, 34, 18, 2, 357, 356, 3, 2, 2, 2, 358, 361, 3, 2, 2, 2, 359, 357, 3, 2, 2, 2, 359, 360, 3, 2, 2, 2, 360, 33, 3, 2, 2, 2, 361, 359, 3, 2, 2, 2, 362, 364, 5, 36, 19, 2, 363, 362, 3, 2, 2, 2, 364, 367, 3, 2, 2, 2, 365, 363, 3, 2, 2, 2, 365, 366, 3, 2, 2, 2, 366, 374, 3, 2, 2, 2, 367, 365, 3, 2, 2, 2, 368, 369, 7, 34, 2, 2, 369, 370, 5, 24, 13, 2, 370, 371, 7, 35, 2, 2, 371, 375, 3, 2, 2, 2, 372, 373, 7, 26, 2, 2, 373, 375, 7, 70, 2, 2, 374, 368, 3, 2, 2, 2, 374, 372, 3, 2, 2, 2, 375, 35, 3, 2, 2, 2, 376, 377, 7, 27, 2, 2, 377, 379, 7, 70, 2, 2, 378, 376, 3, 2, 2, 2, 378, 379, 3, 2, 2, 2, 379, 380, 3, 2, 2, 2, 380, 381, 5, 38, 20, 2, 381, 37, 3, 2, 2, 2, 382, 384, 7, 32, 2, 2, 383, 385, 5, 22, 12, 2, 384, 383, 3, 2, 2, 2, 384, 385, 3, 2, 2, 2, 385, 386, 3, 2, 2, 2, 386, 390, 7, 33, 2, 2, 387, 390, 5, 46, 24, 2, 388, 390, 5, 74, 38, 2, 389, 382, 3, 2, 2, 2, 389, 387, 3, 2, 2, 2, 389, 388, 3, 2, 2, 2, 390, 39, 3, 2, 2, 2, 391, 392, 7, 19, 2, 2, 392, 393, 5, 42, 22, 2, 393, 41, 3, 2, 2, 2, 394, 396, 7, 32, 2, 2, 395, 397, 5, 44, 23, 2, 396, 395, 3, 2, 2, 2, 396, 397, 3, 2, 2, 2, 397, 398, 3, 2, 2, 2, 398, 399, 7, 33, 2, 2, 399, 400, 5, 4, 3, 2, 400, 401, 7, 8, 2, 2, 401, 43, 3, 2, 2, 2, 402, 405, 5, 20, 11, 2, 403, 404, 7, 17, 2, 2, 404, 406, 7, 31, 2, 2, 405, 403, 3, 2, 2, 2, 405, 406, 3, 2, 2, 2, 406, 409, 3, 2, 2, 2, 407, 409, 7, 31, 2, 2, 408, 402, 3, 2, 2, 2, 408, 407, 3, 2, 2, 2, 409, 45, 3, 2, 2, 2, 410, 412, 7, 36, 2, 2, 411, 413, 5, 48, 25, 2, 412, 411, 3, 2, 2, 2, 412, 413, 3, 2, 2, 2, 413, 414, 3, 2, 2, 2, 414, 415, 7, 37, 2, 2, 415, 47, 3, 2, 2, 2, 416, 422, 5, 50, 26, 2, 417, 418, 5, 52, 27, 2, 418, 419, 5, 50, 26, 2, 419, 421, 3, 2, 2, 2, 420, 417, 3, 2, 2, 2, 421, 424, 3, 2, 2, 2, 422, 420, 3, 2, 2, 2, 422, 423, 3, 2, 2, 2, 423, 426, 3, 2, 2, 2, 424, 422, 3, 2, 2, 2, 425, 427, 5, 52, 27, 2, 426, 425, 3, 2, 2, 2, 426, 427, 3, 2, 2, 2, 427, 49, 3, 2, 2, 2, 428, 429, 7, 34, 2, 2, 429, 430, 5, 24, 13, 2, 430, 431, 7, 35, 2, 2, 431, 432, 7, 4, 2, 2, 432, 433, 5, 24, 13, 2, 433, 439, 3, 2, 2, 2, 434, 435, 7, 70, 2, 2, 435, 436, 7, 4, 2, 2, 436, 439, 5, 24, 13, 2, 437, 439, 5, 24, 13, 2, 438, 428, 3, 2, 2, 2, 438, 434, 3, 2, 2, 2, 438, 437, 3, 2, 2, 2, 439, 51, 3, 2, 2, 2, 440, 441, 9, 2, 2, 2, 441, 53, 3, 2, 2, 2, 442, 443, 7, 38, 2, 2, 443, 55, 3, 2, 2, 2, 444, 445, 7, 39, 2, 2, 445, 57, 3, 2, 2, 2, 446, 447, 9, 3, 2, 2, 447, 59, 3, 2, 2, 2, 448, 449, 7, 46, 2, 2, 449, 61, 3, 2, 2, 2, 450, 451, 9, 4, 2, 2, 451, 63, 3, 2, 2, 2, 452, 453, 9, 5, 2, 2, 453, 65, 3, 2, 2, 2, 454, 455, 9, 6, 2, 2, 455, 67, 3, 2, 2, 2, 456, 457, 9, 7, 2, 2, 457, 69, 3, 2, 2, 2, 458, 459, 7, 60, 2, 2, 459, 71, 3, 2, 2, 2, 460, 461, 9, 8, 2, 2, 461, 73, 3, 2, 2, 2, 462, 463, 9, 9, 2, 2, 463, 75, 3, 2, 2, 2, 464, 465, 7, 20, 2, 2, 465, 466, 7, 70, 2, 2, 466, 467, 5, 90, 46, 2, 467, 77, 3, 2, 2, 2, 468, 469, 7, 19, 2, 2, 469, 470, 5, 12, 7, 2, 470, 471, 5, 42, 22, 2, 471, 79, 3, 2, 2, 2, 472, 473, 7, 61, 2, 2, 473, 474, 7, 19, 2, 2, 474, 475, 5, 12, 7, 2, 475, 476, 5, 42, 22, 2, 476, 81, 3, 2, 2, 2, 477, 478, 9, 10, 2, 2, 478, 83, 3, 2, 2, 2, 479, 480, 7, 70, 2, 2, 480, 482, 7, 36, 2, 2, 481, 483, 5, 82, 42, 2, 482, 481, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 486, 3, 2, 2, 2, 486, 487, 7, 37, 2, 2, 487, 85, 3, 2, 2, 2, 488, 489, 7, 64, 2, 2, 489, 491, 7, 32, 2, 2, 490, 492, 5, 44, 23, 2, 491, 490, 3, 2, 2, 2, 491, 492, 3, 2, 2, 2, 492, 493, 3, 2, 2, 2, 493, 494, 7, 33, 2, 2, 494, 495, 5, 4, 3, 2, 495, 496, 7, 8, 2, 2, 496, 87, 3, 2, 2, 2, 497, 501, 5, 78, 40, 2, 498, 501, 5, 84, 43, 2, 499, 501, 5, 86, 44, 2, 500, 497, 3, 2, 2, 2, 500, 498, 3, 2, 2, 2, 500, 499, 3, 2, 2, 2, 501, 89, 3, 2, 2, 2, 502, 507, 5, 80, 41, 2, 503, 507, 5, 78, 40, 2, 504, 507, 5, 84, 43, 2, 505, 507, 5, 86, 44, 2, 506, 502, 3, 2, 2, 2, 506, 503, 3, 2, 2, 2, 506, 504, 3, 2, 2, 2, 506, 505, 3, 2, 2, 2, 507, 510, 3, 2, 2, 2, 508, 506, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 511, 3, 2, 2, 2, 510, 508, 3, 2, 2, 2, 511, 512, 7, 8, 2, 2, 512, 91, 3, 2, 2, 2, 513, 514, 7, 70, 2, 2, 514, 515, 7, 65, 2, 2, 515, 93, 3, 2, 2, 2, 516, 517, 7, 70, 2, 2, 517, 518, 7, 66, 2, 2, 518, 95, 3, 2, 2, 2, 519, 520, 7, 70, 2, 2, 520, 521, 7, 67, 2, 2, 521, 97, 3, 2, 2, 2, 522, 523, 7, 70, 2, 2, 523, 524, 7, 68, 2, 2, 524, 99, 3, 2, 2, 2, 525, 526, 7, 70, 2, 2, 526, 527, 7, 69, 2, 2, 527, 101, 3, 2, 2, 2, 528, 529, 5, 32, 17, 2, 529, 103, 3, 2, 2, 2, 45, 110, 114, 152, 157, 169, 191, 196, 202, 214, 219, 223, 227, 230, 241, 246, 257, 265, 273, 289, 323, 325, 332, 339, 346, 354, 359, 365, 374, 378, 384, 389, 396, 405, 408, 412, 422, 426, 438, 484, 491, 500, 506, 508] -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luapp.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | T__8=9 10 | T__9=10 11 | T__10=11 12 | T__11=12 13 | T__12=13 14 | T__13=14 15 | T__14=15 16 | T__15=16 17 | T__16=17 18 | T__17=18 19 | T__18=19 20 | T__19=20 21 | T__20=21 22 | T__21=22 23 | T__22=23 24 | T__23=24 25 | T__24=25 26 | T__25=26 27 | T__26=27 28 | T__27=28 29 | T__28=29 30 | T__29=30 31 | T__30=31 32 | T__31=32 33 | T__32=33 34 | T__33=34 35 | T__34=35 36 | T__35=36 37 | T__36=37 38 | T__37=38 39 | T__38=39 40 | T__39=40 41 | T__40=41 42 | T__41=42 43 | T__42=43 44 | T__43=44 45 | T__44=45 46 | T__45=46 47 | T__46=47 48 | T__47=48 49 | T__48=49 50 | T__49=50 51 | T__50=51 52 | T__51=52 53 | T__52=53 54 | T__53=54 55 | T__54=55 56 | T__55=56 57 | T__56=57 58 | T__57=58 59 | T__58=59 60 | T__59=60 61 | T__60=61 62 | T__61=62 63 | T__62=63 64 | T__63=64 65 | T__64=65 66 | T__65=66 67 | T__66=67 68 | NAME=68 69 | NORMALSTRING=69 70 | CHARSTRING=70 71 | LONGSTRING=71 72 | INT=72 73 | HEX=73 74 | FLOAT=74 75 | HEX_FLOAT=75 76 | COMMENT=76 77 | LINE_COMMENT=77 78 | WS=78 79 | SHEBANG=79 80 | ';'=1 81 | '='=2 82 | 'break'=3 83 | 'goto'=4 84 | 'do'=5 85 | 'end'=6 86 | 'while'=7 87 | 'repeat'=8 88 | 'until'=9 89 | 'if'=10 90 | 'then'=11 91 | 'elseif'=12 92 | 'else'=13 93 | 'for'=14 94 | ','=15 95 | 'in'=16 96 | 'function'=17 97 | 'class'=18 98 | 'extends'=19 99 | 'local'=20 100 | 'safe'=21 101 | 'return'=22 102 | '::'=23 103 | '.'=24 104 | ':'=25 105 | 'nil'=26 106 | 'false'=27 107 | 'true'=28 108 | '...'=29 109 | '('=30 110 | ')'=31 111 | '['=32 112 | ']'=33 113 | '{'=34 114 | '}'=35 115 | 'or'=36 116 | 'and'=37 117 | '<'=38 118 | '>'=39 119 | '<='=40 120 | '>='=41 121 | '~='=42 122 | '=='=43 123 | '..'=44 124 | '+'=45 125 | '-'=46 126 | '*'=47 127 | '/'=48 128 | '%'=49 129 | '//'=50 130 | '&'=51 131 | '|'=52 132 | '~'=53 133 | '<<'=54 134 | '>>'=55 135 | 'not'=56 136 | '#'=57 137 | '^'=58 138 | 'static'=59 139 | 'get'=60 140 | 'set'=61 141 | 'constructor'=62 142 | '++'=63 143 | '+='=64 144 | '*='=65 145 | '/='=66 146 | '-='=67 147 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappBaseListener.java: -------------------------------------------------------------------------------- 1 | // Generated from C:/Users/Harry/Desktop/Lua/lpp2electricboogaloo/lua-plus-plus/src/main/java/org/luapp/language/parser\luapp.g4 by ANTLR 4.8 2 | package org.luapp.language.generator; 3 | 4 | import org.antlr.v4.runtime.ParserRuleContext; 5 | import org.antlr.v4.runtime.tree.ErrorNode; 6 | import org.antlr.v4.runtime.tree.TerminalNode; 7 | 8 | /** 9 | * This class provides an empty implementation of {@link luappListener}, 10 | * which can be extended to create a listener which only needs to handle a subset 11 | * of the available methods. 12 | */ 13 | public class luappBaseListener implements luappListener { 14 | /** 15 | * {@inheritDoc} 16 | * 17 | *

The default implementation does nothing.

18 | */ 19 | @Override public void enterChunk(luappParser.ChunkContext ctx) { } 20 | /** 21 | * {@inheritDoc} 22 | * 23 | *

The default implementation does nothing.

24 | */ 25 | @Override public void exitChunk(luappParser.ChunkContext ctx) { } 26 | /** 27 | * {@inheritDoc} 28 | * 29 | *

The default implementation does nothing.

30 | */ 31 | @Override public void enterBlock(luappParser.BlockContext ctx) { } 32 | /** 33 | * {@inheritDoc} 34 | * 35 | *

The default implementation does nothing.

36 | */ 37 | @Override public void exitBlock(luappParser.BlockContext ctx) { } 38 | /** 39 | * {@inheritDoc} 40 | * 41 | *

The default implementation does nothing.

42 | */ 43 | @Override public void enterStat(luappParser.StatContext ctx) { } 44 | /** 45 | * {@inheritDoc} 46 | * 47 | *

The default implementation does nothing.

48 | */ 49 | @Override public void exitStat(luappParser.StatContext ctx) { } 50 | /** 51 | * {@inheritDoc} 52 | * 53 | *

The default implementation does nothing.

54 | */ 55 | @Override public void enterRetstat(luappParser.RetstatContext ctx) { } 56 | /** 57 | * {@inheritDoc} 58 | * 59 | *

The default implementation does nothing.

60 | */ 61 | @Override public void exitRetstat(luappParser.RetstatContext ctx) { } 62 | /** 63 | * {@inheritDoc} 64 | * 65 | *

The default implementation does nothing.

66 | */ 67 | @Override public void enterLabel(luappParser.LabelContext ctx) { } 68 | /** 69 | * {@inheritDoc} 70 | * 71 | *

The default implementation does nothing.

72 | */ 73 | @Override public void exitLabel(luappParser.LabelContext ctx) { } 74 | /** 75 | * {@inheritDoc} 76 | * 77 | *

The default implementation does nothing.

78 | */ 79 | @Override public void enterFuncname(luappParser.FuncnameContext ctx) { } 80 | /** 81 | * {@inheritDoc} 82 | * 83 | *

The default implementation does nothing.

84 | */ 85 | @Override public void exitFuncname(luappParser.FuncnameContext ctx) { } 86 | /** 87 | * {@inheritDoc} 88 | * 89 | *

The default implementation does nothing.

90 | */ 91 | @Override public void enterClassname(luappParser.ClassnameContext ctx) { } 92 | /** 93 | * {@inheritDoc} 94 | * 95 | *

The default implementation does nothing.

96 | */ 97 | @Override public void exitClassname(luappParser.ClassnameContext ctx) { } 98 | /** 99 | * {@inheritDoc} 100 | * 101 | *

The default implementation does nothing.

102 | */ 103 | @Override public void enterAbstractclassname(luappParser.AbstractclassnameContext ctx) { } 104 | /** 105 | * {@inheritDoc} 106 | * 107 | *

The default implementation does nothing.

108 | */ 109 | @Override public void exitAbstractclassname(luappParser.AbstractclassnameContext ctx) { } 110 | /** 111 | * {@inheritDoc} 112 | * 113 | *

The default implementation does nothing.

114 | */ 115 | @Override public void enterVarlist(luappParser.VarlistContext ctx) { } 116 | /** 117 | * {@inheritDoc} 118 | * 119 | *

The default implementation does nothing.

120 | */ 121 | @Override public void exitVarlist(luappParser.VarlistContext ctx) { } 122 | /** 123 | * {@inheritDoc} 124 | * 125 | *

The default implementation does nothing.

126 | */ 127 | @Override public void enterNamelist(luappParser.NamelistContext ctx) { } 128 | /** 129 | * {@inheritDoc} 130 | * 131 | *

The default implementation does nothing.

132 | */ 133 | @Override public void exitNamelist(luappParser.NamelistContext ctx) { } 134 | /** 135 | * {@inheritDoc} 136 | * 137 | *

The default implementation does nothing.

138 | */ 139 | @Override public void enterExplist(luappParser.ExplistContext ctx) { } 140 | /** 141 | * {@inheritDoc} 142 | * 143 | *

The default implementation does nothing.

144 | */ 145 | @Override public void exitExplist(luappParser.ExplistContext ctx) { } 146 | /** 147 | * {@inheritDoc} 148 | * 149 | *

The default implementation does nothing.

150 | */ 151 | @Override public void enterExp(luappParser.ExpContext ctx) { } 152 | /** 153 | * {@inheritDoc} 154 | * 155 | *

The default implementation does nothing.

156 | */ 157 | @Override public void exitExp(luappParser.ExpContext ctx) { } 158 | /** 159 | * {@inheritDoc} 160 | * 161 | *

The default implementation does nothing.

162 | */ 163 | @Override public void enterPrefixexp(luappParser.PrefixexpContext ctx) { } 164 | /** 165 | * {@inheritDoc} 166 | * 167 | *

The default implementation does nothing.

168 | */ 169 | @Override public void exitPrefixexp(luappParser.PrefixexpContext ctx) { } 170 | /** 171 | * {@inheritDoc} 172 | * 173 | *

The default implementation does nothing.

174 | */ 175 | @Override public void enterFunctioncall(luappParser.FunctioncallContext ctx) { } 176 | /** 177 | * {@inheritDoc} 178 | * 179 | *

The default implementation does nothing.

180 | */ 181 | @Override public void exitFunctioncall(luappParser.FunctioncallContext ctx) { } 182 | /** 183 | * {@inheritDoc} 184 | * 185 | *

The default implementation does nothing.

186 | */ 187 | @Override public void enterVarOrExp(luappParser.VarOrExpContext ctx) { } 188 | /** 189 | * {@inheritDoc} 190 | * 191 | *

The default implementation does nothing.

192 | */ 193 | @Override public void exitVarOrExp(luappParser.VarOrExpContext ctx) { } 194 | /** 195 | * {@inheritDoc} 196 | * 197 | *

The default implementation does nothing.

198 | */ 199 | @Override public void enterVar(luappParser.VarContext ctx) { } 200 | /** 201 | * {@inheritDoc} 202 | * 203 | *

The default implementation does nothing.

204 | */ 205 | @Override public void exitVar(luappParser.VarContext ctx) { } 206 | /** 207 | * {@inheritDoc} 208 | * 209 | *

The default implementation does nothing.

210 | */ 211 | @Override public void enterVarSuffix(luappParser.VarSuffixContext ctx) { } 212 | /** 213 | * {@inheritDoc} 214 | * 215 | *

The default implementation does nothing.

216 | */ 217 | @Override public void exitVarSuffix(luappParser.VarSuffixContext ctx) { } 218 | /** 219 | * {@inheritDoc} 220 | * 221 | *

The default implementation does nothing.

222 | */ 223 | @Override public void enterNameAndArgs(luappParser.NameAndArgsContext ctx) { } 224 | /** 225 | * {@inheritDoc} 226 | * 227 | *

The default implementation does nothing.

228 | */ 229 | @Override public void exitNameAndArgs(luappParser.NameAndArgsContext ctx) { } 230 | /** 231 | * {@inheritDoc} 232 | * 233 | *

The default implementation does nothing.

234 | */ 235 | @Override public void enterArgs(luappParser.ArgsContext ctx) { } 236 | /** 237 | * {@inheritDoc} 238 | * 239 | *

The default implementation does nothing.

240 | */ 241 | @Override public void exitArgs(luappParser.ArgsContext ctx) { } 242 | /** 243 | * {@inheritDoc} 244 | * 245 | *

The default implementation does nothing.

246 | */ 247 | @Override public void enterFunctiondef(luappParser.FunctiondefContext ctx) { } 248 | /** 249 | * {@inheritDoc} 250 | * 251 | *

The default implementation does nothing.

252 | */ 253 | @Override public void exitFunctiondef(luappParser.FunctiondefContext ctx) { } 254 | /** 255 | * {@inheritDoc} 256 | * 257 | *

The default implementation does nothing.

258 | */ 259 | @Override public void enterFuncbody(luappParser.FuncbodyContext ctx) { } 260 | /** 261 | * {@inheritDoc} 262 | * 263 | *

The default implementation does nothing.

264 | */ 265 | @Override public void exitFuncbody(luappParser.FuncbodyContext ctx) { } 266 | /** 267 | * {@inheritDoc} 268 | * 269 | *

The default implementation does nothing.

270 | */ 271 | @Override public void enterParlist(luappParser.ParlistContext ctx) { } 272 | /** 273 | * {@inheritDoc} 274 | * 275 | *

The default implementation does nothing.

276 | */ 277 | @Override public void exitParlist(luappParser.ParlistContext ctx) { } 278 | /** 279 | * {@inheritDoc} 280 | * 281 | *

The default implementation does nothing.

282 | */ 283 | @Override public void enterTableconstructor(luappParser.TableconstructorContext ctx) { } 284 | /** 285 | * {@inheritDoc} 286 | * 287 | *

The default implementation does nothing.

288 | */ 289 | @Override public void exitTableconstructor(luappParser.TableconstructorContext ctx) { } 290 | /** 291 | * {@inheritDoc} 292 | * 293 | *

The default implementation does nothing.

294 | */ 295 | @Override public void enterFieldlist(luappParser.FieldlistContext ctx) { } 296 | /** 297 | * {@inheritDoc} 298 | * 299 | *

The default implementation does nothing.

300 | */ 301 | @Override public void exitFieldlist(luappParser.FieldlistContext ctx) { } 302 | /** 303 | * {@inheritDoc} 304 | * 305 | *

The default implementation does nothing.

306 | */ 307 | @Override public void enterField(luappParser.FieldContext ctx) { } 308 | /** 309 | * {@inheritDoc} 310 | * 311 | *

The default implementation does nothing.

312 | */ 313 | @Override public void exitField(luappParser.FieldContext ctx) { } 314 | /** 315 | * {@inheritDoc} 316 | * 317 | *

The default implementation does nothing.

318 | */ 319 | @Override public void enterFieldsep(luappParser.FieldsepContext ctx) { } 320 | /** 321 | * {@inheritDoc} 322 | * 323 | *

The default implementation does nothing.

324 | */ 325 | @Override public void exitFieldsep(luappParser.FieldsepContext ctx) { } 326 | /** 327 | * {@inheritDoc} 328 | * 329 | *

The default implementation does nothing.

330 | */ 331 | @Override public void enterOperatorOr(luappParser.OperatorOrContext ctx) { } 332 | /** 333 | * {@inheritDoc} 334 | * 335 | *

The default implementation does nothing.

336 | */ 337 | @Override public void exitOperatorOr(luappParser.OperatorOrContext ctx) { } 338 | /** 339 | * {@inheritDoc} 340 | * 341 | *

The default implementation does nothing.

342 | */ 343 | @Override public void enterOperatorAnd(luappParser.OperatorAndContext ctx) { } 344 | /** 345 | * {@inheritDoc} 346 | * 347 | *

The default implementation does nothing.

348 | */ 349 | @Override public void exitOperatorAnd(luappParser.OperatorAndContext ctx) { } 350 | /** 351 | * {@inheritDoc} 352 | * 353 | *

The default implementation does nothing.

354 | */ 355 | @Override public void enterOperatorComparison(luappParser.OperatorComparisonContext ctx) { } 356 | /** 357 | * {@inheritDoc} 358 | * 359 | *

The default implementation does nothing.

360 | */ 361 | @Override public void exitOperatorComparison(luappParser.OperatorComparisonContext ctx) { } 362 | /** 363 | * {@inheritDoc} 364 | * 365 | *

The default implementation does nothing.

366 | */ 367 | @Override public void enterOperatorStrcat(luappParser.OperatorStrcatContext ctx) { } 368 | /** 369 | * {@inheritDoc} 370 | * 371 | *

The default implementation does nothing.

372 | */ 373 | @Override public void exitOperatorStrcat(luappParser.OperatorStrcatContext ctx) { } 374 | /** 375 | * {@inheritDoc} 376 | * 377 | *

The default implementation does nothing.

378 | */ 379 | @Override public void enterOperatorAddSub(luappParser.OperatorAddSubContext ctx) { } 380 | /** 381 | * {@inheritDoc} 382 | * 383 | *

The default implementation does nothing.

384 | */ 385 | @Override public void exitOperatorAddSub(luappParser.OperatorAddSubContext ctx) { } 386 | /** 387 | * {@inheritDoc} 388 | * 389 | *

The default implementation does nothing.

390 | */ 391 | @Override public void enterOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx) { } 392 | /** 393 | * {@inheritDoc} 394 | * 395 | *

The default implementation does nothing.

396 | */ 397 | @Override public void exitOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx) { } 398 | /** 399 | * {@inheritDoc} 400 | * 401 | *

The default implementation does nothing.

402 | */ 403 | @Override public void enterOperatorBitwise(luappParser.OperatorBitwiseContext ctx) { } 404 | /** 405 | * {@inheritDoc} 406 | * 407 | *

The default implementation does nothing.

408 | */ 409 | @Override public void exitOperatorBitwise(luappParser.OperatorBitwiseContext ctx) { } 410 | /** 411 | * {@inheritDoc} 412 | * 413 | *

The default implementation does nothing.

414 | */ 415 | @Override public void enterOperatorUnary(luappParser.OperatorUnaryContext ctx) { } 416 | /** 417 | * {@inheritDoc} 418 | * 419 | *

The default implementation does nothing.

420 | */ 421 | @Override public void exitOperatorUnary(luappParser.OperatorUnaryContext ctx) { } 422 | /** 423 | * {@inheritDoc} 424 | * 425 | *

The default implementation does nothing.

426 | */ 427 | @Override public void enterOperatorPower(luappParser.OperatorPowerContext ctx) { } 428 | /** 429 | * {@inheritDoc} 430 | * 431 | *

The default implementation does nothing.

432 | */ 433 | @Override public void exitOperatorPower(luappParser.OperatorPowerContext ctx) { } 434 | /** 435 | * {@inheritDoc} 436 | * 437 | *

The default implementation does nothing.

438 | */ 439 | @Override public void enterNumber(luappParser.NumberContext ctx) { } 440 | /** 441 | * {@inheritDoc} 442 | * 443 | *

The default implementation does nothing.

444 | */ 445 | @Override public void exitNumber(luappParser.NumberContext ctx) { } 446 | /** 447 | * {@inheritDoc} 448 | * 449 | *

The default implementation does nothing.

450 | */ 451 | @Override public void enterString(luappParser.StringContext ctx) { } 452 | /** 453 | * {@inheritDoc} 454 | * 455 | *

The default implementation does nothing.

456 | */ 457 | @Override public void exitString(luappParser.StringContext ctx) { } 458 | /** 459 | * {@inheritDoc} 460 | * 461 | *

The default implementation does nothing.

462 | */ 463 | @Override public void enterClassdef(luappParser.ClassdefContext ctx) { } 464 | /** 465 | * {@inheritDoc} 466 | * 467 | *

The default implementation does nothing.

468 | */ 469 | @Override public void exitClassdef(luappParser.ClassdefContext ctx) { } 470 | /** 471 | * {@inheritDoc} 472 | * 473 | *

The default implementation does nothing.

474 | */ 475 | @Override public void enterClassfunction(luappParser.ClassfunctionContext ctx) { } 476 | /** 477 | * {@inheritDoc} 478 | * 479 | *

The default implementation does nothing.

480 | */ 481 | @Override public void exitClassfunction(luappParser.ClassfunctionContext ctx) { } 482 | /** 483 | * {@inheritDoc} 484 | * 485 | *

The default implementation does nothing.

486 | */ 487 | @Override public void enterClassstaticfunction(luappParser.ClassstaticfunctionContext ctx) { } 488 | /** 489 | * {@inheritDoc} 490 | * 491 | *

The default implementation does nothing.

492 | */ 493 | @Override public void exitClassstaticfunction(luappParser.ClassstaticfunctionContext ctx) { } 494 | /** 495 | * {@inheritDoc} 496 | * 497 | *

The default implementation does nothing.

498 | */ 499 | @Override public void enterClassgetorset(luappParser.ClassgetorsetContext ctx) { } 500 | /** 501 | * {@inheritDoc} 502 | * 503 | *

The default implementation does nothing.

504 | */ 505 | @Override public void exitClassgetorset(luappParser.ClassgetorsetContext ctx) { } 506 | /** 507 | * {@inheritDoc} 508 | * 509 | *

The default implementation does nothing.

510 | */ 511 | @Override public void enterClassgetset(luappParser.ClassgetsetContext ctx) { } 512 | /** 513 | * {@inheritDoc} 514 | * 515 | *

The default implementation does nothing.

516 | */ 517 | @Override public void exitClassgetset(luappParser.ClassgetsetContext ctx) { } 518 | /** 519 | * {@inheritDoc} 520 | * 521 | *

The default implementation does nothing.

522 | */ 523 | @Override public void enterConstructor(luappParser.ConstructorContext ctx) { } 524 | /** 525 | * {@inheritDoc} 526 | * 527 | *

The default implementation does nothing.

528 | */ 529 | @Override public void exitConstructor(luappParser.ConstructorContext ctx) { } 530 | /** 531 | * {@inheritDoc} 532 | * 533 | *

The default implementation does nothing.

534 | */ 535 | @Override public void enterClassmember(luappParser.ClassmemberContext ctx) { } 536 | /** 537 | * {@inheritDoc} 538 | * 539 | *

The default implementation does nothing.

540 | */ 541 | @Override public void exitClassmember(luappParser.ClassmemberContext ctx) { } 542 | /** 543 | * {@inheritDoc} 544 | * 545 | *

The default implementation does nothing.

546 | */ 547 | @Override public void enterClassbody(luappParser.ClassbodyContext ctx) { } 548 | /** 549 | * {@inheritDoc} 550 | * 551 | *

The default implementation does nothing.

552 | */ 553 | @Override public void exitClassbody(luappParser.ClassbodyContext ctx) { } 554 | /** 555 | * {@inheritDoc} 556 | * 557 | *

The default implementation does nothing.

558 | */ 559 | @Override public void enterAddOne(luappParser.AddOneContext ctx) { } 560 | /** 561 | * {@inheritDoc} 562 | * 563 | *

The default implementation does nothing.

564 | */ 565 | @Override public void exitAddOne(luappParser.AddOneContext ctx) { } 566 | /** 567 | * {@inheritDoc} 568 | * 569 | *

The default implementation does nothing.

570 | */ 571 | @Override public void enterPlusEqual(luappParser.PlusEqualContext ctx) { } 572 | /** 573 | * {@inheritDoc} 574 | * 575 | *

The default implementation does nothing.

576 | */ 577 | @Override public void exitPlusEqual(luappParser.PlusEqualContext ctx) { } 578 | /** 579 | * {@inheritDoc} 580 | * 581 | *

The default implementation does nothing.

582 | */ 583 | @Override public void enterMultiplyEqual(luappParser.MultiplyEqualContext ctx) { } 584 | /** 585 | * {@inheritDoc} 586 | * 587 | *

The default implementation does nothing.

588 | */ 589 | @Override public void exitMultiplyEqual(luappParser.MultiplyEqualContext ctx) { } 590 | /** 591 | * {@inheritDoc} 592 | * 593 | *

The default implementation does nothing.

594 | */ 595 | @Override public void enterDivEqual(luappParser.DivEqualContext ctx) { } 596 | /** 597 | * {@inheritDoc} 598 | * 599 | *

The default implementation does nothing.

600 | */ 601 | @Override public void exitDivEqual(luappParser.DivEqualContext ctx) { } 602 | /** 603 | * {@inheritDoc} 604 | * 605 | *

The default implementation does nothing.

606 | */ 607 | @Override public void enterMinusEqual(luappParser.MinusEqualContext ctx) { } 608 | /** 609 | * {@inheritDoc} 610 | * 611 | *

The default implementation does nothing.

612 | */ 613 | @Override public void exitMinusEqual(luappParser.MinusEqualContext ctx) { } 614 | /** 615 | * {@inheritDoc} 616 | * 617 | *

The default implementation does nothing.

618 | */ 619 | @Override public void enterSafeOperator(luappParser.SafeOperatorContext ctx) { } 620 | /** 621 | * {@inheritDoc} 622 | * 623 | *

The default implementation does nothing.

624 | */ 625 | @Override public void exitSafeOperator(luappParser.SafeOperatorContext ctx) { } 626 | 627 | /** 628 | * {@inheritDoc} 629 | * 630 | *

The default implementation does nothing.

631 | */ 632 | @Override public void enterEveryRule(ParserRuleContext ctx) { } 633 | /** 634 | * {@inheritDoc} 635 | * 636 | *

The default implementation does nothing.

637 | */ 638 | @Override public void exitEveryRule(ParserRuleContext ctx) { } 639 | /** 640 | * {@inheritDoc} 641 | * 642 | *

The default implementation does nothing.

643 | */ 644 | @Override public void visitTerminal(TerminalNode node) { } 645 | /** 646 | * {@inheritDoc} 647 | * 648 | *

The default implementation does nothing.

649 | */ 650 | @Override public void visitErrorNode(ErrorNode node) { } 651 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappBaseVisitor.java: -------------------------------------------------------------------------------- 1 | // Generated from C:/Users/Harry/Desktop/Lua/lpp2electricboogaloo/lua-plus-plus/src/main/java/org/luapp/language/parser\luapp.g4 by ANTLR 4.8 2 | package org.luapp.language.generator; 3 | import org.antlr.v4.runtime.tree.AbstractParseTreeVisitor; 4 | 5 | /** 6 | * This class provides an empty implementation of {@link luappVisitor}, 7 | * which can be extended to create a visitor which only needs to handle a subset 8 | * of the available methods. 9 | * 10 | * @param The return type of the visit operation. Use {@link Void} for 11 | * operations with no return type. 12 | */ 13 | public class luappBaseVisitor extends AbstractParseTreeVisitor implements luappVisitor { 14 | /** 15 | * {@inheritDoc} 16 | * 17 | *

The default implementation returns the result of calling 18 | * {@link #visitChildren} on {@code ctx}.

19 | */ 20 | @Override public T visitChunk(luappParser.ChunkContext ctx) { return visitChildren(ctx); } 21 | /** 22 | * {@inheritDoc} 23 | * 24 | *

The default implementation returns the result of calling 25 | * {@link #visitChildren} on {@code ctx}.

26 | */ 27 | @Override public T visitBlock(luappParser.BlockContext ctx) { return visitChildren(ctx); } 28 | /** 29 | * {@inheritDoc} 30 | * 31 | *

The default implementation returns the result of calling 32 | * {@link #visitChildren} on {@code ctx}.

33 | */ 34 | @Override public T visitStat(luappParser.StatContext ctx) { return visitChildren(ctx); } 35 | /** 36 | * {@inheritDoc} 37 | * 38 | *

The default implementation returns the result of calling 39 | * {@link #visitChildren} on {@code ctx}.

40 | */ 41 | @Override public T visitRetstat(luappParser.RetstatContext ctx) { return visitChildren(ctx); } 42 | /** 43 | * {@inheritDoc} 44 | * 45 | *

The default implementation returns the result of calling 46 | * {@link #visitChildren} on {@code ctx}.

47 | */ 48 | @Override public T visitLabel(luappParser.LabelContext ctx) { return visitChildren(ctx); } 49 | /** 50 | * {@inheritDoc} 51 | * 52 | *

The default implementation returns the result of calling 53 | * {@link #visitChildren} on {@code ctx}.

54 | */ 55 | @Override public T visitFuncname(luappParser.FuncnameContext ctx) { return visitChildren(ctx); } 56 | /** 57 | * {@inheritDoc} 58 | * 59 | *

The default implementation returns the result of calling 60 | * {@link #visitChildren} on {@code ctx}.

61 | */ 62 | @Override public T visitClassname(luappParser.ClassnameContext ctx) { return visitChildren(ctx); } 63 | /** 64 | * {@inheritDoc} 65 | * 66 | *

The default implementation returns the result of calling 67 | * {@link #visitChildren} on {@code ctx}.

68 | */ 69 | @Override public T visitAbstractclassname(luappParser.AbstractclassnameContext ctx) { return visitChildren(ctx); } 70 | /** 71 | * {@inheritDoc} 72 | * 73 | *

The default implementation returns the result of calling 74 | * {@link #visitChildren} on {@code ctx}.

75 | */ 76 | @Override public T visitVarlist(luappParser.VarlistContext ctx) { return visitChildren(ctx); } 77 | /** 78 | * {@inheritDoc} 79 | * 80 | *

The default implementation returns the result of calling 81 | * {@link #visitChildren} on {@code ctx}.

82 | */ 83 | @Override public T visitNamelist(luappParser.NamelistContext ctx) { return visitChildren(ctx); } 84 | /** 85 | * {@inheritDoc} 86 | * 87 | *

The default implementation returns the result of calling 88 | * {@link #visitChildren} on {@code ctx}.

89 | */ 90 | @Override public T visitExplist(luappParser.ExplistContext ctx) { return visitChildren(ctx); } 91 | /** 92 | * {@inheritDoc} 93 | * 94 | *

The default implementation returns the result of calling 95 | * {@link #visitChildren} on {@code ctx}.

96 | */ 97 | @Override public T visitExp(luappParser.ExpContext ctx) { return visitChildren(ctx); } 98 | /** 99 | * {@inheritDoc} 100 | * 101 | *

The default implementation returns the result of calling 102 | * {@link #visitChildren} on {@code ctx}.

103 | */ 104 | @Override public T visitPrefixexp(luappParser.PrefixexpContext ctx) { return visitChildren(ctx); } 105 | /** 106 | * {@inheritDoc} 107 | * 108 | *

The default implementation returns the result of calling 109 | * {@link #visitChildren} on {@code ctx}.

110 | */ 111 | @Override public T visitFunctioncall(luappParser.FunctioncallContext ctx) { return visitChildren(ctx); } 112 | /** 113 | * {@inheritDoc} 114 | * 115 | *

The default implementation returns the result of calling 116 | * {@link #visitChildren} on {@code ctx}.

117 | */ 118 | @Override public T visitVarOrExp(luappParser.VarOrExpContext ctx) { return visitChildren(ctx); } 119 | /** 120 | * {@inheritDoc} 121 | * 122 | *

The default implementation returns the result of calling 123 | * {@link #visitChildren} on {@code ctx}.

124 | */ 125 | @Override public T visitVar(luappParser.VarContext ctx) { return visitChildren(ctx); } 126 | /** 127 | * {@inheritDoc} 128 | * 129 | *

The default implementation returns the result of calling 130 | * {@link #visitChildren} on {@code ctx}.

131 | */ 132 | @Override public T visitVarSuffix(luappParser.VarSuffixContext ctx) { return visitChildren(ctx); } 133 | /** 134 | * {@inheritDoc} 135 | * 136 | *

The default implementation returns the result of calling 137 | * {@link #visitChildren} on {@code ctx}.

138 | */ 139 | @Override public T visitNameAndArgs(luappParser.NameAndArgsContext ctx) { return visitChildren(ctx); } 140 | /** 141 | * {@inheritDoc} 142 | * 143 | *

The default implementation returns the result of calling 144 | * {@link #visitChildren} on {@code ctx}.

145 | */ 146 | @Override public T visitArgs(luappParser.ArgsContext ctx) { return visitChildren(ctx); } 147 | /** 148 | * {@inheritDoc} 149 | * 150 | *

The default implementation returns the result of calling 151 | * {@link #visitChildren} on {@code ctx}.

152 | */ 153 | @Override public T visitFunctiondef(luappParser.FunctiondefContext ctx) { return visitChildren(ctx); } 154 | /** 155 | * {@inheritDoc} 156 | * 157 | *

The default implementation returns the result of calling 158 | * {@link #visitChildren} on {@code ctx}.

159 | */ 160 | @Override public T visitFuncbody(luappParser.FuncbodyContext ctx) { return visitChildren(ctx); } 161 | /** 162 | * {@inheritDoc} 163 | * 164 | *

The default implementation returns the result of calling 165 | * {@link #visitChildren} on {@code ctx}.

166 | */ 167 | @Override public T visitParlist(luappParser.ParlistContext ctx) { return visitChildren(ctx); } 168 | /** 169 | * {@inheritDoc} 170 | * 171 | *

The default implementation returns the result of calling 172 | * {@link #visitChildren} on {@code ctx}.

173 | */ 174 | @Override public T visitTableconstructor(luappParser.TableconstructorContext ctx) { return visitChildren(ctx); } 175 | /** 176 | * {@inheritDoc} 177 | * 178 | *

The default implementation returns the result of calling 179 | * {@link #visitChildren} on {@code ctx}.

180 | */ 181 | @Override public T visitFieldlist(luappParser.FieldlistContext ctx) { return visitChildren(ctx); } 182 | /** 183 | * {@inheritDoc} 184 | * 185 | *

The default implementation returns the result of calling 186 | * {@link #visitChildren} on {@code ctx}.

187 | */ 188 | @Override public T visitField(luappParser.FieldContext ctx) { return visitChildren(ctx); } 189 | /** 190 | * {@inheritDoc} 191 | * 192 | *

The default implementation returns the result of calling 193 | * {@link #visitChildren} on {@code ctx}.

194 | */ 195 | @Override public T visitFieldsep(luappParser.FieldsepContext ctx) { return visitChildren(ctx); } 196 | /** 197 | * {@inheritDoc} 198 | * 199 | *

The default implementation returns the result of calling 200 | * {@link #visitChildren} on {@code ctx}.

201 | */ 202 | @Override public T visitOperatorOr(luappParser.OperatorOrContext ctx) { return visitChildren(ctx); } 203 | /** 204 | * {@inheritDoc} 205 | * 206 | *

The default implementation returns the result of calling 207 | * {@link #visitChildren} on {@code ctx}.

208 | */ 209 | @Override public T visitOperatorAnd(luappParser.OperatorAndContext ctx) { return visitChildren(ctx); } 210 | /** 211 | * {@inheritDoc} 212 | * 213 | *

The default implementation returns the result of calling 214 | * {@link #visitChildren} on {@code ctx}.

215 | */ 216 | @Override public T visitOperatorComparison(luappParser.OperatorComparisonContext ctx) { return visitChildren(ctx); } 217 | /** 218 | * {@inheritDoc} 219 | * 220 | *

The default implementation returns the result of calling 221 | * {@link #visitChildren} on {@code ctx}.

222 | */ 223 | @Override public T visitOperatorStrcat(luappParser.OperatorStrcatContext ctx) { return visitChildren(ctx); } 224 | /** 225 | * {@inheritDoc} 226 | * 227 | *

The default implementation returns the result of calling 228 | * {@link #visitChildren} on {@code ctx}.

229 | */ 230 | @Override public T visitOperatorAddSub(luappParser.OperatorAddSubContext ctx) { return visitChildren(ctx); } 231 | /** 232 | * {@inheritDoc} 233 | * 234 | *

The default implementation returns the result of calling 235 | * {@link #visitChildren} on {@code ctx}.

236 | */ 237 | @Override public T visitOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx) { return visitChildren(ctx); } 238 | /** 239 | * {@inheritDoc} 240 | * 241 | *

The default implementation returns the result of calling 242 | * {@link #visitChildren} on {@code ctx}.

243 | */ 244 | @Override public T visitOperatorBitwise(luappParser.OperatorBitwiseContext ctx) { return visitChildren(ctx); } 245 | /** 246 | * {@inheritDoc} 247 | * 248 | *

The default implementation returns the result of calling 249 | * {@link #visitChildren} on {@code ctx}.

250 | */ 251 | @Override public T visitOperatorUnary(luappParser.OperatorUnaryContext ctx) { return visitChildren(ctx); } 252 | /** 253 | * {@inheritDoc} 254 | * 255 | *

The default implementation returns the result of calling 256 | * {@link #visitChildren} on {@code ctx}.

257 | */ 258 | @Override public T visitOperatorPower(luappParser.OperatorPowerContext ctx) { return visitChildren(ctx); } 259 | /** 260 | * {@inheritDoc} 261 | * 262 | *

The default implementation returns the result of calling 263 | * {@link #visitChildren} on {@code ctx}.

264 | */ 265 | @Override public T visitNumber(luappParser.NumberContext ctx) { return visitChildren(ctx); } 266 | /** 267 | * {@inheritDoc} 268 | * 269 | *

The default implementation returns the result of calling 270 | * {@link #visitChildren} on {@code ctx}.

271 | */ 272 | @Override public T visitString(luappParser.StringContext ctx) { return visitChildren(ctx); } 273 | /** 274 | * {@inheritDoc} 275 | * 276 | *

The default implementation returns the result of calling 277 | * {@link #visitChildren} on {@code ctx}.

278 | */ 279 | @Override public T visitClassdef(luappParser.ClassdefContext ctx) { return visitChildren(ctx); } 280 | /** 281 | * {@inheritDoc} 282 | * 283 | *

The default implementation returns the result of calling 284 | * {@link #visitChildren} on {@code ctx}.

285 | */ 286 | @Override public T visitClassfunction(luappParser.ClassfunctionContext ctx) { return visitChildren(ctx); } 287 | /** 288 | * {@inheritDoc} 289 | * 290 | *

The default implementation returns the result of calling 291 | * {@link #visitChildren} on {@code ctx}.

292 | */ 293 | @Override public T visitClassstaticfunction(luappParser.ClassstaticfunctionContext ctx) { return visitChildren(ctx); } 294 | /** 295 | * {@inheritDoc} 296 | * 297 | *

The default implementation returns the result of calling 298 | * {@link #visitChildren} on {@code ctx}.

299 | */ 300 | @Override public T visitClassgetorset(luappParser.ClassgetorsetContext ctx) { return visitChildren(ctx); } 301 | /** 302 | * {@inheritDoc} 303 | * 304 | *

The default implementation returns the result of calling 305 | * {@link #visitChildren} on {@code ctx}.

306 | */ 307 | @Override public T visitClassgetset(luappParser.ClassgetsetContext ctx) { return visitChildren(ctx); } 308 | /** 309 | * {@inheritDoc} 310 | * 311 | *

The default implementation returns the result of calling 312 | * {@link #visitChildren} on {@code ctx}.

313 | */ 314 | @Override public T visitConstructor(luappParser.ConstructorContext ctx) { return visitChildren(ctx); } 315 | /** 316 | * {@inheritDoc} 317 | * 318 | *

The default implementation returns the result of calling 319 | * {@link #visitChildren} on {@code ctx}.

320 | */ 321 | @Override public T visitClassmember(luappParser.ClassmemberContext ctx) { return visitChildren(ctx); } 322 | /** 323 | * {@inheritDoc} 324 | * 325 | *

The default implementation returns the result of calling 326 | * {@link #visitChildren} on {@code ctx}.

327 | */ 328 | @Override public T visitClassbody(luappParser.ClassbodyContext ctx) { return visitChildren(ctx); } 329 | /** 330 | * {@inheritDoc} 331 | * 332 | *

The default implementation returns the result of calling 333 | * {@link #visitChildren} on {@code ctx}.

334 | */ 335 | @Override public T visitAddOne(luappParser.AddOneContext ctx) { return visitChildren(ctx); } 336 | /** 337 | * {@inheritDoc} 338 | * 339 | *

The default implementation returns the result of calling 340 | * {@link #visitChildren} on {@code ctx}.

341 | */ 342 | @Override public T visitPlusEqual(luappParser.PlusEqualContext ctx) { return visitChildren(ctx); } 343 | /** 344 | * {@inheritDoc} 345 | * 346 | *

The default implementation returns the result of calling 347 | * {@link #visitChildren} on {@code ctx}.

348 | */ 349 | @Override public T visitMultiplyEqual(luappParser.MultiplyEqualContext ctx) { return visitChildren(ctx); } 350 | /** 351 | * {@inheritDoc} 352 | * 353 | *

The default implementation returns the result of calling 354 | * {@link #visitChildren} on {@code ctx}.

355 | */ 356 | @Override public T visitDivEqual(luappParser.DivEqualContext ctx) { return visitChildren(ctx); } 357 | /** 358 | * {@inheritDoc} 359 | * 360 | *

The default implementation returns the result of calling 361 | * {@link #visitChildren} on {@code ctx}.

362 | */ 363 | @Override public T visitMinusEqual(luappParser.MinusEqualContext ctx) { return visitChildren(ctx); } 364 | /** 365 | * {@inheritDoc} 366 | * 367 | *

The default implementation returns the result of calling 368 | * {@link #visitChildren} on {@code ctx}.

369 | */ 370 | @Override public T visitSafeOperator(luappParser.SafeOperatorContext ctx) { return visitChildren(ctx); } 371 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappLexer.interp: -------------------------------------------------------------------------------- 1 | token literal names: 2 | null 3 | ';' 4 | '=' 5 | 'break' 6 | 'goto' 7 | 'do' 8 | 'end' 9 | 'while' 10 | 'repeat' 11 | 'until' 12 | 'if' 13 | 'then' 14 | 'elseif' 15 | 'else' 16 | 'for' 17 | ',' 18 | 'in' 19 | 'function' 20 | 'class' 21 | 'extends' 22 | 'local' 23 | 'safe' 24 | 'return' 25 | '::' 26 | '.' 27 | ':' 28 | 'nil' 29 | 'false' 30 | 'true' 31 | '...' 32 | '(' 33 | ')' 34 | '[' 35 | ']' 36 | '{' 37 | '}' 38 | 'or' 39 | 'and' 40 | '<' 41 | '>' 42 | '<=' 43 | '>=' 44 | '~=' 45 | '==' 46 | '..' 47 | '+' 48 | '-' 49 | '*' 50 | '/' 51 | '%' 52 | '//' 53 | '&' 54 | '|' 55 | '~' 56 | '<<' 57 | '>>' 58 | 'not' 59 | '#' 60 | '^' 61 | 'static' 62 | 'get' 63 | 'set' 64 | 'constructor' 65 | '++' 66 | '+=' 67 | '*=' 68 | '/=' 69 | '-=' 70 | null 71 | null 72 | null 73 | null 74 | null 75 | null 76 | null 77 | null 78 | null 79 | null 80 | null 81 | null 82 | 83 | token symbolic names: 84 | null 85 | null 86 | null 87 | null 88 | null 89 | null 90 | null 91 | null 92 | null 93 | null 94 | null 95 | null 96 | null 97 | null 98 | null 99 | null 100 | null 101 | null 102 | null 103 | null 104 | null 105 | null 106 | null 107 | null 108 | null 109 | null 110 | null 111 | null 112 | null 113 | null 114 | null 115 | null 116 | null 117 | null 118 | null 119 | null 120 | null 121 | null 122 | null 123 | null 124 | null 125 | null 126 | null 127 | null 128 | null 129 | null 130 | null 131 | null 132 | null 133 | null 134 | null 135 | null 136 | null 137 | null 138 | null 139 | null 140 | null 141 | null 142 | null 143 | null 144 | null 145 | null 146 | null 147 | null 148 | null 149 | null 150 | null 151 | null 152 | NAME 153 | NORMALSTRING 154 | CHARSTRING 155 | LONGSTRING 156 | INT 157 | HEX 158 | FLOAT 159 | HEX_FLOAT 160 | COMMENT 161 | LINE_COMMENT 162 | WS 163 | SHEBANG 164 | 165 | rule names: 166 | T__0 167 | T__1 168 | T__2 169 | T__3 170 | T__4 171 | T__5 172 | T__6 173 | T__7 174 | T__8 175 | T__9 176 | T__10 177 | T__11 178 | T__12 179 | T__13 180 | T__14 181 | T__15 182 | T__16 183 | T__17 184 | T__18 185 | T__19 186 | T__20 187 | T__21 188 | T__22 189 | T__23 190 | T__24 191 | T__25 192 | T__26 193 | T__27 194 | T__28 195 | T__29 196 | T__30 197 | T__31 198 | T__32 199 | T__33 200 | T__34 201 | T__35 202 | T__36 203 | T__37 204 | T__38 205 | T__39 206 | T__40 207 | T__41 208 | T__42 209 | T__43 210 | T__44 211 | T__45 212 | T__46 213 | T__47 214 | T__48 215 | T__49 216 | T__50 217 | T__51 218 | T__52 219 | T__53 220 | T__54 221 | T__55 222 | T__56 223 | T__57 224 | T__58 225 | T__59 226 | T__60 227 | T__61 228 | T__62 229 | T__63 230 | T__64 231 | T__65 232 | T__66 233 | NAME 234 | NORMALSTRING 235 | CHARSTRING 236 | LONGSTRING 237 | NESTED_STR 238 | INT 239 | HEX 240 | FLOAT 241 | HEX_FLOAT 242 | ExponentPart 243 | HexExponentPart 244 | EscapeSequence 245 | DecimalEscape 246 | HexEscape 247 | UtfEscape 248 | Digit 249 | HexDigit 250 | COMMENT 251 | LINE_COMMENT 252 | WS 253 | SHEBANG 254 | 255 | channel names: 256 | DEFAULT_TOKEN_CHANNEL 257 | HIDDEN 258 | 259 | mode names: 260 | DEFAULT_MODE 261 | 262 | atn: 263 | [3, 24715, 42794, 33075, 47597, 16764, 15335, 30598, 22884, 2, 81, 688, 8, 1, 4, 2, 9, 2, 4, 3, 9, 3, 4, 4, 9, 4, 4, 5, 9, 5, 4, 6, 9, 6, 4, 7, 9, 7, 4, 8, 9, 8, 4, 9, 9, 9, 4, 10, 9, 10, 4, 11, 9, 11, 4, 12, 9, 12, 4, 13, 9, 13, 4, 14, 9, 14, 4, 15, 9, 15, 4, 16, 9, 16, 4, 17, 9, 17, 4, 18, 9, 18, 4, 19, 9, 19, 4, 20, 9, 20, 4, 21, 9, 21, 4, 22, 9, 22, 4, 23, 9, 23, 4, 24, 9, 24, 4, 25, 9, 25, 4, 26, 9, 26, 4, 27, 9, 27, 4, 28, 9, 28, 4, 29, 9, 29, 4, 30, 9, 30, 4, 31, 9, 31, 4, 32, 9, 32, 4, 33, 9, 33, 4, 34, 9, 34, 4, 35, 9, 35, 4, 36, 9, 36, 4, 37, 9, 37, 4, 38, 9, 38, 4, 39, 9, 39, 4, 40, 9, 40, 4, 41, 9, 41, 4, 42, 9, 42, 4, 43, 9, 43, 4, 44, 9, 44, 4, 45, 9, 45, 4, 46, 9, 46, 4, 47, 9, 47, 4, 48, 9, 48, 4, 49, 9, 49, 4, 50, 9, 50, 4, 51, 9, 51, 4, 52, 9, 52, 4, 53, 9, 53, 4, 54, 9, 54, 4, 55, 9, 55, 4, 56, 9, 56, 4, 57, 9, 57, 4, 58, 9, 58, 4, 59, 9, 59, 4, 60, 9, 60, 4, 61, 9, 61, 4, 62, 9, 62, 4, 63, 9, 63, 4, 64, 9, 64, 4, 65, 9, 65, 4, 66, 9, 66, 4, 67, 9, 67, 4, 68, 9, 68, 4, 69, 9, 69, 4, 70, 9, 70, 4, 71, 9, 71, 4, 72, 9, 72, 4, 73, 9, 73, 4, 74, 9, 74, 4, 75, 9, 75, 4, 76, 9, 76, 4, 77, 9, 77, 4, 78, 9, 78, 4, 79, 9, 79, 4, 80, 9, 80, 4, 81, 9, 81, 4, 82, 9, 82, 4, 83, 9, 83, 4, 84, 9, 84, 4, 85, 9, 85, 4, 86, 9, 86, 4, 87, 9, 87, 4, 88, 9, 88, 4, 89, 9, 89, 3, 2, 3, 2, 3, 3, 3, 3, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3, 5, 3, 5, 3, 5, 3, 5, 3, 5, 3, 6, 3, 6, 3, 6, 3, 7, 3, 7, 3, 7, 3, 7, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 8, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 9, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 10, 3, 11, 3, 11, 3, 11, 3, 12, 3, 12, 3, 12, 3, 12, 3, 12, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 14, 3, 14, 3, 14, 3, 14, 3, 14, 3, 15, 3, 15, 3, 15, 3, 15, 3, 16, 3, 16, 3, 17, 3, 17, 3, 17, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 18, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 20, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 21, 3, 22, 3, 22, 3, 22, 3, 22, 3, 22, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 23, 3, 24, 3, 24, 3, 24, 3, 25, 3, 25, 3, 26, 3, 26, 3, 27, 3, 27, 3, 27, 3, 27, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 28, 3, 29, 3, 29, 3, 29, 3, 29, 3, 29, 3, 30, 3, 30, 3, 30, 3, 30, 3, 31, 3, 31, 3, 32, 3, 32, 3, 33, 3, 33, 3, 34, 3, 34, 3, 35, 3, 35, 3, 36, 3, 36, 3, 37, 3, 37, 3, 37, 3, 38, 3, 38, 3, 38, 3, 38, 3, 39, 3, 39, 3, 40, 3, 40, 3, 41, 3, 41, 3, 41, 3, 42, 3, 42, 3, 42, 3, 43, 3, 43, 3, 43, 3, 44, 3, 44, 3, 44, 3, 45, 3, 45, 3, 45, 3, 46, 3, 46, 3, 47, 3, 47, 3, 48, 3, 48, 3, 49, 3, 49, 3, 50, 3, 50, 3, 51, 3, 51, 3, 51, 3, 52, 3, 52, 3, 53, 3, 53, 3, 54, 3, 54, 3, 55, 3, 55, 3, 55, 3, 56, 3, 56, 3, 56, 3, 57, 3, 57, 3, 57, 3, 57, 3, 58, 3, 58, 3, 59, 3, 59, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 60, 3, 61, 3, 61, 3, 61, 3, 61, 3, 62, 3, 62, 3, 62, 3, 62, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 63, 3, 64, 3, 64, 3, 64, 3, 65, 3, 65, 3, 65, 3, 66, 3, 66, 3, 66, 3, 67, 3, 67, 3, 67, 3, 68, 3, 68, 3, 68, 3, 69, 3, 69, 7, 69, 432, 10, 69, 12, 69, 14, 69, 435, 11, 69, 3, 70, 3, 70, 3, 70, 7, 70, 440, 10, 70, 12, 70, 14, 70, 443, 11, 70, 3, 70, 3, 70, 3, 71, 3, 71, 3, 71, 7, 71, 450, 10, 71, 12, 71, 14, 71, 453, 11, 71, 3, 71, 3, 71, 3, 72, 3, 72, 3, 72, 3, 72, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 3, 73, 7, 73, 467, 10, 73, 12, 73, 14, 73, 470, 11, 73, 3, 73, 5, 73, 473, 10, 73, 3, 74, 6, 74, 476, 10, 74, 13, 74, 14, 74, 477, 3, 75, 3, 75, 3, 75, 6, 75, 483, 10, 75, 13, 75, 14, 75, 484, 3, 76, 6, 76, 488, 10, 76, 13, 76, 14, 76, 489, 3, 76, 3, 76, 7, 76, 494, 10, 76, 12, 76, 14, 76, 497, 11, 76, 3, 76, 5, 76, 500, 10, 76, 3, 76, 3, 76, 6, 76, 504, 10, 76, 13, 76, 14, 76, 505, 3, 76, 5, 76, 509, 10, 76, 3, 76, 6, 76, 512, 10, 76, 13, 76, 14, 76, 513, 3, 76, 3, 76, 5, 76, 518, 10, 76, 3, 77, 3, 77, 3, 77, 6, 77, 523, 10, 77, 13, 77, 14, 77, 524, 3, 77, 3, 77, 7, 77, 529, 10, 77, 12, 77, 14, 77, 532, 11, 77, 3, 77, 5, 77, 535, 10, 77, 3, 77, 3, 77, 3, 77, 3, 77, 6, 77, 541, 10, 77, 13, 77, 14, 77, 542, 3, 77, 5, 77, 546, 10, 77, 3, 77, 3, 77, 3, 77, 6, 77, 551, 10, 77, 13, 77, 14, 77, 552, 3, 77, 3, 77, 5, 77, 557, 10, 77, 3, 78, 3, 78, 5, 78, 561, 10, 78, 3, 78, 6, 78, 564, 10, 78, 13, 78, 14, 78, 565, 3, 79, 3, 79, 5, 79, 570, 10, 79, 3, 79, 6, 79, 573, 10, 79, 13, 79, 14, 79, 574, 3, 80, 3, 80, 3, 80, 3, 80, 5, 80, 581, 10, 80, 3, 80, 3, 80, 3, 80, 3, 80, 5, 80, 587, 10, 80, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 3, 81, 5, 81, 600, 10, 81, 3, 82, 3, 82, 3, 82, 3, 82, 3, 82, 3, 83, 3, 83, 3, 83, 3, 83, 3, 83, 6, 83, 612, 10, 83, 13, 83, 14, 83, 613, 3, 83, 3, 83, 3, 84, 3, 84, 3, 85, 3, 85, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 86, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 3, 87, 7, 87, 637, 10, 87, 12, 87, 14, 87, 640, 11, 87, 3, 87, 3, 87, 7, 87, 644, 10, 87, 12, 87, 14, 87, 647, 11, 87, 3, 87, 3, 87, 7, 87, 651, 10, 87, 12, 87, 14, 87, 654, 11, 87, 3, 87, 3, 87, 7, 87, 658, 10, 87, 12, 87, 14, 87, 661, 11, 87, 5, 87, 663, 10, 87, 3, 87, 3, 87, 3, 87, 5, 87, 668, 10, 87, 3, 87, 3, 87, 3, 88, 6, 88, 673, 10, 88, 13, 88, 14, 88, 674, 3, 88, 3, 88, 3, 89, 3, 89, 3, 89, 7, 89, 682, 10, 89, 12, 89, 14, 89, 685, 11, 89, 3, 89, 3, 89, 3, 468, 2, 90, 3, 3, 5, 4, 7, 5, 9, 6, 11, 7, 13, 8, 15, 9, 17, 10, 19, 11, 21, 12, 23, 13, 25, 14, 27, 15, 29, 16, 31, 17, 33, 18, 35, 19, 37, 20, 39, 21, 41, 22, 43, 23, 45, 24, 47, 25, 49, 26, 51, 27, 53, 28, 55, 29, 57, 30, 59, 31, 61, 32, 63, 33, 65, 34, 67, 35, 69, 36, 71, 37, 73, 38, 75, 39, 77, 40, 79, 41, 81, 42, 83, 43, 85, 44, 87, 45, 89, 46, 91, 47, 93, 48, 95, 49, 97, 50, 99, 51, 101, 52, 103, 53, 105, 54, 107, 55, 109, 56, 111, 57, 113, 58, 115, 59, 117, 60, 119, 61, 121, 62, 123, 63, 125, 64, 127, 65, 129, 66, 131, 67, 133, 68, 135, 69, 137, 70, 139, 71, 141, 72, 143, 73, 145, 2, 147, 74, 149, 75, 151, 76, 153, 77, 155, 2, 157, 2, 159, 2, 161, 2, 163, 2, 165, 2, 167, 2, 169, 2, 171, 78, 173, 79, 175, 80, 177, 81, 3, 2, 19, 5, 2, 67, 92, 97, 97, 99, 124, 6, 2, 50, 59, 67, 92, 97, 97, 99, 124, 4, 2, 36, 36, 94, 94, 4, 2, 41, 41, 94, 94, 4, 2, 90, 90, 122, 122, 4, 2, 71, 71, 103, 103, 4, 2, 45, 45, 47, 47, 4, 2, 82, 82, 114, 114, 12, 2, 36, 36, 41, 41, 94, 94, 99, 100, 104, 104, 112, 112, 116, 116, 118, 118, 120, 120, 124, 124, 3, 2, 50, 52, 3, 2, 50, 59, 5, 2, 50, 59, 67, 72, 99, 104, 6, 2, 12, 12, 15, 15, 63, 63, 93, 93, 4, 2, 12, 12, 15, 15, 5, 2, 12, 12, 15, 15, 93, 93, 4, 3, 12, 12, 15, 15, 5, 2, 11, 12, 14, 15, 34, 34, 2, 725, 2, 3, 3, 2, 2, 2, 2, 5, 3, 2, 2, 2, 2, 7, 3, 2, 2, 2, 2, 9, 3, 2, 2, 2, 2, 11, 3, 2, 2, 2, 2, 13, 3, 2, 2, 2, 2, 15, 3, 2, 2, 2, 2, 17, 3, 2, 2, 2, 2, 19, 3, 2, 2, 2, 2, 21, 3, 2, 2, 2, 2, 23, 3, 2, 2, 2, 2, 25, 3, 2, 2, 2, 2, 27, 3, 2, 2, 2, 2, 29, 3, 2, 2, 2, 2, 31, 3, 2, 2, 2, 2, 33, 3, 2, 2, 2, 2, 35, 3, 2, 2, 2, 2, 37, 3, 2, 2, 2, 2, 39, 3, 2, 2, 2, 2, 41, 3, 2, 2, 2, 2, 43, 3, 2, 2, 2, 2, 45, 3, 2, 2, 2, 2, 47, 3, 2, 2, 2, 2, 49, 3, 2, 2, 2, 2, 51, 3, 2, 2, 2, 2, 53, 3, 2, 2, 2, 2, 55, 3, 2, 2, 2, 2, 57, 3, 2, 2, 2, 2, 59, 3, 2, 2, 2, 2, 61, 3, 2, 2, 2, 2, 63, 3, 2, 2, 2, 2, 65, 3, 2, 2, 2, 2, 67, 3, 2, 2, 2, 2, 69, 3, 2, 2, 2, 2, 71, 3, 2, 2, 2, 2, 73, 3, 2, 2, 2, 2, 75, 3, 2, 2, 2, 2, 77, 3, 2, 2, 2, 2, 79, 3, 2, 2, 2, 2, 81, 3, 2, 2, 2, 2, 83, 3, 2, 2, 2, 2, 85, 3, 2, 2, 2, 2, 87, 3, 2, 2, 2, 2, 89, 3, 2, 2, 2, 2, 91, 3, 2, 2, 2, 2, 93, 3, 2, 2, 2, 2, 95, 3, 2, 2, 2, 2, 97, 3, 2, 2, 2, 2, 99, 3, 2, 2, 2, 2, 101, 3, 2, 2, 2, 2, 103, 3, 2, 2, 2, 2, 105, 3, 2, 2, 2, 2, 107, 3, 2, 2, 2, 2, 109, 3, 2, 2, 2, 2, 111, 3, 2, 2, 2, 2, 113, 3, 2, 2, 2, 2, 115, 3, 2, 2, 2, 2, 117, 3, 2, 2, 2, 2, 119, 3, 2, 2, 2, 2, 121, 3, 2, 2, 2, 2, 123, 3, 2, 2, 2, 2, 125, 3, 2, 2, 2, 2, 127, 3, 2, 2, 2, 2, 129, 3, 2, 2, 2, 2, 131, 3, 2, 2, 2, 2, 133, 3, 2, 2, 2, 2, 135, 3, 2, 2, 2, 2, 137, 3, 2, 2, 2, 2, 139, 3, 2, 2, 2, 2, 141, 3, 2, 2, 2, 2, 143, 3, 2, 2, 2, 2, 147, 3, 2, 2, 2, 2, 149, 3, 2, 2, 2, 2, 151, 3, 2, 2, 2, 2, 153, 3, 2, 2, 2, 2, 171, 3, 2, 2, 2, 2, 173, 3, 2, 2, 2, 2, 175, 3, 2, 2, 2, 2, 177, 3, 2, 2, 2, 3, 179, 3, 2, 2, 2, 5, 181, 3, 2, 2, 2, 7, 183, 3, 2, 2, 2, 9, 189, 3, 2, 2, 2, 11, 194, 3, 2, 2, 2, 13, 197, 3, 2, 2, 2, 15, 201, 3, 2, 2, 2, 17, 207, 3, 2, 2, 2, 19, 214, 3, 2, 2, 2, 21, 220, 3, 2, 2, 2, 23, 223, 3, 2, 2, 2, 25, 228, 3, 2, 2, 2, 27, 235, 3, 2, 2, 2, 29, 240, 3, 2, 2, 2, 31, 244, 3, 2, 2, 2, 33, 246, 3, 2, 2, 2, 35, 249, 3, 2, 2, 2, 37, 258, 3, 2, 2, 2, 39, 264, 3, 2, 2, 2, 41, 272, 3, 2, 2, 2, 43, 278, 3, 2, 2, 2, 45, 283, 3, 2, 2, 2, 47, 290, 3, 2, 2, 2, 49, 293, 3, 2, 2, 2, 51, 295, 3, 2, 2, 2, 53, 297, 3, 2, 2, 2, 55, 301, 3, 2, 2, 2, 57, 307, 3, 2, 2, 2, 59, 312, 3, 2, 2, 2, 61, 316, 3, 2, 2, 2, 63, 318, 3, 2, 2, 2, 65, 320, 3, 2, 2, 2, 67, 322, 3, 2, 2, 2, 69, 324, 3, 2, 2, 2, 71, 326, 3, 2, 2, 2, 73, 328, 3, 2, 2, 2, 75, 331, 3, 2, 2, 2, 77, 335, 3, 2, 2, 2, 79, 337, 3, 2, 2, 2, 81, 339, 3, 2, 2, 2, 83, 342, 3, 2, 2, 2, 85, 345, 3, 2, 2, 2, 87, 348, 3, 2, 2, 2, 89, 351, 3, 2, 2, 2, 91, 354, 3, 2, 2, 2, 93, 356, 3, 2, 2, 2, 95, 358, 3, 2, 2, 2, 97, 360, 3, 2, 2, 2, 99, 362, 3, 2, 2, 2, 101, 364, 3, 2, 2, 2, 103, 367, 3, 2, 2, 2, 105, 369, 3, 2, 2, 2, 107, 371, 3, 2, 2, 2, 109, 373, 3, 2, 2, 2, 111, 376, 3, 2, 2, 2, 113, 379, 3, 2, 2, 2, 115, 383, 3, 2, 2, 2, 117, 385, 3, 2, 2, 2, 119, 387, 3, 2, 2, 2, 121, 394, 3, 2, 2, 2, 123, 398, 3, 2, 2, 2, 125, 402, 3, 2, 2, 2, 127, 414, 3, 2, 2, 2, 129, 417, 3, 2, 2, 2, 131, 420, 3, 2, 2, 2, 133, 423, 3, 2, 2, 2, 135, 426, 3, 2, 2, 2, 137, 429, 3, 2, 2, 2, 139, 436, 3, 2, 2, 2, 141, 446, 3, 2, 2, 2, 143, 456, 3, 2, 2, 2, 145, 472, 3, 2, 2, 2, 147, 475, 3, 2, 2, 2, 149, 479, 3, 2, 2, 2, 151, 517, 3, 2, 2, 2, 153, 556, 3, 2, 2, 2, 155, 558, 3, 2, 2, 2, 157, 567, 3, 2, 2, 2, 159, 586, 3, 2, 2, 2, 161, 599, 3, 2, 2, 2, 163, 601, 3, 2, 2, 2, 165, 606, 3, 2, 2, 2, 167, 617, 3, 2, 2, 2, 169, 619, 3, 2, 2, 2, 171, 621, 3, 2, 2, 2, 173, 630, 3, 2, 2, 2, 175, 672, 3, 2, 2, 2, 177, 678, 3, 2, 2, 2, 179, 180, 7, 61, 2, 2, 180, 4, 3, 2, 2, 2, 181, 182, 7, 63, 2, 2, 182, 6, 3, 2, 2, 2, 183, 184, 7, 100, 2, 2, 184, 185, 7, 116, 2, 2, 185, 186, 7, 103, 2, 2, 186, 187, 7, 99, 2, 2, 187, 188, 7, 109, 2, 2, 188, 8, 3, 2, 2, 2, 189, 190, 7, 105, 2, 2, 190, 191, 7, 113, 2, 2, 191, 192, 7, 118, 2, 2, 192, 193, 7, 113, 2, 2, 193, 10, 3, 2, 2, 2, 194, 195, 7, 102, 2, 2, 195, 196, 7, 113, 2, 2, 196, 12, 3, 2, 2, 2, 197, 198, 7, 103, 2, 2, 198, 199, 7, 112, 2, 2, 199, 200, 7, 102, 2, 2, 200, 14, 3, 2, 2, 2, 201, 202, 7, 121, 2, 2, 202, 203, 7, 106, 2, 2, 203, 204, 7, 107, 2, 2, 204, 205, 7, 110, 2, 2, 205, 206, 7, 103, 2, 2, 206, 16, 3, 2, 2, 2, 207, 208, 7, 116, 2, 2, 208, 209, 7, 103, 2, 2, 209, 210, 7, 114, 2, 2, 210, 211, 7, 103, 2, 2, 211, 212, 7, 99, 2, 2, 212, 213, 7, 118, 2, 2, 213, 18, 3, 2, 2, 2, 214, 215, 7, 119, 2, 2, 215, 216, 7, 112, 2, 2, 216, 217, 7, 118, 2, 2, 217, 218, 7, 107, 2, 2, 218, 219, 7, 110, 2, 2, 219, 20, 3, 2, 2, 2, 220, 221, 7, 107, 2, 2, 221, 222, 7, 104, 2, 2, 222, 22, 3, 2, 2, 2, 223, 224, 7, 118, 2, 2, 224, 225, 7, 106, 2, 2, 225, 226, 7, 103, 2, 2, 226, 227, 7, 112, 2, 2, 227, 24, 3, 2, 2, 2, 228, 229, 7, 103, 2, 2, 229, 230, 7, 110, 2, 2, 230, 231, 7, 117, 2, 2, 231, 232, 7, 103, 2, 2, 232, 233, 7, 107, 2, 2, 233, 234, 7, 104, 2, 2, 234, 26, 3, 2, 2, 2, 235, 236, 7, 103, 2, 2, 236, 237, 7, 110, 2, 2, 237, 238, 7, 117, 2, 2, 238, 239, 7, 103, 2, 2, 239, 28, 3, 2, 2, 2, 240, 241, 7, 104, 2, 2, 241, 242, 7, 113, 2, 2, 242, 243, 7, 116, 2, 2, 243, 30, 3, 2, 2, 2, 244, 245, 7, 46, 2, 2, 245, 32, 3, 2, 2, 2, 246, 247, 7, 107, 2, 2, 247, 248, 7, 112, 2, 2, 248, 34, 3, 2, 2, 2, 249, 250, 7, 104, 2, 2, 250, 251, 7, 119, 2, 2, 251, 252, 7, 112, 2, 2, 252, 253, 7, 101, 2, 2, 253, 254, 7, 118, 2, 2, 254, 255, 7, 107, 2, 2, 255, 256, 7, 113, 2, 2, 256, 257, 7, 112, 2, 2, 257, 36, 3, 2, 2, 2, 258, 259, 7, 101, 2, 2, 259, 260, 7, 110, 2, 2, 260, 261, 7, 99, 2, 2, 261, 262, 7, 117, 2, 2, 262, 263, 7, 117, 2, 2, 263, 38, 3, 2, 2, 2, 264, 265, 7, 103, 2, 2, 265, 266, 7, 122, 2, 2, 266, 267, 7, 118, 2, 2, 267, 268, 7, 103, 2, 2, 268, 269, 7, 112, 2, 2, 269, 270, 7, 102, 2, 2, 270, 271, 7, 117, 2, 2, 271, 40, 3, 2, 2, 2, 272, 273, 7, 110, 2, 2, 273, 274, 7, 113, 2, 2, 274, 275, 7, 101, 2, 2, 275, 276, 7, 99, 2, 2, 276, 277, 7, 110, 2, 2, 277, 42, 3, 2, 2, 2, 278, 279, 7, 117, 2, 2, 279, 280, 7, 99, 2, 2, 280, 281, 7, 104, 2, 2, 281, 282, 7, 103, 2, 2, 282, 44, 3, 2, 2, 2, 283, 284, 7, 116, 2, 2, 284, 285, 7, 103, 2, 2, 285, 286, 7, 118, 2, 2, 286, 287, 7, 119, 2, 2, 287, 288, 7, 116, 2, 2, 288, 289, 7, 112, 2, 2, 289, 46, 3, 2, 2, 2, 290, 291, 7, 60, 2, 2, 291, 292, 7, 60, 2, 2, 292, 48, 3, 2, 2, 2, 293, 294, 7, 48, 2, 2, 294, 50, 3, 2, 2, 2, 295, 296, 7, 60, 2, 2, 296, 52, 3, 2, 2, 2, 297, 298, 7, 112, 2, 2, 298, 299, 7, 107, 2, 2, 299, 300, 7, 110, 2, 2, 300, 54, 3, 2, 2, 2, 301, 302, 7, 104, 2, 2, 302, 303, 7, 99, 2, 2, 303, 304, 7, 110, 2, 2, 304, 305, 7, 117, 2, 2, 305, 306, 7, 103, 2, 2, 306, 56, 3, 2, 2, 2, 307, 308, 7, 118, 2, 2, 308, 309, 7, 116, 2, 2, 309, 310, 7, 119, 2, 2, 310, 311, 7, 103, 2, 2, 311, 58, 3, 2, 2, 2, 312, 313, 7, 48, 2, 2, 313, 314, 7, 48, 2, 2, 314, 315, 7, 48, 2, 2, 315, 60, 3, 2, 2, 2, 316, 317, 7, 42, 2, 2, 317, 62, 3, 2, 2, 2, 318, 319, 7, 43, 2, 2, 319, 64, 3, 2, 2, 2, 320, 321, 7, 93, 2, 2, 321, 66, 3, 2, 2, 2, 322, 323, 7, 95, 2, 2, 323, 68, 3, 2, 2, 2, 324, 325, 7, 125, 2, 2, 325, 70, 3, 2, 2, 2, 326, 327, 7, 127, 2, 2, 327, 72, 3, 2, 2, 2, 328, 329, 7, 113, 2, 2, 329, 330, 7, 116, 2, 2, 330, 74, 3, 2, 2, 2, 331, 332, 7, 99, 2, 2, 332, 333, 7, 112, 2, 2, 333, 334, 7, 102, 2, 2, 334, 76, 3, 2, 2, 2, 335, 336, 7, 62, 2, 2, 336, 78, 3, 2, 2, 2, 337, 338, 7, 64, 2, 2, 338, 80, 3, 2, 2, 2, 339, 340, 7, 62, 2, 2, 340, 341, 7, 63, 2, 2, 341, 82, 3, 2, 2, 2, 342, 343, 7, 64, 2, 2, 343, 344, 7, 63, 2, 2, 344, 84, 3, 2, 2, 2, 345, 346, 7, 128, 2, 2, 346, 347, 7, 63, 2, 2, 347, 86, 3, 2, 2, 2, 348, 349, 7, 63, 2, 2, 349, 350, 7, 63, 2, 2, 350, 88, 3, 2, 2, 2, 351, 352, 7, 48, 2, 2, 352, 353, 7, 48, 2, 2, 353, 90, 3, 2, 2, 2, 354, 355, 7, 45, 2, 2, 355, 92, 3, 2, 2, 2, 356, 357, 7, 47, 2, 2, 357, 94, 3, 2, 2, 2, 358, 359, 7, 44, 2, 2, 359, 96, 3, 2, 2, 2, 360, 361, 7, 49, 2, 2, 361, 98, 3, 2, 2, 2, 362, 363, 7, 39, 2, 2, 363, 100, 3, 2, 2, 2, 364, 365, 7, 49, 2, 2, 365, 366, 7, 49, 2, 2, 366, 102, 3, 2, 2, 2, 367, 368, 7, 40, 2, 2, 368, 104, 3, 2, 2, 2, 369, 370, 7, 126, 2, 2, 370, 106, 3, 2, 2, 2, 371, 372, 7, 128, 2, 2, 372, 108, 3, 2, 2, 2, 373, 374, 7, 62, 2, 2, 374, 375, 7, 62, 2, 2, 375, 110, 3, 2, 2, 2, 376, 377, 7, 64, 2, 2, 377, 378, 7, 64, 2, 2, 378, 112, 3, 2, 2, 2, 379, 380, 7, 112, 2, 2, 380, 381, 7, 113, 2, 2, 381, 382, 7, 118, 2, 2, 382, 114, 3, 2, 2, 2, 383, 384, 7, 37, 2, 2, 384, 116, 3, 2, 2, 2, 385, 386, 7, 96, 2, 2, 386, 118, 3, 2, 2, 2, 387, 388, 7, 117, 2, 2, 388, 389, 7, 118, 2, 2, 389, 390, 7, 99, 2, 2, 390, 391, 7, 118, 2, 2, 391, 392, 7, 107, 2, 2, 392, 393, 7, 101, 2, 2, 393, 120, 3, 2, 2, 2, 394, 395, 7, 105, 2, 2, 395, 396, 7, 103, 2, 2, 396, 397, 7, 118, 2, 2, 397, 122, 3, 2, 2, 2, 398, 399, 7, 117, 2, 2, 399, 400, 7, 103, 2, 2, 400, 401, 7, 118, 2, 2, 401, 124, 3, 2, 2, 2, 402, 403, 7, 101, 2, 2, 403, 404, 7, 113, 2, 2, 404, 405, 7, 112, 2, 2, 405, 406, 7, 117, 2, 2, 406, 407, 7, 118, 2, 2, 407, 408, 7, 116, 2, 2, 408, 409, 7, 119, 2, 2, 409, 410, 7, 101, 2, 2, 410, 411, 7, 118, 2, 2, 411, 412, 7, 113, 2, 2, 412, 413, 7, 116, 2, 2, 413, 126, 3, 2, 2, 2, 414, 415, 7, 45, 2, 2, 415, 416, 7, 45, 2, 2, 416, 128, 3, 2, 2, 2, 417, 418, 7, 45, 2, 2, 418, 419, 7, 63, 2, 2, 419, 130, 3, 2, 2, 2, 420, 421, 7, 44, 2, 2, 421, 422, 7, 63, 2, 2, 422, 132, 3, 2, 2, 2, 423, 424, 7, 49, 2, 2, 424, 425, 7, 63, 2, 2, 425, 134, 3, 2, 2, 2, 426, 427, 7, 47, 2, 2, 427, 428, 7, 63, 2, 2, 428, 136, 3, 2, 2, 2, 429, 433, 9, 2, 2, 2, 430, 432, 9, 3, 2, 2, 431, 430, 3, 2, 2, 2, 432, 435, 3, 2, 2, 2, 433, 431, 3, 2, 2, 2, 433, 434, 3, 2, 2, 2, 434, 138, 3, 2, 2, 2, 435, 433, 3, 2, 2, 2, 436, 441, 7, 36, 2, 2, 437, 440, 5, 159, 80, 2, 438, 440, 10, 4, 2, 2, 439, 437, 3, 2, 2, 2, 439, 438, 3, 2, 2, 2, 440, 443, 3, 2, 2, 2, 441, 439, 3, 2, 2, 2, 441, 442, 3, 2, 2, 2, 442, 444, 3, 2, 2, 2, 443, 441, 3, 2, 2, 2, 444, 445, 7, 36, 2, 2, 445, 140, 3, 2, 2, 2, 446, 451, 7, 41, 2, 2, 447, 450, 5, 159, 80, 2, 448, 450, 10, 5, 2, 2, 449, 447, 3, 2, 2, 2, 449, 448, 3, 2, 2, 2, 450, 453, 3, 2, 2, 2, 451, 449, 3, 2, 2, 2, 451, 452, 3, 2, 2, 2, 452, 454, 3, 2, 2, 2, 453, 451, 3, 2, 2, 2, 454, 455, 7, 41, 2, 2, 455, 142, 3, 2, 2, 2, 456, 457, 7, 93, 2, 2, 457, 458, 5, 145, 73, 2, 458, 459, 7, 95, 2, 2, 459, 144, 3, 2, 2, 2, 460, 461, 7, 63, 2, 2, 461, 462, 5, 145, 73, 2, 462, 463, 7, 63, 2, 2, 463, 473, 3, 2, 2, 2, 464, 468, 7, 93, 2, 2, 465, 467, 11, 2, 2, 2, 466, 465, 3, 2, 2, 2, 467, 470, 3, 2, 2, 2, 468, 469, 3, 2, 2, 2, 468, 466, 3, 2, 2, 2, 469, 471, 3, 2, 2, 2, 470, 468, 3, 2, 2, 2, 471, 473, 7, 95, 2, 2, 472, 460, 3, 2, 2, 2, 472, 464, 3, 2, 2, 2, 473, 146, 3, 2, 2, 2, 474, 476, 5, 167, 84, 2, 475, 474, 3, 2, 2, 2, 476, 477, 3, 2, 2, 2, 477, 475, 3, 2, 2, 2, 477, 478, 3, 2, 2, 2, 478, 148, 3, 2, 2, 2, 479, 480, 7, 50, 2, 2, 480, 482, 9, 6, 2, 2, 481, 483, 5, 169, 85, 2, 482, 481, 3, 2, 2, 2, 483, 484, 3, 2, 2, 2, 484, 482, 3, 2, 2, 2, 484, 485, 3, 2, 2, 2, 485, 150, 3, 2, 2, 2, 486, 488, 5, 167, 84, 2, 487, 486, 3, 2, 2, 2, 488, 489, 3, 2, 2, 2, 489, 487, 3, 2, 2, 2, 489, 490, 3, 2, 2, 2, 490, 491, 3, 2, 2, 2, 491, 495, 7, 48, 2, 2, 492, 494, 5, 167, 84, 2, 493, 492, 3, 2, 2, 2, 494, 497, 3, 2, 2, 2, 495, 493, 3, 2, 2, 2, 495, 496, 3, 2, 2, 2, 496, 499, 3, 2, 2, 2, 497, 495, 3, 2, 2, 2, 498, 500, 5, 155, 78, 2, 499, 498, 3, 2, 2, 2, 499, 500, 3, 2, 2, 2, 500, 518, 3, 2, 2, 2, 501, 503, 7, 48, 2, 2, 502, 504, 5, 167, 84, 2, 503, 502, 3, 2, 2, 2, 504, 505, 3, 2, 2, 2, 505, 503, 3, 2, 2, 2, 505, 506, 3, 2, 2, 2, 506, 508, 3, 2, 2, 2, 507, 509, 5, 155, 78, 2, 508, 507, 3, 2, 2, 2, 508, 509, 3, 2, 2, 2, 509, 518, 3, 2, 2, 2, 510, 512, 5, 167, 84, 2, 511, 510, 3, 2, 2, 2, 512, 513, 3, 2, 2, 2, 513, 511, 3, 2, 2, 2, 513, 514, 3, 2, 2, 2, 514, 515, 3, 2, 2, 2, 515, 516, 5, 155, 78, 2, 516, 518, 3, 2, 2, 2, 517, 487, 3, 2, 2, 2, 517, 501, 3, 2, 2, 2, 517, 511, 3, 2, 2, 2, 518, 152, 3, 2, 2, 2, 519, 520, 7, 50, 2, 2, 520, 522, 9, 6, 2, 2, 521, 523, 5, 169, 85, 2, 522, 521, 3, 2, 2, 2, 523, 524, 3, 2, 2, 2, 524, 522, 3, 2, 2, 2, 524, 525, 3, 2, 2, 2, 525, 526, 3, 2, 2, 2, 526, 530, 7, 48, 2, 2, 527, 529, 5, 169, 85, 2, 528, 527, 3, 2, 2, 2, 529, 532, 3, 2, 2, 2, 530, 528, 3, 2, 2, 2, 530, 531, 3, 2, 2, 2, 531, 534, 3, 2, 2, 2, 532, 530, 3, 2, 2, 2, 533, 535, 5, 157, 79, 2, 534, 533, 3, 2, 2, 2, 534, 535, 3, 2, 2, 2, 535, 557, 3, 2, 2, 2, 536, 537, 7, 50, 2, 2, 537, 538, 9, 6, 2, 2, 538, 540, 7, 48, 2, 2, 539, 541, 5, 169, 85, 2, 540, 539, 3, 2, 2, 2, 541, 542, 3, 2, 2, 2, 542, 540, 3, 2, 2, 2, 542, 543, 3, 2, 2, 2, 543, 545, 3, 2, 2, 2, 544, 546, 5, 157, 79, 2, 545, 544, 3, 2, 2, 2, 545, 546, 3, 2, 2, 2, 546, 557, 3, 2, 2, 2, 547, 548, 7, 50, 2, 2, 548, 550, 9, 6, 2, 2, 549, 551, 5, 169, 85, 2, 550, 549, 3, 2, 2, 2, 551, 552, 3, 2, 2, 2, 552, 550, 3, 2, 2, 2, 552, 553, 3, 2, 2, 2, 553, 554, 3, 2, 2, 2, 554, 555, 5, 157, 79, 2, 555, 557, 3, 2, 2, 2, 556, 519, 3, 2, 2, 2, 556, 536, 3, 2, 2, 2, 556, 547, 3, 2, 2, 2, 557, 154, 3, 2, 2, 2, 558, 560, 9, 7, 2, 2, 559, 561, 9, 8, 2, 2, 560, 559, 3, 2, 2, 2, 560, 561, 3, 2, 2, 2, 561, 563, 3, 2, 2, 2, 562, 564, 5, 167, 84, 2, 563, 562, 3, 2, 2, 2, 564, 565, 3, 2, 2, 2, 565, 563, 3, 2, 2, 2, 565, 566, 3, 2, 2, 2, 566, 156, 3, 2, 2, 2, 567, 569, 9, 9, 2, 2, 568, 570, 9, 8, 2, 2, 569, 568, 3, 2, 2, 2, 569, 570, 3, 2, 2, 2, 570, 572, 3, 2, 2, 2, 571, 573, 5, 167, 84, 2, 572, 571, 3, 2, 2, 2, 573, 574, 3, 2, 2, 2, 574, 572, 3, 2, 2, 2, 574, 575, 3, 2, 2, 2, 575, 158, 3, 2, 2, 2, 576, 577, 7, 94, 2, 2, 577, 587, 9, 10, 2, 2, 578, 580, 7, 94, 2, 2, 579, 581, 7, 15, 2, 2, 580, 579, 3, 2, 2, 2, 580, 581, 3, 2, 2, 2, 581, 582, 3, 2, 2, 2, 582, 587, 7, 12, 2, 2, 583, 587, 5, 161, 81, 2, 584, 587, 5, 163, 82, 2, 585, 587, 5, 165, 83, 2, 586, 576, 3, 2, 2, 2, 586, 578, 3, 2, 2, 2, 586, 583, 3, 2, 2, 2, 586, 584, 3, 2, 2, 2, 586, 585, 3, 2, 2, 2, 587, 160, 3, 2, 2, 2, 588, 589, 7, 94, 2, 2, 589, 600, 5, 167, 84, 2, 590, 591, 7, 94, 2, 2, 591, 592, 5, 167, 84, 2, 592, 593, 5, 167, 84, 2, 593, 600, 3, 2, 2, 2, 594, 595, 7, 94, 2, 2, 595, 596, 9, 11, 2, 2, 596, 597, 5, 167, 84, 2, 597, 598, 5, 167, 84, 2, 598, 600, 3, 2, 2, 2, 599, 588, 3, 2, 2, 2, 599, 590, 3, 2, 2, 2, 599, 594, 3, 2, 2, 2, 600, 162, 3, 2, 2, 2, 601, 602, 7, 94, 2, 2, 602, 603, 7, 122, 2, 2, 603, 604, 5, 169, 85, 2, 604, 605, 5, 169, 85, 2, 605, 164, 3, 2, 2, 2, 606, 607, 7, 94, 2, 2, 607, 608, 7, 119, 2, 2, 608, 609, 7, 125, 2, 2, 609, 611, 3, 2, 2, 2, 610, 612, 5, 169, 85, 2, 611, 610, 3, 2, 2, 2, 612, 613, 3, 2, 2, 2, 613, 611, 3, 2, 2, 2, 613, 614, 3, 2, 2, 2, 614, 615, 3, 2, 2, 2, 615, 616, 7, 127, 2, 2, 616, 166, 3, 2, 2, 2, 617, 618, 9, 12, 2, 2, 618, 168, 3, 2, 2, 2, 619, 620, 9, 13, 2, 2, 620, 170, 3, 2, 2, 2, 621, 622, 7, 47, 2, 2, 622, 623, 7, 47, 2, 2, 623, 624, 7, 93, 2, 2, 624, 625, 3, 2, 2, 2, 625, 626, 5, 145, 73, 2, 626, 627, 7, 95, 2, 2, 627, 628, 3, 2, 2, 2, 628, 629, 8, 86, 2, 2, 629, 172, 3, 2, 2, 2, 630, 631, 7, 47, 2, 2, 631, 632, 7, 47, 2, 2, 632, 662, 3, 2, 2, 2, 633, 663, 3, 2, 2, 2, 634, 638, 7, 93, 2, 2, 635, 637, 7, 63, 2, 2, 636, 635, 3, 2, 2, 2, 637, 640, 3, 2, 2, 2, 638, 636, 3, 2, 2, 2, 638, 639, 3, 2, 2, 2, 639, 663, 3, 2, 2, 2, 640, 638, 3, 2, 2, 2, 641, 645, 7, 93, 2, 2, 642, 644, 7, 63, 2, 2, 643, 642, 3, 2, 2, 2, 644, 647, 3, 2, 2, 2, 645, 643, 3, 2, 2, 2, 645, 646, 3, 2, 2, 2, 646, 648, 3, 2, 2, 2, 647, 645, 3, 2, 2, 2, 648, 652, 10, 14, 2, 2, 649, 651, 10, 15, 2, 2, 650, 649, 3, 2, 2, 2, 651, 654, 3, 2, 2, 2, 652, 650, 3, 2, 2, 2, 652, 653, 3, 2, 2, 2, 653, 663, 3, 2, 2, 2, 654, 652, 3, 2, 2, 2, 655, 659, 10, 16, 2, 2, 656, 658, 10, 15, 2, 2, 657, 656, 3, 2, 2, 2, 658, 661, 3, 2, 2, 2, 659, 657, 3, 2, 2, 2, 659, 660, 3, 2, 2, 2, 660, 663, 3, 2, 2, 2, 661, 659, 3, 2, 2, 2, 662, 633, 3, 2, 2, 2, 662, 634, 3, 2, 2, 2, 662, 641, 3, 2, 2, 2, 662, 655, 3, 2, 2, 2, 663, 667, 3, 2, 2, 2, 664, 665, 7, 15, 2, 2, 665, 668, 7, 12, 2, 2, 666, 668, 9, 17, 2, 2, 667, 664, 3, 2, 2, 2, 667, 666, 3, 2, 2, 2, 668, 669, 3, 2, 2, 2, 669, 670, 8, 87, 2, 2, 670, 174, 3, 2, 2, 2, 671, 673, 9, 18, 2, 2, 672, 671, 3, 2, 2, 2, 673, 674, 3, 2, 2, 2, 674, 672, 3, 2, 2, 2, 674, 675, 3, 2, 2, 2, 675, 676, 3, 2, 2, 2, 676, 677, 8, 88, 3, 2, 677, 176, 3, 2, 2, 2, 678, 679, 7, 37, 2, 2, 679, 683, 7, 35, 2, 2, 680, 682, 10, 15, 2, 2, 681, 680, 3, 2, 2, 2, 682, 685, 3, 2, 2, 2, 683, 681, 3, 2, 2, 2, 683, 684, 3, 2, 2, 2, 684, 686, 3, 2, 2, 2, 685, 683, 3, 2, 2, 2, 686, 687, 8, 89, 2, 2, 687, 178, 3, 2, 2, 2, 42, 2, 433, 439, 441, 449, 451, 468, 472, 477, 484, 489, 495, 499, 505, 508, 513, 517, 524, 530, 534, 542, 545, 552, 556, 560, 565, 569, 574, 580, 586, 599, 613, 638, 645, 652, 659, 662, 667, 674, 683, 4, 2, 3, 2, 8, 2, 2] -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappLexer.java: -------------------------------------------------------------------------------- 1 | // Generated from C:/Users/Harry/Desktop/Lua/lpp2electricboogaloo/lua-plus-plus/src/main/java/org/luapp/language/parser\luapp.g4 by ANTLR 4.8 2 | package org.luapp.language.generator; 3 | import org.antlr.v4.runtime.Lexer; 4 | import org.antlr.v4.runtime.CharStream; 5 | import org.antlr.v4.runtime.Token; 6 | import org.antlr.v4.runtime.TokenStream; 7 | import org.antlr.v4.runtime.*; 8 | import org.antlr.v4.runtime.atn.*; 9 | import org.antlr.v4.runtime.dfa.DFA; 10 | import org.antlr.v4.runtime.misc.*; 11 | 12 | @SuppressWarnings({"all", "warnings", "unchecked", "unused", "cast"}) 13 | public class luappLexer extends Lexer { 14 | static { RuntimeMetaData.checkVersion("4.8", RuntimeMetaData.VERSION); } 15 | 16 | protected static final DFA[] _decisionToDFA; 17 | protected static final PredictionContextCache _sharedContextCache = 18 | new PredictionContextCache(); 19 | public static final int 20 | T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, 21 | T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, 22 | T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, 23 | T__24=25, T__25=26, T__26=27, T__27=28, T__28=29, T__29=30, T__30=31, 24 | T__31=32, T__32=33, T__33=34, T__34=35, T__35=36, T__36=37, T__37=38, 25 | T__38=39, T__39=40, T__40=41, T__41=42, T__42=43, T__43=44, T__44=45, 26 | T__45=46, T__46=47, T__47=48, T__48=49, T__49=50, T__50=51, T__51=52, 27 | T__52=53, T__53=54, T__54=55, T__55=56, T__56=57, T__57=58, T__58=59, 28 | T__59=60, T__60=61, T__61=62, T__62=63, T__63=64, T__64=65, T__65=66, 29 | T__66=67, NAME=68, NORMALSTRING=69, CHARSTRING=70, LONGSTRING=71, INT=72, 30 | HEX=73, FLOAT=74, HEX_FLOAT=75, COMMENT=76, LINE_COMMENT=77, WS=78, SHEBANG=79; 31 | public static String[] channelNames = { 32 | "DEFAULT_TOKEN_CHANNEL", "HIDDEN" 33 | }; 34 | 35 | public static String[] modeNames = { 36 | "DEFAULT_MODE" 37 | }; 38 | 39 | private static String[] makeRuleNames() { 40 | return new String[] { 41 | "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", 42 | "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", 43 | "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", 44 | "T__25", "T__26", "T__27", "T__28", "T__29", "T__30", "T__31", "T__32", 45 | "T__33", "T__34", "T__35", "T__36", "T__37", "T__38", "T__39", "T__40", 46 | "T__41", "T__42", "T__43", "T__44", "T__45", "T__46", "T__47", "T__48", 47 | "T__49", "T__50", "T__51", "T__52", "T__53", "T__54", "T__55", "T__56", 48 | "T__57", "T__58", "T__59", "T__60", "T__61", "T__62", "T__63", "T__64", 49 | "T__65", "T__66", "NAME", "NORMALSTRING", "CHARSTRING", "LONGSTRING", 50 | "NESTED_STR", "INT", "HEX", "FLOAT", "HEX_FLOAT", "ExponentPart", "HexExponentPart", 51 | "EscapeSequence", "DecimalEscape", "HexEscape", "UtfEscape", "Digit", 52 | "HexDigit", "COMMENT", "LINE_COMMENT", "WS", "SHEBANG" 53 | }; 54 | } 55 | public static final String[] ruleNames = makeRuleNames(); 56 | 57 | private static String[] makeLiteralNames() { 58 | return new String[] { 59 | null, "';'", "'='", "'break'", "'goto'", "'do'", "'end'", "'while'", 60 | "'repeat'", "'until'", "'if'", "'then'", "'elseif'", "'else'", "'for'", 61 | "','", "'in'", "'function'", "'class'", "'extends'", "'local'", "'safe'", 62 | "'return'", "'::'", "'.'", "':'", "'nil'", "'false'", "'true'", "'...'", 63 | "'('", "')'", "'['", "']'", "'{'", "'}'", "'or'", "'and'", "'<'", "'>'", 64 | "'<='", "'>='", "'~='", "'=='", "'..'", "'+'", "'-'", "'*'", "'/'", "'%'", 65 | "'//'", "'&'", "'|'", "'~'", "'<<'", "'>>'", "'not'", "'#'", "'^'", "'static'", 66 | "'get'", "'set'", "'constructor'", "'++'", "'+='", "'*='", "'/='", "'-='" 67 | }; 68 | } 69 | private static final String[] _LITERAL_NAMES = makeLiteralNames(); 70 | private static String[] makeSymbolicNames() { 71 | return new String[] { 72 | null, null, null, null, null, null, null, null, null, null, null, null, 73 | null, null, null, null, null, null, null, null, null, null, null, null, 74 | null, null, null, null, null, null, null, null, null, null, null, null, 75 | null, null, null, null, null, null, null, null, null, null, null, null, 76 | null, null, null, null, null, null, null, null, null, null, null, null, 77 | null, null, null, null, null, null, null, null, "NAME", "NORMALSTRING", 78 | "CHARSTRING", "LONGSTRING", "INT", "HEX", "FLOAT", "HEX_FLOAT", "COMMENT", 79 | "LINE_COMMENT", "WS", "SHEBANG" 80 | }; 81 | } 82 | private static final String[] _SYMBOLIC_NAMES = makeSymbolicNames(); 83 | public static final Vocabulary VOCABULARY = new VocabularyImpl(_LITERAL_NAMES, _SYMBOLIC_NAMES); 84 | 85 | /** 86 | * @deprecated Use {@link #VOCABULARY} instead. 87 | */ 88 | @Deprecated 89 | public static final String[] tokenNames; 90 | static { 91 | tokenNames = new String[_SYMBOLIC_NAMES.length]; 92 | for (int i = 0; i < tokenNames.length; i++) { 93 | tokenNames[i] = VOCABULARY.getLiteralName(i); 94 | if (tokenNames[i] == null) { 95 | tokenNames[i] = VOCABULARY.getSymbolicName(i); 96 | } 97 | 98 | if (tokenNames[i] == null) { 99 | tokenNames[i] = ""; 100 | } 101 | } 102 | } 103 | 104 | @Override 105 | @Deprecated 106 | public String[] getTokenNames() { 107 | return tokenNames; 108 | } 109 | 110 | @Override 111 | 112 | public Vocabulary getVocabulary() { 113 | return VOCABULARY; 114 | } 115 | 116 | 117 | public luappLexer(CharStream input) { 118 | super(input); 119 | _interp = new LexerATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache); 120 | } 121 | 122 | @Override 123 | public String getGrammarFileName() { return "luapp.g4"; } 124 | 125 | @Override 126 | public String[] getRuleNames() { return ruleNames; } 127 | 128 | @Override 129 | public String getSerializedATN() { return _serializedATN; } 130 | 131 | @Override 132 | public String[] getChannelNames() { return channelNames; } 133 | 134 | @Override 135 | public String[] getModeNames() { return modeNames; } 136 | 137 | @Override 138 | public ATN getATN() { return _ATN; } 139 | 140 | public static final String _serializedATN = 141 | "\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u5964\2Q\u02b0\b\1\4\2\t"+ 142 | "\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13"+ 143 | "\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+ 144 | "\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+ 145 | "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\4\37\t\37\4 \t \4!"+ 146 | "\t!\4\"\t\"\4#\t#\4$\t$\4%\t%\4&\t&\4\'\t\'\4(\t(\4)\t)\4*\t*\4+\t+\4"+ 147 | ",\t,\4-\t-\4.\t.\4/\t/\4\60\t\60\4\61\t\61\4\62\t\62\4\63\t\63\4\64\t"+ 148 | "\64\4\65\t\65\4\66\t\66\4\67\t\67\48\t8\49\t9\4:\t:\4;\t;\4<\t<\4=\t="+ 149 | "\4>\t>\4?\t?\4@\t@\4A\tA\4B\tB\4C\tC\4D\tD\4E\tE\4F\tF\4G\tG\4H\tH\4I"+ 150 | "\tI\4J\tJ\4K\tK\4L\tL\4M\tM\4N\tN\4O\tO\4P\tP\4Q\tQ\4R\tR\4S\tS\4T\tT"+ 151 | "\4U\tU\4V\tV\4W\tW\4X\tX\4Y\tY\3\2\3\2\3\3\3\3\3\4\3\4\3\4\3\4\3\4\3\4"+ 152 | "\3\5\3\5\3\5\3\5\3\5\3\6\3\6\3\6\3\7\3\7\3\7\3\7\3\b\3\b\3\b\3\b\3\b\3"+ 153 | "\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\3\n\3\n\3\n\3\n\3\n\3\n\3\13\3\13\3\13"+ 154 | "\3\f\3\f\3\f\3\f\3\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\16\3\16\3\16\3\16\3"+ 155 | "\16\3\17\3\17\3\17\3\17\3\20\3\20\3\21\3\21\3\21\3\22\3\22\3\22\3\22\3"+ 156 | "\22\3\22\3\22\3\22\3\22\3\23\3\23\3\23\3\23\3\23\3\23\3\24\3\24\3\24\3"+ 157 | "\24\3\24\3\24\3\24\3\24\3\25\3\25\3\25\3\25\3\25\3\25\3\26\3\26\3\26\3"+ 158 | "\26\3\26\3\27\3\27\3\27\3\27\3\27\3\27\3\27\3\30\3\30\3\30\3\31\3\31\3"+ 159 | "\32\3\32\3\33\3\33\3\33\3\33\3\34\3\34\3\34\3\34\3\34\3\34\3\35\3\35\3"+ 160 | "\35\3\35\3\35\3\36\3\36\3\36\3\36\3\37\3\37\3 \3 \3!\3!\3\"\3\"\3#\3#"+ 161 | "\3$\3$\3%\3%\3%\3&\3&\3&\3&\3\'\3\'\3(\3(\3)\3)\3)\3*\3*\3*\3+\3+\3+\3"+ 162 | ",\3,\3,\3-\3-\3-\3.\3.\3/\3/\3\60\3\60\3\61\3\61\3\62\3\62\3\63\3\63\3"+ 163 | "\63\3\64\3\64\3\65\3\65\3\66\3\66\3\67\3\67\3\67\38\38\38\39\39\39\39"+ 164 | "\3:\3:\3;\3;\3<\3<\3<\3<\3<\3<\3<\3=\3=\3=\3=\3>\3>\3>\3>\3?\3?\3?\3?"+ 165 | "\3?\3?\3?\3?\3?\3?\3?\3?\3@\3@\3@\3A\3A\3A\3B\3B\3B\3C\3C\3C\3D\3D\3D"+ 166 | "\3E\3E\7E\u01b0\nE\fE\16E\u01b3\13E\3F\3F\3F\7F\u01b8\nF\fF\16F\u01bb"+ 167 | "\13F\3F\3F\3G\3G\3G\7G\u01c2\nG\fG\16G\u01c5\13G\3G\3G\3H\3H\3H\3H\3I"+ 168 | "\3I\3I\3I\3I\3I\7I\u01d3\nI\fI\16I\u01d6\13I\3I\5I\u01d9\nI\3J\6J\u01dc"+ 169 | "\nJ\rJ\16J\u01dd\3K\3K\3K\6K\u01e3\nK\rK\16K\u01e4\3L\6L\u01e8\nL\rL\16"+ 170 | "L\u01e9\3L\3L\7L\u01ee\nL\fL\16L\u01f1\13L\3L\5L\u01f4\nL\3L\3L\6L\u01f8"+ 171 | "\nL\rL\16L\u01f9\3L\5L\u01fd\nL\3L\6L\u0200\nL\rL\16L\u0201\3L\3L\5L\u0206"+ 172 | "\nL\3M\3M\3M\6M\u020b\nM\rM\16M\u020c\3M\3M\7M\u0211\nM\fM\16M\u0214\13"+ 173 | "M\3M\5M\u0217\nM\3M\3M\3M\3M\6M\u021d\nM\rM\16M\u021e\3M\5M\u0222\nM\3"+ 174 | "M\3M\3M\6M\u0227\nM\rM\16M\u0228\3M\3M\5M\u022d\nM\3N\3N\5N\u0231\nN\3"+ 175 | "N\6N\u0234\nN\rN\16N\u0235\3O\3O\5O\u023a\nO\3O\6O\u023d\nO\rO\16O\u023e"+ 176 | "\3P\3P\3P\3P\5P\u0245\nP\3P\3P\3P\3P\5P\u024b\nP\3Q\3Q\3Q\3Q\3Q\3Q\3Q"+ 177 | "\3Q\3Q\3Q\3Q\5Q\u0258\nQ\3R\3R\3R\3R\3R\3S\3S\3S\3S\3S\6S\u0264\nS\rS"+ 178 | "\16S\u0265\3S\3S\3T\3T\3U\3U\3V\3V\3V\3V\3V\3V\3V\3V\3V\3W\3W\3W\3W\3"+ 179 | "W\3W\7W\u027d\nW\fW\16W\u0280\13W\3W\3W\7W\u0284\nW\fW\16W\u0287\13W\3"+ 180 | "W\3W\7W\u028b\nW\fW\16W\u028e\13W\3W\3W\7W\u0292\nW\fW\16W\u0295\13W\5"+ 181 | "W\u0297\nW\3W\3W\3W\5W\u029c\nW\3W\3W\3X\6X\u02a1\nX\rX\16X\u02a2\3X\3"+ 182 | "X\3Y\3Y\3Y\7Y\u02aa\nY\fY\16Y\u02ad\13Y\3Y\3Y\3\u01d4\2Z\3\3\5\4\7\5\t"+ 183 | "\6\13\7\r\b\17\t\21\n\23\13\25\f\27\r\31\16\33\17\35\20\37\21!\22#\23"+ 184 | "%\24\'\25)\26+\27-\30/\31\61\32\63\33\65\34\67\359\36;\37= ?!A\"C#E$G"+ 185 | "%I&K\'M(O)Q*S+U,W-Y.[/]\60_\61a\62c\63e\64g\65i\66k\67m8o9q:s;u{"+ 186 | "?}@\177A\u0081B\u0083C\u0085D\u0087E\u0089F\u008bG\u008dH\u008fI\u0091"+ 187 | "\2\u0093J\u0095K\u0097L\u0099M\u009b\2\u009d\2\u009f\2\u00a1\2\u00a3\2"+ 188 | "\u00a5\2\u00a7\2\u00a9\2\u00abN\u00adO\u00afP\u00b1Q\3\2\23\5\2C\\aac"+ 189 | "|\6\2\62;C\\aac|\4\2$$^^\4\2))^^\4\2ZZzz\4\2GGgg\4\2--//\4\2RRrr\f\2$"+ 190 | "$))^^cdhhppttvvxx||\3\2\62\64\3\2\62;\5\2\62;CHch\6\2\f\f\17\17??]]\4"+ 191 | "\2\f\f\17\17\5\2\f\f\17\17]]\4\3\f\f\17\17\5\2\13\f\16\17\"\"\2\u02d5"+ 192 | "\2\3\3\2\2\2\2\5\3\2\2\2\2\7\3\2\2\2\2\t\3\2\2\2\2\13\3\2\2\2\2\r\3\2"+ 193 | "\2\2\2\17\3\2\2\2\2\21\3\2\2\2\2\23\3\2\2\2\2\25\3\2\2\2\2\27\3\2\2\2"+ 194 | "\2\31\3\2\2\2\2\33\3\2\2\2\2\35\3\2\2\2\2\37\3\2\2\2\2!\3\2\2\2\2#\3\2"+ 195 | "\2\2\2%\3\2\2\2\2\'\3\2\2\2\2)\3\2\2\2\2+\3\2\2\2\2-\3\2\2\2\2/\3\2\2"+ 196 | "\2\2\61\3\2\2\2\2\63\3\2\2\2\2\65\3\2\2\2\2\67\3\2\2\2\29\3\2\2\2\2;\3"+ 197 | "\2\2\2\2=\3\2\2\2\2?\3\2\2\2\2A\3\2\2\2\2C\3\2\2\2\2E\3\2\2\2\2G\3\2\2"+ 198 | "\2\2I\3\2\2\2\2K\3\2\2\2\2M\3\2\2\2\2O\3\2\2\2\2Q\3\2\2\2\2S\3\2\2\2\2"+ 199 | "U\3\2\2\2\2W\3\2\2\2\2Y\3\2\2\2\2[\3\2\2\2\2]\3\2\2\2\2_\3\2\2\2\2a\3"+ 200 | "\2\2\2\2c\3\2\2\2\2e\3\2\2\2\2g\3\2\2\2\2i\3\2\2\2\2k\3\2\2\2\2m\3\2\2"+ 201 | "\2\2o\3\2\2\2\2q\3\2\2\2\2s\3\2\2\2\2u\3\2\2\2\2w\3\2\2\2\2y\3\2\2\2\2"+ 202 | "{\3\2\2\2\2}\3\2\2\2\2\177\3\2\2\2\2\u0081\3\2\2\2\2\u0083\3\2\2\2\2\u0085"+ 203 | "\3\2\2\2\2\u0087\3\2\2\2\2\u0089\3\2\2\2\2\u008b\3\2\2\2\2\u008d\3\2\2"+ 204 | "\2\2\u008f\3\2\2\2\2\u0093\3\2\2\2\2\u0095\3\2\2\2\2\u0097\3\2\2\2\2\u0099"+ 205 | "\3\2\2\2\2\u00ab\3\2\2\2\2\u00ad\3\2\2\2\2\u00af\3\2\2\2\2\u00b1\3\2\2"+ 206 | "\2\3\u00b3\3\2\2\2\5\u00b5\3\2\2\2\7\u00b7\3\2\2\2\t\u00bd\3\2\2\2\13"+ 207 | "\u00c2\3\2\2\2\r\u00c5\3\2\2\2\17\u00c9\3\2\2\2\21\u00cf\3\2\2\2\23\u00d6"+ 208 | "\3\2\2\2\25\u00dc\3\2\2\2\27\u00df\3\2\2\2\31\u00e4\3\2\2\2\33\u00eb\3"+ 209 | "\2\2\2\35\u00f0\3\2\2\2\37\u00f4\3\2\2\2!\u00f6\3\2\2\2#\u00f9\3\2\2\2"+ 210 | "%\u0102\3\2\2\2\'\u0108\3\2\2\2)\u0110\3\2\2\2+\u0116\3\2\2\2-\u011b\3"+ 211 | "\2\2\2/\u0122\3\2\2\2\61\u0125\3\2\2\2\63\u0127\3\2\2\2\65\u0129\3\2\2"+ 212 | "\2\67\u012d\3\2\2\29\u0133\3\2\2\2;\u0138\3\2\2\2=\u013c\3\2\2\2?\u013e"+ 213 | "\3\2\2\2A\u0140\3\2\2\2C\u0142\3\2\2\2E\u0144\3\2\2\2G\u0146\3\2\2\2I"+ 214 | "\u0148\3\2\2\2K\u014b\3\2\2\2M\u014f\3\2\2\2O\u0151\3\2\2\2Q\u0153\3\2"+ 215 | "\2\2S\u0156\3\2\2\2U\u0159\3\2\2\2W\u015c\3\2\2\2Y\u015f\3\2\2\2[\u0162"+ 216 | "\3\2\2\2]\u0164\3\2\2\2_\u0166\3\2\2\2a\u0168\3\2\2\2c\u016a\3\2\2\2e"+ 217 | "\u016c\3\2\2\2g\u016f\3\2\2\2i\u0171\3\2\2\2k\u0173\3\2\2\2m\u0175\3\2"+ 218 | "\2\2o\u0178\3\2\2\2q\u017b\3\2\2\2s\u017f\3\2\2\2u\u0181\3\2\2\2w\u0183"+ 219 | "\3\2\2\2y\u018a\3\2\2\2{\u018e\3\2\2\2}\u0192\3\2\2\2\177\u019e\3\2\2"+ 220 | "\2\u0081\u01a1\3\2\2\2\u0083\u01a4\3\2\2\2\u0085\u01a7\3\2\2\2\u0087\u01aa"+ 221 | "\3\2\2\2\u0089\u01ad\3\2\2\2\u008b\u01b4\3\2\2\2\u008d\u01be\3\2\2\2\u008f"+ 222 | "\u01c8\3\2\2\2\u0091\u01d8\3\2\2\2\u0093\u01db\3\2\2\2\u0095\u01df\3\2"+ 223 | "\2\2\u0097\u0205\3\2\2\2\u0099\u022c\3\2\2\2\u009b\u022e\3\2\2\2\u009d"+ 224 | "\u0237\3\2\2\2\u009f\u024a\3\2\2\2\u00a1\u0257\3\2\2\2\u00a3\u0259\3\2"+ 225 | "\2\2\u00a5\u025e\3\2\2\2\u00a7\u0269\3\2\2\2\u00a9\u026b\3\2\2\2\u00ab"+ 226 | "\u026d\3\2\2\2\u00ad\u0276\3\2\2\2\u00af\u02a0\3\2\2\2\u00b1\u02a6\3\2"+ 227 | "\2\2\u00b3\u00b4\7=\2\2\u00b4\4\3\2\2\2\u00b5\u00b6\7?\2\2\u00b6\6\3\2"+ 228 | "\2\2\u00b7\u00b8\7d\2\2\u00b8\u00b9\7t\2\2\u00b9\u00ba\7g\2\2\u00ba\u00bb"+ 229 | "\7c\2\2\u00bb\u00bc\7m\2\2\u00bc\b\3\2\2\2\u00bd\u00be\7i\2\2\u00be\u00bf"+ 230 | "\7q\2\2\u00bf\u00c0\7v\2\2\u00c0\u00c1\7q\2\2\u00c1\n\3\2\2\2\u00c2\u00c3"+ 231 | "\7f\2\2\u00c3\u00c4\7q\2\2\u00c4\f\3\2\2\2\u00c5\u00c6\7g\2\2\u00c6\u00c7"+ 232 | "\7p\2\2\u00c7\u00c8\7f\2\2\u00c8\16\3\2\2\2\u00c9\u00ca\7y\2\2\u00ca\u00cb"+ 233 | "\7j\2\2\u00cb\u00cc\7k\2\2\u00cc\u00cd\7n\2\2\u00cd\u00ce\7g\2\2\u00ce"+ 234 | "\20\3\2\2\2\u00cf\u00d0\7t\2\2\u00d0\u00d1\7g\2\2\u00d1\u00d2\7r\2\2\u00d2"+ 235 | "\u00d3\7g\2\2\u00d3\u00d4\7c\2\2\u00d4\u00d5\7v\2\2\u00d5\22\3\2\2\2\u00d6"+ 236 | "\u00d7\7w\2\2\u00d7\u00d8\7p\2\2\u00d8\u00d9\7v\2\2\u00d9\u00da\7k\2\2"+ 237 | "\u00da\u00db\7n\2\2\u00db\24\3\2\2\2\u00dc\u00dd\7k\2\2\u00dd\u00de\7"+ 238 | "h\2\2\u00de\26\3\2\2\2\u00df\u00e0\7v\2\2\u00e0\u00e1\7j\2\2\u00e1\u00e2"+ 239 | "\7g\2\2\u00e2\u00e3\7p\2\2\u00e3\30\3\2\2\2\u00e4\u00e5\7g\2\2\u00e5\u00e6"+ 240 | "\7n\2\2\u00e6\u00e7\7u\2\2\u00e7\u00e8\7g\2\2\u00e8\u00e9\7k\2\2\u00e9"+ 241 | "\u00ea\7h\2\2\u00ea\32\3\2\2\2\u00eb\u00ec\7g\2\2\u00ec\u00ed\7n\2\2\u00ed"+ 242 | "\u00ee\7u\2\2\u00ee\u00ef\7g\2\2\u00ef\34\3\2\2\2\u00f0\u00f1\7h\2\2\u00f1"+ 243 | "\u00f2\7q\2\2\u00f2\u00f3\7t\2\2\u00f3\36\3\2\2\2\u00f4\u00f5\7.\2\2\u00f5"+ 244 | " \3\2\2\2\u00f6\u00f7\7k\2\2\u00f7\u00f8\7p\2\2\u00f8\"\3\2\2\2\u00f9"+ 245 | "\u00fa\7h\2\2\u00fa\u00fb\7w\2\2\u00fb\u00fc\7p\2\2\u00fc\u00fd\7e\2\2"+ 246 | "\u00fd\u00fe\7v\2\2\u00fe\u00ff\7k\2\2\u00ff\u0100\7q\2\2\u0100\u0101"+ 247 | "\7p\2\2\u0101$\3\2\2\2\u0102\u0103\7e\2\2\u0103\u0104\7n\2\2\u0104\u0105"+ 248 | "\7c\2\2\u0105\u0106\7u\2\2\u0106\u0107\7u\2\2\u0107&\3\2\2\2\u0108\u0109"+ 249 | "\7g\2\2\u0109\u010a\7z\2\2\u010a\u010b\7v\2\2\u010b\u010c\7g\2\2\u010c"+ 250 | "\u010d\7p\2\2\u010d\u010e\7f\2\2\u010e\u010f\7u\2\2\u010f(\3\2\2\2\u0110"+ 251 | "\u0111\7n\2\2\u0111\u0112\7q\2\2\u0112\u0113\7e\2\2\u0113\u0114\7c\2\2"+ 252 | "\u0114\u0115\7n\2\2\u0115*\3\2\2\2\u0116\u0117\7u\2\2\u0117\u0118\7c\2"+ 253 | "\2\u0118\u0119\7h\2\2\u0119\u011a\7g\2\2\u011a,\3\2\2\2\u011b\u011c\7"+ 254 | "t\2\2\u011c\u011d\7g\2\2\u011d\u011e\7v\2\2\u011e\u011f\7w\2\2\u011f\u0120"+ 255 | "\7t\2\2\u0120\u0121\7p\2\2\u0121.\3\2\2\2\u0122\u0123\7<\2\2\u0123\u0124"+ 256 | "\7<\2\2\u0124\60\3\2\2\2\u0125\u0126\7\60\2\2\u0126\62\3\2\2\2\u0127\u0128"+ 257 | "\7<\2\2\u0128\64\3\2\2\2\u0129\u012a\7p\2\2\u012a\u012b\7k\2\2\u012b\u012c"+ 258 | "\7n\2\2\u012c\66\3\2\2\2\u012d\u012e\7h\2\2\u012e\u012f\7c\2\2\u012f\u0130"+ 259 | "\7n\2\2\u0130\u0131\7u\2\2\u0131\u0132\7g\2\2\u01328\3\2\2\2\u0133\u0134"+ 260 | "\7v\2\2\u0134\u0135\7t\2\2\u0135\u0136\7w\2\2\u0136\u0137\7g\2\2\u0137"+ 261 | ":\3\2\2\2\u0138\u0139\7\60\2\2\u0139\u013a\7\60\2\2\u013a\u013b\7\60\2"+ 262 | "\2\u013b<\3\2\2\2\u013c\u013d\7*\2\2\u013d>\3\2\2\2\u013e\u013f\7+\2\2"+ 263 | "\u013f@\3\2\2\2\u0140\u0141\7]\2\2\u0141B\3\2\2\2\u0142\u0143\7_\2\2\u0143"+ 264 | "D\3\2\2\2\u0144\u0145\7}\2\2\u0145F\3\2\2\2\u0146\u0147\7\177\2\2\u0147"+ 265 | "H\3\2\2\2\u0148\u0149\7q\2\2\u0149\u014a\7t\2\2\u014aJ\3\2\2\2\u014b\u014c"+ 266 | "\7c\2\2\u014c\u014d\7p\2\2\u014d\u014e\7f\2\2\u014eL\3\2\2\2\u014f\u0150"+ 267 | "\7>\2\2\u0150N\3\2\2\2\u0151\u0152\7@\2\2\u0152P\3\2\2\2\u0153\u0154\7"+ 268 | ">\2\2\u0154\u0155\7?\2\2\u0155R\3\2\2\2\u0156\u0157\7@\2\2\u0157\u0158"+ 269 | "\7?\2\2\u0158T\3\2\2\2\u0159\u015a\7\u0080\2\2\u015a\u015b\7?\2\2\u015b"+ 270 | "V\3\2\2\2\u015c\u015d\7?\2\2\u015d\u015e\7?\2\2\u015eX\3\2\2\2\u015f\u0160"+ 271 | "\7\60\2\2\u0160\u0161\7\60\2\2\u0161Z\3\2\2\2\u0162\u0163\7-\2\2\u0163"+ 272 | "\\\3\2\2\2\u0164\u0165\7/\2\2\u0165^\3\2\2\2\u0166\u0167\7,\2\2\u0167"+ 273 | "`\3\2\2\2\u0168\u0169\7\61\2\2\u0169b\3\2\2\2\u016a\u016b\7\'\2\2\u016b"+ 274 | "d\3\2\2\2\u016c\u016d\7\61\2\2\u016d\u016e\7\61\2\2\u016ef\3\2\2\2\u016f"+ 275 | "\u0170\7(\2\2\u0170h\3\2\2\2\u0171\u0172\7~\2\2\u0172j\3\2\2\2\u0173\u0174"+ 276 | "\7\u0080\2\2\u0174l\3\2\2\2\u0175\u0176\7>\2\2\u0176\u0177\7>\2\2\u0177"+ 277 | "n\3\2\2\2\u0178\u0179\7@\2\2\u0179\u017a\7@\2\2\u017ap\3\2\2\2\u017b\u017c"+ 278 | "\7p\2\2\u017c\u017d\7q\2\2\u017d\u017e\7v\2\2\u017er\3\2\2\2\u017f\u0180"+ 279 | "\7%\2\2\u0180t\3\2\2\2\u0181\u0182\7`\2\2\u0182v\3\2\2\2\u0183\u0184\7"+ 280 | "u\2\2\u0184\u0185\7v\2\2\u0185\u0186\7c\2\2\u0186\u0187\7v\2\2\u0187\u0188"+ 281 | "\7k\2\2\u0188\u0189\7e\2\2\u0189x\3\2\2\2\u018a\u018b\7i\2\2\u018b\u018c"+ 282 | "\7g\2\2\u018c\u018d\7v\2\2\u018dz\3\2\2\2\u018e\u018f\7u\2\2\u018f\u0190"+ 283 | "\7g\2\2\u0190\u0191\7v\2\2\u0191|\3\2\2\2\u0192\u0193\7e\2\2\u0193\u0194"+ 284 | "\7q\2\2\u0194\u0195\7p\2\2\u0195\u0196\7u\2\2\u0196\u0197\7v\2\2\u0197"+ 285 | "\u0198\7t\2\2\u0198\u0199\7w\2\2\u0199\u019a\7e\2\2\u019a\u019b\7v\2\2"+ 286 | "\u019b\u019c\7q\2\2\u019c\u019d\7t\2\2\u019d~\3\2\2\2\u019e\u019f\7-\2"+ 287 | "\2\u019f\u01a0\7-\2\2\u01a0\u0080\3\2\2\2\u01a1\u01a2\7-\2\2\u01a2\u01a3"+ 288 | "\7?\2\2\u01a3\u0082\3\2\2\2\u01a4\u01a5\7,\2\2\u01a5\u01a6\7?\2\2\u01a6"+ 289 | "\u0084\3\2\2\2\u01a7\u01a8\7\61\2\2\u01a8\u01a9\7?\2\2\u01a9\u0086\3\2"+ 290 | "\2\2\u01aa\u01ab\7/\2\2\u01ab\u01ac\7?\2\2\u01ac\u0088\3\2\2\2\u01ad\u01b1"+ 291 | "\t\2\2\2\u01ae\u01b0\t\3\2\2\u01af\u01ae\3\2\2\2\u01b0\u01b3\3\2\2\2\u01b1"+ 292 | "\u01af\3\2\2\2\u01b1\u01b2\3\2\2\2\u01b2\u008a\3\2\2\2\u01b3\u01b1\3\2"+ 293 | "\2\2\u01b4\u01b9\7$\2\2\u01b5\u01b8\5\u009fP\2\u01b6\u01b8\n\4\2\2\u01b7"+ 294 | "\u01b5\3\2\2\2\u01b7\u01b6\3\2\2\2\u01b8\u01bb\3\2\2\2\u01b9\u01b7\3\2"+ 295 | "\2\2\u01b9\u01ba\3\2\2\2\u01ba\u01bc\3\2\2\2\u01bb\u01b9\3\2\2\2\u01bc"+ 296 | "\u01bd\7$\2\2\u01bd\u008c\3\2\2\2\u01be\u01c3\7)\2\2\u01bf\u01c2\5\u009f"+ 297 | "P\2\u01c0\u01c2\n\5\2\2\u01c1\u01bf\3\2\2\2\u01c1\u01c0\3\2\2\2\u01c2"+ 298 | "\u01c5\3\2\2\2\u01c3\u01c1\3\2\2\2\u01c3\u01c4\3\2\2\2\u01c4\u01c6\3\2"+ 299 | "\2\2\u01c5\u01c3\3\2\2\2\u01c6\u01c7\7)\2\2\u01c7\u008e\3\2\2\2\u01c8"+ 300 | "\u01c9\7]\2\2\u01c9\u01ca\5\u0091I\2\u01ca\u01cb\7_\2\2\u01cb\u0090\3"+ 301 | "\2\2\2\u01cc\u01cd\7?\2\2\u01cd\u01ce\5\u0091I\2\u01ce\u01cf\7?\2\2\u01cf"+ 302 | "\u01d9\3\2\2\2\u01d0\u01d4\7]\2\2\u01d1\u01d3\13\2\2\2\u01d2\u01d1\3\2"+ 303 | "\2\2\u01d3\u01d6\3\2\2\2\u01d4\u01d5\3\2\2\2\u01d4\u01d2\3\2\2\2\u01d5"+ 304 | "\u01d7\3\2\2\2\u01d6\u01d4\3\2\2\2\u01d7\u01d9\7_\2\2\u01d8\u01cc\3\2"+ 305 | "\2\2\u01d8\u01d0\3\2\2\2\u01d9\u0092\3\2\2\2\u01da\u01dc\5\u00a7T\2\u01db"+ 306 | "\u01da\3\2\2\2\u01dc\u01dd\3\2\2\2\u01dd\u01db\3\2\2\2\u01dd\u01de\3\2"+ 307 | "\2\2\u01de\u0094\3\2\2\2\u01df\u01e0\7\62\2\2\u01e0\u01e2\t\6\2\2\u01e1"+ 308 | "\u01e3\5\u00a9U\2\u01e2\u01e1\3\2\2\2\u01e3\u01e4\3\2\2\2\u01e4\u01e2"+ 309 | "\3\2\2\2\u01e4\u01e5\3\2\2\2\u01e5\u0096\3\2\2\2\u01e6\u01e8\5\u00a7T"+ 310 | "\2\u01e7\u01e6\3\2\2\2\u01e8\u01e9\3\2\2\2\u01e9\u01e7\3\2\2\2\u01e9\u01ea"+ 311 | "\3\2\2\2\u01ea\u01eb\3\2\2\2\u01eb\u01ef\7\60\2\2\u01ec\u01ee\5\u00a7"+ 312 | "T\2\u01ed\u01ec\3\2\2\2\u01ee\u01f1\3\2\2\2\u01ef\u01ed\3\2\2\2\u01ef"+ 313 | "\u01f0\3\2\2\2\u01f0\u01f3\3\2\2\2\u01f1\u01ef\3\2\2\2\u01f2\u01f4\5\u009b"+ 314 | "N\2\u01f3\u01f2\3\2\2\2\u01f3\u01f4\3\2\2\2\u01f4\u0206\3\2\2\2\u01f5"+ 315 | "\u01f7\7\60\2\2\u01f6\u01f8\5\u00a7T\2\u01f7\u01f6\3\2\2\2\u01f8\u01f9"+ 316 | "\3\2\2\2\u01f9\u01f7\3\2\2\2\u01f9\u01fa\3\2\2\2\u01fa\u01fc\3\2\2\2\u01fb"+ 317 | "\u01fd\5\u009bN\2\u01fc\u01fb\3\2\2\2\u01fc\u01fd\3\2\2\2\u01fd\u0206"+ 318 | "\3\2\2\2\u01fe\u0200\5\u00a7T\2\u01ff\u01fe\3\2\2\2\u0200\u0201\3\2\2"+ 319 | "\2\u0201\u01ff\3\2\2\2\u0201\u0202\3\2\2\2\u0202\u0203\3\2\2\2\u0203\u0204"+ 320 | "\5\u009bN\2\u0204\u0206\3\2\2\2\u0205\u01e7\3\2\2\2\u0205\u01f5\3\2\2"+ 321 | "\2\u0205\u01ff\3\2\2\2\u0206\u0098\3\2\2\2\u0207\u0208\7\62\2\2\u0208"+ 322 | "\u020a\t\6\2\2\u0209\u020b\5\u00a9U\2\u020a\u0209\3\2\2\2\u020b\u020c"+ 323 | "\3\2\2\2\u020c\u020a\3\2\2\2\u020c\u020d\3\2\2\2\u020d\u020e\3\2\2\2\u020e"+ 324 | "\u0212\7\60\2\2\u020f\u0211\5\u00a9U\2\u0210\u020f\3\2\2\2\u0211\u0214"+ 325 | "\3\2\2\2\u0212\u0210\3\2\2\2\u0212\u0213\3\2\2\2\u0213\u0216\3\2\2\2\u0214"+ 326 | "\u0212\3\2\2\2\u0215\u0217\5\u009dO\2\u0216\u0215\3\2\2\2\u0216\u0217"+ 327 | "\3\2\2\2\u0217\u022d\3\2\2\2\u0218\u0219\7\62\2\2\u0219\u021a\t\6\2\2"+ 328 | "\u021a\u021c\7\60\2\2\u021b\u021d\5\u00a9U\2\u021c\u021b\3\2\2\2\u021d"+ 329 | "\u021e\3\2\2\2\u021e\u021c\3\2\2\2\u021e\u021f\3\2\2\2\u021f\u0221\3\2"+ 330 | "\2\2\u0220\u0222\5\u009dO\2\u0221\u0220\3\2\2\2\u0221\u0222\3\2\2\2\u0222"+ 331 | "\u022d\3\2\2\2\u0223\u0224\7\62\2\2\u0224\u0226\t\6\2\2\u0225\u0227\5"+ 332 | "\u00a9U\2\u0226\u0225\3\2\2\2\u0227\u0228\3\2\2\2\u0228\u0226\3\2\2\2"+ 333 | "\u0228\u0229\3\2\2\2\u0229\u022a\3\2\2\2\u022a\u022b\5\u009dO\2\u022b"+ 334 | "\u022d\3\2\2\2\u022c\u0207\3\2\2\2\u022c\u0218\3\2\2\2\u022c\u0223\3\2"+ 335 | "\2\2\u022d\u009a\3\2\2\2\u022e\u0230\t\7\2\2\u022f\u0231\t\b\2\2\u0230"+ 336 | "\u022f\3\2\2\2\u0230\u0231\3\2\2\2\u0231\u0233\3\2\2\2\u0232\u0234\5\u00a7"+ 337 | "T\2\u0233\u0232\3\2\2\2\u0234\u0235\3\2\2\2\u0235\u0233\3\2\2\2\u0235"+ 338 | "\u0236\3\2\2\2\u0236\u009c\3\2\2\2\u0237\u0239\t\t\2\2\u0238\u023a\t\b"+ 339 | "\2\2\u0239\u0238\3\2\2\2\u0239\u023a\3\2\2\2\u023a\u023c\3\2\2\2\u023b"+ 340 | "\u023d\5\u00a7T\2\u023c\u023b\3\2\2\2\u023d\u023e\3\2\2\2\u023e\u023c"+ 341 | "\3\2\2\2\u023e\u023f\3\2\2\2\u023f\u009e\3\2\2\2\u0240\u0241\7^\2\2\u0241"+ 342 | "\u024b\t\n\2\2\u0242\u0244\7^\2\2\u0243\u0245\7\17\2\2\u0244\u0243\3\2"+ 343 | "\2\2\u0244\u0245\3\2\2\2\u0245\u0246\3\2\2\2\u0246\u024b\7\f\2\2\u0247"+ 344 | "\u024b\5\u00a1Q\2\u0248\u024b\5\u00a3R\2\u0249\u024b\5\u00a5S\2\u024a"+ 345 | "\u0240\3\2\2\2\u024a\u0242\3\2\2\2\u024a\u0247\3\2\2\2\u024a\u0248\3\2"+ 346 | "\2\2\u024a\u0249\3\2\2\2\u024b\u00a0\3\2\2\2\u024c\u024d\7^\2\2\u024d"+ 347 | "\u0258\5\u00a7T\2\u024e\u024f\7^\2\2\u024f\u0250\5\u00a7T\2\u0250\u0251"+ 348 | "\5\u00a7T\2\u0251\u0258\3\2\2\2\u0252\u0253\7^\2\2\u0253\u0254\t\13\2"+ 349 | "\2\u0254\u0255\5\u00a7T\2\u0255\u0256\5\u00a7T\2\u0256\u0258\3\2\2\2\u0257"+ 350 | "\u024c\3\2\2\2\u0257\u024e\3\2\2\2\u0257\u0252\3\2\2\2\u0258\u00a2\3\2"+ 351 | "\2\2\u0259\u025a\7^\2\2\u025a\u025b\7z\2\2\u025b\u025c\5\u00a9U\2\u025c"+ 352 | "\u025d\5\u00a9U\2\u025d\u00a4\3\2\2\2\u025e\u025f\7^\2\2\u025f\u0260\7"+ 353 | "w\2\2\u0260\u0261\7}\2\2\u0261\u0263\3\2\2\2\u0262\u0264\5\u00a9U\2\u0263"+ 354 | "\u0262\3\2\2\2\u0264\u0265\3\2\2\2\u0265\u0263\3\2\2\2\u0265\u0266\3\2"+ 355 | "\2\2\u0266\u0267\3\2\2\2\u0267\u0268\7\177\2\2\u0268\u00a6\3\2\2\2\u0269"+ 356 | "\u026a\t\f\2\2\u026a\u00a8\3\2\2\2\u026b\u026c\t\r\2\2\u026c\u00aa\3\2"+ 357 | "\2\2\u026d\u026e\7/\2\2\u026e\u026f\7/\2\2\u026f\u0270\7]\2\2\u0270\u0271"+ 358 | "\3\2\2\2\u0271\u0272\5\u0091I\2\u0272\u0273\7_\2\2\u0273\u0274\3\2\2\2"+ 359 | "\u0274\u0275\bV\2\2\u0275\u00ac\3\2\2\2\u0276\u0277\7/\2\2\u0277\u0278"+ 360 | "\7/\2\2\u0278\u0296\3\2\2\2\u0279\u0297\3\2\2\2\u027a\u027e\7]\2\2\u027b"+ 361 | "\u027d\7?\2\2\u027c\u027b\3\2\2\2\u027d\u0280\3\2\2\2\u027e\u027c\3\2"+ 362 | "\2\2\u027e\u027f\3\2\2\2\u027f\u0297\3\2\2\2\u0280\u027e\3\2\2\2\u0281"+ 363 | "\u0285\7]\2\2\u0282\u0284\7?\2\2\u0283\u0282\3\2\2\2\u0284\u0287\3\2\2"+ 364 | "\2\u0285\u0283\3\2\2\2\u0285\u0286\3\2\2\2\u0286\u0288\3\2\2\2\u0287\u0285"+ 365 | "\3\2\2\2\u0288\u028c\n\16\2\2\u0289\u028b\n\17\2\2\u028a\u0289\3\2\2\2"+ 366 | "\u028b\u028e\3\2\2\2\u028c\u028a\3\2\2\2\u028c\u028d\3\2\2\2\u028d\u0297"+ 367 | "\3\2\2\2\u028e\u028c\3\2\2\2\u028f\u0293\n\20\2\2\u0290\u0292\n\17\2\2"+ 368 | "\u0291\u0290\3\2\2\2\u0292\u0295\3\2\2\2\u0293\u0291\3\2\2\2\u0293\u0294"+ 369 | "\3\2\2\2\u0294\u0297\3\2\2\2\u0295\u0293\3\2\2\2\u0296\u0279\3\2\2\2\u0296"+ 370 | "\u027a\3\2\2\2\u0296\u0281\3\2\2\2\u0296\u028f\3\2\2\2\u0297\u029b\3\2"+ 371 | "\2\2\u0298\u0299\7\17\2\2\u0299\u029c\7\f\2\2\u029a\u029c\t\21\2\2\u029b"+ 372 | "\u0298\3\2\2\2\u029b\u029a\3\2\2\2\u029c\u029d\3\2\2\2\u029d\u029e\bW"+ 373 | "\2\2\u029e\u00ae\3\2\2\2\u029f\u02a1\t\22\2\2\u02a0\u029f\3\2\2\2\u02a1"+ 374 | "\u02a2\3\2\2\2\u02a2\u02a0\3\2\2\2\u02a2\u02a3\3\2\2\2\u02a3\u02a4\3\2"+ 375 | "\2\2\u02a4\u02a5\bX\3\2\u02a5\u00b0\3\2\2\2\u02a6\u02a7\7%\2\2\u02a7\u02ab"+ 376 | "\7#\2\2\u02a8\u02aa\n\17\2\2\u02a9\u02a8\3\2\2\2\u02aa\u02ad\3\2\2\2\u02ab"+ 377 | "\u02a9\3\2\2\2\u02ab\u02ac\3\2\2\2\u02ac\u02ae\3\2\2\2\u02ad\u02ab\3\2"+ 378 | "\2\2\u02ae\u02af\bY\2\2\u02af\u00b2\3\2\2\2*\2\u01b1\u01b7\u01b9\u01c1"+ 379 | "\u01c3\u01d4\u01d8\u01dd\u01e4\u01e9\u01ef\u01f3\u01f9\u01fc\u0201\u0205"+ 380 | "\u020c\u0212\u0216\u021e\u0221\u0228\u022c\u0230\u0235\u0239\u023e\u0244"+ 381 | "\u024a\u0257\u0265\u027e\u0285\u028c\u0293\u0296\u029b\u02a2\u02ab\4\2"+ 382 | "\3\2\b\2\2"; 383 | public static final ATN _ATN = 384 | new ATNDeserializer().deserialize(_serializedATN.toCharArray()); 385 | static { 386 | _decisionToDFA = new DFA[_ATN.getNumberOfDecisions()]; 387 | for (int i = 0; i < _ATN.getNumberOfDecisions(); i++) { 388 | _decisionToDFA[i] = new DFA(_ATN.getDecisionState(i), i); 389 | } 390 | } 391 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappLexer.tokens: -------------------------------------------------------------------------------- 1 | T__0=1 2 | T__1=2 3 | T__2=3 4 | T__3=4 5 | T__4=5 6 | T__5=6 7 | T__6=7 8 | T__7=8 9 | T__8=9 10 | T__9=10 11 | T__10=11 12 | T__11=12 13 | T__12=13 14 | T__13=14 15 | T__14=15 16 | T__15=16 17 | T__16=17 18 | T__17=18 19 | T__18=19 20 | T__19=20 21 | T__20=21 22 | T__21=22 23 | T__22=23 24 | T__23=24 25 | T__24=25 26 | T__25=26 27 | T__26=27 28 | T__27=28 29 | T__28=29 30 | T__29=30 31 | T__30=31 32 | T__31=32 33 | T__32=33 34 | T__33=34 35 | T__34=35 36 | T__35=36 37 | T__36=37 38 | T__37=38 39 | T__38=39 40 | T__39=40 41 | T__40=41 42 | T__41=42 43 | T__42=43 44 | T__43=44 45 | T__44=45 46 | T__45=46 47 | T__46=47 48 | T__47=48 49 | T__48=49 50 | T__49=50 51 | T__50=51 52 | T__51=52 53 | T__52=53 54 | T__53=54 55 | T__54=55 56 | T__55=56 57 | T__56=57 58 | T__57=58 59 | T__58=59 60 | T__59=60 61 | T__60=61 62 | T__61=62 63 | T__62=63 64 | T__63=64 65 | T__64=65 66 | T__65=66 67 | T__66=67 68 | NAME=68 69 | NORMALSTRING=69 70 | CHARSTRING=70 71 | LONGSTRING=71 72 | INT=72 73 | HEX=73 74 | FLOAT=74 75 | HEX_FLOAT=75 76 | COMMENT=76 77 | LINE_COMMENT=77 78 | WS=78 79 | SHEBANG=79 80 | ';'=1 81 | '='=2 82 | 'break'=3 83 | 'goto'=4 84 | 'do'=5 85 | 'end'=6 86 | 'while'=7 87 | 'repeat'=8 88 | 'until'=9 89 | 'if'=10 90 | 'then'=11 91 | 'elseif'=12 92 | 'else'=13 93 | 'for'=14 94 | ','=15 95 | 'in'=16 96 | 'function'=17 97 | 'class'=18 98 | 'extends'=19 99 | 'local'=20 100 | 'safe'=21 101 | 'return'=22 102 | '::'=23 103 | '.'=24 104 | ':'=25 105 | 'nil'=26 106 | 'false'=27 107 | 'true'=28 108 | '...'=29 109 | '('=30 110 | ')'=31 111 | '['=32 112 | ']'=33 113 | '{'=34 114 | '}'=35 115 | 'or'=36 116 | 'and'=37 117 | '<'=38 118 | '>'=39 119 | '<='=40 120 | '>='=41 121 | '~='=42 122 | '=='=43 123 | '..'=44 124 | '+'=45 125 | '-'=46 126 | '*'=47 127 | '/'=48 128 | '%'=49 129 | '//'=50 130 | '&'=51 131 | '|'=52 132 | '~'=53 133 | '<<'=54 134 | '>>'=55 135 | 'not'=56 136 | '#'=57 137 | '^'=58 138 | 'static'=59 139 | 'get'=60 140 | 'set'=61 141 | 'constructor'=62 142 | '++'=63 143 | '+='=64 144 | '*='=65 145 | '/='=66 146 | '-='=67 147 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappListener.java: -------------------------------------------------------------------------------- 1 | // Generated from C:/Users/Harry/Desktop/Lua/lpp2electricboogaloo/lua-plus-plus/src/main/java/org/luapp/language/parser\luapp.g4 by ANTLR 4.8 2 | package org.luapp.language.generator; 3 | import org.antlr.v4.runtime.tree.ParseTreeListener; 4 | 5 | /** 6 | * This interface defines a complete listener for a parse tree produced by 7 | * {@link luappParser}. 8 | */ 9 | public interface luappListener extends ParseTreeListener { 10 | /** 11 | * Enter a parse tree produced by {@link luappParser#chunk}. 12 | * @param ctx the parse tree 13 | */ 14 | void enterChunk(luappParser.ChunkContext ctx); 15 | /** 16 | * Exit a parse tree produced by {@link luappParser#chunk}. 17 | * @param ctx the parse tree 18 | */ 19 | void exitChunk(luappParser.ChunkContext ctx); 20 | /** 21 | * Enter a parse tree produced by {@link luappParser#block}. 22 | * @param ctx the parse tree 23 | */ 24 | void enterBlock(luappParser.BlockContext ctx); 25 | /** 26 | * Exit a parse tree produced by {@link luappParser#block}. 27 | * @param ctx the parse tree 28 | */ 29 | void exitBlock(luappParser.BlockContext ctx); 30 | /** 31 | * Enter a parse tree produced by {@link luappParser#stat}. 32 | * @param ctx the parse tree 33 | */ 34 | void enterStat(luappParser.StatContext ctx); 35 | /** 36 | * Exit a parse tree produced by {@link luappParser#stat}. 37 | * @param ctx the parse tree 38 | */ 39 | void exitStat(luappParser.StatContext ctx); 40 | /** 41 | * Enter a parse tree produced by {@link luappParser#retstat}. 42 | * @param ctx the parse tree 43 | */ 44 | void enterRetstat(luappParser.RetstatContext ctx); 45 | /** 46 | * Exit a parse tree produced by {@link luappParser#retstat}. 47 | * @param ctx the parse tree 48 | */ 49 | void exitRetstat(luappParser.RetstatContext ctx); 50 | /** 51 | * Enter a parse tree produced by {@link luappParser#label}. 52 | * @param ctx the parse tree 53 | */ 54 | void enterLabel(luappParser.LabelContext ctx); 55 | /** 56 | * Exit a parse tree produced by {@link luappParser#label}. 57 | * @param ctx the parse tree 58 | */ 59 | void exitLabel(luappParser.LabelContext ctx); 60 | /** 61 | * Enter a parse tree produced by {@link luappParser#funcname}. 62 | * @param ctx the parse tree 63 | */ 64 | void enterFuncname(luappParser.FuncnameContext ctx); 65 | /** 66 | * Exit a parse tree produced by {@link luappParser#funcname}. 67 | * @param ctx the parse tree 68 | */ 69 | void exitFuncname(luappParser.FuncnameContext ctx); 70 | /** 71 | * Enter a parse tree produced by {@link luappParser#classname}. 72 | * @param ctx the parse tree 73 | */ 74 | void enterClassname(luappParser.ClassnameContext ctx); 75 | /** 76 | * Exit a parse tree produced by {@link luappParser#classname}. 77 | * @param ctx the parse tree 78 | */ 79 | void exitClassname(luappParser.ClassnameContext ctx); 80 | /** 81 | * Enter a parse tree produced by {@link luappParser#abstractclassname}. 82 | * @param ctx the parse tree 83 | */ 84 | void enterAbstractclassname(luappParser.AbstractclassnameContext ctx); 85 | /** 86 | * Exit a parse tree produced by {@link luappParser#abstractclassname}. 87 | * @param ctx the parse tree 88 | */ 89 | void exitAbstractclassname(luappParser.AbstractclassnameContext ctx); 90 | /** 91 | * Enter a parse tree produced by {@link luappParser#varlist}. 92 | * @param ctx the parse tree 93 | */ 94 | void enterVarlist(luappParser.VarlistContext ctx); 95 | /** 96 | * Exit a parse tree produced by {@link luappParser#varlist}. 97 | * @param ctx the parse tree 98 | */ 99 | void exitVarlist(luappParser.VarlistContext ctx); 100 | /** 101 | * Enter a parse tree produced by {@link luappParser#namelist}. 102 | * @param ctx the parse tree 103 | */ 104 | void enterNamelist(luappParser.NamelistContext ctx); 105 | /** 106 | * Exit a parse tree produced by {@link luappParser#namelist}. 107 | * @param ctx the parse tree 108 | */ 109 | void exitNamelist(luappParser.NamelistContext ctx); 110 | /** 111 | * Enter a parse tree produced by {@link luappParser#explist}. 112 | * @param ctx the parse tree 113 | */ 114 | void enterExplist(luappParser.ExplistContext ctx); 115 | /** 116 | * Exit a parse tree produced by {@link luappParser#explist}. 117 | * @param ctx the parse tree 118 | */ 119 | void exitExplist(luappParser.ExplistContext ctx); 120 | /** 121 | * Enter a parse tree produced by {@link luappParser#exp}. 122 | * @param ctx the parse tree 123 | */ 124 | void enterExp(luappParser.ExpContext ctx); 125 | /** 126 | * Exit a parse tree produced by {@link luappParser#exp}. 127 | * @param ctx the parse tree 128 | */ 129 | void exitExp(luappParser.ExpContext ctx); 130 | /** 131 | * Enter a parse tree produced by {@link luappParser#prefixexp}. 132 | * @param ctx the parse tree 133 | */ 134 | void enterPrefixexp(luappParser.PrefixexpContext ctx); 135 | /** 136 | * Exit a parse tree produced by {@link luappParser#prefixexp}. 137 | * @param ctx the parse tree 138 | */ 139 | void exitPrefixexp(luappParser.PrefixexpContext ctx); 140 | /** 141 | * Enter a parse tree produced by {@link luappParser#functioncall}. 142 | * @param ctx the parse tree 143 | */ 144 | void enterFunctioncall(luappParser.FunctioncallContext ctx); 145 | /** 146 | * Exit a parse tree produced by {@link luappParser#functioncall}. 147 | * @param ctx the parse tree 148 | */ 149 | void exitFunctioncall(luappParser.FunctioncallContext ctx); 150 | /** 151 | * Enter a parse tree produced by {@link luappParser#varOrExp}. 152 | * @param ctx the parse tree 153 | */ 154 | void enterVarOrExp(luappParser.VarOrExpContext ctx); 155 | /** 156 | * Exit a parse tree produced by {@link luappParser#varOrExp}. 157 | * @param ctx the parse tree 158 | */ 159 | void exitVarOrExp(luappParser.VarOrExpContext ctx); 160 | /** 161 | * Enter a parse tree produced by {@link luappParser#var}. 162 | * @param ctx the parse tree 163 | */ 164 | void enterVar(luappParser.VarContext ctx); 165 | /** 166 | * Exit a parse tree produced by {@link luappParser#var}. 167 | * @param ctx the parse tree 168 | */ 169 | void exitVar(luappParser.VarContext ctx); 170 | /** 171 | * Enter a parse tree produced by {@link luappParser#varSuffix}. 172 | * @param ctx the parse tree 173 | */ 174 | void enterVarSuffix(luappParser.VarSuffixContext ctx); 175 | /** 176 | * Exit a parse tree produced by {@link luappParser#varSuffix}. 177 | * @param ctx the parse tree 178 | */ 179 | void exitVarSuffix(luappParser.VarSuffixContext ctx); 180 | /** 181 | * Enter a parse tree produced by {@link luappParser#nameAndArgs}. 182 | * @param ctx the parse tree 183 | */ 184 | void enterNameAndArgs(luappParser.NameAndArgsContext ctx); 185 | /** 186 | * Exit a parse tree produced by {@link luappParser#nameAndArgs}. 187 | * @param ctx the parse tree 188 | */ 189 | void exitNameAndArgs(luappParser.NameAndArgsContext ctx); 190 | /** 191 | * Enter a parse tree produced by {@link luappParser#args}. 192 | * @param ctx the parse tree 193 | */ 194 | void enterArgs(luappParser.ArgsContext ctx); 195 | /** 196 | * Exit a parse tree produced by {@link luappParser#args}. 197 | * @param ctx the parse tree 198 | */ 199 | void exitArgs(luappParser.ArgsContext ctx); 200 | /** 201 | * Enter a parse tree produced by {@link luappParser#functiondef}. 202 | * @param ctx the parse tree 203 | */ 204 | void enterFunctiondef(luappParser.FunctiondefContext ctx); 205 | /** 206 | * Exit a parse tree produced by {@link luappParser#functiondef}. 207 | * @param ctx the parse tree 208 | */ 209 | void exitFunctiondef(luappParser.FunctiondefContext ctx); 210 | /** 211 | * Enter a parse tree produced by {@link luappParser#funcbody}. 212 | * @param ctx the parse tree 213 | */ 214 | void enterFuncbody(luappParser.FuncbodyContext ctx); 215 | /** 216 | * Exit a parse tree produced by {@link luappParser#funcbody}. 217 | * @param ctx the parse tree 218 | */ 219 | void exitFuncbody(luappParser.FuncbodyContext ctx); 220 | /** 221 | * Enter a parse tree produced by {@link luappParser#parlist}. 222 | * @param ctx the parse tree 223 | */ 224 | void enterParlist(luappParser.ParlistContext ctx); 225 | /** 226 | * Exit a parse tree produced by {@link luappParser#parlist}. 227 | * @param ctx the parse tree 228 | */ 229 | void exitParlist(luappParser.ParlistContext ctx); 230 | /** 231 | * Enter a parse tree produced by {@link luappParser#tableconstructor}. 232 | * @param ctx the parse tree 233 | */ 234 | void enterTableconstructor(luappParser.TableconstructorContext ctx); 235 | /** 236 | * Exit a parse tree produced by {@link luappParser#tableconstructor}. 237 | * @param ctx the parse tree 238 | */ 239 | void exitTableconstructor(luappParser.TableconstructorContext ctx); 240 | /** 241 | * Enter a parse tree produced by {@link luappParser#fieldlist}. 242 | * @param ctx the parse tree 243 | */ 244 | void enterFieldlist(luappParser.FieldlistContext ctx); 245 | /** 246 | * Exit a parse tree produced by {@link luappParser#fieldlist}. 247 | * @param ctx the parse tree 248 | */ 249 | void exitFieldlist(luappParser.FieldlistContext ctx); 250 | /** 251 | * Enter a parse tree produced by {@link luappParser#field}. 252 | * @param ctx the parse tree 253 | */ 254 | void enterField(luappParser.FieldContext ctx); 255 | /** 256 | * Exit a parse tree produced by {@link luappParser#field}. 257 | * @param ctx the parse tree 258 | */ 259 | void exitField(luappParser.FieldContext ctx); 260 | /** 261 | * Enter a parse tree produced by {@link luappParser#fieldsep}. 262 | * @param ctx the parse tree 263 | */ 264 | void enterFieldsep(luappParser.FieldsepContext ctx); 265 | /** 266 | * Exit a parse tree produced by {@link luappParser#fieldsep}. 267 | * @param ctx the parse tree 268 | */ 269 | void exitFieldsep(luappParser.FieldsepContext ctx); 270 | /** 271 | * Enter a parse tree produced by {@link luappParser#operatorOr}. 272 | * @param ctx the parse tree 273 | */ 274 | void enterOperatorOr(luappParser.OperatorOrContext ctx); 275 | /** 276 | * Exit a parse tree produced by {@link luappParser#operatorOr}. 277 | * @param ctx the parse tree 278 | */ 279 | void exitOperatorOr(luappParser.OperatorOrContext ctx); 280 | /** 281 | * Enter a parse tree produced by {@link luappParser#operatorAnd}. 282 | * @param ctx the parse tree 283 | */ 284 | void enterOperatorAnd(luappParser.OperatorAndContext ctx); 285 | /** 286 | * Exit a parse tree produced by {@link luappParser#operatorAnd}. 287 | * @param ctx the parse tree 288 | */ 289 | void exitOperatorAnd(luappParser.OperatorAndContext ctx); 290 | /** 291 | * Enter a parse tree produced by {@link luappParser#operatorComparison}. 292 | * @param ctx the parse tree 293 | */ 294 | void enterOperatorComparison(luappParser.OperatorComparisonContext ctx); 295 | /** 296 | * Exit a parse tree produced by {@link luappParser#operatorComparison}. 297 | * @param ctx the parse tree 298 | */ 299 | void exitOperatorComparison(luappParser.OperatorComparisonContext ctx); 300 | /** 301 | * Enter a parse tree produced by {@link luappParser#operatorStrcat}. 302 | * @param ctx the parse tree 303 | */ 304 | void enterOperatorStrcat(luappParser.OperatorStrcatContext ctx); 305 | /** 306 | * Exit a parse tree produced by {@link luappParser#operatorStrcat}. 307 | * @param ctx the parse tree 308 | */ 309 | void exitOperatorStrcat(luappParser.OperatorStrcatContext ctx); 310 | /** 311 | * Enter a parse tree produced by {@link luappParser#operatorAddSub}. 312 | * @param ctx the parse tree 313 | */ 314 | void enterOperatorAddSub(luappParser.OperatorAddSubContext ctx); 315 | /** 316 | * Exit a parse tree produced by {@link luappParser#operatorAddSub}. 317 | * @param ctx the parse tree 318 | */ 319 | void exitOperatorAddSub(luappParser.OperatorAddSubContext ctx); 320 | /** 321 | * Enter a parse tree produced by {@link luappParser#operatorMulDivMod}. 322 | * @param ctx the parse tree 323 | */ 324 | void enterOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx); 325 | /** 326 | * Exit a parse tree produced by {@link luappParser#operatorMulDivMod}. 327 | * @param ctx the parse tree 328 | */ 329 | void exitOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx); 330 | /** 331 | * Enter a parse tree produced by {@link luappParser#operatorBitwise}. 332 | * @param ctx the parse tree 333 | */ 334 | void enterOperatorBitwise(luappParser.OperatorBitwiseContext ctx); 335 | /** 336 | * Exit a parse tree produced by {@link luappParser#operatorBitwise}. 337 | * @param ctx the parse tree 338 | */ 339 | void exitOperatorBitwise(luappParser.OperatorBitwiseContext ctx); 340 | /** 341 | * Enter a parse tree produced by {@link luappParser#operatorUnary}. 342 | * @param ctx the parse tree 343 | */ 344 | void enterOperatorUnary(luappParser.OperatorUnaryContext ctx); 345 | /** 346 | * Exit a parse tree produced by {@link luappParser#operatorUnary}. 347 | * @param ctx the parse tree 348 | */ 349 | void exitOperatorUnary(luappParser.OperatorUnaryContext ctx); 350 | /** 351 | * Enter a parse tree produced by {@link luappParser#operatorPower}. 352 | * @param ctx the parse tree 353 | */ 354 | void enterOperatorPower(luappParser.OperatorPowerContext ctx); 355 | /** 356 | * Exit a parse tree produced by {@link luappParser#operatorPower}. 357 | * @param ctx the parse tree 358 | */ 359 | void exitOperatorPower(luappParser.OperatorPowerContext ctx); 360 | /** 361 | * Enter a parse tree produced by {@link luappParser#number}. 362 | * @param ctx the parse tree 363 | */ 364 | void enterNumber(luappParser.NumberContext ctx); 365 | /** 366 | * Exit a parse tree produced by {@link luappParser#number}. 367 | * @param ctx the parse tree 368 | */ 369 | void exitNumber(luappParser.NumberContext ctx); 370 | /** 371 | * Enter a parse tree produced by {@link luappParser#string}. 372 | * @param ctx the parse tree 373 | */ 374 | void enterString(luappParser.StringContext ctx); 375 | /** 376 | * Exit a parse tree produced by {@link luappParser#string}. 377 | * @param ctx the parse tree 378 | */ 379 | void exitString(luappParser.StringContext ctx); 380 | /** 381 | * Enter a parse tree produced by {@link luappParser#classdef}. 382 | * @param ctx the parse tree 383 | */ 384 | void enterClassdef(luappParser.ClassdefContext ctx); 385 | /** 386 | * Exit a parse tree produced by {@link luappParser#classdef}. 387 | * @param ctx the parse tree 388 | */ 389 | void exitClassdef(luappParser.ClassdefContext ctx); 390 | /** 391 | * Enter a parse tree produced by {@link luappParser#classfunction}. 392 | * @param ctx the parse tree 393 | */ 394 | void enterClassfunction(luappParser.ClassfunctionContext ctx); 395 | /** 396 | * Exit a parse tree produced by {@link luappParser#classfunction}. 397 | * @param ctx the parse tree 398 | */ 399 | void exitClassfunction(luappParser.ClassfunctionContext ctx); 400 | /** 401 | * Enter a parse tree produced by {@link luappParser#classstaticfunction}. 402 | * @param ctx the parse tree 403 | */ 404 | void enterClassstaticfunction(luappParser.ClassstaticfunctionContext ctx); 405 | /** 406 | * Exit a parse tree produced by {@link luappParser#classstaticfunction}. 407 | * @param ctx the parse tree 408 | */ 409 | void exitClassstaticfunction(luappParser.ClassstaticfunctionContext ctx); 410 | /** 411 | * Enter a parse tree produced by {@link luappParser#classgetorset}. 412 | * @param ctx the parse tree 413 | */ 414 | void enterClassgetorset(luappParser.ClassgetorsetContext ctx); 415 | /** 416 | * Exit a parse tree produced by {@link luappParser#classgetorset}. 417 | * @param ctx the parse tree 418 | */ 419 | void exitClassgetorset(luappParser.ClassgetorsetContext ctx); 420 | /** 421 | * Enter a parse tree produced by {@link luappParser#classgetset}. 422 | * @param ctx the parse tree 423 | */ 424 | void enterClassgetset(luappParser.ClassgetsetContext ctx); 425 | /** 426 | * Exit a parse tree produced by {@link luappParser#classgetset}. 427 | * @param ctx the parse tree 428 | */ 429 | void exitClassgetset(luappParser.ClassgetsetContext ctx); 430 | /** 431 | * Enter a parse tree produced by {@link luappParser#constructor}. 432 | * @param ctx the parse tree 433 | */ 434 | void enterConstructor(luappParser.ConstructorContext ctx); 435 | /** 436 | * Exit a parse tree produced by {@link luappParser#constructor}. 437 | * @param ctx the parse tree 438 | */ 439 | void exitConstructor(luappParser.ConstructorContext ctx); 440 | /** 441 | * Enter a parse tree produced by {@link luappParser#classmember}. 442 | * @param ctx the parse tree 443 | */ 444 | void enterClassmember(luappParser.ClassmemberContext ctx); 445 | /** 446 | * Exit a parse tree produced by {@link luappParser#classmember}. 447 | * @param ctx the parse tree 448 | */ 449 | void exitClassmember(luappParser.ClassmemberContext ctx); 450 | /** 451 | * Enter a parse tree produced by {@link luappParser#classbody}. 452 | * @param ctx the parse tree 453 | */ 454 | void enterClassbody(luappParser.ClassbodyContext ctx); 455 | /** 456 | * Exit a parse tree produced by {@link luappParser#classbody}. 457 | * @param ctx the parse tree 458 | */ 459 | void exitClassbody(luappParser.ClassbodyContext ctx); 460 | /** 461 | * Enter a parse tree produced by {@link luappParser#addOne}. 462 | * @param ctx the parse tree 463 | */ 464 | void enterAddOne(luappParser.AddOneContext ctx); 465 | /** 466 | * Exit a parse tree produced by {@link luappParser#addOne}. 467 | * @param ctx the parse tree 468 | */ 469 | void exitAddOne(luappParser.AddOneContext ctx); 470 | /** 471 | * Enter a parse tree produced by {@link luappParser#plusEqual}. 472 | * @param ctx the parse tree 473 | */ 474 | void enterPlusEqual(luappParser.PlusEqualContext ctx); 475 | /** 476 | * Exit a parse tree produced by {@link luappParser#plusEqual}. 477 | * @param ctx the parse tree 478 | */ 479 | void exitPlusEqual(luappParser.PlusEqualContext ctx); 480 | /** 481 | * Enter a parse tree produced by {@link luappParser#multiplyEqual}. 482 | * @param ctx the parse tree 483 | */ 484 | void enterMultiplyEqual(luappParser.MultiplyEqualContext ctx); 485 | /** 486 | * Exit a parse tree produced by {@link luappParser#multiplyEqual}. 487 | * @param ctx the parse tree 488 | */ 489 | void exitMultiplyEqual(luappParser.MultiplyEqualContext ctx); 490 | /** 491 | * Enter a parse tree produced by {@link luappParser#divEqual}. 492 | * @param ctx the parse tree 493 | */ 494 | void enterDivEqual(luappParser.DivEqualContext ctx); 495 | /** 496 | * Exit a parse tree produced by {@link luappParser#divEqual}. 497 | * @param ctx the parse tree 498 | */ 499 | void exitDivEqual(luappParser.DivEqualContext ctx); 500 | /** 501 | * Enter a parse tree produced by {@link luappParser#minusEqual}. 502 | * @param ctx the parse tree 503 | */ 504 | void enterMinusEqual(luappParser.MinusEqualContext ctx); 505 | /** 506 | * Exit a parse tree produced by {@link luappParser#minusEqual}. 507 | * @param ctx the parse tree 508 | */ 509 | void exitMinusEqual(luappParser.MinusEqualContext ctx); 510 | /** 511 | * Enter a parse tree produced by {@link luappParser#safeOperator}. 512 | * @param ctx the parse tree 513 | */ 514 | void enterSafeOperator(luappParser.SafeOperatorContext ctx); 515 | /** 516 | * Exit a parse tree produced by {@link luappParser#safeOperator}. 517 | * @param ctx the parse tree 518 | */ 519 | void exitSafeOperator(luappParser.SafeOperatorContext ctx); 520 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/generator/luappVisitor.java: -------------------------------------------------------------------------------- 1 | // Generated from C:/Users/Harry/Desktop/Lua/lpp2electricboogaloo/lua-plus-plus/src/main/java/org/luapp/language/parser\luapp.g4 by ANTLR 4.8 2 | package org.luapp.language.generator; 3 | import org.antlr.v4.runtime.tree.ParseTreeVisitor; 4 | 5 | /** 6 | * This interface defines a complete generic visitor for a parse tree produced 7 | * by {@link luappParser}. 8 | * 9 | * @param The return type of the visit operation. Use {@link Void} for 10 | * operations with no return type. 11 | */ 12 | public interface luappVisitor extends ParseTreeVisitor { 13 | /** 14 | * Visit a parse tree produced by {@link luappParser#chunk}. 15 | * @param ctx the parse tree 16 | * @return the visitor result 17 | */ 18 | T visitChunk(luappParser.ChunkContext ctx); 19 | /** 20 | * Visit a parse tree produced by {@link luappParser#block}. 21 | * @param ctx the parse tree 22 | * @return the visitor result 23 | */ 24 | T visitBlock(luappParser.BlockContext ctx); 25 | /** 26 | * Visit a parse tree produced by {@link luappParser#stat}. 27 | * @param ctx the parse tree 28 | * @return the visitor result 29 | */ 30 | T visitStat(luappParser.StatContext ctx); 31 | /** 32 | * Visit a parse tree produced by {@link luappParser#retstat}. 33 | * @param ctx the parse tree 34 | * @return the visitor result 35 | */ 36 | T visitRetstat(luappParser.RetstatContext ctx); 37 | /** 38 | * Visit a parse tree produced by {@link luappParser#label}. 39 | * @param ctx the parse tree 40 | * @return the visitor result 41 | */ 42 | T visitLabel(luappParser.LabelContext ctx); 43 | /** 44 | * Visit a parse tree produced by {@link luappParser#funcname}. 45 | * @param ctx the parse tree 46 | * @return the visitor result 47 | */ 48 | T visitFuncname(luappParser.FuncnameContext ctx); 49 | /** 50 | * Visit a parse tree produced by {@link luappParser#classname}. 51 | * @param ctx the parse tree 52 | * @return the visitor result 53 | */ 54 | T visitClassname(luappParser.ClassnameContext ctx); 55 | /** 56 | * Visit a parse tree produced by {@link luappParser#abstractclassname}. 57 | * @param ctx the parse tree 58 | * @return the visitor result 59 | */ 60 | T visitAbstractclassname(luappParser.AbstractclassnameContext ctx); 61 | /** 62 | * Visit a parse tree produced by {@link luappParser#varlist}. 63 | * @param ctx the parse tree 64 | * @return the visitor result 65 | */ 66 | T visitVarlist(luappParser.VarlistContext ctx); 67 | /** 68 | * Visit a parse tree produced by {@link luappParser#namelist}. 69 | * @param ctx the parse tree 70 | * @return the visitor result 71 | */ 72 | T visitNamelist(luappParser.NamelistContext ctx); 73 | /** 74 | * Visit a parse tree produced by {@link luappParser#explist}. 75 | * @param ctx the parse tree 76 | * @return the visitor result 77 | */ 78 | T visitExplist(luappParser.ExplistContext ctx); 79 | /** 80 | * Visit a parse tree produced by {@link luappParser#exp}. 81 | * @param ctx the parse tree 82 | * @return the visitor result 83 | */ 84 | T visitExp(luappParser.ExpContext ctx); 85 | /** 86 | * Visit a parse tree produced by {@link luappParser#prefixexp}. 87 | * @param ctx the parse tree 88 | * @return the visitor result 89 | */ 90 | T visitPrefixexp(luappParser.PrefixexpContext ctx); 91 | /** 92 | * Visit a parse tree produced by {@link luappParser#functioncall}. 93 | * @param ctx the parse tree 94 | * @return the visitor result 95 | */ 96 | T visitFunctioncall(luappParser.FunctioncallContext ctx); 97 | /** 98 | * Visit a parse tree produced by {@link luappParser#varOrExp}. 99 | * @param ctx the parse tree 100 | * @return the visitor result 101 | */ 102 | T visitVarOrExp(luappParser.VarOrExpContext ctx); 103 | /** 104 | * Visit a parse tree produced by {@link luappParser#var}. 105 | * @param ctx the parse tree 106 | * @return the visitor result 107 | */ 108 | T visitVar(luappParser.VarContext ctx); 109 | /** 110 | * Visit a parse tree produced by {@link luappParser#varSuffix}. 111 | * @param ctx the parse tree 112 | * @return the visitor result 113 | */ 114 | T visitVarSuffix(luappParser.VarSuffixContext ctx); 115 | /** 116 | * Visit a parse tree produced by {@link luappParser#nameAndArgs}. 117 | * @param ctx the parse tree 118 | * @return the visitor result 119 | */ 120 | T visitNameAndArgs(luappParser.NameAndArgsContext ctx); 121 | /** 122 | * Visit a parse tree produced by {@link luappParser#args}. 123 | * @param ctx the parse tree 124 | * @return the visitor result 125 | */ 126 | T visitArgs(luappParser.ArgsContext ctx); 127 | /** 128 | * Visit a parse tree produced by {@link luappParser#functiondef}. 129 | * @param ctx the parse tree 130 | * @return the visitor result 131 | */ 132 | T visitFunctiondef(luappParser.FunctiondefContext ctx); 133 | /** 134 | * Visit a parse tree produced by {@link luappParser#funcbody}. 135 | * @param ctx the parse tree 136 | * @return the visitor result 137 | */ 138 | T visitFuncbody(luappParser.FuncbodyContext ctx); 139 | /** 140 | * Visit a parse tree produced by {@link luappParser#parlist}. 141 | * @param ctx the parse tree 142 | * @return the visitor result 143 | */ 144 | T visitParlist(luappParser.ParlistContext ctx); 145 | /** 146 | * Visit a parse tree produced by {@link luappParser#tableconstructor}. 147 | * @param ctx the parse tree 148 | * @return the visitor result 149 | */ 150 | T visitTableconstructor(luappParser.TableconstructorContext ctx); 151 | /** 152 | * Visit a parse tree produced by {@link luappParser#fieldlist}. 153 | * @param ctx the parse tree 154 | * @return the visitor result 155 | */ 156 | T visitFieldlist(luappParser.FieldlistContext ctx); 157 | /** 158 | * Visit a parse tree produced by {@link luappParser#field}. 159 | * @param ctx the parse tree 160 | * @return the visitor result 161 | */ 162 | T visitField(luappParser.FieldContext ctx); 163 | /** 164 | * Visit a parse tree produced by {@link luappParser#fieldsep}. 165 | * @param ctx the parse tree 166 | * @return the visitor result 167 | */ 168 | T visitFieldsep(luappParser.FieldsepContext ctx); 169 | /** 170 | * Visit a parse tree produced by {@link luappParser#operatorOr}. 171 | * @param ctx the parse tree 172 | * @return the visitor result 173 | */ 174 | T visitOperatorOr(luappParser.OperatorOrContext ctx); 175 | /** 176 | * Visit a parse tree produced by {@link luappParser#operatorAnd}. 177 | * @param ctx the parse tree 178 | * @return the visitor result 179 | */ 180 | T visitOperatorAnd(luappParser.OperatorAndContext ctx); 181 | /** 182 | * Visit a parse tree produced by {@link luappParser#operatorComparison}. 183 | * @param ctx the parse tree 184 | * @return the visitor result 185 | */ 186 | T visitOperatorComparison(luappParser.OperatorComparisonContext ctx); 187 | /** 188 | * Visit a parse tree produced by {@link luappParser#operatorStrcat}. 189 | * @param ctx the parse tree 190 | * @return the visitor result 191 | */ 192 | T visitOperatorStrcat(luappParser.OperatorStrcatContext ctx); 193 | /** 194 | * Visit a parse tree produced by {@link luappParser#operatorAddSub}. 195 | * @param ctx the parse tree 196 | * @return the visitor result 197 | */ 198 | T visitOperatorAddSub(luappParser.OperatorAddSubContext ctx); 199 | /** 200 | * Visit a parse tree produced by {@link luappParser#operatorMulDivMod}. 201 | * @param ctx the parse tree 202 | * @return the visitor result 203 | */ 204 | T visitOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx); 205 | /** 206 | * Visit a parse tree produced by {@link luappParser#operatorBitwise}. 207 | * @param ctx the parse tree 208 | * @return the visitor result 209 | */ 210 | T visitOperatorBitwise(luappParser.OperatorBitwiseContext ctx); 211 | /** 212 | * Visit a parse tree produced by {@link luappParser#operatorUnary}. 213 | * @param ctx the parse tree 214 | * @return the visitor result 215 | */ 216 | T visitOperatorUnary(luappParser.OperatorUnaryContext ctx); 217 | /** 218 | * Visit a parse tree produced by {@link luappParser#operatorPower}. 219 | * @param ctx the parse tree 220 | * @return the visitor result 221 | */ 222 | T visitOperatorPower(luappParser.OperatorPowerContext ctx); 223 | /** 224 | * Visit a parse tree produced by {@link luappParser#number}. 225 | * @param ctx the parse tree 226 | * @return the visitor result 227 | */ 228 | T visitNumber(luappParser.NumberContext ctx); 229 | /** 230 | * Visit a parse tree produced by {@link luappParser#string}. 231 | * @param ctx the parse tree 232 | * @return the visitor result 233 | */ 234 | T visitString(luappParser.StringContext ctx); 235 | /** 236 | * Visit a parse tree produced by {@link luappParser#classdef}. 237 | * @param ctx the parse tree 238 | * @return the visitor result 239 | */ 240 | T visitClassdef(luappParser.ClassdefContext ctx); 241 | /** 242 | * Visit a parse tree produced by {@link luappParser#classfunction}. 243 | * @param ctx the parse tree 244 | * @return the visitor result 245 | */ 246 | T visitClassfunction(luappParser.ClassfunctionContext ctx); 247 | /** 248 | * Visit a parse tree produced by {@link luappParser#classstaticfunction}. 249 | * @param ctx the parse tree 250 | * @return the visitor result 251 | */ 252 | T visitClassstaticfunction(luappParser.ClassstaticfunctionContext ctx); 253 | /** 254 | * Visit a parse tree produced by {@link luappParser#classgetorset}. 255 | * @param ctx the parse tree 256 | * @return the visitor result 257 | */ 258 | T visitClassgetorset(luappParser.ClassgetorsetContext ctx); 259 | /** 260 | * Visit a parse tree produced by {@link luappParser#classgetset}. 261 | * @param ctx the parse tree 262 | * @return the visitor result 263 | */ 264 | T visitClassgetset(luappParser.ClassgetsetContext ctx); 265 | /** 266 | * Visit a parse tree produced by {@link luappParser#constructor}. 267 | * @param ctx the parse tree 268 | * @return the visitor result 269 | */ 270 | T visitConstructor(luappParser.ConstructorContext ctx); 271 | /** 272 | * Visit a parse tree produced by {@link luappParser#classmember}. 273 | * @param ctx the parse tree 274 | * @return the visitor result 275 | */ 276 | T visitClassmember(luappParser.ClassmemberContext ctx); 277 | /** 278 | * Visit a parse tree produced by {@link luappParser#classbody}. 279 | * @param ctx the parse tree 280 | * @return the visitor result 281 | */ 282 | T visitClassbody(luappParser.ClassbodyContext ctx); 283 | /** 284 | * Visit a parse tree produced by {@link luappParser#addOne}. 285 | * @param ctx the parse tree 286 | * @return the visitor result 287 | */ 288 | T visitAddOne(luappParser.AddOneContext ctx); 289 | /** 290 | * Visit a parse tree produced by {@link luappParser#plusEqual}. 291 | * @param ctx the parse tree 292 | * @return the visitor result 293 | */ 294 | T visitPlusEqual(luappParser.PlusEqualContext ctx); 295 | /** 296 | * Visit a parse tree produced by {@link luappParser#multiplyEqual}. 297 | * @param ctx the parse tree 298 | * @return the visitor result 299 | */ 300 | T visitMultiplyEqual(luappParser.MultiplyEqualContext ctx); 301 | /** 302 | * Visit a parse tree produced by {@link luappParser#divEqual}. 303 | * @param ctx the parse tree 304 | * @return the visitor result 305 | */ 306 | T visitDivEqual(luappParser.DivEqualContext ctx); 307 | /** 308 | * Visit a parse tree produced by {@link luappParser#minusEqual}. 309 | * @param ctx the parse tree 310 | * @return the visitor result 311 | */ 312 | T visitMinusEqual(luappParser.MinusEqualContext ctx); 313 | /** 314 | * Visit a parse tree produced by {@link luappParser#safeOperator}. 315 | * @param ctx the parse tree 316 | * @return the visitor result 317 | */ 318 | T visitSafeOperator(luappParser.SafeOperatorContext ctx); 319 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/AbstractClassNameHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.luapp.language.generator.luappParser; 5 | import org.luapp.language.listeners.LuaPPListener; 6 | 7 | public class AbstractClassNameHandler extends LuaPPListener { 8 | 9 | public AbstractClassNameHandler(){ 10 | this.setTarget(luappParser.RULE_abstractclassname); 11 | } 12 | 13 | @Override 14 | public void onEnterContext(ParserRuleContext enterContext) { 15 | this.getLuaPP().currentAbstract = enterContext.getText(); 16 | } 17 | 18 | @Override 19 | public void onExitContext(ParserRuleContext exitContext) { 20 | 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ClassBodyHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.antlr.v4.runtime.tree.TerminalNodeImpl; 6 | import org.luapp.language.generator.luappParser; 7 | import org.luapp.language.listeners.LuaPPListener; 8 | 9 | public class ClassBodyHandler extends LuaPPListener { 10 | 11 | public ClassBodyHandler() { 12 | this.setTarget(luappParser.RULE_classbody); 13 | } 14 | 15 | public boolean isClassFunction(ParseTree context){ 16 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_classfunction; 17 | } 18 | 19 | public boolean isClassGetSet(ParseTree context){ 20 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_classgetset; 21 | } 22 | 23 | public boolean isClassConstructor(ParseTree context){ 24 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_constructor; 25 | } 26 | 27 | public boolean isClassName(ParseTree context){ 28 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_classname; 29 | } 30 | 31 | public boolean isStaticFunction(ParseTree context){ 32 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_classstaticfunction; 33 | } 34 | 35 | @Override 36 | public void onSetManager() { 37 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 38 | } 39 | 40 | @Override 41 | public void onEnterContext(ParserRuleContext enterContext) { 42 | if(this.getLuaPP().currentClass.isEmpty()) { 43 | System.out.println("No class name, not completing body."); 44 | return; 45 | } 46 | for (ParseTree child : enterContext.children) { 47 | if(child instanceof TerminalNodeImpl) continue; 48 | if(isClassFunction(child)){ 49 | this.listenerManager 50 | .GetInstangeByTarget(luappParser.RULE_classfunction) 51 | .handleEnterContext((ParserRuleContext)child); 52 | }else if(isClassConstructor(child)){ 53 | System.out.println("Constructor!"); 54 | this.listenerManager 55 | .GetInstangeByTarget(luappParser.RULE_constructor) 56 | .handleEnterContext((ParserRuleContext)child); 57 | }else if(isClassGetSet(child)){ 58 | this.listenerManager 59 | .GetInstangeByTarget(luappParser.RULE_classfunction) 60 | .handleEnterContext((ParserRuleContext)child); 61 | }else if(isClassName(child)){ 62 | 63 | }else if(isStaticFunction(child)){ 64 | this.listenerManager 65 | .GetInstangeByTarget(luappParser.RULE_classstaticfunction) 66 | .handleEnterContext((ParserRuleContext)child); 67 | } 68 | } 69 | 70 | } 71 | 72 | @Override 73 | public void onExitContext(ParserRuleContext exitContext) { 74 | this.getLuaPP().currentClass = ""; 75 | this.getLuaPP().currentAbstract = ""; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ClassFunctionHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.luapp.language.generator.luappParser; 6 | import org.luapp.language.listeners.LuaPPListener; 7 | 8 | public class ClassFunctionHandler extends LuaPPListener { 9 | 10 | public ClassFunctionHandler(){ 11 | this.target = luappParser.RULE_classfunction; 12 | } 13 | 14 | @Override 15 | public void onSetManager() { 16 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 17 | } 18 | 19 | @Override 20 | public void onEnterContext(ParserRuleContext enterContext) { 21 | ParseTree name = enterContext.getChild(1); 22 | ParseTree body = enterContext.getChild(2); 23 | this.addToLuaPPResult("function " + this.getLuaPP().currentClass 24 | + ":" + name.getText() + this.getLuaPP().getRawFromContext((ParserRuleContext)body)); 25 | } 26 | 27 | @Override 28 | public void onExitContext(ParserRuleContext exitContext) { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ClassGetSetHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.antlr.v4.runtime.tree.TerminalNodeImpl; 6 | import org.luapp.language.generator.luappParser; 7 | import org.luapp.language.listeners.LuaPPListener; 8 | 9 | public class ClassGetSetHandler extends LuaPPListener { 10 | 11 | public ClassGetSetHandler(){ 12 | this.target = luappParser.RULE_classgetset; 13 | } 14 | 15 | @Override 16 | public void onSetManager() { 17 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 18 | } 19 | 20 | @Override 21 | public void onEnterContext(ParserRuleContext enterContext) { 22 | luappParser.ClassgetsetContext ctx = (luappParser.ClassgetsetContext)enterContext; 23 | 24 | ParseTree name = ctx.getChild(0); 25 | String nameText = name.getText(); 26 | 27 | for (int i=2; i < ctx.getChildCount(); i++) { 28 | ParseTree getset = ctx.getChild(i); 29 | if(getset == null){ 30 | return; 31 | } 32 | if(getset instanceof TerminalNodeImpl) continue; 33 | if(((ParserRuleContext)getset).getRuleIndex() == luappParser.RULE_classgetorset){ 34 | String getSet = getset.getText(); 35 | String camelCaseName = nameText.substring(0, 1).toUpperCase() + nameText.substring(1); 36 | if(getSet.equals("get")){ 37 | this.addToLuaPPResult("function " + this.getLuaPP().currentClass + ":get" + camelCaseName + "()" + 38 | "\n\treturn self." + nameText + "\nend" ); 39 | }else if(getSet.equals("set")){ 40 | this.addToLuaPPResult("function " + this.getLuaPP().currentClass + ":set" + camelCaseName + "(obj)" + 41 | "\n\tself." + nameText + " = obj\nend" ); 42 | } 43 | } 44 | } 45 | 46 | 47 | } 48 | 49 | @Override 50 | public void onExitContext(ParserRuleContext exitContext) { 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ClassNameHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.luapp.language.generator.luappParser; 5 | import org.luapp.language.listeners.LuaPPListener; 6 | 7 | public class ClassNameHandler extends LuaPPListener { 8 | 9 | public ClassNameHandler() { 10 | this.setTarget(luappParser.RULE_classname); 11 | } 12 | 13 | @Override 14 | public void onSetManager() { 15 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 16 | } 17 | 18 | @Override 19 | public void onEnterContext(ParserRuleContext enterContext) { 20 | System.out.println(""); 21 | this.getLuaPP().currentClass = enterContext.getText(); 22 | String currentClass = enterContext.getText(); 23 | this.addToLuaPPResult(currentClass + " = {}\n" + currentClass + ".__index = " + currentClass); 24 | } 25 | 26 | @Override 27 | public void onExitContext(ParserRuleContext exitContext) { 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ClassStaticFunctionHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.luapp.language.generator.luappParser; 6 | import org.luapp.language.listeners.LuaPPListener; 7 | 8 | public class ClassStaticFunctionHandler extends LuaPPListener { 9 | public ClassStaticFunctionHandler(){ 10 | this.target = luappParser.RULE_classstaticfunction; 11 | } 12 | 13 | @Override 14 | public void onSetManager() { 15 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 16 | } 17 | 18 | @Override 19 | public void onEnterContext(ParserRuleContext enterContext) { 20 | System.out.println("Static?"); 21 | ParseTree name = enterContext.getChild(2); 22 | ParseTree body = enterContext.getChild(3); 23 | this.addToLuaPPResult("function " + this.getLuaPP().currentClass 24 | + "." + name.getText() + this.getLuaPP().getRawFromContext((ParserRuleContext)body)); 25 | } 26 | 27 | @Override 28 | public void onExitContext(ParserRuleContext exitContext) { 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/ConstructorHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.luapp.language.generator.luappParser; 6 | import org.luapp.language.listeners.LuaPPListener; 7 | 8 | public class ConstructorHandler extends LuaPPListener { 9 | 10 | public ConstructorHandler() { 11 | this.setTarget(luappParser.RULE_constructor); 12 | 13 | } 14 | @Override 15 | public void onSetManager() { 16 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 17 | } 18 | 19 | @Override 20 | public void onEnterContext(ParserRuleContext enterContext) { 21 | 22 | luappParser.ConstructorContext constructorContext = (luappParser.ConstructorContext)enterContext; 23 | ParseTree funcParams = constructorContext.getChild(2); 24 | ParseTree funcBody = constructorContext.getChild(4); 25 | if(funcBody == null || funcParams == null){ 26 | System.out.println("Function Body or Function Parameters are null"); 27 | return; 28 | } 29 | String params = this.getLuaPP().getRawFromContext((ParserRuleContext)funcParams); 30 | String body = this.getLuaPP().getRawFromContext((ParserRuleContext) funcBody); 31 | 32 | String abstractClass = this.getLuaPP().currentAbstract == null ? "" : this.getLuaPP().currentAbstract; 33 | String currentClass = this.getLuaPP().currentClass == null ? "" : this.getLuaPP().currentClass; 34 | this.addToLuaPPResult("function " + currentClass + ".new(" + params + ")\n" + 35 | "\tlocal self = {}\n" + 36 | "\tsetmetatable(self, " + currentClass +")" + 37 | "\n" + (abstractClass.isEmpty() ? "" : ("\n\tfor k,v in pairs(" + abstractClass + ") do \n" + 38 | " self[k] = v\n" + 39 | " end ")) + 40 | "\n\t" + body + 41 | "\n\treturn self\nend"); 42 | 43 | } 44 | 45 | @Override 46 | public void onExitContext(ParserRuleContext exitContext) { 47 | 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/SafeHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ParseTree; 5 | import org.luapp.language.generator.luappParser; 6 | import org.luapp.language.listeners.LuaPPListener; 7 | 8 | public class SafeHandler extends LuaPPListener { 9 | 10 | public SafeHandler() { 11 | this.setTarget(luappParser.RULE_safeOperator); 12 | //this.ignoreCheck = true; 13 | } 14 | 15 | @Override 16 | public void onSetManager() { 17 | this.listenerManager.RegisterIgnoredContext(this.getTarget()); 18 | } 19 | 20 | 21 | @Override 22 | public void onEnterContext(ParserRuleContext enterContext) { 23 | //luappParser.SafeOperatorContext safeOperatorContext = (luappParser.SafeOperatorContext)enterContext; 24 | StringBuilder stat = new StringBuilder("if "); 25 | String name = ""; 26 | boolean first = false; 27 | 28 | String[] elems = enterContext.getChild(0).getText().split("\\."); 29 | for (String elem : elems) { 30 | if(!first){ 31 | name = elem; 32 | 33 | }else{ 34 | name += "." + elem; 35 | } 36 | 37 | if(!first){ 38 | first = true; 39 | stat.append(name); 40 | break; 41 | } 42 | 43 | stat.append(" and ").append(name); 44 | } 45 | 46 | } 47 | 48 | @Override 49 | public void onExitContext(ParserRuleContext exitContext) { 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/handlers/StatementHandler.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.handlers; 2 | 3 | import org.antlr.v4.runtime.Parser; 4 | import org.antlr.v4.runtime.ParserRuleContext; 5 | import org.antlr.v4.runtime.RuleContext; 6 | import org.antlr.v4.runtime.tree.ParseTree; 7 | import org.antlr.v4.runtime.tree.TerminalNodeImpl; 8 | import org.luapp.language.generator.luappParser; 9 | import org.luapp.language.listeners.LuaPPListener; 10 | 11 | public class StatementHandler extends LuaPPListener { 12 | 13 | public StatementHandler() { 14 | this.setTarget(luappParser.RULE_stat); 15 | } 16 | 17 | public boolean isParentClass(ParserRuleContext context){ 18 | ParseTree parent = context.parent; 19 | for(int i =0; i < 1000000; i++){ // This is because I KNOW someone's gonna have some weird edge cases. 20 | ParserRuleContext prc = (ParserRuleContext)parent; 21 | if(prc == null) return false; 22 | if(prc.parent == null) return false; 23 | if(prc.getParent().getRuleIndex() == luappParser.RULE_classbody 24 | || prc.getParent().getRuleIndex() == luappParser.RULE_block) { 25 | return true; 26 | } 27 | parent = prc.parent; 28 | } 29 | 30 | return false; 31 | } 32 | 33 | public boolean isClassName(ParseTree context){ 34 | return ((ParserRuleContext)context).getRuleIndex() == luappParser.RULE_classname; 35 | } 36 | 37 | 38 | public boolean isChildIgnored(ParserRuleContext context){ 39 | if (context.children == null) return false; 40 | 41 | for (ParseTree child : context.children) { 42 | if(child instanceof TerminalNodeImpl) continue; 43 | ParserRuleContext childParser = ((ParserRuleContext)child); 44 | 45 | for (int ignoredStatement : this.listenerManager.ignoredStatements) { 46 | 47 | if( childParser.getRuleIndex() == ignoredStatement){ 48 | System.out.println("Ignored Grammar Rule: " + childParser.getRuleIndex()); 49 | return true; 50 | } 51 | } 52 | } 53 | return false; 54 | } 55 | 56 | 57 | 58 | /** 59 | * This will handle all default geneartion. 60 | * @param enterContext The actual context. 61 | */ 62 | @Override 63 | public void onEnterContext(ParserRuleContext enterContext) { 64 | 65 | boolean removeSafeIndex = false; 66 | 67 | 68 | boolean isNewStatement = false; 69 | if (enterContext.children != null) { 70 | for (ParseTree child : enterContext.children) { 71 | if(child instanceof TerminalNodeImpl) continue; 72 | if(((ParserRuleContext)child).getRuleIndex() == luappParser.RULE_safeOperator){ 73 | this.listenerManager 74 | .GetInstangeByTarget(luappParser.RULE_safeOperator) 75 | .handleEnterContext(enterContext); 76 | } 77 | 78 | if (child instanceof luappParser.ClassbodyContext) { 79 | this.listenerManager 80 | .GetInstangeByTarget(luappParser.RULE_classbody) 81 | .handleEnterContext(enterContext); 82 | return; 83 | } 84 | } 85 | } 86 | 87 | if(this.isParentClass(enterContext)) { 88 | //System.out.println("Parent is a class!"); 89 | return; 90 | } 91 | 92 | if(enterContext instanceof luappParser.SafeOperatorContext){ 93 | System.out.println("It's a Safe Op."); 94 | } 95 | 96 | if(this.isChildIgnored(enterContext)){ 97 | return; 98 | } 99 | 100 | 101 | //System.out.println("NewLine:" + this.getLuaPP().getRawFromContext(enterContext)); 102 | 103 | 104 | this.addToLuaPPResult(this.getLuaPP().getRawFromContext(enterContext)); 105 | 106 | } 107 | 108 | @Override 109 | public void onExitContext(ParserRuleContext exitContext) { 110 | //this.addToLuaPPResult(this.getLuaPP().getRawFromContext(exitContext)); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/listeners/LuaPPFileWatchingService.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.listeners; 2 | 3 | public class LuaPPFileWatchingService{ 4 | } 5 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/listeners/LuaPPListener.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.listeners; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.luapp.language.Luapp; 5 | import org.luapp.language.Main; 6 | import org.luapp.language.loader.ListenerManager; 7 | 8 | public abstract class LuaPPListener { 9 | 10 | // The Target Event/Context. 11 | public int target; 12 | public boolean ignoreCheck = false; 13 | public ListenerManager listenerManager; 14 | 15 | public void setListenerManager(ListenerManager listenerManager) { 16 | this.listenerManager = listenerManager; 17 | this.onSetManager(); 18 | } 19 | 20 | public void onSetManager(){} 21 | 22 | public void setTarget(int target) { 23 | this.target = target; 24 | } 25 | 26 | public int getTarget() { 27 | return target; 28 | } 29 | 30 | public boolean isCorrectContext(ParserRuleContext context){ 31 | return context.getRuleIndex() == this.target; 32 | } 33 | 34 | public void handleEnterContext(ParserRuleContext context){ 35 | if (this.ignoreCheck) {onEnterContext(context);return;} 36 | if (isCorrectContext(context)) onEnterContext(context); 37 | } 38 | 39 | public void handleExitContext(ParserRuleContext context){ 40 | if (this.ignoreCheck) {onExitContext(context); return;} 41 | if (isCorrectContext(context)) onExitContext(context); 42 | } 43 | 44 | public Luapp getLuaPP(){ 45 | return Main.luaPPInstance; 46 | } 47 | 48 | public void addToLuaPPResult(String result){ 49 | 50 | this.getLuaPP().currentResult += "\n" + result; 51 | } 52 | 53 | /** 54 | * Handles the time it enters the context. 55 | * @param enterContext The actual context. 56 | */ 57 | public abstract void onEnterContext(ParserRuleContext enterContext); 58 | 59 | /** 60 | * Handles the time it exists the context 61 | * @param exitContext The actual context. 62 | */ 63 | public abstract void onExitContext(ParserRuleContext exitContext); 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/listeners/MasterLuaPPListener.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.listeners; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.antlr.v4.runtime.tree.ErrorNode; 5 | import org.antlr.v4.runtime.tree.TerminalNode; 6 | import org.luapp.language.Luapp; 7 | import org.luapp.language.Main; 8 | import org.luapp.language.generator.luappListener; 9 | import org.luapp.language.generator.luappParser; 10 | 11 | public class MasterLuaPPListener implements luappListener { 12 | public Luapp getLuaPP(){ 13 | return Main.luaPPInstance; 14 | } 15 | 16 | @Override 17 | public void enterChunk(luappParser.ChunkContext ctx) { 18 | 19 | } 20 | 21 | @Override 22 | public void exitChunk(luappParser.ChunkContext ctx) { 23 | 24 | } 25 | 26 | @Override 27 | public void enterBlock(luappParser.BlockContext ctx) { 28 | } 29 | 30 | @Override 31 | public void exitBlock(luappParser.BlockContext ctx) { 32 | } 33 | 34 | @Override 35 | public void enterStat(luappParser.StatContext ctx) { 36 | Main.luaPPInstance.handleEnterContext(ctx); 37 | } 38 | 39 | @Override 40 | public void exitStat(luappParser.StatContext ctx) { 41 | Main.luaPPInstance.handleExitContext(ctx); 42 | } 43 | 44 | @Override 45 | public void enterRetstat(luappParser.RetstatContext ctx) { 46 | } 47 | 48 | @Override 49 | public void exitRetstat(luappParser.RetstatContext ctx) { 50 | 51 | } 52 | 53 | @Override 54 | public void enterLabel(luappParser.LabelContext ctx) { 55 | 56 | } 57 | 58 | @Override 59 | public void exitLabel(luappParser.LabelContext ctx) { 60 | 61 | } 62 | 63 | @Override 64 | public void enterFuncname(luappParser.FuncnameContext ctx) { 65 | 66 | } 67 | 68 | @Override 69 | public void exitFuncname(luappParser.FuncnameContext ctx) { 70 | 71 | } 72 | 73 | @Override 74 | public void enterClassname(luappParser.ClassnameContext ctx) { 75 | Main.luaPPInstance.handleEnterContext(ctx); 76 | } 77 | 78 | @Override 79 | public void exitClassname(luappParser.ClassnameContext ctx) { 80 | Main.luaPPInstance.handleExitContext(ctx); 81 | } 82 | 83 | @Override 84 | public void enterAbstractclassname(luappParser.AbstractclassnameContext ctx) { 85 | Main.luaPPInstance.handleEnterContext(ctx); 86 | } 87 | 88 | @Override 89 | public void exitAbstractclassname(luappParser.AbstractclassnameContext ctx) { 90 | //Main.luaPPInstance.handleExitContext(ctx); 91 | } 92 | 93 | @Override 94 | public void enterVarlist(luappParser.VarlistContext ctx) { 95 | 96 | } 97 | 98 | @Override 99 | public void exitVarlist(luappParser.VarlistContext ctx) { 100 | 101 | } 102 | 103 | @Override 104 | public void enterNamelist(luappParser.NamelistContext ctx) { 105 | 106 | } 107 | 108 | @Override 109 | public void exitNamelist(luappParser.NamelistContext ctx) { 110 | 111 | } 112 | 113 | @Override 114 | public void enterExplist(luappParser.ExplistContext ctx) { 115 | 116 | } 117 | 118 | @Override 119 | public void exitExplist(luappParser.ExplistContext ctx) { 120 | 121 | } 122 | 123 | @Override 124 | public void enterExp(luappParser.ExpContext ctx) { 125 | 126 | } 127 | 128 | @Override 129 | public void exitExp(luappParser.ExpContext ctx) { 130 | 131 | } 132 | 133 | @Override 134 | public void enterPrefixexp(luappParser.PrefixexpContext ctx) { 135 | 136 | } 137 | 138 | @Override 139 | public void exitPrefixexp(luappParser.PrefixexpContext ctx) { 140 | 141 | } 142 | 143 | @Override 144 | public void enterFunctioncall(luappParser.FunctioncallContext ctx) { 145 | 146 | } 147 | 148 | @Override 149 | public void exitFunctioncall(luappParser.FunctioncallContext ctx) { 150 | 151 | } 152 | 153 | @Override 154 | public void enterVarOrExp(luappParser.VarOrExpContext ctx) { 155 | 156 | } 157 | 158 | @Override 159 | public void exitVarOrExp(luappParser.VarOrExpContext ctx) { 160 | 161 | } 162 | 163 | @Override 164 | public void enterVar(luappParser.VarContext ctx) { 165 | 166 | } 167 | 168 | @Override 169 | public void exitVar(luappParser.VarContext ctx) { 170 | 171 | } 172 | 173 | @Override 174 | public void enterVarSuffix(luappParser.VarSuffixContext ctx) { 175 | 176 | } 177 | 178 | @Override 179 | public void exitVarSuffix(luappParser.VarSuffixContext ctx) { 180 | 181 | } 182 | 183 | @Override 184 | public void enterNameAndArgs(luappParser.NameAndArgsContext ctx) { 185 | 186 | } 187 | 188 | @Override 189 | public void exitNameAndArgs(luappParser.NameAndArgsContext ctx) { 190 | 191 | } 192 | 193 | @Override 194 | public void enterArgs(luappParser.ArgsContext ctx) { 195 | 196 | } 197 | 198 | @Override 199 | public void exitArgs(luappParser.ArgsContext ctx) { 200 | 201 | } 202 | 203 | @Override 204 | public void enterFunctiondef(luappParser.FunctiondefContext ctx) { 205 | //Main.luaPPInstance.handleEnterContext(ctx); 206 | } 207 | 208 | @Override 209 | public void exitFunctiondef(luappParser.FunctiondefContext ctx) { 210 | //Main.luaPPInstance.handleExitContext(ctx); 211 | } 212 | 213 | @Override 214 | public void enterFuncbody(luappParser.FuncbodyContext ctx) { 215 | 216 | } 217 | 218 | @Override 219 | public void exitFuncbody(luappParser.FuncbodyContext ctx) { 220 | 221 | } 222 | 223 | @Override 224 | public void enterParlist(luappParser.ParlistContext ctx) { 225 | 226 | } 227 | 228 | @Override 229 | public void exitParlist(luappParser.ParlistContext ctx) { 230 | 231 | } 232 | 233 | @Override 234 | public void enterTableconstructor(luappParser.TableconstructorContext ctx) { 235 | 236 | } 237 | 238 | @Override 239 | public void exitTableconstructor(luappParser.TableconstructorContext ctx) { 240 | 241 | } 242 | 243 | @Override 244 | public void enterFieldlist(luappParser.FieldlistContext ctx) { 245 | 246 | } 247 | 248 | @Override 249 | public void exitFieldlist(luappParser.FieldlistContext ctx) { 250 | 251 | } 252 | 253 | @Override 254 | public void enterField(luappParser.FieldContext ctx) { 255 | 256 | } 257 | 258 | @Override 259 | public void exitField(luappParser.FieldContext ctx) { 260 | 261 | } 262 | 263 | @Override 264 | public void enterFieldsep(luappParser.FieldsepContext ctx) { 265 | 266 | } 267 | 268 | @Override 269 | public void exitFieldsep(luappParser.FieldsepContext ctx) { 270 | 271 | } 272 | 273 | @Override 274 | public void enterOperatorOr(luappParser.OperatorOrContext ctx) { 275 | 276 | } 277 | 278 | @Override 279 | public void exitOperatorOr(luappParser.OperatorOrContext ctx) { 280 | 281 | } 282 | 283 | @Override 284 | public void enterOperatorAnd(luappParser.OperatorAndContext ctx) { 285 | 286 | } 287 | 288 | @Override 289 | public void exitOperatorAnd(luappParser.OperatorAndContext ctx) { 290 | 291 | } 292 | 293 | @Override 294 | public void enterOperatorComparison(luappParser.OperatorComparisonContext ctx) { 295 | 296 | } 297 | 298 | @Override 299 | public void exitOperatorComparison(luappParser.OperatorComparisonContext ctx) { 300 | 301 | } 302 | 303 | @Override 304 | public void enterOperatorStrcat(luappParser.OperatorStrcatContext ctx) { 305 | 306 | } 307 | 308 | @Override 309 | public void exitOperatorStrcat(luappParser.OperatorStrcatContext ctx) { 310 | 311 | } 312 | 313 | @Override 314 | public void enterOperatorAddSub(luappParser.OperatorAddSubContext ctx) { 315 | 316 | } 317 | 318 | @Override 319 | public void exitOperatorAddSub(luappParser.OperatorAddSubContext ctx) { 320 | 321 | } 322 | 323 | @Override 324 | public void enterOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx) { 325 | 326 | } 327 | 328 | @Override 329 | public void exitOperatorMulDivMod(luappParser.OperatorMulDivModContext ctx) { 330 | 331 | } 332 | 333 | @Override 334 | public void enterOperatorBitwise(luappParser.OperatorBitwiseContext ctx) { 335 | 336 | } 337 | 338 | @Override 339 | public void exitOperatorBitwise(luappParser.OperatorBitwiseContext ctx) { 340 | 341 | } 342 | 343 | @Override 344 | public void enterOperatorUnary(luappParser.OperatorUnaryContext ctx) { 345 | 346 | } 347 | 348 | @Override 349 | public void exitOperatorUnary(luappParser.OperatorUnaryContext ctx) { 350 | 351 | } 352 | 353 | @Override 354 | public void enterOperatorPower(luappParser.OperatorPowerContext ctx) { 355 | 356 | } 357 | 358 | @Override 359 | public void exitOperatorPower(luappParser.OperatorPowerContext ctx) { 360 | 361 | } 362 | 363 | @Override 364 | public void enterNumber(luappParser.NumberContext ctx) { 365 | 366 | } 367 | 368 | @Override 369 | public void exitNumber(luappParser.NumberContext ctx) { 370 | 371 | } 372 | 373 | @Override 374 | public void enterString(luappParser.StringContext ctx) { 375 | 376 | } 377 | 378 | @Override 379 | public void exitString(luappParser.StringContext ctx) { 380 | 381 | } 382 | 383 | 384 | @Override 385 | public void enterClassdef(luappParser.ClassdefContext ctx) { 386 | 387 | } 388 | 389 | @Override 390 | public void exitClassdef(luappParser.ClassdefContext ctx) { 391 | 392 | } 393 | 394 | @Override 395 | public void enterClassfunction(luappParser.ClassfunctionContext ctx) { 396 | 397 | } 398 | 399 | @Override 400 | public void exitClassfunction(luappParser.ClassfunctionContext ctx) { 401 | 402 | } 403 | 404 | @Override 405 | public void enterClassstaticfunction(luappParser.ClassstaticfunctionContext ctx) { 406 | 407 | } 408 | 409 | @Override 410 | public void exitClassstaticfunction(luappParser.ClassstaticfunctionContext ctx) { 411 | 412 | } 413 | 414 | @Override 415 | public void enterClassgetorset(luappParser.ClassgetorsetContext ctx) { 416 | 417 | } 418 | 419 | @Override 420 | public void exitClassgetorset(luappParser.ClassgetorsetContext ctx) { 421 | 422 | } 423 | 424 | @Override 425 | public void enterClassgetset(luappParser.ClassgetsetContext ctx) { 426 | Main.luaPPInstance.handleEnterContext(ctx); 427 | } 428 | 429 | @Override 430 | public void exitClassgetset(luappParser.ClassgetsetContext ctx) { 431 | Main.luaPPInstance.handleExitContext(ctx); 432 | } 433 | 434 | @Override 435 | public void enterConstructor(luappParser.ConstructorContext ctx) { 436 | //Main.luaPPInstance.handleEnterContext(ctx); 437 | } 438 | 439 | @Override 440 | public void exitConstructor(luappParser.ConstructorContext ctx) { 441 | //Main.luaPPInstance.handleExitContext(ctx); 442 | } 443 | 444 | @Override 445 | public void enterClassmember(luappParser.ClassmemberContext ctx) { 446 | 447 | } 448 | 449 | @Override 450 | public void exitClassmember(luappParser.ClassmemberContext ctx) { 451 | 452 | } 453 | 454 | @Override 455 | public void enterClassbody(luappParser.ClassbodyContext ctx) { 456 | Main.luaPPInstance.handleEnterContext(ctx); 457 | } 458 | 459 | @Override 460 | public void exitClassbody(luappParser.ClassbodyContext ctx) { 461 | // Main.luaPPInstance.handleEnterContext(ctx); 462 | } 463 | 464 | @Override 465 | public void enterAddOne(luappParser.AddOneContext ctx) { 466 | 467 | } 468 | 469 | @Override 470 | public void exitAddOne(luappParser.AddOneContext ctx) { 471 | 472 | } 473 | 474 | @Override 475 | public void enterPlusEqual(luappParser.PlusEqualContext ctx) { 476 | 477 | } 478 | 479 | @Override 480 | public void exitPlusEqual(luappParser.PlusEqualContext ctx) { 481 | 482 | } 483 | 484 | @Override 485 | public void enterMultiplyEqual(luappParser.MultiplyEqualContext ctx) { 486 | 487 | } 488 | 489 | @Override 490 | public void exitMultiplyEqual(luappParser.MultiplyEqualContext ctx) { 491 | 492 | } 493 | 494 | @Override 495 | public void enterDivEqual(luappParser.DivEqualContext ctx) { 496 | 497 | } 498 | 499 | @Override 500 | public void exitDivEqual(luappParser.DivEqualContext ctx) { 501 | 502 | } 503 | 504 | @Override 505 | public void enterMinusEqual(luappParser.MinusEqualContext ctx) { 506 | 507 | } 508 | 509 | @Override 510 | public void exitMinusEqual(luappParser.MinusEqualContext ctx) { 511 | 512 | } 513 | 514 | @Override 515 | public void enterSafeOperator(luappParser.SafeOperatorContext ctx) { 516 | 517 | } 518 | 519 | @Override 520 | public void exitSafeOperator(luappParser.SafeOperatorContext ctx) { 521 | 522 | } 523 | 524 | @Override 525 | public void visitTerminal(TerminalNode terminalNode) { 526 | 527 | } 528 | 529 | @Override 530 | public void visitErrorNode(ErrorNode errorNode) { 531 | 532 | } 533 | 534 | @Override 535 | public void enterEveryRule(ParserRuleContext parserRuleContext) { 536 | 537 | } 538 | 539 | @Override 540 | public void exitEveryRule(ParserRuleContext parserRuleContext) { 541 | 542 | } 543 | } 544 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/loader/ListenerManager.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.loader; 2 | 3 | import org.antlr.v4.runtime.ParserRuleContext; 4 | import org.luapp.language.generator.luappListener; 5 | import org.luapp.language.generator.luappParser; 6 | import org.luapp.language.listeners.LuaPPListener; 7 | import org.reflections.Reflections; 8 | 9 | import java.util.ArrayList; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | public class ListenerManager { 15 | 16 | public List listeners = new ArrayList(); 17 | 18 | public List ignoredStatements = new ArrayList(); 19 | 20 | public void Load(){ 21 | 22 | Reflections reflections = new Reflections("org.luapp.language.handlers"); 23 | Set> listeners = reflections.getSubTypesOf(LuaPPListener.class); 24 | 25 | for (Class listener : listeners) { 26 | System.out.println("Registered Listener: " + listener.getCanonicalName()); 27 | try { 28 | LuaPPListener listenerInstance = listener.newInstance(); 29 | listenerInstance.setListenerManager(this); 30 | this.Register(listenerInstance); 31 | } catch (InstantiationException | IllegalAccessException e) { 32 | e.printStackTrace(); 33 | } 34 | } 35 | 36 | } 37 | 38 | public void RegisterIgnoredContext(int ignoredClass){ 39 | this.ignoredStatements.add(ignoredClass); 40 | } 41 | 42 | /** 43 | * Get's a Listener instance from it's target ID. 44 | * @param target The rule ID 45 | * @return Listener 46 | */ 47 | public LuaPPListener GetInstangeByTarget(int target){ 48 | return listeners 49 | .stream() 50 | .filter((listener)-> listener.target == target) 51 | .findFirst() 52 | .orElse(null); 53 | } 54 | 55 | public void Register(LuaPPListener listener){ 56 | listeners.add(listener); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/parser/luapp.g4: -------------------------------------------------------------------------------- 1 | grammar luapp; 2 | 3 | chunk 4 | : block EOF 5 | ; 6 | 7 | block 8 | : stat* retstat? 9 | ; 10 | 11 | stat 12 | : ';' 13 | | varlist '=' explist 14 | | functioncall 15 | | label 16 | | 'break' 17 | | 'goto' NAME 18 | | 'do' block 'end' 19 | | 'while' exp 'do' block 'end' 20 | | 'repeat' block 'until' exp 21 | | 'if' exp 'then' block ('elseif' exp 'then' block)* ('else' block)? 'end' 22 | | 'for' NAME '=' exp ',' exp (',' exp)? 'do' block 'end' 23 | | 'for' namelist 'in' explist 'do' block 'end' 24 | | 'function' funcname funcbody 25 | | 'class' classname ('extends' abstractclassname)? classbody 26 | | ('local')? 'class' classname ('extends' abstractclassname)? classbody 27 | | 'local' 'function' NAME funcbody 28 | | 'local' namelist ('=' explist)? 29 | | 'safe' safeOperator 30 | | ('local')? NAME minusEqual 31 | ; 32 | 33 | retstat 34 | : 'return' explist? ';'? 35 | ; 36 | 37 | label 38 | : '::' NAME '::' 39 | ; 40 | 41 | funcname 42 | : NAME ('.' NAME)* (':' NAME)? 43 | ; 44 | 45 | classname 46 | : var 47 | ; 48 | 49 | abstractclassname 50 | : var 51 | ; 52 | 53 | varlist 54 | : var (',' var)* 55 | ; 56 | 57 | namelist 58 | : NAME (',' NAME)* 59 | ; 60 | 61 | explist 62 | : exp (',' exp)* 63 | ; 64 | 65 | exp 66 | : 'nil' | 'false' | 'true' 67 | | number 68 | | string 69 | | '...' 70 | | functiondef 71 | | prefixexp 72 | | tableconstructor 73 | | exp operatorPower exp 74 | | operatorUnary exp 75 | | exp operatorMulDivMod exp 76 | | exp operatorAddSub exp 77 | | exp operatorStrcat exp 78 | | exp operatorComparison exp 79 | | exp operatorAnd exp 80 | | exp operatorOr exp 81 | | exp operatorBitwise exp 82 | ; 83 | 84 | prefixexp 85 | : varOrExp nameAndArgs* 86 | ; 87 | 88 | functioncall 89 | : varOrExp nameAndArgs+ 90 | ; 91 | 92 | varOrExp 93 | : var | '(' exp ')' 94 | ; 95 | 96 | var 97 | : (NAME | '(' exp ')' varSuffix) varSuffix* 98 | ; 99 | 100 | varSuffix 101 | : nameAndArgs* ('[' exp ']' | '.' NAME) 102 | ; 103 | 104 | nameAndArgs 105 | : (':' NAME)? args 106 | ; 107 | 108 | args 109 | : '(' explist? ')' | tableconstructor | string 110 | ; 111 | 112 | functiondef 113 | : 'function' funcbody 114 | ; 115 | 116 | funcbody 117 | : '(' parlist? ')' block 'end' 118 | ; 119 | 120 | parlist 121 | : namelist (',' '...')? | '...' 122 | ; 123 | 124 | tableconstructor 125 | : '{' fieldlist? '}' 126 | ; 127 | 128 | fieldlist 129 | : field (fieldsep field)* fieldsep? 130 | ; 131 | 132 | field 133 | : '[' exp ']' '=' exp | NAME '=' exp | exp 134 | ; 135 | 136 | fieldsep 137 | : ',' | ';' 138 | ; 139 | 140 | operatorOr 141 | : 'or'; 142 | 143 | operatorAnd 144 | : 'and'; 145 | 146 | operatorComparison 147 | : '<' | '>' | '<=' | '>=' | '~=' | '=='; 148 | 149 | operatorStrcat 150 | : '..'; 151 | 152 | operatorAddSub 153 | : '+' | '-'; 154 | 155 | operatorMulDivMod 156 | : '*' | '/' | '%' | '//'; 157 | 158 | operatorBitwise 159 | : '&' | '|' | '~' | '<<' | '>>'; 160 | 161 | operatorUnary 162 | : 'not' | '#' | '-' | '~'; 163 | 164 | operatorPower 165 | : '^'; 166 | 167 | number 168 | : INT | HEX | FLOAT | HEX_FLOAT 169 | ; 170 | 171 | string 172 | : NORMALSTRING | CHARSTRING | LONGSTRING 173 | ; 174 | 175 | // Plus-Plus Modifications 176 | 177 | 178 | classdef 179 | : 'class' NAME classbody 180 | ; 181 | 182 | classfunction 183 | : 'function' funcname funcbody 184 | ; 185 | 186 | classstaticfunction 187 | : 'static' 'function' funcname funcbody 188 | ; 189 | 190 | classgetorset 191 | : 'get' | 'set' 192 | ; 193 | 194 | classgetset 195 | : NAME '{' classgetorset+ '}' 196 | ; 197 | 198 | constructor 199 | : 'constructor' '(' parlist? ')' block 'end' 200 | ; 201 | 202 | classmember 203 | : classfunction | classgetset | constructor 204 | ; 205 | 206 | classbody 207 | : ( classstaticfunction | classfunction | classgetset | constructor)* 'end' 208 | ; 209 | 210 | addOne 211 | : NAME '++' 212 | ; 213 | 214 | plusEqual 215 | : NAME '+=' 216 | ; 217 | 218 | multiplyEqual 219 | : NAME '*=' 220 | ; 221 | 222 | divEqual 223 | : NAME '/=' 224 | ; 225 | 226 | minusEqual 227 | : NAME '-=' 228 | ; 229 | 230 | safeOperator 231 | : var 232 | ; 233 | ////////////////////////////////////////// 234 | 235 | // LEXER 236 | 237 | NAME 238 | : [a-zA-Z_][a-zA-Z_0-9]* 239 | ; 240 | 241 | NORMALSTRING 242 | : '"' ( EscapeSequence | ~('\\'|'"') )* '"' 243 | ; 244 | 245 | CHARSTRING 246 | : '\'' ( EscapeSequence | ~('\''|'\\') )* '\'' 247 | ; 248 | 249 | LONGSTRING 250 | : '[' NESTED_STR ']' 251 | ; 252 | 253 | fragment 254 | NESTED_STR 255 | : '=' NESTED_STR '=' 256 | | '[' .*? ']' 257 | ; 258 | 259 | INT 260 | : Digit+ 261 | ; 262 | 263 | HEX 264 | : '0' [xX] HexDigit+ 265 | ; 266 | 267 | FLOAT 268 | : Digit+ '.' Digit* ExponentPart? 269 | | '.' Digit+ ExponentPart? 270 | | Digit+ ExponentPart 271 | ; 272 | 273 | HEX_FLOAT 274 | : '0' [xX] HexDigit+ '.' HexDigit* HexExponentPart? 275 | | '0' [xX] '.' HexDigit+ HexExponentPart? 276 | | '0' [xX] HexDigit+ HexExponentPart 277 | ; 278 | 279 | fragment 280 | ExponentPart 281 | : [eE] [+-]? Digit+ 282 | ; 283 | 284 | fragment 285 | HexExponentPart 286 | : [pP] [+-]? Digit+ 287 | ; 288 | 289 | fragment 290 | EscapeSequence 291 | : '\\' [abfnrtvz"'\\] 292 | | '\\' '\r'? '\n' 293 | | DecimalEscape 294 | | HexEscape 295 | | UtfEscape 296 | ; 297 | 298 | fragment 299 | DecimalEscape 300 | : '\\' Digit 301 | | '\\' Digit Digit 302 | | '\\' [0-2] Digit Digit 303 | ; 304 | 305 | fragment 306 | HexEscape 307 | : '\\' 'x' HexDigit HexDigit 308 | ; 309 | fragment 310 | UtfEscape 311 | : '\\' 'u{' HexDigit+ '}' 312 | ; 313 | fragment 314 | Digit 315 | : [0-9] 316 | ; 317 | fragment 318 | HexDigit 319 | : [0-9a-fA-F] 320 | ; 321 | COMMENT 322 | : '--[' NESTED_STR ']' -> channel(HIDDEN) 323 | ; 324 | 325 | LINE_COMMENT 326 | : '--' 327 | ( // -- 328 | | '[' '='* // --[== 329 | | '[' '='* ~('='|'['|'\r'|'\n') ~('\r'|'\n')* // --[==AA 330 | | ~('['|'\r'|'\n') ~('\r'|'\n')* // --AAA 331 | ) ('\r\n'|'\r'|'\n'|EOF) 332 | -> channel(HIDDEN) 333 | ; 334 | 335 | WS 336 | : [ \t\u000C\r\n]+ -> skip 337 | ; 338 | SHEBANG 339 | : '#' '!' ~('\n'|'\r')* -> channel(HIDDEN) 340 | ; -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/test.lpp: -------------------------------------------------------------------------------- 1 | class cat 2 | name {get set} 3 | age {get set} 4 | type {get } 5 | 6 | constructor(name) 7 | self.name = name 8 | end 9 | 10 | function isCat() 11 | return true 12 | end 13 | 14 | static function coolCat() 15 | return "coolCat!" 16 | end 17 | end 18 | 19 | local thomas = cat.new("Thomas") 20 | thomas:setNge(50) 21 | thomas:setName("Thomas v2") 22 | print(thomas:isCat()) -- outputs -> true 23 | print(thomas:getName()) -- outputs -> "Thomas v2" 24 | print(thomas:getAge()) -- outputs -> 50 -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/test.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Written with Lua++. 3 | Don't remove this notice please 4 | 5 | https://github.com/LuaPlusPlus/lua-plus-plus 6 | ]]-- 7 | cat = {} 8 | cat.__index = cat 9 | function cat.new(name) 10 | local self = {} 11 | setmetatable(self, cat) 12 | 13 | self.name = name 14 | return self 15 | end 16 | function cat:isCat() 17 | return true 18 | end 19 | function cat.coolCat() 20 | return "coolCat!" 21 | end 22 | function cat:getName() 23 | return self.name 24 | end 25 | function cat:setName(obj) 26 | self.name = obj 27 | end 28 | function cat:getAge() 29 | return self.age 30 | end 31 | function cat:setAge(obj) 32 | self.age = obj 33 | end 34 | function cat:getType() 35 | return self.type 36 | end 37 | local thomas = cat.new("Thomas") 38 | thomas:setNge(50) 39 | thomas:setName("Thomas v2") 40 | print(thomas:isCat()) 41 | print(thomas:getName()) 42 | print(thomas:getAge()) -------------------------------------------------------------------------------- /src/main/java/org/luapp/language/watcher/FileWatcher.java: -------------------------------------------------------------------------------- 1 | package org.luapp.language.watcher; 2 | 3 | import org.luapp.language.Luapp; 4 | 5 | public class FileWatcher { 6 | 7 | 8 | public FileWatcher(Luapp instance){ 9 | } 10 | 11 | public void onFileSave(String path){ 12 | // this.instance 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Main-Class: org.luapp.language.Main 2 | --------------------------------------------------------------------------------