nqc-3.1.r6/0000755000175000017500000000000010633766435010615 5ustar blpblpnqc-3.1.r6/LICENSE0000600000175000017500000004722707754122134011616 0ustar blpblp MOZILLA PUBLIC LICENSE Version 1.0 ---------------- 1. Definitions. 1.1. ``Contributor'' means each entity that creates or contributes to the creation of Modifications. 1.2. ``Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. ``Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. ``Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. ``Executable'' means Covered Code in any form other than Source Code. 1.6. ``Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. ``Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. ``License'' means this document. 1.9. ``Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. ``Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.11. ``Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or a list of source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. ``You'' means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, ``You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, ``control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and (b) under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell (``Utilize'') the Original Code (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Original Code (or portions thereof) and not to any greater extent that may be necessary to Utilize further Modifications or combinations. 2.2. Contributor Grant. Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and (b) under patents now or hereafter owned or controlled by Contributor, to Utilize the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Contributor Version (or portions thereof), and not to any greater extent that may be necessary to Utilize further Modifications or combinations. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which you contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled ``LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients' rights relating to Covered Code. If You created one or more Modification(s), You may add your name as a Contributor to the notice described in Exhibit A. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A, and to related Covered Code. 6. Versions of the License. 6.1. New Versions. Netscape Communications Corporation (``Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If you create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), you must (a) rename Your license so that the phrases ``Mozilla'', ``MOZILLAPL'', ``MOZPL'', ``Netscape'', ``NPL'' or any confusingly similar phrase do not appear anywhere in your license and (b) otherwise make it clear that your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a ``commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software'' and ``commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in, the United States of America: (a) unless otherwise agreed in writing, all disputes relating to this License (excepting any dispute relating to intellectual property rights) shall be subject to final and binding arbitration, with the losing party paying all costs of arbitration; (b) any arbitration relating to this Agreement shall be held in Santa Clara County, California, under the auspices of JAMS/EndDispute; and (c) any litigation relating to this Agreement shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Covered Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis. EXHIBIT A. ``The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is ______________________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved. Contributor(s): ______________________________________.'' nqc-3.1.r6/Makefile0000600000175000017500000001617710216070664012246 0ustar blpblp# Makefile for nqc # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in # compliance with the License. You may obtain a copy of the License at # http://www.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the # License for the specific language governing rights and limitations # under the License. # # The Initial Developer of this code is David Baum. # Portions created by David Baum are Copyright (C) 1999 David Baum. # All Rights Reserved. # # Portions created by John Hansen are Copyright (C) 2005 John Hansen. # All Rights Reserved. # # original author: # Dave Baum # # other contributors: # Rodd Zurcher # Patrick Nadeau # Jonathan W. Miner # # .SUFFIXES: .cpp .c # # Pick your C++ compiler. # CXX ?= ${CXX} # CXX ?= gcc # # Pick your YACC processor # YACC ?= bison -y # YACC ?= yacc # # Define the FLEX processor # note - lex will not work # FLEX ?= flex # Link in any necessary C++ libraries # LIBS ?= -lstdc++ # installation information PREFIX?=/usr/local BINDIR?=${PREFIX}/bin MANDIR?=${PREFIX}/man/man1 MANEXT?=1 # other commands CP?=cp -f MKDIR?=mkdir MV?=mv -f RM?=rm -f # CFLAGS #CFLAGS = -pipe -Iplatform -Ircxlib -Inqc -Icompiler -Wall -Wstrict-prototypes -Wmissing-prototypes CFLAGS += -Iplatform -Ircxlib -Inqc -Icompiler -Wall USBOBJ = rcxlib/RCX_USBTowerPipe_none.o # # Platform specific tweaks # OSTYPE := $(strip $(shell uname -s)) ifneq (,$(strip $(findstring $(OSTYPE), Darwin))) # Mac OSX LIBS += -framework IOKit -framework CoreFoundation USBOBJ = rcxlib/RCX_USBTowerPipe_osx.o CXX = c++ else ifneq (,$(strip $(findstring $(OSTYPE), Linux))) # Linux # uncomment this next line if you have the USB tower library installed # USBOBJ = rcxlib/RCX_USBTowerPipe_linux.o CFLAGS += -I/usr/local/include/LegoUSB -Wno-deprecated else ifneq (,$(findstring $(OSTYPE), SunOS)) # Solaris CFLAGS += -DSOLARIS else ifneq (,$(strip $(findstring $(OSTYPE), FreeBSD))) # FreeBSD USBOBJ = rcxlib/RCX_USBTowerPipe_fbsd.o DEFAULT_SERIAL_NAME = "/dev/cuad0" CFLAGS += -Wno-deprecated else # default Unix build without USB support CFLAGS += -O6 endif endif endif endif # this must happen after the platform tweaks just in case the platform # wants to redefine the default serial name # ifndef DEFAULT_SERIAL_NAME DEFAULT_SERIAL_NAME = "/dev/ttyS0" endif CFLAGS += -DDEFAULT_SERIAL_NAME='$(DEFAULT_SERIAL_NAME)' # # Object files # OBJ = $(NQCOBJ) $(COBJ) $(RCXOBJ) $(POBJ) RCXOBJ= rcxlib/RCX_Cmd.o rcxlib/RCX_Disasm.o rcxlib/RCX_Image.o \ rcxlib/RCX_Link.o rcxlib/RCX_Log.o rcxlib/RCX_Target.o \ rcxlib/RCX_Pipe.o rcxlib/RCX_PipeTransport.o rcxlib/RCX_Transport.o \ rcxlib/RCX_SpyboticsLinker.o rcxlib/RCX_SerialPipe.o \ $(USBOBJ) POBJ= platform/PStream.o platform/PSerial_unix.o \ platform/PHashTable.o platform/PListS.o COBJ= compiler/AsmStmt.o compiler/AssignStmt.o compiler/BlockStmt.o compiler/Bytecode.o \ compiler/Conditional.o compiler/CondParser.o compiler/DoStmt.o \ compiler/Expansion.o compiler/Fragment.o compiler/IfStmt.o compiler/JumpStmt.o \ compiler/lexer.o compiler/Macro.o compiler/parse.o \ compiler/PreProc.o compiler/Program.o compiler/RepeatStmt.o compiler/AssignMathStmt.o \ compiler/Stmt.o compiler/Symbol.o compiler/TaskStmt.o compiler/WhileStmt.o compiler/Error.o \ compiler/AutoFree.o compiler/parse_util.o compiler/Expr.o \ compiler/GosubStmt.o compiler/Scope.o compiler/InlineStmt.o compiler/CallStmt.o \ compiler/CaseStmt.o compiler/SwitchStmt.o compiler/MonitorStmt.o compiler/AcquireStmt.o \ compiler/DeclareStmt.o compiler/ScopeStmt.o compiler/ForStmt.o compiler/CatchStmt.o\ compiler/LabelStmt.o compiler/GotoStmt.o \ compiler/Compiler.o compiler/Buffer.o compiler/Mapping.o \ compiler/FunctionDef.o compiler/ExprStmt.o compiler/AtomExpr.o compiler/IncDecExpr.o \ compiler/BinaryExpr.o compiler/UnaryExpr.o compiler/ValueExpr.o compiler/TypeExpr.o \ compiler/ModExpr.o compiler/EventSrcExpr.o compiler/SensorExpr.o \ compiler/ArrayExpr.o compiler/TaskIdExpr.o compiler/RelExpr.o compiler/LogicalExpr.o \ compiler/NegateExpr.o compiler/IndirectExpr.o compiler/NodeExpr.o compiler/ShiftExpr.o compiler/TernaryExpr.o \ compiler/VarAllocator.o compiler/VarTranslator.o compiler/Resource.o \ compiler/AddrOfExpr.o compiler/DerefExpr.o compiler/GosubParamStmt.o NQCOBJ = nqc/nqc.o nqc/SRecord.o nqc/DirList.o nqc/CmdLine.o # We need a 'bin' directory because the names of the binaries clash # with existing directory names. all : bin nqh nub bin/nqc # Create the bin directory in the Makefile because it is not part # of the original distribution. This prevents the need to tell the user # to do it. bin: $(MKDIR) bin bin/nqc : compiler/parse.cpp $(OBJ) $(CXX) -o $@ $(OBJ) $(LIBS) bin/mkdata : mkdata/mkdata.cpp nqc/SRecord.cpp $(CXX) -o bin/mkdata -Inqc/ -Iplatform/ mkdata/mkdata.cpp nqc/SRecord.cpp # # clean up stuff # clean: clean-parser clean-lexer clean-obj clean-nqh clean-nub clean-obj: $(RM) bin/* $(RM) */*.o clean-parser: $(RM) compiler/parse.cpp compiler/parse.tab.h clean-lexer: $(RM) compiler/lexer.cpp clean-nqh: $(RM) compiler/rcx1_nqh.h compiler/rcx2_nqh.h clean-nub: $(RM) rcxlib/rcxnub.h # # create the parser files (parse.cpp and parse.tab.h) # compiler/parse.cpp: compiler/parse.y (cd compiler ; $(YACC) -d parse.y ; \ $(MV) y.tab.c parse.cpp ; $(MV) y.tab.h parse.tab.h ) # # create the lexer file (lexer.cpp) # compiler/lexer.cpp: compiler/lex.l (cd compiler ; $(FLEX) lex.l ) # # NQH files # nqh : compiler/rcx1_nqh.h compiler/rcx2_nqh.h compiler/rcx1_nqh.h: compiler/rcx1.nqh bin/mkdata bin/mkdata compiler/rcx1.nqh compiler/rcx1_nqh.h rcx1_nqh compiler/rcx2_nqh.h: compiler/rcx2.nqh bin/mkdata bin/mkdata compiler/rcx2.nqh compiler/rcx2_nqh.h rcx2_nqh # # rcxnub.h # nub: rcxlib/rcxnub.h rcxlib/rcxnub.h: rcxlib/fastdl.srec bin/mkdata bin/mkdata -s rcxlib/fastdl.srec rcxlib/rcxnub.h rcxnub # # general rule for compiling # .cpp.o: $(CXX) -c $(CFLAGS) $< -o $*.o # # Use these targets to use the default parser/lexer files. This is handy if # your system does not have a suitable flex and/or yacc tool. # default-parser: $(CP) default/parse.cpp default/parse.tab.h nqc default-lexer: $(CP) default/lexer.cpp nqc # # This is used to create a default parser, lexer, and nqh files for later use. # You shouldn't need to do this as part of a port. # DEF_FILES = compiler/parse.cpp compiler/lexer.cpp compiler/rcx1_nqh.h compiler/rcx2_nqh.h default-snapshot: default $(DEF_FILES) $(CP) $(DEF_FILES) compiler/parse.tab.h default default: $(MKDIR) default # # Installation of binary and man page # install: all test -d $(BINDIR) || mkdir -p $(BINDIR) cp -r bin/* $(BINDIR) test -d $(MANDIR) || mkdir -p $(MANDIR) cp nqc-man-2.1r1-0.man $(MANDIR)/nqc.$(MANEXT) nqc-3.1.r6/PORTING0000600000175000017500000001337707754122134011655 0ustar blpblpDisclaimer - most of the source is uncommented, and I don't have time to answer questions on it. Bottom line - you're on your own. Mainfest -------- LICENSE - the source code license (MPL) Makefile - a sample Makefile that builds nqcc for Linux PORTING - this file default - default parse/lexer sources nqc - sources specific to nqc platform - source for utility classes rcx.nqh - system include file for using nqcc rcxlib - classes implementing the rcx interface readme.txt - the readme file test.nqc - a trivial nqcc test program The Mac and win32 version are built under Metrowerks CodeWarrior. The included Makefile was designed for Linux, but should work on other Unix platforms with minor modification. General ------- The Makefile uses a variable called TARGET to determine if platform specific options are needed for the build. Currently there are two targets defined: macosx - Mac OS X solaris - sun solaris If TARGET is not defined, then the default options are used which are suitable for Linux and probably most Posix systems. You can define TARGET as part of the make command like this: make TARGET=macosx There are two other variables that might be helpful during a build: DEFAULT_SERIAL_NAME: the name of the device to be used as a default serial port. If undefined, the Makefile sets it to /dev/ttyS0 USBOBJ: the object files that implement USB support. If undefined, the Makefile defaults to rcxlib/RCX_USBTowerPipe_none.o, which is a dummy module for when no USB support is present. Note that a TARGET of macosx overrides the default USBOBJ with a macosx specific one. The build is done with lots of warnings turned on (-Wall and a few others), and warnings are treated as errors (-Werror). The build goes through my compilers just fine this way, but every compiler looks for something a little different with -Wall. If you're having trouble with the build, remove -Werror from the compiler flags. Serial Ports ------------ All serial access is done through subclasses of PSerial. Which subclass is determined by which implementation is linked into the executable: PSerial_mac.cpp - macintosh PSerial_win.cpp - win32 PSerial_unix.cpp - Linux, NetBSD and possibly others Other unix implementations may wish to #ifdef the unix file, or create a new implementation file (e.g. PSerial_solaris.cpp). Note that the Unix code is only a partial implementation of the generic serial interface, but it is sufficient to work with the RCX. Most notably, the unix code defaults to the appropriate serial setting (2400/8/1/odd), and does not support the SetSpeed() method. Unix implementations may also wish to override the default serial port. This can be done by setting DEFAULT_SERIAL_NAME to the appropriate device name in the Makefile: DEFAULT_SERIAL_NAME = "/dev/ttyS0" Note for BSD Unix users: ----------------------- When choosing the correct serial driver be sure to pick the one that doesn't require Carrier Detect to be raised. The IR tower doesn't seem to raise Carrier Detect like a modem or a Pilot cradle does. For COM1 on an Intel box running FreeBSD you'll want to use /dev/cuaa0, not /dev/ttyd0. You'll also probably need to check the ownships and permissions on the device to be sure you can read and write it. Note for Solaris users: ----------------------- One file (PSerial_unix.cpp) has an #ifdef for building under Solaris. Be sure to define the symbol SOLARIS before building (e.g. -DSOLARIS to CFLAGS in the Makefile). Parser and Lexer ---------------- The parser and lexer are normally built using bison and flex respectively. The parser consists of parse.cpp and parse.tab.h, both of which are generated from parse.y using bison. The lexer consists of lexer.cpp which is generated from lex.l using flex. Is most cases, the C++ source files (parse.cpp, parse.tab.h and lexer.cpp) should be re-generated using local versions of bison and flex. In some cases, however, this may not be possible (perhaps there is no version of flex on your system). In this case, the default versions (those generated with the Linux versions of flex and bison) can be used instead. This is done by making the following targets: make default-parser (copies parse.cpp and parse.tab.h from default directory) make default-lexer (copies lexer.cpp from default directory) I'm fairly certain that yacc can be substitued for bison, but it has not been tested extensively. Lex cannot be substituted for flex - the lex.l file will not work with most variants of lex. Use flex, or stick with the default lexer.cpp. Version Numbers --------------- The macro VERSION contains the version number for the build, and is defined in nqcc.cpp. Version numbers have the following format: major.minor[.fix] [phase release] For example, version "0.5 b1" is the first beta release of major version 0, minor version 5. The phases are 'a' for my own alpha tests, and 'b' for public beta. Final releases do not have a phase as part of the version string. The first official release would be version "1.0". A beta test to a bug fix to this version could be "1.0.1 b1", which would then get released as "1.0.1". If you port nqc to another platform, you should keep the version number intact. You may, however, want to print out additional information in the PrintUsage() function in nqc.cpp. If you add new features to nqc or write a new program based on nqc, please embed the nqcc version number within your own version numbering, e.g. "Foo 1.42 (nqc 1.0)". This will help track potential problems back to the appropriate version of nqc source code. Bugs ---- If you find a bug, please let me know - dbaum@enteract.com nqc-3.1.r6/compiler/0000700000175000017500000000000010633241725012403 5ustar blpblpnqc-3.1.r6/compiler/.cvsignore0000600000175000017500000000013210215607262014377 0ustar blpblp.DS_Store parse.y copy parse.output parse.tab.h rcx1.bak rcx2.bak y_tab.c y_tab.h nqc-3.1.r6/compiler/AcquireStmt.cpp0000600000175000017500000000412210216066270015346 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "AcquireStmt.h" #include "Bytecode.h" #include "Expr.h" #include "RCX_Cmd.h" #include "RCX_Target.h" #include "Error.h" AcquireStmt::AcquireStmt(UByte resources, Stmt* body, Stmt *handler, const LexLocation &loc) : BinaryStmt(body, handler), fResources(resources), fLocation(loc) { } void AcquireStmt::EmitActual(Bytecode &b) { if (!b.GetTarget()->fResources) { Error(kErr_NoTargetResources, b.GetTarget()->fName).Raise(&fLocation); return; } if (!b.BeginHandler(Bytecode::kAcquireHandler)) { Error(kErr_NoNestedResources).Raise(&fLocation); return; } RCX_Cmd cmd; int handlerLabel = b.NewLabel(); int endLabel = b.NewLabel(); // start event monitoring cmd.Set(kRCX_EnterAccessCtrlOp, fResources, 0, 0); b.Add(cmd); b.AddFixup(Bytecode::kSignBitLongFixup, handlerLabel); GetPrimary()->Emit(b); // end event monitoring cmd.Set(kRCX_ExitAccessCtrlOp); b.Add(cmd); if (GetSecondary()) b.AddJump(endLabel); // here's the handler b.SetLabel(handlerLabel); if (GetSecondary()) GetSecondary()->Emit(b); b.SetLabel(endLabel); b.EndHandler(Bytecode::kAcquireHandler); } Stmt* AcquireStmt::CloneActual(Mapping *b) const { Stmt *s = GetSecondary() ? GetSecondary()->Clone(b) : 0; return new AcquireStmt(fResources, GetPrimary()->Clone(b), s, fLocation); } nqc-3.1.r6/compiler/AcquireStmt.h0000600000175000017500000000226410216066302015014 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AcquireStmt_h #define __AcquireStmt_h #ifndef __LexLocation_h #include "LexLocation.h" #endif #ifndef __Stmt_h #include "Stmt.h" #endif class AcquireStmt : public BinaryStmt { public: AcquireStmt(UByte resources, Stmt *body, Stmt *handler, const LexLocation &loc); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: UByte fResources; LexLocation fLocation; }; #endif nqc-3.1.r6/compiler/AddrOfExpr.cpp0000600000175000017500000000500510216066316015105 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. */ #include "AddrOfExpr.h" #include "Variable.h" #include "Mapping.h" #include "Bytecode.h" #include "RCX_Target.h" AddrOfExpr::AddrOfExpr(int value, int offset, const LexLocation &loc) : Expr(loc), fValue(value), foffset(offset) { } bool AddrOfExpr::PromiseConstant() const { // if (fValue & kVirtualConstantFlag) return true; // return false; return true; } bool AddrOfExpr::Evaluate(int &value) const { if (fValue & kVirtualConstantFlag) return false; value = fValue+foffset; return true; } bool AddrOfExpr::Contains(int var) const { return (fValue==var); } RCX_Value AddrOfExpr::EmitAny_(Bytecode &) const { return RCX_VALUE(kRCX_ConstantType, fValue); } void AddrOfExpr::Translate(int from, int to) { if (fValue == from) fValue = to; } Expr* AddrOfExpr::Clone(Mapping *m) const { if (m && (fValue & kVirtualVarBase)) { const Expr *e = m->Get(fValue); if (e) { Expr *cloned = e->Clone(0); // I can't decide if substituted vars from inline functions // should bind their location to the expr within the function // or the actual parameter. For actual parameter, do nothing, // for expr within function, set the location of the cloned // expression. cloned->SetLoc(GetLoc()); return cloned; } } return new AddrOfExpr(fValue, foffset, GetLoc()); } RCX_Value AddrOfExpr::GetStaticEA_() const { return RCX_VALUE(kRCX_ConstantType, fValue+foffset); } bool AddrOfExpr::LValueIsPointer() const { return true; } nqc-3.1.r6/compiler/AddrOfExpr.h0000600000175000017500000000270710216066324014557 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. */ #ifndef __AddrOfExpr_h #define __AddrOfExpr_h #ifndef __Expr_h #include "Expr.h" #endif #ifndef __VarTranslator_h #include "VarTranslator.h" #endif class AddrOfExpr : public Expr, public Translatable { public: AddrOfExpr(int value, int offset, const LexLocation &loc); virtual bool PromiseConstant() const; virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual bool Contains(int var) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual RCX_Value GetStaticEA_() const; virtual bool LValueIsPointer() const; void Translate(int from, int to); private: int fValue; int foffset; }; #endif nqc-3.1.r6/compiler/ArrayExpr.cpp0000600000175000017500000000335110216066334015026 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ArrayExpr.h" #include "Mapping.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Program.h" Expr* ArrayExpr::Clone(Mapping *m) const { int newVar = m ? m->GetMappedVar(fVar) : fVar; return new ArrayExpr(newVar, Get(0)->Clone(m)); } RCX_Value ArrayExpr::EmitAny_(Bytecode &b) const { int value; if (Get(0)->Evaluate(value)) { return RCX_VALUE(kRCX_VariableType,fVar + value); } // emit the index int dst = GetTempVar(b); if (dst < 0) return kIllegalEA; Get(0)->EmitTo(b, dst); // adjust for base of array if (fVar) { RCX_Cmd cmd; cmd.MakeVar(kRCX_AddVar,dst, RCX_VALUE(kRCX_ConstantType,fVar)); b.Add(cmd); } return RCX_VALUE(kRCX_IndirectType,dst) + kRCX_ValueUsesTemp; } void ArrayExpr::Translate(int from, int to) { if (fVar == from) fVar = to; } nqc-3.1.r6/compiler/ArrayExpr.h0000600000175000017500000000246110216066346014477 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ArrayExpr_h #define __ArrayExpr_h #include "NodeExpr.h" #ifndef __VarTranslator_h #include "VarTranslator.h" #endif class ArrayExpr : public NodeExpr, public Translatable { public: ArrayExpr(int var, Expr *e) : NodeExpr(e), fVar(var) {} virtual Expr* Clone(Mapping *b) const; virtual bool PromiseConstant() const { return false; } virtual bool PotentialLValue() const { return true; } virtual RCX_Value EmitAny_(Bytecode &b) const; virtual void Translate(int from, int to); private: int fVar; }; #endif nqc-3.1.r6/compiler/AsmStmt.cpp0000600000175000017500000000516410252114554014503 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "AsmStmt.h" #include "Bytecode.h" #include "Expr.h" #include "RCX_Cmd.h" #include "RCX_Target.h" #include "Error.h" AsmStmt::~AsmStmt() { while(Field *f = fFields.RemoveHead()) delete f; } void AsmStmt::EmitActual(Bytecode &b) { Field *f; for(f = fFields.GetHead(); f; f=f->GetNext()) f->PreEmit(b); vectorv; for(f = fFields.GetHead(); f; f=f->GetNext()) f->Emit(b, v); RCX_Cmd cmd; cmd.Set(&v[0], v.size()); b.Add(cmd); } Stmt* AsmStmt::CloneActual(Mapping *m) const { AsmStmt *a = new AsmStmt(); for(Field *f = fFields.GetHead(); f; f=f->GetNext()) a->Add(f->Clone(m)); return a; } void AsmStmt::GetExprs(vector &v) const { Field *f; for(f = fFields.GetHead(); f; f=f->GetNext()) { v.push_back(f->GetExpr()); } } Field::~Field() { delete fExpr; } Field* ConstField::Clone(Mapping *m) const { return new ConstField(fExpr->Clone(m)); } void ConstField::Emit(Bytecode &, vector &v) const { int value; fExpr->Evaluate(value); v.push_back( (UByte) value ); } EAField::EAField(Expr *e, ULong restrictor) : Field(e), fRestrictor(restrictor), fEA(Expr::kIllegalEA) { } Field* EAField::Clone(Mapping *m) const { return new EAField(fExpr->Clone(m), fRestrictor); } void EAField::PreEmit(Bytecode &b) { ULong sources = fRestrictor & kSourceMask; bool canUseLocal = !(fRestrictor & kNoLocal); if (sources || !canUseLocal) fEA = fExpr->EmitConstrained(b, sources, canUseLocal); else fEA = fExpr->EmitAny(b); } void EAField::Emit(Bytecode &b, vector &v) const { if (!(fRestrictor & kNoTypeCode)) v.push_back((UByte) RCX_VALUE_TYPE(fEA)); v.push_back((UByte) RCX_VALUE_DATA(fEA)); if (!(fRestrictor & kSmallOperand)) v.push_back((UByte) (RCX_VALUE_DATA(fEA) >> 8)); b.ReleaseTempEA(fEA); } nqc-3.1.r6/compiler/AsmStmt.h0000600000175000017500000000432610252126244014146 0ustar blpblp /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AsmStmt_h #define __AsmStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #include using std::vector; class Field; class Expr; class Field : public PLinkS, public AutoFree { public: Field(Expr *e) : fExpr(e) {} virtual ~Field(); virtual Field* Clone(Mapping *m) const = 0; virtual void PreEmit(Bytecode &) {}; virtual void Emit(Bytecode &b, vector &v) const = 0; Expr* GetExpr() { return fExpr; } protected: Expr* fExpr; }; class AsmStmt : public LeafStmt { public: ~AsmStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; void Add(Field *f) { fFields.InsertTail(f); } virtual void GetExprs(vector & v) const; private: PListS fFields; }; class ConstField : public Field { public: ConstField(Expr *e) : Field(e) {}; virtual Field* Clone(Mapping *m) const; virtual void Emit(Bytecode &b, vector &v) const; private: }; class EAField : public Field { public: enum { kSmallOperand = 0x1000000, kNoTypeCode = 0x2000000, kNoLocal = 0x4000000, kSourceMask = 0x00ffffff }; EAField(Expr *e, ULong restrictor=0); virtual Field* Clone(Mapping *m) const; virtual void PreEmit(Bytecode &b); virtual void Emit(Bytecode &b, vector &v) const; private: ULong fRestrictor; RCX_Value fEA; }; #endif nqc-3.1.r6/compiler/AssignMathStmt.cpp0000600000175000017500000000432110216066434016016 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "AssignMathStmt.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Expr.h" #include "Error.h" AssignMathStmt::AssignMathStmt(Expr *lval, RCX_VarCode code, Expr * value) : AssignStmt(lval, value), fCode(code) { } void AssignMathStmt::EmitActual(Bytecode &b) { RCX_Value dst = fLval->EmitAny(b); if (RCX_VALUE_TYPE(dst) == kRCX_VariableType) { EmitOperation(b, RCX_VALUE_DATA(dst)); } else if (b.GetTarget()->fHasExtendedMathOps && (fCode != kRCX_IllegalVar)) { // this firmware supports math assignment to generic sources EmitValueOperation(b, dst); } else Error(kErr_NotSupported, "math assignment to non-vars").Raise(&fLval->GetLoc()); b.ReleaseTempEA(dst); } void AssignMathStmt::EmitOperation(Bytecode &b, int var) { RCX_Value ea = fValue->EmitMath(b); if (ea != Expr::kIllegalEA) { RCX_Cmd cmd; cmd.MakeVar(fCode, (UByte)var, ea); b.Add(cmd); b.ReleaseTempEA(ea); } } void AssignMathStmt::EmitValueOperation(Bytecode &b, RCX_Value dst) { RCX_Value ea = fValue->EmitMath(b); if (ea != Expr::kIllegalEA) { RCX_Cmd cmd; cmd.MakeSetMath(dst, ea, fCode); b.Add(cmd); b.ReleaseTempEA(ea); } } Stmt* AssignMathStmt::CloneActual(Mapping *m) const { return new AssignMathStmt(fLval->Clone(m), fCode, fValue->Clone(m)); } nqc-3.1.r6/compiler/AssignMathStmt.h0000600000175000017500000000241710216066430015463 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AssignMathStmt_h #define __AssignMathStmt_h #ifndef __AssignStmt_h #include "AssignStmt.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif class AssignMathStmt : public AssignStmt { public: AssignMathStmt(Expr *lval, RCX_VarCode code, Expr* value); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: void EmitOperation(Bytecode &b, int var); void EmitValueOperation(Bytecode &b, RCX_Value dst); RCX_VarCode fCode; }; #endif nqc-3.1.r6/compiler/AssignStmt.cpp0000600000175000017500000000347210216066424015211 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "AssignStmt.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Expr.h" #include "RCX_Target.h" #include "Error.h" AssignStmt::AssignStmt(Expr *lval, Expr * value) : fLval(lval), fValue(value) { } AssignStmt::~AssignStmt() { delete fLval; delete fValue; } void AssignStmt::EmitActual(Bytecode &b) { RCX_Value dst = fLval->EmitAny(b); int type = RCX_VALUE_TYPE(dst); if (type == kRCX_VariableType) { fValue->EmitTo(b, RCX_VALUE_DATA(dst)); } else { if (b.GetTarget()->SourceWritable(type)) { RCX_Cmd cmd; RCX_Value ea = fValue->EmitAny(b); cmd.MakeSet(dst, ea); b.Add(cmd); b.ReleaseTempEA(ea); } else Error(kErr_LValueNeeded).Raise(&fLval->GetLoc()); } b.ReleaseTempEA(dst); // ea may be an array with temp index } Stmt* AssignStmt::CloneActual(Mapping *m) const { return new AssignStmt(fLval->Clone(m), fValue->Clone(m)); } void AssignStmt::GetExprs(vector &v) const { v.push_back(fLval); v.push_back(fValue); } nqc-3.1.r6/compiler/AssignStmt.h0000600000175000017500000000222510216066420014645 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AssignStmt_h #define __AssignStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif class Expr; class AssignStmt : public LeafStmt { public: AssignStmt(Expr *lval, Expr* value); ~AssignStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const; protected: Expr* fLval; Expr* fValue; }; #endif nqc-3.1.r6/compiler/AtomExpr.cpp0000600000175000017500000000603710216066412014651 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "AtomExpr.h" #include "Variable.h" #include "Mapping.h" #include "Bytecode.h" #include "Program.h" #include "RCX_Target.h" AtomExpr::AtomExpr(RCX_ValueType type, int value, const LexLocation &loc, bool ptr) : Expr(loc), fType(type), fValue(value), fPtr(ptr) { } bool AtomExpr::PromiseConstant() const { if (fType == kRCX_ConstantType) return true; if ((fType == kRCX_VariableType) && (fValue & kVirtualConstantFlag)) return true; return false; } bool AtomExpr::Evaluate(int &value) const { if ((fType != kRCX_ConstantType)/* && !fPtr*/) return false; value = fValue; return true; } bool AtomExpr::Contains(int var) const { return (((fType==kRCX_VariableType) || (fType == kRCX_IndirectType)) && fValue==var); } bool AtomExpr::PotentialLValue() const { // check for const vars if (fType == kRCX_VariableType && fValue & kVirtualReadOnlyFlag) return false; // everything else is a potential LValue...make the // final determination during code generation return true; } int AtomExpr::GetLValue() const { if (fType != kRCX_VariableType) return kIllegalVar; if (fValue & kVirtualReadOnlyFlag) return kIllegalVar; // if (fPtr) return fValue | kPointerFlag; return fValue; } bool AtomExpr::LValueIsPointer() const { return fPtr; } RCX_Value AtomExpr::EmitAny_(Bytecode &) const { return RCX_VALUE(fType, fValue); } void AtomExpr::Translate(int from, int to) { if (((fType == kRCX_VariableType) || (fType == kRCX_IndirectType)) && fValue == from) { fValue = to; } } Expr* AtomExpr::Clone(Mapping *m) const { if (((fType == kRCX_VariableType) || (fType == kRCX_IndirectType)) && m && (fValue & kVirtualVarBase)) { const Expr *e = m->Get(fValue); if (e) { Expr *cloned = e->Clone(0); // I can't decide if substituted vars from inline functions // should bind their location to the expr within the function // or the actual parameter. For actual parameter, do nothing, // for expr within function, set the location of the cloned // expression. cloned->SetLoc(GetLoc()); return cloned; } } return new AtomExpr(fType, fValue, GetLoc(), fPtr); } RCX_Value AtomExpr::GetStaticEA_() const { return RCX_VALUE(fType, fValue); } nqc-3.1.r6/compiler/AtomExpr.h0000600000175000017500000000310010216066406014305 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AtomExpr_h #define __AtomExpr_h #ifndef __Expr_h #include "Expr.h" #endif #ifndef __VarTranslator_h #include "VarTranslator.h" #endif class AtomExpr : public Expr, public Translatable { public: AtomExpr(RCX_ValueType type, int value, const LexLocation &loc, bool ptr = false); virtual bool PromiseConstant() const; virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual bool PotentialLValue() const; virtual int GetLValue() const; virtual bool LValueIsPointer() const; virtual bool Contains(int var) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual RCX_Value GetStaticEA_() const; void Translate(int from, int to); private: RCX_ValueType fType; int fValue; bool fPtr; }; #endif nqc-3.1.r6/compiler/AutoFree.cpp0000600000175000017500000000357010216066402014622 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "AutoFree.h" AutoFreeGroup& GetAutoFreeGroup() { static AutoFreeGroup afGroup; return afGroup; } AutoFreeGroup::AutoFreeGroup() { head_.next_ = &tail_; head_.prev_ = 0; tail_.next_ = 0; tail_.prev_ = &head_; } void* AutoFreeGroup::allocate(size_t n) { // allocate memory plus overhead for link Link *link = (Link *) ::operator new(n + sizeof(Link)); // link memory into pool list link->next_ = head_.next_; link->prev_ = &head_; link->next_->prev_ = link; link->prev_->next_ = link; // return pointer to memory past the link return (void *)((char *)link + sizeof(Link)); } void AutoFreeGroup::free(void *ptr) { if (ptr==0) return; // determine pointer to link Link *link = (Link *)((char *)ptr - sizeof(Link)); dispose(link); } void AutoFreeGroup::dispose(Link *link) { // unlink memory from pool list link->prev_->next_ = link->next_; link->next_->prev_ = link->prev_; // free the memory ::operator delete((void*)link); } void AutoFreeGroup::freeAll() { Link *link; while((link = head_.next_)->next_ != 0) { dispose(link); } } nqc-3.1.r6/compiler/AutoFree.h0000600000175000017500000000316110216066374014273 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __AutoFree_h #define __AutoFree_h #include using std::size_t; class AutoFreeGroup { public: AutoFreeGroup(); // these are called by new/delete operators void* allocate(size_t); void free(void*); // call this to release all remaining objects void freeAll(); private: struct Link { Link* next_; Link* prev_; }; // internal call to unlink and dispose an item void dispose(Link *link); Link head_; Link tail_; }; extern AutoFreeGroup& GetAutoFreeGroup(); class AutoFree { public: void* operator new(size_t n) { return GetAutoFreeGroup().allocate(n); } void operator delete(void* ptr, size_t) { GetAutoFreeGroup().free(ptr); } void* operator new[](size_t n) { return GetAutoFreeGroup().allocate(n); } void operator delete[](void * ptr, size_t) { GetAutoFreeGroup().free(ptr); } }; #endif nqc-3.1.r6/compiler/BinaryExpr.cpp0000600000175000017500000000730110320267446015176 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "BinaryExpr.h" #include "parser.h" #include "Bytecode.h" #include "RCX_Cmd.h" #include "Program.h" static RCX_VarCode GetBinaryCode(int op); static RCX_VarCode GetBinaryCode(int op) { const RCX_Target *t = gProgram->GetTarget(); switch(op) { case '+': return kRCX_AddVar; case '-': return kRCX_SubVar; case '*': return kRCX_MulVar; case '/': return kRCX_DivVar; case '&': return kRCX_AndVar; case '|': return kRCX_OrVar; case '%': if (t->fType == kRCX_SwanTarget) return kRCX_ModVar; else return kRCX_IllegalVar; case LEFT: if (t->fType == kRCX_SwanTarget) return kRCX_ShlVar; else return kRCX_IllegalVar; case RIGHT: if (t->fType == kRCX_SwanTarget) return kRCX_ShrVar; else return kRCX_IllegalVar; case '^': if (t->fType == kRCX_SwanTarget) return kRCX_XOrVar; else return kRCX_IllegalVar; default: return kRCX_IllegalVar; } } BinaryExpr::BinaryExpr(Expr *lhs, int op, Expr *rhs) : NodeExpr(lhs, rhs), fOp(op) { } Expr* BinaryExpr::Clone(Mapping *b) const { return new BinaryExpr(Get(0)->Clone(b), fOp, Get(1)->Clone(b)); } bool BinaryExpr::Evaluate(int &value) const { int v1, v2; if (!Get(0)->Evaluate(v1)) return false; if (!Get(1)->Evaluate(v2)) return false; switch(fOp) { case '+': value = v1 + v2; break; case '-': value = v1 - v2; break; case '*': value = v1 * v2; break; case '/': value = v1 / v2; break; case '&': value = v1 & v2; break; case '|': value = v1 | v2; break; case '%': value = v1 % v2; break; case LEFT: value = v1 << v2; break; case RIGHT: value = v1 >> v2; break; case '^': value = v1 ^ v2; break; default: return false; } return true; } RCX_Value BinaryExpr::EmitAny_(Bytecode &b) const { RCX_Cmd cmd; RCX_Value ea; RCX_Value dstEA; int dst; RCX_VarCode code; ea = Get(0)->EmitAny(b); if (ea == kIllegalEA) return ea; if (b.IsTempEA(ea)) dst = RCX_VALUE_DATA(ea); else { dst = GetTempVar(b); if (dst < 0) return kIllegalEA; b.AddMove(dst, ea); } code = GetBinaryCode(fOp); dstEA = RCX_VALUE(kRCX_VariableType, dst); ea = Get(1)->EmitMath(b); if (ea == kIllegalEA) { b.ReleaseTempEA(dstEA); return ea; } cmd.MakeVar(code, dst, ea); b.Add(cmd); b.ReleaseTempEA(ea); return dstEA; } bool BinaryExpr::EmitTo_(Bytecode &b, int dst) const { if (Get(1)->Contains(dst)) return Expr::EmitTo_(b, dst); else { Get(0)->EmitTo(b, dst); RCX_Cmd cmd; RCX_VarCode code = GetBinaryCode(fOp); RCX_Value ea = Get(1)->EmitMath(b); if (ea == kIllegalEA) return false; cmd.MakeVar(code, dst, ea); b.Add(cmd); b.ReleaseTempEA(ea); return true; } } bool BinaryExpr::NeedsConstant(int op) { return GetBinaryCode(op) == kRCX_IllegalVar; } nqc-3.1.r6/compiler/BinaryExpr.h0000600000175000017500000000226210216071350014633 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __BinaryExpr_h #define __BinaryExpr_h #include "NodeExpr.h" class BinaryExpr : public NodeExpr { public: BinaryExpr(Expr *lhs, int op, Expr *rhs); virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; static bool NeedsConstant(int op); private: int fOp; }; #endif nqc-3.1.r6/compiler/BlockStmt.cpp0000600000175000017500000000304010216071344015003 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "BlockStmt.h" BlockStmt::BlockStmt() { } BlockStmt::~BlockStmt() { Stmt *s; while((s = fList.RemoveHead()) != nil) delete s; } Stmt* BlockStmt::GetChildren() { return fList.GetHead(); } void BlockStmt::Add(Stmt *s) { if (s) { fList.InsertTail(s); Adopt(s); } } void BlockStmt::Prepend(Stmt *s) { if (s) { fList.InsertHead(s); Adopt(s); } } void BlockStmt::EmitActual(Bytecode &b) { for(Stmt *s = fList.GetHead(); s; s=s->GetNext()) { s->Emit(b); } } Stmt* BlockStmt::CloneActual(Mapping *b) const { BlockStmt *block = new BlockStmt; for(Stmt *s = fList.GetHead(); s; s=s->GetNext()) { Stmt *child = s->Clone(b); block->fList.InsertTail(child); block->Adopt(child); } return block; } nqc-3.1.r6/compiler/BlockStmt.h0000600000175000017500000000246010216071340014451 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __BlockStmt_h #define __BlockStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif class BlockStmt : public Stmt { public: BlockStmt(); ~BlockStmt(); virtual Stmt* GetChildren(); void Add(Stmt *s); void Prepend(Stmt *s); const Stmt* GetHead() const { return fList.GetHead(); } Stmt* GetHead() { return fList.GetHead(); } Stmt* RemoveHead() { return fList.RemoveHead(); } virtual void EmitActual(Bytecode &b); virtual Stmt* CloneActual(Mapping *b) const; private: PListS fList; }; #endif nqc-3.1.r6/compiler/Buffer.cpp0000600000175000017500000001216410220015022014303 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include #include "Buffer.h" using std::fopen; using std::memcpy; using std::strlen; #ifdef DEBUG using std::strcpy; #endif #define CR 0x0d #define LF 0x0a #define kDefaultBufferSize 10 Buffer::Buffer() : fName(0), fData(0), fLength(0) { } Buffer::~Buffer() { delete [] fName; delete [] fData; } bool Buffer::Create(const char *name, const char *pathname) { FILE *fp = fopen(pathname, "rb"); if (!fp) return false; Create(name, fp); fclose(fp); return true; } void Buffer::Create(const char *name, FILE *fp) { // figure out length if (fseek(fp,0,SEEK_END)==0) { // if stream supports seeking, then we can determine total size, // allcoate enough storage, and read the entire thing at once fLength = ftell(fp); fseek(fp, 0, SEEK_SET); // allow room for terminating NL int allocate = fLength + 1; fData = new char[allocate]; fread(fData, 1, fLength, fp); } else { // This code is for io streams (such as redirected stdin under MPW) // which don't support seeking. The data from the stream is read into // a dynamically growing array. This is a lot less efficient than // the previous case which knew the total lenght beforehand. int max = kDefaultBufferSize; fData = new char[max]; fLength = 0; int c; while((c=getc(fp)) != EOF) { fData[fLength++] = (char)c; if (fLength == max) { // grow buffer - this needs to be done even on the last // char in the file since a terminating NL will be added // later on max *= 2; char *newBuf = new char[max]; memcpy(newBuf, fData, fLength); delete [] fData; fData = newBuf; } } } FinishCreate(name); } void Buffer::Create(const char *name, const char *data, int length) { // allcoate memory (allow for trailing NL) fData = new char[length + 1]; fLength = length; memcpy(fData, data, length); FinishCreate(name); } void Buffer::FinishCreate(const char *name) { fName = new char[strlen(name) + 1]; strcpy(fName, name); ConvertLineEndings(); // do this after ConvertLineEndings() since mac files might // end with CR and \n is an LF, so CRLF would get reduced if // \n was added before conversion fData[fLength++] = '\n'; } const char *Buffer::GetLine(int line) const { if (line < 1) return 0; const char *ptr = fData; const char *end = fData + fLength; --line; while(line) { if (ptr == end) return 0; if (*ptr++ == '\n') --line; } return ptr; } /* * int Buffer::FindLine(int &offset) const * * return the line number given an offset. Also adjust the offset * to the start of the line. */ int Buffer::FindLine(int &offset) const { const char *ptr = fData; const char *lineStart = fData; int line = 1; // clip the offset to fLength-1 since fData[fLength-1] is implicitly // the last line of the buffer and no line can start after it const char *end = ptr + ((offset < (fLength-1)) ? offset : fLength-1); while(ptr < end) { if (*ptr++ == '\n') { ++line; lineStart = ptr; // ptr is already adjusted past the NL } } offset = lineStart - fData; return line; } /* * int Buffer::FindStartOfLine(int offset) const * * return the offset of the first character in the line containing the * specified offset. */ int Buffer::FindStartOfLine(int offset) const { const char *ptr = fData + offset; while(ptr > fData) { --ptr; if (*ptr == '\n') return (ptr - fData + 1); } return 0; } /* * int Buffer::FindEndOfLine(int offset) const * * return the offset of the newline ending the line containing the * specified offset. */ int Buffer::FindEndOfLine(int offset) const { const char *ptr = fData + offset; const char *end = fData + fLength; while(ptr < end) { if (*ptr == '\n') return ptr - fData; ++ptr; } return fLength - 1; } void Buffer::ConvertLineEndings() { const char *src, *end; char *dst; src = fData; end = src + fLength; dst = fData; while(src < end) { char c = *src++; switch(c) { case CR: *dst++ = '\n'; // skip second part of CR-LF pair if (src < end && *src==LF) src++; break; case LF: *dst++ = '\n'; break; default: *dst++ = c; break; } } fLength = dst - fData; } nqc-3.1.r6/compiler/Buffer.h0000600000175000017500000000275110216071332013764 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef _STDIO_H #include using std::FILE; #endif class Buffer { public: Buffer(); virtual ~Buffer(); bool Create(const char *name, const char *pathname); void Create(const char *name, FILE *fp); void Create(const char *name, const char *data, int length); const char* GetName() const { return fName; } int GetLength() const { return fLength; } const char * GetData() const { return fData; } const char * GetLine(int line) const; int FindLine(int &offset) const; int FindStartOfLine(int offset) const; int FindEndOfLine(int offset) const; protected: void FinishCreate(const char *name); void ConvertLineEndings(); char* fName; char* fData; int fLength; }; nqc-3.1.r6/compiler/build.bat0000600000175000017500000000017310146455320014172 0ustar blpblp@set BISON_SIMPLE=c:\cbuilderx\bin\bison.simple @bison -y -d parse.y @copy y_tab.c parse.cpp @copy y_tab.h parse.tab.h nqc-3.1.r6/compiler/Bytecode.cpp0000600000175000017500000002130210216071326014640 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "Bytecode.h" #include "RCX_Cmd.h" #include "RCX_Target.h" using std::memcpy; using std::memset; Bytecode::Bytecode(VarAllocator &varAllocator, const RCX_Target *target, RCX_Image *image) : fVarAllocator(varAllocator), fTarget(target), fImage(image) { fData.reserve(256); fLabels.reserve(50); for(int i=0; iGetNext()) { if (f->fLocation >= length) { f->fType = kNoFixup; } } } void Bytecode::AddJump(int label) { RCX_Cmd cmd; cmd.MakeJump(0); Add(cmd); AddFixup(kSignBitLongFixup, label, 1, kRCX_SJumpOp); } bool Bytecode::AddFlowJump(FlowCode code) { int label = GetFlowLabel(code); if (label == kIllegalLabel) return false; for(int i=0; ifType = type; f->fLocation = GetLength()-size; f->fLabel = label; f->fOpcodeOffset = opcodeOffset; f->fShortOpcode = shortOpcode; fFixups.InsertHead(f); } void Bytecode::OptimizeFixups() { Fixup *f; int codeLength = GetLength(); // the remap array initially is marked with bytes that // are to be deleted, then later it becomes the map // from old index to new one int *remap = new int[codeLength+1]; memset(remap, 0, (codeLength+1) * sizeof(int)); for(f=fFixups.GetHead(); f; f=f->GetNext()) { if (ShortenFixup(*f)) { // mark byte to be deleted remap[f->fLocation+1] = 1; // change the opcode fData[f->fLocation - f->fOpcodeOffset] = f->fShortOpcode; } } // trim the code and compute the remap array int offset = 0; for(int i=0; iGetNext()) { f->fLocation = remap[f->fLocation]; } // adjust source tags for(i=0; i<(int)fTags.size(); ++i) { fTags[i].fAddress = remap[fTags[i].fAddress]; } delete [] remap; } bool Bytecode::ShortenFixup(Fixup &f) { // cannot shorten if short opcode is 0 if (f.fShortOpcode == 0) return false; int offset = fLabels[f.fLabel] - f.fLocation; switch(f.fType) { case kSimpleLongFixup: if (offset >= 0 && offset <= 255) { f.fType = kSimpleShortFixup; return true; } break; case kSignBitLongFixup: if (offset >= -127 && offset <= 127) { f.fType = kSignBitShortFixup; return true; } break; } return false; } void Bytecode::ApplyFixups() { OptimizeFixups(); Fixup *f; while((f = fFixups.RemoveHead()) != nil) { int offset = fLabels[f->fLabel] - f->fLocation; switch(f->fType) { case kNoFixup: break; case kSimpleLongFixup: case kSimpleShortFixup: fData[f->fLocation] = (UByte)(offset & 0xff); if (f->fType == kSimpleLongFixup) { fData[f->fLocation+1] = (UByte)((offset >> 8) & 0xff); } break; case kSignBitLongFixup: case kSignBitShortFixup: UByte neg = 0; if (offset < 0) { neg = 0x80; offset = -offset; } fData[f->fLocation] = (UByte)(neg | (offset & 0x7f)); if (f->fType == kSignBitLongFixup) { fData[f->fLocation+1] = (UByte)((offset >> 7) & 0xff); } break; } delete f; } } int Bytecode::PushFlow(FlowCode code, bool legal) { int label = legal ? NewLabel() : kIllegalLabel; fFlowContexts[code].push_back(label); return label; } int Bytecode::GetFlowLabel(FlowCode code) { vector &v = fFlowContexts[code]; return v[v.size() - 1]; } /* void Bytecode::PushLoopContext(bool continueAllowed) { fLoopContexts.push_back(LoopContext( continueAllowed ? NewLabel() : kIllegalLabel, NewLabel())); } void Bytecode::PopLoopContext(int continueTarget, int breakTarget) { SetLabel(GetLoopLabel(kContinueLabel), continueTarget); SetLabel(GetLoopLabel(kBreakLabel), breakTarget); fLoopContexts.pop_back(); } int Bytecode::GetLoopLabel(int type) const { return fLoopContexts[GetLoopLevel() - 1].fLabels[type]; } void Bytecode::PushReturnLabel() { fReturnLabels.push_back(NewLabel()); fLoopContexts.push_back(LoopContext(kIllegalLabel, kIllegalLabel)); } void Bytecode::PopReturnLabel() { fReturnLabels.pop_back(); fLoopContexts.pop_back(); } */ bool Bytecode::BeginHandler(int type) { HandlerContext &h = fHandlerContexts[type]; if (h.fInUse) return false; for(int i=0; i(i)); } h.fInUse = true; return true; } void Bytecode::EndHandler(int type) { fHandlerContexts[type].fInUse = false; } int Bytecode::GetTempVar(bool canUseLocals) { return fVarAllocator.Allocate(true, canUseLocals, 1); } void Bytecode::ReleaseTempEA(RCX_Value ea) { if (RCX_VALUE_TYPE(ea) == kRCX_VariableType || ea & kRCX_ValueUsesTemp) { fVarAllocator.ReleaseTemp(RCX_VALUE_DATA(ea)); } } bool Bytecode::IsTempEA(RCX_Value ea) const { if (RCX_VALUE_TYPE(ea) != kRCX_VariableType) return false; int v = RCX_VALUE_DATA(ea); return fVarAllocator.IsTemp(v); } bool Bytecode::IsLocalEA(RCX_Value ea) const { if (RCX_VALUE_TYPE(ea) != kRCX_VariableType) return false; return RCX_VALUE_DATA(ea) >= fTarget->fMaxGlobalVars; } void Bytecode::AddSourceTag(int type, const LexLocation &loc) { if (loc.fIndex == kIllegalSrcIndex) return; int n = fTags.size(); fTags.resize(n+1); RCX_SourceTag &t = fTags[n]; t.fType = type; t.fSrcIndex = loc.fIndex; t.fSrcOffset = loc.fOffset + loc.fLength-1; t.fAddress = GetLength(); } nqc-3.1.r6/compiler/Bytecode.h0000600000175000017500000001031410216071324014304 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Bytecode_h #define __Bytecode_h #ifndef __PListS_h #include "PListS.h" #endif #ifndef __PTypes_h #include "PTypes.h" #endif #ifndef __JumpStmt_h #include "JumpStmt.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __VarAllocator_h #include "VarAllocator.h" #endif #ifndef __RCX_Image_h #include "RCX_Image.h" #endif #ifndef __RCX_SourceTag_h #include "RCX_SourceTag.h" #endif #include using std::vector; class RCX_Cmd; #define kCurrentPosition -1 #define kIllegalLabel -1 class VarPool; class RCX_Target; class Bytecode { public: enum HandlerCode { // codes for Handler contexts kEventHandler = 0, kAcquireHandler, kHandlerCount // not an actual handler - must be the last code }; enum FlowCode { // codes for Flow contexts kContinueFlow = 0, kBreakFlow, kReturnFlow, kFlowCount // not an actual flow - must be the last code }; enum FixupCode { kNoFixup = 0, // used to invalidiate a fixup kSimpleLongFixup, kSimpleShortFixup, kSignBitLongFixup, kSignBitShortFixup }; Bytecode(VarAllocator &varAllocator, const RCX_Target *target, RCX_Image *image); ~Bytecode(); int GetLength() const { return fData.size(); } const UByte* GetData() const { return &fData[0]; } void Add(const RCX_Cmd &cmd); void AddJump(int label); void AddTest(RCX_Value v1, RCX_Relation rel, RCX_Value v2, int label); void AddMove(int dst, RCX_Value ea); void Truncate(int length); bool AddFlowJump(FlowCode code); int NewLabel(); void SetLabel(int label, int target = kCurrentPosition); int GetLabelPosition(int label) const { return fLabels[label]; } void AddFixup(FixupCode code, int label, int opcodeOffset=0, UByte shortOpcode=0); void ApplyFixups(); int PushFlow(FlowCode code, bool legal=true); void PopFlow(FlowCode code) { fFlowContexts[code].pop_back(); } bool BeginHandler(int type); void EndHandler(int type); int GetTempVar(bool canUseLocal); void ReleaseTempEA(RCX_Value ea); bool IsTempEA(RCX_Value ea) const; bool IsLocalEA(RCX_Value ea) const; VarAllocator& GetVarAllocator() { return fVarAllocator; } const RCX_Target* GetTarget() const { return fTarget; } void AddVariableName(int index, const char *name) { fImage->SetVariable(index, name); } // source tags void AddSourceTag(int type, const LexLocation &loc); const RCX_SourceTag* GetSourceTags() const { return &fTags[0]; } int GetSourceTagCount() const { return fTags.size(); } private: class Fixup : public PLinkS { public: FixupCode fType; UShort fLocation; int fLabel; int fOpcodeOffset; int fShortOpcode; }; struct HandlerContext { HandlerContext() : fInUse(false) { } int fFlowLevels[kFlowCount]; bool fInUse; }; int GetFlowLevel(FlowCode code) { return fFlowContexts[code].size(); } int GetFlowLabel(FlowCode code); void Add(const UByte *data, int count); void AddHandlerExit(int i); void OptimizeFixups(); bool ShortenFixup(Fixup &f); vector fData; PListSS fFixups; vector fLabels; vector fFlowContexts[kFlowCount]; HandlerContext fHandlerContexts[kHandlerCount]; VarAllocator& fVarAllocator; const RCX_Target* fTarget; RCX_Image* fImage; // used to hold symbolic information // source info (used for mixed source/code listings vector fTags; }; #endif nqc-3.1.r6/compiler/CallStmt.cpp0000600000175000017500000001555410216071320014633 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "CallStmt.h" #include "Bytecode.h" #include "Program.h" #include "Symbol.h" #include "Fragment.h" #include "GosubStmt.h" #include "GosubParamStmt.h" #include "InlineStmt.h" #include "FunctionDef.h" #include "Mapping.h" #include "AtomExpr.h" #include "DerefExpr.h" #include "DeclareStmt.h" #include "Error.h" #include "BlockStmt.h" #include "ScopeStmt.h" #include "Resource.h" CallStmt::CallStmt() { fName = 0; } CallStmt::~CallStmt() { for(size_t i=0; iGetSub(fName)) { const RCX_Target *t = gProgram->GetTarget(); if (!t->fSubParams) { // sub call if (!fragment->IsTask()) { Error(kErr_NestedSubs).Raise(&fLocation); } else if (fParams.size() != 0) { Error(kErr_ParamCount).Raise(&fLocation); } else { SetBody(new GosubStmt(sub, fLocation)); sub->AssignTaskID(fragment->GetTaskID()); } } else { GosubParamStmt *g = new GosubParamStmt(sub, fLocation); g->AddParams(fParams); SetBody(g); sub->AssignTaskID(fragment->GetTaskID()); } } else if (FunctionDef *func = gProgram->GetFunction(fName)) { if (func->IsExpanded()) { Error(kErr_RecursiveCall, fName->GetKey()).Raise(&fLocation); } else { func->SetExpanded(true); ExpandFunction(func, fragment); func->SetExpanded(false); } } else { Error(kErr_UndefinedFunction, fName->GetKey()).Raise(&fLocation); } } void CallStmt::EmitActual(Bytecode &b) { Stmt *body = GetBody(); if (body) body->Emit(b); } Stmt *CallStmt::CloneActual(Mapping *b) const { CallStmt *c = new CallStmt; c->fName = fName; c->fLocation = fLocation; const Stmt *body = GetBody(); c->SetBody(body ? body->Clone(b) : 0); for(size_t i=0; ifParams.push_back(fParams[i]->Clone(b)); return c; } void CallStmt::ExpandFunction(FunctionDef *func, Fragment *fragment) { size_t argCount = func->GetArgCount(); // check number of parameters if (argCount != fParams.size()) { Error(kErr_ParamCount).Raise(&fLocation); return; } /* statement should look like this: * * CallStmt * | * InlineStmt * | * ScopeStmt * | * BlockStmt * / | \ * DeclareStmt... body of function */ BlockStmt *block = new BlockStmt(); SetBody( new InlineStmt(new ScopeStmt(block), func)); Mapping mapping; for(size_t i=0; iGetArgVar(i); int val; switch(func->GetArgType(i)) { case FunctionDef::kConstantArg: if (!arg->Evaluate(val)) { Error(kErr_ParamType, "constant").Raise(&arg->GetLoc()); return; } mapping.Add(var, new AtomExpr(kRCX_ConstantType, val, fLocation)); break; case FunctionDef::kIntegerArg: val = gProgram->NextVirtualVar(); mapping.Add(var, new AtomExpr(kRCX_VariableType, val, fLocation)); { DeclareStmt *ds = new DeclareStmt(func->GetArgName(i), val, fLocation, 1, false, true); ds->SetInitialValue(arg->Clone(0)); block->Add(ds); } break; case FunctionDef::kReferenceArg: val = arg->GetLValue(); if (val == kIllegalVar) { Error(kErr_ParamType, "variable").Raise(&arg->GetLoc()); return; } mapping.Add(var, new AtomExpr(kRCX_VariableType, val, fLocation)); break; case FunctionDef::kConstRefArg: mapping.Add(var, arg->Clone(0)); break; case FunctionDef::kSensorArg: if (RCX_VALUE_TYPE(arg->GetStaticEA()) != kRCX_InputValueType) { Error(kErr_ParamType, "sensor").Raise(&arg->GetLoc()); return; } mapping.Add(var, arg->Clone(0)); break; case FunctionDef::kPointerArg: if (!arg->LValueIsPointer()) { Error(kErr_ParamType, "pointer").Raise(&arg->GetLoc()); return; } mapping.Add(var, arg->Clone(0)); break; case FunctionDef::kConstPtrArg: if (!arg->LValueIsPointer()) { Error(kErr_ParamType, "pointer").Raise(&arg->GetLoc()); return; } val = gProgram->NextVirtualVar(); { DeclareStmt *ds = new DeclareStmt(func->GetArgName(i), val, fLocation, 1, true, true); ds->SetInitialValue(arg->Clone(0)); block->Add(ds); } mapping.Add(var, new AtomExpr(kRCX_VariableType, val, fLocation, true)); break; default: Error(kErr_ParamType, "???").Raise(&fParams[i]->GetLoc()); return; } } // add body of inline and then expand block->Add(func->GetBody()->Clone(&mapping)); Expander e(fragment); Apply(GetBody(), e); } void CallStmt::GetExprs(vector &v) const { int n = fParams.size(); for(int i=0; i(s)) != 0) { cs->Expand(fFragment); return false; } return true; } nqc-3.1.r6/compiler/CallStmt.h0000600000175000017500000000327110216071314014274 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __CallStmt_h #define __CallStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif #include using std::vector; class Symbol; class Expr; class CallStmt : public ChainStmt { public: CallStmt(); ~CallStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const; void SetName(const Symbol *name) { fName = name; } void SetLocation(const struct LexLocation &loc) { fLocation = loc; } void AddParam(Expr *c) { fParams.push_back(c); } void Expand(Fragment *f); class Expander { public: Expander(Fragment *f) : fFragment(f) {} bool operator()(Stmt *s); private: Fragment* fFragment; }; private: void ExpandFunction(FunctionDef *func, Fragment *fragment); const Symbol* fName; struct LexLocation fLocation; vector fParams; }; #endif nqc-3.1.r6/compiler/CaseStmt.cpp0000600000175000017500000000356210216071312014630 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "CaseStmt.h" #include "Bytecode.h" #include "Error.h" #include "SwitchStmt.h" CaseStmt::CaseStmt(int v, const LexLocation &loc, Stmt *s) : ChainStmt(s), fValue(v), fLocation(loc), fLabel(kIllegalLabel) { } CaseStmt::~CaseStmt() { } void CaseStmt::EmitActual(Bytecode &b) { if (fLabel == kIllegalLabel) { Error(kErr_NoSwitch).Raise(&fLocation); return; } b.SetLabel(fLabel); GetBody()->Emit(b); } void CaseStmt::EmitSwitchCases(Bytecode &b, SwitchState &state) { // check for duplicate case if (state.ContainsCase(fValue)) { Error(kErr_DuplicateCase).Raise(&fLocation); } // add the case state.AddCase(fValue); if (fValue == kDefaultValue) { // don't emit a test - just remember this is the default case fLabel = state.GetDefaultLabel(); } else { // create label for the case and emit the test fLabel = b.NewLabel(); b.AddTest(RCX_VALUE(kRCX_ConstantType, fValue), kRCX_EqualTo, state.GetSelector(), fLabel); } } Stmt* CaseStmt::CloneActual(Mapping *m) const { return new CaseStmt(fValue, fLocation, GetBody()->Clone(m)); } nqc-3.1.r6/compiler/CaseStmt.h0000600000175000017500000000354210216071302014272 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * CaseStmts are used to bind a case label to another statement. The * CaseStmt isn't really a statement itself - just a wrapper for * a single child statement. * * Upon construction CaseStmts are assigned their value and location. * During code generation of a switch statement, actual labels are * assigned to the CaseStmts within the switch. Code generation for * CaseStmt itself only consists of setting the designated label to the * current bytecode locaiton. * */ #ifndef __CaseStmt_h #define __CaseStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class SwitchState; class CaseStmt : public ChainStmt { public: enum { kDefaultValue = 0x10000 // value for 'default:' }; CaseStmt(int v, const LexLocation &loc, Stmt *s = 0); ~CaseStmt(); void SetStmt(Stmt *s) { SetBody(s); } virtual void EmitActual(Bytecode &b); virtual Stmt* CloneActual(Mapping *b) const; void EmitSwitchCases(Bytecode &b, SwitchState &s); private: int fValue; LexLocation fLocation; int fLabel; }; #endif nqc-3.1.r6/compiler/CatchStmt.cpp0000600000175000017500000000365510216071300014777 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "CatchStmt.h" #include "Bytecode.h" #include "Error.h" #include "RCX_Cmd.h" #include "RCX_Target.h" #include "Variable.h" CatchStmt::CatchStmt(int v, Stmt *s, const LexLocation &loc) : ChainStmt(s), fValue(v), fLocation(loc) { } CatchStmt::~CatchStmt() { } void CatchStmt::EmitActual(Bytecode &b) { if ((b.GetTarget()->fType != kRCX_RCX2Target) && (b.GetTarget()->fType != kRCX_SwanTarget)) { Error(kErr_NoTargetPartialCatch, b.GetTarget()->fName).Raise(&fLocation); return; } int var = b.GetTempVar(true); if (var == kIllegalVar) { Error(kErr_NoMoreTemps).Raise(&fLocation); return; } RCX_Value ea = RCX_VALUE(kRCX_VariableType, var); b.ReleaseTempEA(ea); // move active events into temp b.AddMove(var, RCX_VALUE(0x17, 0x0a)); // and with mask RCX_Cmd cmd; cmd.MakeVar(kRCX_AndVar, var, RCX_VALUE(kRCX_ConstantType, fValue)); b.Add(cmd); // jump if zero b.AddTest(RCX_VALUE(kRCX_ConstantType, 0), kRCX_EqualTo, RCX_VALUE(kRCX_VariableType, var), fLabel); GetBody()->Emit(b); } Stmt* CatchStmt::CloneActual(Mapping *m) const { return new CatchStmt(fValue, GetBody()->Clone(m), fLocation); } nqc-3.1.r6/compiler/CatchStmt.h0000600000175000017500000000236510216071274014453 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __CatchStmt_h #define __CatchStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class SwitchState; class CatchStmt : public ChainStmt { public: CatchStmt(int v, Stmt *s, const LexLocation &loc); ~CatchStmt(); virtual void EmitActual(Bytecode &b); virtual Stmt* CloneActual(Mapping *b) const; void SetLabel(int l) { fLabel = l; } private: int fValue; LexLocation fLocation; int fLabel; }; #endif nqc-3.1.r6/compiler/Compiler.cpp0000600000175000017500000000774010216071256014670 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "Compiler.h" #include "PreProc.h" #include "Symbol.h" #include "Program.h" #include "Buffer.h" #include "Macro.h" #include "rcx1_nqh.h" #include "rcx2_nqh.h" #include "Error.h" #include "RCX_Image.h" #include "RCX_Target.h" #include "version.h" using std::sprintf; //#define NO_AUTO_FREE Compiler* Compiler::sCompiler = 0; void Compiler::Reset() { // this function resets the state of the compiler, freeing // up any memory used by it. Beware, any references to // program fragments, statements, conditions, or symbols // will become invalid after this LexReset(); delete gPreProc; delete gProgram; gProgram = 0; Symbol::GetSymbolTable()->DeleteAll(); #ifndef NO_AUTO_FREE GetAutoFreeGroup().freeAll(); #endif gPreProc = new PreProc(); ReleaseBuffers(); fDirty = false; } int Compiler::AddBuffer(Buffer *b) { int index = fBuffers.size(); fBuffers.push_back(b); return index; } RCX_Image *Compiler::Compile(Buffer *b, const RCX_Target *target, int flags) { // reset compiler if needed if (fDirty) { Reset(); } fDirty = true; gProgram = new Program(target); // define compiler target and compat mode Define(target->fDefine, target->fDefValue); if (flags & kCompat_Flag) Define("__NQC1"); // define NQC version number char versionCode[5]; sprintf(versionCode, "%d", MAJOR_VERSION * 100 + MINOR_VERSION); Define("__NQC__", versionCode); LexPush(b); // system file if ((flags & kNoSysFile_Flag) == 0) { LexPush(CreateApiBuffer(flags & kCompat_Flag)); } ErrorHandler::Get()->Reset(); yyparse(); RCX_Image *image = 0; if (ErrorHandler::Get()->GetErrorCount() == 0) { image = gProgram->CreateImage(); if (ErrorHandler::Get()->GetErrorCount()) { delete image; image = 0; } } return image; } Buffer *Compiler::CreateApiBuffer(bool compatMode) { Buffer *b = new Buffer(); if (compatMode) b->Create("rcx.nqh", rcx1_nqh, sizeof(rcx1_nqh)); else b->Create("rcx.nqh", rcx2_nqh, sizeof(rcx2_nqh)); return b; } void Compiler::Define(const char *name, const char *value) { Symbol *s = Symbol::Get(name); Macro *m; if (value) { vector tokens; Buffer *buf; int t; TokenVal v; int count = 0; buf = new Buffer(); buf->Create("", value, (int)strlen(value)); LexPush(buf); while((t=yylex(v)) != 0) { tokens.resize(count+1); tokens[count].fType = t; tokens[count].fValue = v; count++; } m = new Macro(&tokens[0], tokens.size(), Macro::kNoArgs); } else m = new Macro(0, 0, Macro::kNoArgs); s->Define(m); } void Compiler::Undefine(const char *name) { Symbol::Get(name)->Undefine(); } void Compiler::ReleaseBuffers() { for(size_t i=0; i= (short)fBuffers.size()) return end; const Buffer *b = fBuffers[index]; start = b->FindStartOfLine(start); end = b->FindEndOfLine(end); dst->Print(b->GetData() + start, end - start + 1); return end; } nqc-3.1.r6/compiler/Compiler.h0000600000175000017500000000363310216071236014330 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Compiler_h #define __Compiler_h #include #include "RCX_Constants.h" #include "RCX_Target.h" #include "RCX_Disasm.h" using std::vector; class RCX_Image; class Buffer; class Compiler : public RCX_SourceFiles { public: enum { kCompat_Flag = 1 << 0, kNoSysFile_Flag = 1 << 2 }; Compiler() { sCompiler = this; fDirty = false; } virtual ~Compiler() {} static Compiler* Get() { return sCompiler; } void Reset(); RCX_Image * Compile(Buffer *buffer, const RCX_Target *target, int flags); void Define(const char *name, const char *value=0); void Undefine(const char *name); // hooks for the lexer int AddBuffer(Buffer *b); Buffer* GetBuffer(int i) { return fBuffers[i]; } virtual Buffer *CreateBuffer(const char *name) = 0; // access to system API buffer static Buffer* CreateApiBuffer(bool compatMode); // used to insert source code into assembly listings (from RCX_SourceFiles) virtual long Print(RCX_Printer *printer, short index, long start, long end); private: void ReleaseBuffers(); vector fBuffers; bool fDirty; static Compiler* sCompiler; }; #endif nqc-3.1.r6/compiler/Conditional.cpp0000600000175000017500000000417010216071232015345 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Conditional.h" Conditional::Conditional() { Level *l = new Level; l->fState = Level::kActive; l->fElseAllowed = false; l->fTopLevel = true; fLevels.InsertHead(l); } Conditional::~Conditional() { Level *l; while((l = fLevels.RemoveHead()) != nil) delete l; } bool Conditional::Elif(bool b) { Level *l = GetLevel(); if (!l->fElseAllowed) return false; if (l->fState == Level::kPending) { l->fState = (b ? Level::kActive : Level::kPending); } else l->fState = Level::kInactive; return true; } void Conditional::If(bool b) { Level *l = new Level; Level::State state; if (IsActive()) { if (b) state = Level::kActive; else state = Level::kPending; } else state = Level::kInactive; l->fState = state; l->fElseAllowed = true; l->fTopLevel = false; fLevels.InsertHead(l); } bool Conditional::Else() { Level *l = GetLevel(); if (!l->fElseAllowed) return false; l->fElseAllowed = false; switch(l->fState) { case Level::kActive: l->fState = Level::kInactive; break; case Level::kPending: l->fState = Level::kActive; break; default: // no change for inactive level break; } return true; } bool Conditional::Endif() { Level *l; if (IsTopLevel()) return false; l = fLevels.RemoveHead(); delete l; return true; } nqc-3.1.r6/compiler/Conditional.h0000600000175000017500000000300210216071230015001 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Conditional_h #define __Conditional_h #ifndef __PListS_h #include "PListS.h" #endif class Conditional { public: Conditional(); ~Conditional(); bool IsActive() { return (GetLevel()->fState == Level::kActive) ? true : false; } bool IsTopLevel() { return GetLevel()->fTopLevel; } void If(bool b); bool Elif(bool b); bool Else(); bool Endif(); private: class Level : public PLinkS { public: // states for a level enum State { kInactive, kActive, kPending }; State fState; // see above bool fElseAllowed; // true until else is done bool fTopLevel; // only true for the top level }; Level* GetLevel() { return fLevels.GetHead(); } PListSS fLevels; }; #endif nqc-3.1.r6/compiler/CondParser.cpp0000600000175000017500000001262510216071224015147 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include #include "CondParser.h" #include "Symbol.h" #include "PreProc.h" #include "Error.h" using std::memcpy; static int Precedence(int t); static long BinOp(long x, int op, long y); #define kDefaultDepth 2 CondParser::CondParser() { fMaxDepth = kDefaultDepth; fStack = new long[kDefaultDepth]; fDefinedSymbol = nil; } CondParser::~CondParser() { delete [] fStack; } bool CondParser::Parse(long &value) { int t; TokenVal v; Init(); value = 0; // default value in case of error while((t=gPreProc->GetReplacedToken(v)) != 0) { bool ok; if (t==NL) break; if (fState == kValueState) ok = DoValueState(t, v); else ok = DoOpState(t); if (!ok) { Error(kErr_CondExpression).RaiseLex(); return false; } } if (fState == kValueState) { Error(kErr_UnexpectedEOL).RaiseLex(); return false; } if (fParen != 0) { Error(kErr_UnbalancedParens).RaiseLex(); return false; } Reduce(); value = fStack[0]; return true; } void CondParser::Init() { fState = kValueState; fUnaryCount = 0; fDepth = 0; fParen = 0; if (!fDefinedSymbol) fDefinedSymbol = Symbol::Get("defined"); } bool CondParser::DoValueState(int t, TokenVal v) { long x; // only valid tokens are unary operations, '(', ID, and NUMBER switch(t) { case ID: if (v.fSymbol == fDefinedSymbol) { if (!ParseDefined(x)) return false; } else x = 0; ReduceUnaries(x); fState = kOpState; break; case NUMBER: ReduceUnaries(v.fInt); fState = kOpState; break; case '-': case '!': case '~': Push(t); fUnaryCount++; break; case '(': // push paren state Push(fParen); Push(fUnaryCount); fParen = fDepth; fUnaryCount = 0; break; default: return false; } return true; } bool CondParser::DoOpState(int t) { int prec; if (t == ')') { // pop paren state long x; Reduce(); x = Pop(); fUnaryCount = Pop(); fParen = Pop(); ReduceUnaries(x); } else { prec = Precedence(t); if (!prec) return false; Reduce(prec); Push(t); fState = kValueState; } return true; } bool CondParser::ParseDefined(long &value) { int t; TokenVal v; t = gPreProc->GetReplacedToken(v); if (t != '(') return false; t = gPreProc->GetRawToken(v); if (t != ID) return false; value = v.fSymbol->IsDefined(); t = gPreProc->GetReplacedToken(v); if (t != ')') return false; return true; } void CondParser::Reduce(int limit) { int prec; int i; long x, y; int op; y = Pop(); // reduce any ops with precedence >= limit for(i=fDepth-1; i>fParen; i-=2) { op = fStack[i]; prec = Precedence(op); if (prec < limit) break; x = fStack[i-1]; Drop(2); y = BinOp(x, op, y); } Push(y); } void CondParser::ReduceUnaries(long x) { long op; while(fUnaryCount) { op = Pop(); switch(op) { case '-': x = -x; break; case '!': x = (x ? 0 : 1); break; case '~': x = ~x; break; } fUnaryCount--; } Push(x); } void CondParser::Push(long x) { if (fDepth == fMaxDepth) { // grow stack int newDepth = fMaxDepth * 2; long* newStack = new long[newDepth]; memcpy(newStack, fStack, sizeof(long) * fMaxDepth); delete [] fStack; fStack = newStack; fMaxDepth = newDepth; } fStack[fDepth++] = x; } long BinOp(long x, int op, long y) { //printf("RED: %d %c %d\n", x, op, y); switch(op) { case '*': return x * y; case '/': return x / y; case '%': return x % y; case '+': return x + y; case '-': return x - y; case LEFT: return x << y; case RIGHT: return x >> y; case '>': return x > y; case '<': return x < y; case REL_GE: return x >= y; case REL_LE: return x <= y; case REL_EQ: return x == y; case REL_NE: return x != y; case '&': return x & y; case '^': return x ^ y; case '|': return x | y; case AND: return x && y; case OR: return x || y; } // should never get here return 0; } int Precedence(int t) { switch(t) { case '*': case '/': case '%': return 10; case '+': case '-': return 9; case LEFT: case RIGHT: return 8; case '>': case '<': case REL_GE: case REL_LE: return 7; case REL_EQ: case REL_NE: return 6; case '&': return 5; case '^': return 4; case '|': return 3; case AND: return 2; case OR: return 1; default: return 0; } } nqc-3.1.r6/compiler/CondParser.h0000600000175000017500000000274410216071222014613 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __CondParser_h #define __CondParser_h #ifndef __Token_h #include "Token.h" #endif #ifndef __PTypes_h #include "PTypes.h" #endif class Symbol; class CondParser { public: CondParser(); ~CondParser(); bool Parse(long &value); private: enum State { kValueState, kOpState }; void Init(); bool DoValueState(int t, TokenVal v); bool DoOpState(int t); bool ParseDefined(long &value); void ReduceUnaries(long x); void Reduce(int limit=0); void Push(long x); long Pop() { return fStack[--fDepth]; } void Drop(int n) { fDepth -= n; } State fState; int fUnaryCount; int fParen; int fDepth; int fMaxDepth; long* fStack; Symbol* fDefinedSymbol; }; #endif nqc-3.1.r6/compiler/DeclareStmt.cpp0000600000175000017500000000456010216071216015316 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "DeclareStmt.h" #include "AssignStmt.h" #include "ScopeStmt.h" #include "Variable.h" #include "Bytecode.h" #include "Error.h" #include "AtomExpr.h" #include "Symbol.h" DeclareStmt::DeclareStmt(const Symbol *name, int var, const struct LexLocation &loc, int count, bool ptr, bool stack) : ChainStmt(), fName(name), fVar(var), fScope(0), fLoc(loc), fCount(count), fPtr(ptr), fStack(stack) { } DeclareStmt::~DeclareStmt() { } void DeclareStmt::SetInitialValue(Expr *e) { SetBody(new AssignStmt(new AtomExpr(kRCX_VariableType, fVar, e->GetLoc()), e)); } void DeclareStmt::EmitActual(Bytecode &b) { if (fVar & kVirtualVarBase && fScope) { int physical = b.GetVarAllocator().Allocate(false, true, fCount); if (physical == kIllegalVar) { Error(kErr_NoMoreVars).Raise(&fLoc); } fScope->RemapVar(fVar, physical, fCount); // add symbolic information if (fName) b.AddVariableName(physical, fName->GetKey()); } Stmt *body = GetBody(); if (body) body->Emit(b); } Stmt* DeclareStmt::CloneActual(Mapping *b) const { DeclareStmt *s = new DeclareStmt(fName, fVar, fLoc, fCount, fPtr, fStack); if (GetBody()) s->SetBody(GetBody()->Clone(b)); return s; } bool DeclareStmt::Binder::operator()(Stmt *s) { if (ScopeStmt *ss = dynamic_cast(s)) { // recurse into scopes with new Binder, then return false Binder b(ss); Apply(ss->GetBody(),b); return false; } // bind declarations to scopes if (DeclareStmt *ds = dynamic_cast(s)) { ds->fScope = fScope; } return true; } nqc-3.1.r6/compiler/DeclareStmt.h0000600000175000017500000000403710216071212014756 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __DeclareStmt_h #define __DeclareStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __LexLocation_h #include "LexLocation.h" #endif class Symbol; class Expr; class ScopeStmt; class DeclareStmt : public ChainStmt { public: DeclareStmt(const Symbol *name, int var, const struct LexLocation &loc, int count, bool ptr, bool stack); ~DeclareStmt(); void SetInitialValue(Expr *e); int GetVar() const { return fVar; } const LexLocation& GetLoc() const { return fLoc; } int GetCount() const { return fCount; } const Symbol* GetName() const { return fName; } bool GetPointer() const { return fPtr; } bool GetStack() const { return fStack; } void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; // Binder is a function object that binds declarations to a scope class Binder { public: Binder(ScopeStmt *scope) : fScope(scope) {} bool operator()(Stmt *s); private: ScopeStmt* fScope; }; friend class Binder; private: const Symbol* fName; int fVar; ScopeStmt* fScope; struct LexLocation fLoc; int fCount; bool fPtr; bool fStack; }; #endif nqc-3.1.r6/compiler/DerefExpr.cpp0000600000175000017500000000600310216071210014757 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2004 John Hansen. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "DerefExpr.h" #include "Variable.h" #include "Mapping.h" #include "Bytecode.h" #include "Program.h" #include "RCX_Target.h" #include "Error.h" DerefExpr::DerefExpr(int value, const LexLocation &loc) : Expr(loc), fValue(value) { } bool DerefExpr::PromiseConstant() const { if (fValue & kVirtualConstantFlag) return true; return false; } bool DerefExpr::Evaluate(int &) const { return false; } bool DerefExpr::Contains(int var) const { return (fValue==var); } bool DerefExpr::PotentialLValue() const { return true; } int DerefExpr::GetLValue() const { const RCX_Target *t = gProgram->GetTarget(); if (t->fHasExtendedMathOps) { return fValue; } else return kIllegalVar; } RCX_Value DerefExpr::EmitAny_(Bytecode &) const { return RCX_VALUE(kRCX_IndirectType, fValue); } void DerefExpr::Translate(int from, int to) { if (fValue == from) fValue = to; } Expr* DerefExpr::Clone(Mapping *m) const { if (m && (fValue & kVirtualVarBase)) { const Expr *e = m->Get(fValue); if (e) { // a deref expression always needs to return a deref expr clone // regardless of the type of expression in the Mapping // the expression in the map is used only to pass us the variable number int val; if (!e->Evaluate(val)) { val = e->GetLValue(); if ((val == kIllegalVar) /* || !(val & kPointerFlag) */) { Error(kErr_ParamType, "pointer").Raise(&e->GetLoc()); return e->Clone(0); } } // return new DerefExpr(((val & kPointerFlag) ? val - kPointerFlag : val), GetLoc()); return new DerefExpr(val, GetLoc()); } } return new DerefExpr(fValue, GetLoc()); } RCX_Value DerefExpr::GetStaticEA_() const { return RCX_VALUE(kRCX_IndirectType, fValue); } nqc-3.1.r6/compiler/DerefExpr.h0000600000175000017500000000300310216071204014424 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2004 John Hansen. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __DerefExpr_h #define __DerefExpr_h #ifndef __Expr_h #include "Expr.h" #endif #ifndef __VarTranslator_h #include "VarTranslator.h" #endif class DerefExpr : public Expr, public Translatable { public: DerefExpr(int value, const LexLocation &loc); virtual bool PromiseConstant() const; virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual bool PotentialLValue() const; virtual int GetLValue() const; virtual bool Contains(int var) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual RCX_Value GetStaticEA_() const; void Translate(int from, int to); private: int fValue; }; #endif nqc-3.1.r6/compiler/DoStmt.cpp0000600000175000017500000000275010216071174014323 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "DoStmt.h" #include "Bytecode.h" #include "JumpStmt.h" DoStmt::DoStmt(Expr *c, Stmt *s) : ChainStmt(s) { fCondition = c; } DoStmt::~DoStmt() { delete fCondition; } void DoStmt::EmitActual(Bytecode &b) { /* sLabel: fBody cLabel: test -> sLabel bLabel: */ int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); int sLabel = b.NewLabel(); GetBody()->Emit(b); b.SetLabel(cLabel); fCondition->EmitBranch(b, sLabel, true); b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } Stmt* DoStmt::CloneActual(Mapping *b) const { return new DoStmt(fCondition->Clone(b), GetBody()->Clone(b)); } nqc-3.1.r6/compiler/DoStmt.h0000600000175000017500000000224410216071170013762 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __DoStmt_h #define __DoStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __Expr_h #include "Expr.h" #endif class DoStmt : public ChainStmt { public: DoStmt(Expr *c, Stmt *s); ~DoStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const { v.push_back(fCondition); } private: Expr* fCondition; }; #endif nqc-3.1.r6/compiler/Error.cpp0000600000175000017500000001027110216071164014176 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "parser.h" #include "Buffer.h" #include "Error.h" #include "LexLocation.h" using std::sprintf; static const char *sErrorText[] = { // errors "internal error", "%s", "unterminated #if/#ifdef/#ifndef", "%s without preceeding #if/#ifdef/#ifndef", "illegal preprocessor directive", "#include requires a filename", "could not open file %s", "%s required a symbol name", "redefinition of \'%s\'", "illegal define arguments", "circular definition in \'%s\'", "wrong number of arguments to \'%s\'", "syntax error in expression", "unexpected end of line", "unbalanced parentheses", "unterminated comment", "\'%s\' cannot be redeclared", "variable declarations not allowed in subs", "could not allocate storage for variable", "\'%s\' has not been declared", "constant expression required", "expression is not a legal target for assignment", "undefined task \'%s\'", "maximum of %d subroutines exceeded", "maximum of %d tasks exceeded", "initialization function \'%s\' is not defined", "task \'main\' not defined", "\'continue\' is only valid within a loop", "case/default only valid in a switch", "\'break\' is only valid in a switch or loop", "Expression is not a valid argument type", "Ran out of temporary variables", "nested subroutine calls are not allowed", "wrong number of parameters", "undefined function \'%s\'", "argument must be a %s", "undefined variable \'%s\'", "case value must be between -32768 and 32767", "duplicate case or default label in switch", "recursive function call: \'%s\'", "number out of range", "%s does not support resource acquisition", "%s does not support event monitoring", "%s does not support arrays", "%s does not support partial catch", "%s does not support indirect variables", "%s does not support subroutine parameters", "illegal event source", "nested resource acquisition is not allowed", "nested event monitoring is not allowed", "could not reserve variables", "%s is not a pointer", "%s is an array", "%s is not an array", "sub called by multiple tasks - __taskid cannot be determined", "preprocessor #error directive", "undefined label \'%s\'", "label \'%s\' redefined", "illegal resource type", "maximum of %d resources of this type exceeded", "cannot take the address of an array with a non-constant index", // catch-all for things in progress "%s is not yet supported", // warnings "Unknown Warning", "illegal #pragma", "preprocessor #warning directive", }; ErrorHandler* ErrorHandler::sErrorHandler = 0; void Error::RaiseLex() const { LexLocation loc; LexCurrentLocation(loc); Raise(&loc); } void Error::Raise(const LexLocation *loc) const { ErrorHandler* eh = ErrorHandler::Get(); if (eh) eh->Raise(*this, loc); } bool Error::IsWarning() const { return fCode >= kWarn_Base; } void Error::SPrint(char *str) const { if (fCode < 0 || fCode >= (ErrorCode)(sizeof(sErrorText) / sizeof(const char *))) sprintf(str, "internal error #%d", fCode); else sprintf(str, sErrorText[fCode], fData); } void ErrorHandler::Reset() { fErrorCount = 0; fWarningCount = 0; ClearErrors(); } void ErrorHandler::Raise(const Error &e, const LexLocation *loc) { if (e.IsWarning()) fWarningCount++; else fErrorCount++; AddError(e, loc); } void ErrorHandler::ClearErrors() { } nqc-3.1.r6/compiler/Error.h0000600000175000017500000000656010633240416013652 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Error_h #define __Error_h #include enum ErrorCode { kErr_None = 0, kErr_Parser, kErr_UnterminatedIfdef, kErr_UnexpectedElse, kErr_UnknownDirective, kErr_IncludeNeedsName, kErr_FileOpen, kErr_SymbolNameNeeded, kErr_DefineRedef, kErr_DefineArgs, kErr_CircularDef, kErr_WrongArgCount, kErr_CondExpression, kErr_UnexpectedEOL, kErr_UnbalancedParens, kErr_UnterminatedComment, kErr_SymRedef, kErr_NoVarDecl, kErr_NoMoreVars, kErr_Undeclared, kErr_ConstantNeeded, kErr_LValueNeeded, kErr_UndefinedTask, kErr_TooManySubs, kErr_TooManyTasks, kErr_UnknownInit, kErr_UndefinedMain, kErr_NoContinueContext, kErr_NoSwitch, kErr_NoBreakContext, kErr_BadExpression, kErr_NoMoreTemps, kErr_NestedSubs, kErr_ParamCount, kErr_UndefinedFunction, kErr_ParamType, kErr_UndefinedVar, kErr_CaseRange, kErr_DuplicateCase, kErr_RecursiveCall, kErr_NumberRange, kErr_NoTargetResources, kErr_NoTargetEvents, kErr_NoTargetArrays, kErr_NoTargetPartialCatch, kErr_NoTargetIndirect, kErr_NoTargetSubParams, kErr_BadEventSource, kErr_NoNestedResources, kErr_NoNestedEvents, kErr_CouldNotReserveVars, kErr_VarIsNotPointer, kErr_VarIsArray, kErr_VarIsNotArray, kErr_TaskIdUnknown, kErr_ErrorDirective, kErr_UndefinedLabel, kErr_RedefinedLabel, kErr_BadResourceType, kErr_TooManyResources, kErr_AddrOfNonConstantIndex, // catch-all for things in progress kErr_NotSupported, // warnings kWarn_Base, kWarn_IllegalPragma, kWarn_WarningDirective, kErr_Last }; class ErrorHandler; struct LexLocation; class Error { public: enum { kMaxErrorMsg = 256 }; Error(ErrorCode code, intptr_t data=0) : fCode(code), fData(data) {} Error(ErrorCode code, const char *s) : fCode(code), fData((intptr_t)s) {} // raising errors void Raise(const LexLocation *loc) const; // raise error at specified location void RaiseLex() const; // raise error at current lex location // useful for error handlers ErrorCode GetCode() const { return fCode; } intptr_t GetData() const { return fData; } bool IsWarning() const; void SPrint(char *str) const; private: ErrorCode fCode; intptr_t fData; }; class ErrorHandler { public: void Raise(const Error&e, const LexLocation *loc); void Reset(); int GetErrorCount() { return fErrorCount; } int GetWarningCount() { return fWarningCount; } virtual void ClearErrors(); virtual void AddError(const Error &e, const LexLocation *loc) = 0; static ErrorHandler* Get() { return sErrorHandler; } protected: ErrorHandler() { sErrorHandler = this; } private: int fErrorCount; int fWarningCount; static ErrorHandler* sErrorHandler; }; #endif nqc-3.1.r6/compiler/EventSrcExpr.cpp0000600000175000017500000000533510216071132015475 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "EventSrcExpr.h" #include "Bytecode.h" #include "Error.h" static int ConvertRcx2Source(int type, int data); static int ConvertSpyboticsSource(int type, int data); Expr* EventSrcExpr::Clone(Mapping *b) const { return new EventSrcExpr(Get(0)->Clone(b), fTargetType); } RCX_Value EventSrcExpr::EmitAny_(Bytecode &) const { // this function only gets called after Evaluate() has failed, // so we can just return an error without trying to Evaluate return kIllegalEA; } bool EventSrcExpr::Evaluate(int &v) const { RCX_Value ea; ea = Get(0)->GetStaticEA(); v = -1; if (ea != kIllegalEA) { int data = RCX_VALUE_DATA(ea); int type = RCX_VALUE_TYPE(ea); switch(fTargetType) { case kRCX_RCX2Target: case kRCX_SwanTarget: v = ConvertRcx2Source(type, data); break; case kRCX_SpyboticsTarget: v = ConvertSpyboticsSource(type, data); break; default: v = -1; break; } } if (v==-1) { Error(kErr_BadEventSource).Raise(&GetLoc()); } return true; } int ConvertRcx2Source(int type, int data) { switch(type) { case kRCX_InputValueType: if (data >= 0 && data <=2) return data; break; case kRCX_TimerType: if (data >=0 && data <= 3) return 3 + data; break; case kRCX_MessageType: if (data == 0) return 7; break; case kRCX_CounterType: if (data >=0 && data <= 2) return 8 + data; break; default: // don't do anything...just prevent warnings break; } return -1; } int ConvertSpyboticsSource(int type, int data) { switch(type) { case kRCX_InputValueType: if (data >= 0 && data <=1) return data; break; case kRCX_TimerType: if (data >=0 && data <= 3) return 2 + data; break; case kRCX_CounterType: if (data >=0 && data <= 2) return 6 + data; break; case kRCX_MessageType: if (data == 0) return 9; break; } return -1; } nqc-3.1.r6/compiler/EventSrcExpr.h0000600000175000017500000000273610216071126015147 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* This class is only partially implemented. Specifically, evaluation always * fails even though in theory the value will be constant. In order to fix this * some other virtual such as Expr::GetEA() would need to be added. */ #ifndef __EventSrcExpr_h #define __EventSrcExpr_h #include "NodeExpr.h" #include "RCX_Target.h" class EventSrcExpr : public NodeExpr { public: EventSrcExpr(Expr *e, RCX_TargetType targetType) : NodeExpr(e), fTargetType(targetType) {} virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool PromiseConstant() const { return true; } virtual bool Evaluate(int &) const; private: RCX_TargetType fTargetType; }; #endif nqc-3.1.r6/compiler/Expansion.cpp0000600000175000017500000000374210216071124015052 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include "Expansion.h" #include "Macro.h" #include "parser.h" #include "Symbol.h" using std::memcpy; Expansion::Expansion(Macro *def) { fDef = def; fDef->SetMark(); fTokens = def->GetTokens(); fEnd = fTokens + def->GetTokenCount(); fArgCount = def->GetArgCount(); if (fArgCount > 0) { fArgs = new Token*[fArgCount]; fArgLengths = new int[fArgCount]; for(int i=0; ifArgs[i]; fEnd = fTokens + e->fArgLengths[i]; fArgCount = 0; fArgs = nil; fArgLengths = nil; } Expansion::~Expansion() { if (fDef) fDef->ClearMark(); if (fArgs) { for(int i=0; ifType; v = fTokens->fValue; fTokens++; return t; } void Expansion::SetArg(int i, const Token *t, int count) { Token *tokens = new Token[count]; memcpy(tokens, t, count * sizeof(Token)); fArgs[i] = tokens; fArgLengths[i] = count; } nqc-3.1.r6/compiler/Expansion.h0000600000175000017500000000257110216071120014512 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Expansion_h #define __Expansion_h #ifndef __Token_h #include "Token.h" #endif #ifndef __PListS_h #include "PListS.h" #endif class Macro; class Expansion : public PLinkS { public: Expansion(Macro *def); Expansion(const Expansion *e, int i); ~Expansion(); int NextToken(TokenVal &v); bool IsDone() const { return fTokens==fEnd; } int GetArgCount() const { return fArgCount; } void SetArg(int i, const Token *t, int count); private: Macro* fDef; const Token* fTokens; const Token* fEnd; int fArgCount; Token** fArgs; int* fArgLengths; }; #endif nqc-3.1.r6/compiler/Expr.cpp0000600000175000017500000001362710216071116014030 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Expr.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Error.h" #include "RCX_Target.h" #define MAX_INT 65535 #define MIN_INT -32768 // suitable sources for math operations (if target has constrained math) #define MATH_MASK (TYPEMASK(kRCX_VariableType) + \ TYPEMASK(kRCX_ConstantType)) static bool IsTypeInMask(long mask, RCX_ValueType type); Expr::~Expr() { } RCX_Value Expr::EmitAny(Bytecode &b) const { int v; if (Evaluate(v)) { if (v < MIN_INT || v > MAX_INT) Error(kErr_NumberRange).Raise(&fLoc); return RCX_VALUE(kRCX_ConstantType, v); } else return EmitAny_(b); } bool Expr::EmitTo(Bytecode &b, int dst) const { int v; if (Evaluate(v)) { b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, v)); return true; } else return EmitTo_(b, dst); } RCX_Value Expr::EmitConstrained(Bytecode &b, long mask, bool canUseLocals) const { /* * There's one case that still isn't optimized...if locals cannot be used, * but EmitAny() wants a temp (such as for a math operation), then it is * possible for a local temp to be allocated, which just forces a move to * a global temp later on. It would be better if EmitAny() could be told * not to use locals, but this could involve a lot of tweaking. A possible * hack is to put the VarAllocator into kGlobal mode prior to an AsmField * calling EmitConstrained, then restoring the mode later on. */ RCX_Value ea = EmitAny(b); if (ea == kIllegalEA) return ea; RCX_ValueType type = RCX_VALUE_TYPE(ea); // check ea was allowed if (IsTypeInMask(mask, type) && (canUseLocals || !b.IsLocalEA(ea))) { return ea; } // must move to another ea // if registers are not valid, then return illegal EA if (!IsTypeInMask(mask, kRCX_VariableType)) { Error(kErr_BadExpression).Raise(&GetLoc()); return kIllegalEA; } // move into temp register int dst = GetTempVar(b, canUseLocals); if (dst == kIllegalVar) return kIllegalEA; b.AddMove(dst, ea); // when using arrays, there's a special case when the ea is // temp but not a variable. Another case arises if the original // emit was to a temp local, but they aren't allowed. // call ReleaseTempEA just in case b.ReleaseTempEA(ea); ea = RCX_VALUE(kRCX_VariableType, dst); return ea; } bool IsTypeInMask(long mask, RCX_ValueType type) { // special case, when mask==0 all types are allowed if (!mask) return true; return (1L << type) & mask; } RCX_Value Expr::EmitMath(Bytecode &b) const { // emit expression to an ea that is suitable for math operations if (b.GetTarget()->fRestrictedMath) return EmitConstrained(b, MATH_MASK); else return EmitAny(b); } bool Expr::EmitSide(Bytecode &b) const { return EmitSide_(b); } bool Expr::EmitBranch(Bytecode &b, int label, bool condition) const { int v; if (Evaluate(v)) { if ((v && condition) || (!v && !condition)) { b.AddJump(label); } return true; } return EmitBranch_(b, label, condition); } RCX_Value Expr::GetStaticEA() const { int v; if (Evaluate(v)) { return RCX_VALUE(kRCX_ConstantType, v); } return GetStaticEA_(); } RCX_Value Expr::GetStaticEA_() const { return kIllegalEA; } bool Expr::EmitTo_(Bytecode &b, int dst) const { RCX_Value ea = EmitAny_(b); if (ea == kIllegalEA) return false; b.AddMove(dst, ea); b.ReleaseTempEA(ea); return true; } bool Expr::EmitSide_(Bytecode &b) const { vector v; GetExprs(v); for(int i=0; i<(int)v.size(); ++i) if (!v[i]->EmitSide(b)) return false; return true; } bool Expr::EmitBranch_(Bytecode &b, int label, bool condition) const { RCX_Value ea = EmitConstrained(b, TEST_MASK); if (ea==kIllegalEA) return false; // compare ea to 0 and branch b.AddTest( RCX_VALUE(kRCX_ConstantType,0), condition ? kRCX_NotEqualTo : kRCX_EqualTo, ea, label); b.ReleaseTempEA(ea); return true; } RCX_Value Expr::EmitBoolAny(Bytecode &b) const { int dst = GetTempVar(b); if (dst < 0) return kIllegalEA; RCX_Value dstEA = RCX_VALUE(kRCX_VariableType, dst); if (!EmitBoolTo(b, dst)) { b.ReleaseTempEA(dstEA); return kIllegalEA; } return dstEA; } bool Expr::EmitBoolTo(Bytecode &b, int dst) const { int doneLabel = b.NewLabel(); if (Contains(dst)) { /* * if condition then goto 1 * dst = 0 * goto done * 1: * dst = 1 * done: */ int setLabel = b.NewLabel(); EmitBranch(b, setLabel, true); b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, 0)); b.AddJump(doneLabel); b.SetLabel(setLabel); b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, 1)); } else { /* dst = 0 * if !condition then goto done * dst = 1 * done: */ b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, 0)); EmitBranch(b, doneLabel, false); b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, 1)); } b.SetLabel(doneLabel); return true; } int Expr::GetTempVar(Bytecode &b, bool canUseLocals) const { int var = b.GetTempVar(canUseLocals); if (var == kIllegalVar) { Error(kErr_NoMoreTemps).Raise(&GetLoc()); } return var; } nqc-3.1.r6/compiler/Expr.h0000600000175000017500000001035210216071112013461 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Expr_h #define __Expr_h #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif #ifndef __Variable_h #include "Variable.h" #endif #ifndef __LexLocation_h #include "LexLocation.h" #endif #include using std::vector; class Bytecode; class Mapping; class RCX_Target; /* * The Expr class is the base class for expressions. It declares * several important virtual methods that are used by the rest of * the compiler to determine properties and generate code for * general expressions. * * Expr* Clone(Mapping*) - used to clone an expression while making * the substitutions defined by a mapping. This is primarily * used during expansion of inline functions (see CallStmt). * * bool PotentialLValue() - used to determine if an expression is * a potential candidate as an LValue. This does not guarantee * that the expression is a legal LValue for a given target, but * merely that it obeys the semantic rules for being an LValue. * This includes making sure that variables are non-const and * that the expression is not a calculated value. Most expressions * are not potential LValues, so the default implementation is to * return false. * */ class Expr : public AutoFree { public: enum { kIllegalEA = -1 }; Expr(const LexLocation &loc) : fLoc(loc) {} virtual ~Expr() = 0; const LexLocation& GetLoc() const { return fLoc; } void SetLoc(const LexLocation &loc) { fLoc = loc; } virtual Expr* Clone(Mapping *) const = 0; virtual bool Evaluate(int & /*value */) const { return false; } virtual bool PotentialLValue() const { return false; } virtual int GetLValue() const { return kIllegalVar; } RCX_Value GetStaticEA() const; virtual bool PromiseConstant() const { return true; } virtual bool Contains(int /* var */) const { return false; } virtual bool LValueIsPointer() const { return false; } // append sub-expressions into vector virtual void GetExprs(vector & /* v */) const { } // calls to emit code RCX_Value EmitAny(Bytecode &b) const; bool EmitTo(Bytecode &b, int dst) const; RCX_Value EmitConstrained(Bytecode &b, long mask, bool canUseLocals=true) const; bool EmitSide(Bytecode &b) const; bool EmitBranch(Bytecode &b, int label, bool condition) const; RCX_Value EmitMath(Bytecode &b) const; protected: // virtual code emit methods for derrived classes virtual RCX_Value EmitAny_(Bytecode &b) const = 0; virtual bool EmitTo_(Bytecode &b, int dst) const; virtual bool EmitSide_(Bytecode &) const; virtual bool EmitBranch_(Bytecode &b, int label, bool condition) const; virtual RCX_Value GetStaticEA_() const; // helper routines for EmitAny_() and EmitTo_() implementations RCX_Value EmitBoolAny(Bytecode &b) const; bool EmitBoolTo(Bytecode &b, int dst) const; // utility function int GetTempVar(Bytecode &b, bool canUseLocals=true) const; private: LexLocation fLoc; }; // use this to build a typemask for EmitConstrained() #define TYPEMASK(t) (1L << (t)) // masks for EmitConstrained() #define TEST_MASK (~(TYPEMASK(kRCX_RandomType) + \ TYPEMASK(kRCX_ProgramType) + \ TYPEMASK(kRCX_AGCType))) #define SET_MASK -1 template void Apply(Expr *base, OP &op) { if (op(base)) { vector v; base->GetExprs(v); int n = v.size(); for(int i=0; i #include "ExprStmt.h" #include "Bytecode.h" #include "Expr.h" ExprStmt::ExprStmt(Expr * value) : fValue(value) { } ExprStmt::~ExprStmt() { delete fValue; } void ExprStmt::EmitActual(Bytecode &b) { fValue->EmitSide(b); } Stmt* ExprStmt::CloneActual(Mapping *b) const { return new ExprStmt(fValue->Clone(b)); } void ExprStmt::GetExprs(vector &v) const { v.push_back(fValue); } nqc-3.1.r6/compiler/ExprStmt.h0000600000175000017500000000215310216071104014332 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ExprStmt_h #define __ExprStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif class Expr; class ExprStmt : public LeafStmt { public: ExprStmt(Expr* value); ~ExprStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const; private: Expr* fValue; }; #endif nqc-3.1.r6/compiler/ForStmt.cpp0000600000175000017500000000421110216071100014466 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ForStmt.h" #include "Bytecode.h" ForStmt::ForStmt(Stmt *init, Expr *c, Stmt *iterate, Stmt *body) : fInit(init), fCondition(c), fIterate(iterate), fBody(body) { // note that fInit, fCondition, and fIterate are all optional and // may be NULL! // we need to keep child statments in a list fChildren.InsertHead(fBody); if (fIterate) fChildren.InsertHead(fIterate); if (fInit) fChildren.InsertHead(fInit); Adopt(init); Adopt(iterate); Adopt(body); } ForStmt::~ForStmt() { delete fInit; delete fCondition; delete fIterate; delete fBody; } void ForStmt::EmitActual(Bytecode &b) { /* init loop: test !condition -> break body continue: iterate jump -> loop break: */ if (fInit) fInit->Emit(b); int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); int loopLabel = b.NewLabel(); if (fCondition) fCondition->EmitBranch(b, bLabel, false); fBody->Emit(b); b.SetLabel(cLabel); if (fIterate) fIterate->Emit(b); b.AddJump(loopLabel); b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } Stmt* ForStmt::CloneActual(Mapping *b) const { return new ForStmt( fInit ? fInit->Clone(b) : 0, fCondition ? fCondition->Clone(b) : 0, fIterate ? fIterate->Clone(b) : 0, fBody->Clone(b)); } nqc-3.1.r6/compiler/ForStmt.h0000600000175000017500000000256610216071076014162 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ForStmt_h #define __ForStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __Expr_h #include "Expr.h" #endif class ForStmt : public Stmt { public: ForStmt(Stmt *init, Expr *c, Stmt *iterate, Stmt *body); ~ForStmt(); virtual Stmt* GetChildren() { return fChildren.GetHead(); } virtual void GetExprs(vector & v) const { if (fCondition) v.push_back(fCondition); } virtual void EmitActual(Bytecode &b); virtual Stmt* CloneActual(Mapping *b) const; private: Stmt* fInit; Expr* fCondition; Stmt* fIterate; Stmt* fBody; PListSS fChildren; }; #endif nqc-3.1.r6/compiler/Fragment.cpp0000600000175000017500000001255010216071072014650 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Fragment.h" #include "BlockStmt.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Program.h" #include "Symbol.h" #include "CallStmt.h" #include "DeclareStmt.h" #include "TaskIdExpr.h" #include "GotoStmt.h" #ifdef DEBUG //#ifdef __MWERKS__ #include //#endif // uncomment this to print the statement tree //#define DEBUG_DUMP_FRAGMENT #endif Fragment::Fragment(bool isTask, Symbol *name, Stmt *body) { fIsTask = isTask; fName = name; fBody = body; fNumber = gProgram->AddFragment(this); fTaskID = isTask ? fNumber : kNoTaskID; fStart.fIndex = kIllegalSrcIndex; fEnd.fIndex = kIllegalSrcIndex; } Fragment::Fragment(bool isTask) : fName(0), fBody(0) { fIsTask = isTask; fStart.fIndex = kIllegalSrcIndex; fEnd.fIndex = kIllegalSrcIndex; } Fragment::~Fragment() { delete fBody; } void Fragment::SetName(Symbol *name) { fName = name; fNumber = gProgram->AddFragment(this); fTaskID = fIsTask ? fNumber : kNoTaskID; } void Fragment::SetBody(Stmt *s) { // delete fBody; // this caused a call to a pure virtual function... fBody = s; } bool Fragment::AddArg(const Symbol *name, FunctionDef::ArgType type) { Arg a; for(size_t i=0; iNextVirtualVar(); switch(fArgs[i].fType) { case FunctionDef::kConstantArg: var |= kVirtualConstantFlag | kVirtualReadOnlyFlag; break; case FunctionDef::kConstRefArg: case FunctionDef::kSensorArg: var |= kVirtualReadOnlyFlag; break; case FunctionDef::kPointerArg: var |= kPointerFlag; break; case FunctionDef::kConstPtrArg: var |= kVirtualReadOnlyFlag | kPointerFlag; break; default: break; } fArgs[i].fVar = var; gProgram->DefineVar(fArgs[i].fName, var, false, ((fArgs[i].fType == FunctionDef::kPointerArg) || (fArgs[i].fType == FunctionDef::kConstPtrArg)), true); } } void Fragment::SetLocations(LocationNode *start, LocationNode *end) { fStart = start->GetLoc(); delete start; fEnd = end->GetLoc(); delete end; } void Fragment::AssignTaskID(int n) { if (n == fTaskID) return; if (fTaskID == kNoTaskID) fTaskID = n; else fTaskID = kMultiTaskID; } void Fragment::Emit(Bytecode &b) { b.AddSourceTag(RCX_SourceTag::kBegin, fStart); // bind TaskIdExprs to the actual task id // this must be done in Emit() rather than // Check() since subroutine trace isn't // complete until all fragments are checked TaskIdExpr::Patcher p(fTaskID); Apply(fBody, p); // resolve gotos - must be done in Emit() rather than // Check() since bytecode labels need to be generated GotoStmt::ResolveGotos(fBody, b); int rLabel = b.PushFlow(Bytecode::kReturnFlow); fBody->Emit(b); b.SetLabel(rLabel); b.PopFlow(Bytecode::kReturnFlow); b.ApplyFixups(); b.AddSourceTag(RCX_SourceTag::kEnd, fEnd); } #ifdef DEBUG using std::printf; class ParentChecker { public: bool operator()(Stmt *s); }; bool ParentChecker::operator()(Stmt *s) { Stmt *c; for(c=s->GetChildren(); c; c=c->GetNext()) { if (c->GetParent() != s) { printf("%s %08x\n", typeid(*s).name(), s); printf("Parent mistmatch: Found %08x expected %08x\n", c->GetParent(), s); } } return true; } #endif void Fragment::Check() { #ifdef DEBUG_DUMP_FRAGMENT DumpStmt(fBody); #endif CallStmt::Expander e(this); Apply(fBody, e); DeclareStmt::Binder b(0); Apply(fBody, b); #ifdef DEBUG ParentChecker p; Apply(fBody, p); #endif #ifdef DEBUG_DUMP_FRAGMENT DumpStmt(fBody); #endif } nqc-3.1.r6/compiler/Fragment.h0000600000175000017500000000562310216071066014323 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Fragment_h #define __Fragment_h #ifndef __PTypes_h #include "PTypes.h" #endif #ifndef __PListS_h #include "PListS.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __LocationNode_h #include "LocationNode.h" #endif #ifndef __FunctionDef_h #include "FunctionDef.h" #endif class Symbol; class Stmt; class Bytecode; class Program; class VarPool; class Fragment : public PLinkS, public AutoFree { public: enum { // special task IDs kNoTaskID = -1, kMultiTaskID = -2 }; Fragment(bool isTask, Symbol *name, Stmt *body); Fragment(bool isTask); ~Fragment(); bool AddArg(const Symbol *name, FunctionDef::ArgType type); int GetArgCount() const { return fArgs.size(); } const Symbol* GetArgName(int i) const { return fArgs[i].fName; } FunctionDef::ArgType GetArgType(int i) const { return fArgs[i].fType; } int GetArgVar(int i) const { return fArgs[i].fVar; } void SetLocations(LocationNode *start, LocationNode *end); void CreateArgVars(); int GetNumber() const { return fNumber; } void SetName(Symbol *name); Symbol* GetName() const { return fName; } bool IsTask() const { return fIsTask; } RCX_ChunkType GetChunkType() const { return fIsTask ? kRCX_TaskChunk : kRCX_SubChunk; } int GetTaskID() const { return fTaskID; } void SetBody(Stmt *stmt); Stmt* GetBody() { return fBody; } int GetLocalMask() const { return fLocalMask; } void SetLocalMask(int m) { fLocalMask = m; } void SetNumber(int n) { fNumber = n; } void AssignTaskID(int n); // only affects kRCX_SubFragment types void Emit(Bytecode &b); void Check(); private: struct Arg { const Symbol * fName; FunctionDef::ArgType fType; int fVar; }; vector fArgs; bool fIsTask; Symbol* fName; Stmt* fBody; int fNumber; int fTaskID; int fLocalMask; LexLocation fStart; LexLocation fEnd; }; #endif nqc-3.1.r6/compiler/FunctionDef.cpp0000600000175000017500000000452710216071064015317 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "FunctionDef.h" #include "Stmt.h" #include "Scope.h" #include "Program.h" FunctionDef::FunctionDef() { fBody = 0; fName = 0; fExpanded = false; fListingEnabled = true; } FunctionDef::~FunctionDef() { delete fBody; } bool FunctionDef::AddArg(const Symbol *name, ArgType type) { Arg a; for(size_t i=0; iNextVirtualVar(); switch(fArgs[i].fType) { case kConstantArg: var |= kVirtualConstantFlag | kVirtualReadOnlyFlag; break; case kConstRefArg: case kSensorArg: var |= kVirtualReadOnlyFlag; break; case kPointerArg: var |= kPointerFlag; break; case kConstPtrArg: var |= kVirtualReadOnlyFlag | kPointerFlag; break; default: break; } fArgs[i].fVar = var; gProgram->DefineVar(fArgs[i].fName, var, false, ((fArgs[i].fType == kPointerArg) || (fArgs[i].fType == kConstPtrArg)), false); } } void FunctionDef::SetLocations(LocationNode *start, LocationNode *end) { fStart = start->GetLoc(); delete start; fEnd = end->GetLoc(); delete end; } nqc-3.1.r6/compiler/FunctionDef.h0000600000175000017500000000501510216071060014751 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __FunctionDef_h #define __FunctionDef_h #ifndef __AutoFree_h #include "AutoFree.h" #endif #ifndef __PListS_h #include "PListS.h" #endif #ifndef __LocationNode_h #include "LocationNode.h" #endif #include using std::vector; class Symbol; class Stmt; class Scope; class FunctionDef : public PLinkS, public AutoFree { public: enum ArgType { kConstantArg = 0, kIntegerArg, kReferenceArg, kConstRefArg, kSensorArg, kPointerArg, kConstPtrArg }; FunctionDef(); ~FunctionDef(); bool AddArg(const Symbol *name, ArgType type); int GetArgCount() const { return fArgs.size(); } const Symbol* GetArgName(int i) const { return fArgs[i].fName; } ArgType GetArgType(int i) const { return fArgs[i].fType; } int GetArgVar(int i) const { return fArgs[i].fVar; } void SetBody(Stmt *stmt); Stmt* GetBody() { return fBody; } void SetName(const Symbol *name) { fName = name; } const Symbol* GetName() const { return fName; } // support for source code listings void SetListingEnabled(bool b) { fListingEnabled = b; } bool GetListingEnabled() const { return fListingEnabled; } void SetLocations(LocationNode *start, LocationNode *end); const LexLocation& GetStartLoc() const { return fStart; } const LexLocation& GetEndLoc() const { return fEnd; } void CreateArgVars(); bool IsExpanded() const { return fExpanded; } void SetExpanded(bool b) { fExpanded = b; } private: const Symbol* fName; struct Arg { const Symbol * fName; ArgType fType; int fVar; }; vector fArgs; Stmt* fBody; bool fExpanded; bool fListingEnabled; LexLocation fStart; LexLocation fEnd; }; #endif nqc-3.1.r6/compiler/GosubParamStmt.cpp0000600000175000017500000000434010216071056016015 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. */ #include "GosubParamStmt.h" #include "Bytecode.h" #include "AtomExpr.h" #include "Fragment.h" #include "Error.h" #include "RCX_Cmd.h" void GosubParamStmt::AddParams(vector ¶ms) { for(size_t i=0; iGetLocalMask())) { Error(kErr_NoMoreVars).Raise(&fLocation); return; } size_t argCount = fFragment->GetArgCount(); if (argCount != fParams.size()) { Error(kErr_ParamCount).Raise(&fLocation); return; } RCX_Cmd cmd; // push parameters onto the stack for(int i = 0; i < (int)fParams.size(); i++) { RCX_Value ea = fParams[i]->EmitAny(b); cmd.MakePushStackEntry(ea); b.Add(cmd); b.ReleaseTempEA(ea); } cmd.Set(kRCX_GoSubOp, fFragment->GetNumber()); b.Add(cmd); if (fFragment->GetArgCount() > 0) { // pop parameters off the stack cmd.Set(kRCX_PopStackEntryOp, fParams.size()); b.Add(cmd); } } Stmt* GosubParamStmt::CloneActual(Mapping *b) const { GosubParamStmt *g = new GosubParamStmt(fFragment, fLocation); for(size_t i=0; ifParams.push_back(fParams[i]->Clone(b)); return g; } nqc-3.1.r6/compiler/GosubParamStmt.h0000600000175000017500000000252510216071050015457 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is John Hansen. * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. */ #ifndef __GosubParamStmt_h #define __GosubParamStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif #include using std::vector; class Fragment; class Expr; class GosubParamStmt : public LeafStmt { public: GosubParamStmt(Fragment *f, const struct LexLocation &loc) : fFragment(f), fLocation(loc) {} bool Check(CheckState &state); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; Fragment* GetFragment() const { return fFragment; } void AddParams(vector ¶ms); private: Fragment* fFragment; struct LexLocation fLocation; vector fParams; }; #endif nqc-3.1.r6/compiler/GosubStmt.cpp0000600000175000017500000000233310216071040015025 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "GosubStmt.h" #include "Bytecode.h" #include "Fragment.h" #include "Error.h" #include "RCX_Cmd.h" void GosubStmt::EmitActual(Bytecode &b) { if (!b.GetVarAllocator().CheckLocalMask(fFragment->GetLocalMask())) { Error(kErr_NoMoreVars).Raise(&fLocation); return; } RCX_Cmd cmd; cmd.Set(kRCX_GoSubOp, fFragment->GetNumber()); b.Add(cmd); } Stmt* GosubStmt::CloneActual(Mapping *) const { return new GosubStmt(fFragment, fLocation); } nqc-3.1.r6/compiler/GosubStmt.h0000600000175000017500000000243610216071036014503 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __GosubStmt_h #define __GosubStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class Fragment; class GosubStmt : public LeafStmt { public: GosubStmt(Fragment *f, const struct LexLocation &loc) : fFragment(f), fLocation(loc) {} bool Check(CheckState &state); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; Fragment* GetFragment() const { return fFragment; } private: Fragment* fFragment; struct LexLocation fLocation; }; #endif nqc-3.1.r6/compiler/GotoStmt.cpp0000600000175000017500000000643010216071032014661 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "GotoStmt.h" #include "Bytecode.h" #include "Error.h" #include "LabelStmt.h" #include "Symbol.h" #include "InlineStmt.h" class LabelSet { public: LabelStmt* find(const Symbol *name); void add(LabelStmt *s) { fLabels.push_back(s); } private: vector fLabels; }; GotoStmt::GotoStmt(const Symbol *name, const struct LexLocation &loc) : fName(name), fLocation(loc), fLabel(kIllegalLabel) { } void GotoStmt::EmitActual(Bytecode &b) { if (fLabel == kIllegalLabel) { Error(kErr_UndefinedLabel, fName->GetKey()).Raise(&fLocation); return; } b.AddJump(fLabel); } Stmt* GotoStmt::CloneActual(Mapping *) const { return new GotoStmt(fName, fLocation); } class LabelFinder { public: LabelFinder(LabelSet &labelSet, Bytecode &b) : fLabelSet(labelSet), fBytecode(b) {}; bool operator()(Stmt *s); private: LabelSet& fLabelSet; Bytecode& fBytecode; }; bool LabelFinder::operator()(Stmt *s) { // restart resolving within an InlineStmt InlineStmt *is = dynamic_cast(s); if (is) { GotoStmt::ResolveGotos(is->GetBody(), fBytecode); return false; } // register the label LabelStmt* ls = dynamic_cast(s); if (ls) { if (fLabelSet.find(ls->fName)) { Error(kErr_RedefinedLabel, ls->fName->GetKey()).Raise(&ls->fLocation); } else { fLabelSet.add(ls); ls->fLabel = fBytecode.NewLabel(); } } return true; } class GotoBinder { public: GotoBinder(LabelSet &labelSet) : fLabelSet(labelSet) {}; bool operator()(Stmt *s); private: LabelSet& fLabelSet; }; bool GotoBinder::operator()(Stmt *s) { // stop at InlineStmt if (dynamic_cast(s)) { return false; } // resolve the label GotoStmt* gs = dynamic_cast(s); if (gs) { LabelStmt* ls = fLabelSet.find(gs->fName); if (ls) { gs->fLabel = ls->GetLabel(); // force everything from the labelstmt up to a common parent to emit Stmt* ancestor = ls; while(ancestor) { if (s->IsDescendantOf(ancestor)) break; ancestor->SetMustEmit(true); ancestor = ancestor->GetParent(); } } } return true; } void GotoStmt::ResolveGotos(Stmt *s, Bytecode &b) { LabelSet labelSet; LabelFinder lf(labelSet, b); Apply(s, lf); GotoBinder gb(labelSet); Apply(s, gb); } LabelStmt* LabelSet::find(const Symbol *s) { for(int i=0; i<(int)fLabels.size(); ++i) { if (fLabels[i]->GetName() == s) return fLabels[i]; } return 0; } nqc-3.1.r6/compiler/GotoStmt.h0000600000175000017500000000252710216071026014334 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __GotoStmt_h #define __GotoStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class Bytecode; class GotoStmt : public LeafStmt { public: GotoStmt(const Symbol *name, const struct LexLocation &loc); bool Check(CheckState &state); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; void SetLabel(int l) { fLabel = l; } static void ResolveGotos(Stmt *s, Bytecode &b); friend class GotoBinder; private: const Symbol* fName; struct LexLocation fLocation; int fLabel; }; #endif nqc-3.1.r6/compiler/IfStmt.cpp0000600000175000017500000000375110216071024014313 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "IfStmt.h" #include "Bytecode.h" IfStmt::IfStmt(Expr *c, Stmt *s1, Stmt *s2) : BinaryStmt(s1, s2), fCondition(c) { } IfStmt::~IfStmt() { delete fCondition; } void IfStmt::EmitActual(Bytecode &b) { int value; if (fCondition->Evaluate(value)) { if (value && (!GetSecondary() || !GetSecondary()->GetMustEmit())) { GetPrimary()->Emit(b); return; } else if (!GetPrimary()->GetMustEmit()) { if (GetSecondary()) GetSecondary()->Emit(b); return; } } if (GetSecondary()) EmitIfElse(b); else EmitIf(b); } void IfStmt::EmitIf(Bytecode &b) { int label; label = b.NewLabel(); fCondition->EmitBranch(b, label, false); GetPrimary()->Emit(b); b.SetLabel(label); } void IfStmt::EmitIfElse(Bytecode &b) { int testLabel = b.NewLabel(); int outLabel= b.NewLabel(); fCondition->EmitBranch(b, testLabel, false); // generate A and jump GetPrimary()->Emit(b); b.AddJump(outLabel); b.SetLabel(testLabel); // generate B GetSecondary()->Emit(b); b.SetLabel(outLabel); } Stmt* IfStmt::CloneActual(Mapping *b) const { return new IfStmt( fCondition->Clone(b), GetPrimary()->Clone(b), GetSecondary() ? GetSecondary()->Clone(b) : 0); } nqc-3.1.r6/compiler/IfStmt.h0000600000175000017500000000236210216071020013751 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __IfStmt_h #define __IfStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __Expr_h #include "Expr.h" #endif class IfStmt : public BinaryStmt { public: IfStmt(Expr *c, Stmt *s1, Stmt *s2=nil); ~IfStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const { v.push_back(fCondition); } private: void EmitIf(Bytecode &b); void EmitIfElse(Bytecode &b); Expr* fCondition; }; #endif nqc-3.1.r6/compiler/IncDecExpr.cpp0000600000175000017500000000420010216071016015060 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "IncDecExpr.h" #include "RCX_Cmd.h" #include "Bytecode.h" #include "Mapping.h" IncDecExpr::IncDecExpr(int var, bool inc, bool pre, const LexLocation &loc) : Expr(loc), fVar(var), fInc(inc), fPre(pre) { } IncDecExpr::~IncDecExpr() { } Expr* IncDecExpr::Clone(Mapping *m) const { int newVar = m ? m->GetMappedVar(fVar) : fVar; return new IncDecExpr(newVar, fInc, fPre, GetLoc()); } bool IncDecExpr::Contains(int var) const { return var == fVar; } RCX_Value IncDecExpr::EmitAny_(Bytecode &b) const { RCX_Value src; src = RCX_VALUE(kRCX_VariableType, fVar); if (fPre) { (void)EmitSide_(b); return src; } else { int var = GetTempVar(b); if (var == kIllegalVar) return kIllegalEA; b.AddMove(var, src); (void)EmitSide_(b); return RCX_VALUE(kRCX_VariableType, var); } } bool IncDecExpr::EmitTo_(Bytecode &b, int dst) const { if (fPre) { EmitSide_(b); if (dst != fVar) b.AddMove(dst, fVar); } else { if (dst!=fVar) { b.AddMove(dst, fVar); EmitSide_(b); } } return true; } bool IncDecExpr::EmitSide_(Bytecode &b) const { RCX_Cmd cmd; cmd.MakeVar(fInc ? kRCX_AddVar : kRCX_SubVar, fVar, RCX_VALUE(kRCX_ConstantType, 1)); b.Add(cmd); return true; } void IncDecExpr::Translate(int from, int to) { if (fVar == from) fVar = to; } nqc-3.1.r6/compiler/IncDecExpr.h0000600000175000017500000000271210216071012014527 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __IncDecExpr_h #define __IncDecExpr_h #ifndef __Expr_h #include "Expr.h" #endif #ifndef __VarTranslator_h #include "VarTranslator.h" #endif class IncDecExpr : public Expr, public Translatable { public: IncDecExpr(int var, bool inc, bool pre, const LexLocation &loc); ~IncDecExpr(); virtual Expr* Clone(Mapping *b) const; virtual bool Contains(int var) const; virtual bool PromiseConstant() const { return false; } virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; virtual bool EmitSide_(Bytecode &b) const; void Translate(int from, int to); private: int fVar; bool fInc; bool fPre; }; #endif nqc-3.1.r6/compiler/IndirectExpr.cpp0000600000175000017500000000320310216071010015470 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "IndirectExpr.h" #include "Mapping.h" #include "RCX_Cmd.h" #include "Bytecode.h" Expr* IndirectExpr::Clone(Mapping *m) const { return new IndirectExpr(Get(0)->Clone(m), Get(1)->Clone(m)); } RCX_Value IndirectExpr::EmitAny_(Bytecode &b) const { // decode src int src; if (!Get(0)->Evaluate(src)) return kIllegalEA; int directSrc = (src >> 8) & 0xff; int indirectSrc = (src) & 0xff; // see if direct can be used int idx; if (directSrc && Get(1)->Evaluate(idx)) { return RCX_VALUE(directSrc, idx); } // must use indirect // see if index is already in a var int var = Get(1)->GetLValue(); if (var != kIllegalVar) return RCX_VALUE(indirectSrc, var); // emit the index int dst = GetTempVar(b); if (dst < 0) return kIllegalEA; Get(1)->EmitTo(b, dst); return RCX_VALUE(indirectSrc, dst) + kRCX_ValueUsesTemp; } nqc-3.1.r6/compiler/IndirectExpr.h0000600000175000017500000000225710216071004015150 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __IndirectExpr_h #define __IndirectExpr_h #include "NodeExpr.h" class IndirectExpr : public NodeExpr { public: IndirectExpr(Expr *src, Expr *idx) : NodeExpr(src, idx) {} virtual Expr* Clone(Mapping *b) const; virtual bool PromiseConstant() const { return false; } virtual bool PotentialLValue() const { return true; } virtual RCX_Value EmitAny_(Bytecode &b) const; private: }; #endif nqc-3.1.r6/compiler/InlineStmt.cpp0000600000175000017500000000312510216071000015160 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "InlineStmt.h" #include "Bytecode.h" #include "FunctionDef.h" void InlineStmt::EmitActual(Bytecode &b) { b.AddSourceTag( fFunction->GetListingEnabled() ? RCX_SourceTag::kBegin : RCX_SourceTag::kBeginNoList, fFunction->GetStartLoc()); int rLabel = b.PushFlow(Bytecode::kReturnFlow); b.PushFlow(Bytecode::kContinueFlow, false); b.PushFlow(Bytecode::kBreakFlow, false); GetBody()->Emit(b); b.SetLabel(rLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); b.PopFlow(Bytecode::kReturnFlow); b.AddSourceTag(RCX_SourceTag::kEnd, fFunction->GetEndLoc()); } Stmt* InlineStmt::CloneActual(Mapping *b) const { // this never really gets called because cloning happens before // InlineStmts are substituted for CallStmts. return new InlineStmt(GetBody()->Clone(b), fFunction); } nqc-3.1.r6/compiler/InlineStmt.h0000600000175000017500000000254410216070776014654 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __InlineStmt_h #define __InlineStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif /* * The purpose of the InlineStmt class is to be the root of an * expanded inline function. Its only true funciton is to setup * the return label so that return statements within the expanded * function will exit to the correct place. */ class FunctionDef; class InlineStmt : public ChainStmt { public: InlineStmt(Stmt *s, FunctionDef *f) : ChainStmt(s), fFunction(f) { } void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: FunctionDef* fFunction; }; #endif nqc-3.1.r6/compiler/JumpStmt.cpp0000600000175000017500000000235610216070772014701 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "JumpStmt.h" #include "Bytecode.h" #include "Error.h" JumpStmt::JumpStmt(int type, const LexLocation &loc) { fType = type; fLocation = loc; } void JumpStmt::EmitActual(Bytecode &b) { if (!b.AddFlowJump(static_cast(fType))) { Error( (fType==Bytecode::kContinueFlow) ? kErr_NoContinueContext : kErr_NoBreakContext ).Raise(&fLocation); } } Stmt* JumpStmt::CloneActual(Mapping *) const { return new JumpStmt(fType, fLocation); } nqc-3.1.r6/compiler/JumpStmt.h0000600000175000017500000000233010216070766014341 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __JumpStmt_h #define __JumpStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class JumpStmt : public LeafStmt { public: JumpStmt(int type, const LexLocation &loc); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: int fType; LexLocation fLocation; }; /* enum { kJump_Break = 0, kJump_Continue, kJump_Count // must be the last one }; */ #endif nqc-3.1.r6/compiler/LabelStmt.cpp0000600000175000017500000000232310216070762014776 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "LabelStmt.h" #include "Bytecode.h" #include "Error.h" #include "Symbol.h" LabelStmt::LabelStmt(const Symbol *name, const LexLocation &loc, Stmt *s) : ChainStmt(s), fName(name), fLocation(loc) { } LabelStmt::~LabelStmt() { } void LabelStmt::EmitActual(Bytecode &b) { b.SetLabel(fLabel); GetBody()->Emit(b); } Stmt* LabelStmt::CloneActual(Mapping *m) const { return new LabelStmt(fName, fLocation, GetBody()->Clone(m)); } nqc-3.1.r6/compiler/LabelStmt.h0000600000175000017500000000300210216070760014434 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * LabelStmts are used to bind a label to another statement. The * LabelStmt isn't really a statement itself - just a wrapper for * a single child statement. * */ #ifndef __LabelStmt_h #define __LabelStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class LabelStmt : public ChainStmt { public: LabelStmt(const Symbol *name, const LexLocation &loc, Stmt *s = 0); ~LabelStmt(); virtual void EmitActual(Bytecode &b); virtual Stmt* CloneActual(Mapping *b) const; const Symbol* GetName() const { return fName; } int GetLabel() const { return fLabel; } friend class LabelFinder; private: const Symbol* fName; LexLocation fLocation; int fLabel; }; #endif nqc-3.1.r6/compiler/lex.l0000600000175000017500000002012110216065240013337 0ustar blpblp%{ /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include #include "Symbol.h" #include "RCX_Constants.h" #include "JumpStmt.h" #include "Buffer.h" #include "parser.h" #include "Compiler.h" #include "Error.h" #include "Bytecode.h" #define kMaxFileDepth 16 #define kMaxFileCount 255 typedef struct InputFile { struct InputFile *fNext; int fSourceIndex; YY_BUFFER_STATE fBufferState; long fSavedOffset; const char* fDataPtr; int fDataRemain; } InputFile; static int sFileDepth = 0; static InputFile *sCurrentInputFile = 0; static int sSourceIndex = 0; static long sOffset = 0; static int sReturnWhitespace = 0; static int sInsideDirective = 0; static int sInsideProse = 0; static int FillBuffer(char *ptr, int max); #define YY_DECL int yylex(YYSTYPE &yylval) #define YY_USER_ACTION { sOffset += yyleng; } #define YY_INPUT(buf,res,max) (res = FillBuffer(buf, max)) #define Return(tok, val) do { yylval.fInt = val; return tok; } while(0) // this is a hack so that isatty() and fileno() aren't required for the Win32/macintosh builds #if defined(WIN32) || defined(macintosh) #define YY_NEVER_INTERACTIVE 1 #endif %} %option outfile="lexer.cpp" id0 [a-zA-Z_] idn [a-zA-Z_0-9] digit [0-9] hex [0-9a-fA-F] any [^\r\n] ws [ \t] nl [\r\n] %x COMMENT PREPROC %% "//"{any}* ; \032 ; // hack for DOS EOF characters {nl} { if (sInsideDirective) { sInsideDirective = 0; return NL; } } \\{nl} { } {ws}*"##" { return PP_GLOM; } {ws}*#{ws}* { if (sInsideDirective) return '#'; else { BEGIN(PREPROC); sInsideDirective = 1; } } "include" { BEGIN(INITIAL); return PP_INCLUDE; } "define" { BEGIN(INITIAL); return PP_DEFINE; } "ifdef" { BEGIN(INITIAL); Return(PP_IFDEF, true); } "ifndef" { BEGIN(INITIAL); Return(PP_IFDEF, false); } "if" { BEGIN(INITIAL); return PP_IF; } "else" { BEGIN(INITIAL); return PP_ELSE; } "elif" { BEGIN(INITIAL); return PP_ELIF; } "endif" { BEGIN(INITIAL); return PP_ENDIF; } "undef" { BEGIN(INITIAL); return PP_UNDEF; } "pragma" { BEGIN(INITIAL); return PP_PRAGMA; } "error" { BEGIN(INITIAL); return PP_ERROR; } "warning" { BEGIN(INITIAL); return PP_WARNING; } {nl} { BEGIN(INITIAL); yyless(yyleng-1); return PP_UNKNOWN; } . { BEGIN(INITIAL); return PP_UNKNOWN; } "if" { return IF; } "else" { return ELSE; } "while" { return WHILE; } "do" { return DO; } "for" { return FOR; } "repeat" { return REPEAT; } "break" { yylval.fInt = Bytecode::kBreakFlow; return JUMP; } "continue" { yylval.fInt = Bytecode::kContinueFlow; return JUMP; } "return" { yylval.fInt = Bytecode::kReturnFlow; return JUMP; } "switch" { return SWITCH; } "case" { return CASE; } "default" { return DEFAULT; } "monitor" { return MONITOR; } "acquire" { return ACQUIRE; } "catch" { return CATCH; } "goto" { return GOTO; } "int" { return INT; } "void" { return T_VOID; } "const" { return T_CONST; } "__sensor" { return SENSOR; } "__type" { return TYPE; } "__event_src" { return EVENT_SRC; } "__taskid" { return TASKID; } "__nolist" { return NOLIST; } "__res" { return RES; } "asm" { return ASM; } "task" { return TASK; } "sub" { return SUB; } "stop" { Return( TASKOP, kRCX_StopTaskOp); } "start" { Return( TASKOP, kRCX_StartTaskOp); } "abs" { return ABS; } "sign" { return SIGN; } "+=" { Return( ASSIGN, kRCX_AddVar); } "-=" { Return( ASSIGN, kRCX_SubVar); } "*=" { Return( ASSIGN, kRCX_MulVar); } "/=" { Return( ASSIGN, kRCX_DivVar); } "&=" { Return( ASSIGN, kRCX_AndVar); } "|=" { Return( ASSIGN, kRCX_OrVar); } "||=" { Return( ASSIGN, kRCX_AbsVar); } "+-=" { Return( ASSIGN, kRCX_SgnVar); } ">>=" { Return( ASSIGN2, RIGHT); } "<<=" { Return( ASSIGN2, LEFT); } "%=" { Return( ASSIGN2, '%'); } "^=" { Return( ASSIGN2, '^'); } "==" { return REL_EQ; } "!=" { return REL_NE; } "<=" { return REL_LE; } ">=" { return REL_GE; } "&&" { return AND; } "||" { return OR; } "++" { Return( INCDEC, 1); } "--" { Return( INCDEC, 0); } "true" { return CTRUE; } "false" { return CFALSE; } "<<" { return LEFT; } ">>" { return RIGHT; } "@@" { return INDIRECT; } {id0}{idn}* { yylval.fSymbol = Symbol::Get(yytext); return ID; } 0[xX]{hex}+ { char*ptr; yylval.fInt = strtol(yytext, &ptr, 0); return NUMBER; } {digit}+ { yylval.fInt = (int)atof(yytext); return NUMBER; } "\""[^\"]*"\"" { yytext[yyleng-1]=0; yylval.fString = yytext+1; return STRING; } {ws}+ { if (sReturnWhitespace) return WS; } . { return yytext[0]; } "/*" BEGIN(COMMENT); [^*\r\n]* /* eat anything that's not a '*' */ "*"+[^*/\r\n]* /* eat up '*'s not followed by '/'s */ {nl} /* eat up newlines */ "*"+"/" BEGIN(INITIAL); %% void LexCurrentLocation(LexLocation &loc) { loc.fLength = yyleng; loc.fIndex = sSourceIndex; loc.fOffset = sOffset - yyleng; } void LexReturnWhitespace(int mode) { sReturnWhitespace = mode; } int LexFindAndPushFile(const char *name) { Buffer *b = Compiler::Get()->CreateBuffer(name); if (!b) { Error(kErr_FileOpen, name).RaiseLex(); return 0; } return LexPush(b); } int LexPush(Buffer *b) { InputFile *inputFile; int index; index = Compiler::Get()->AddBuffer(b); // make sure max file depth and file count haven't been exceeded if (sFileDepth == kMaxFileDepth || index > kMaxFileCount) return 0; // save line number and buffer in previous file if (sCurrentInputFile) { sCurrentInputFile->fSavedOffset = sOffset; sCurrentInputFile->fBufferState = YY_CURRENT_BUFFER; } inputFile = (InputFile *)malloc(sizeof(InputFile)); inputFile->fBufferState = yy_create_buffer(0, YY_BUF_SIZE); inputFile->fDataPtr = b->GetData(); inputFile->fDataRemain = b->GetLength(); inputFile->fSourceIndex = index; // link into list inputFile->fNext = sCurrentInputFile; sCurrentInputFile = inputFile; sFileDepth++; // switch to new buffer sOffset = 0; sSourceIndex = index; yy_switch_to_buffer(inputFile->fBufferState); return 1; } int yywrap() { InputFile *inputFile; // check for unterminated comments if (YY_START == COMMENT) { Error(kErr_UnterminatedComment).RaiseLex(); BEGIN(INITIAL); } // if no input files, just return if (sCurrentInputFile == 0) return 1; // pop an input file off the list inputFile = sCurrentInputFile; sCurrentInputFile = inputFile->fNext; sFileDepth--; // cleanup the input file yy_delete_buffer(YY_CURRENT_BUFFER); free(inputFile); // if no more files, just return 1 if (!sCurrentInputFile) return 1; // switch to next file yy_switch_to_buffer(sCurrentInputFile->fBufferState); sOffset = sCurrentInputFile->fSavedOffset; sSourceIndex = sCurrentInputFile->fSourceIndex; // tell yylex() to continue return 0; } void LexReset() { while(yywrap() == 0) ; } int FillBuffer(char *buf, int max_size) { int result; // if no files are pending, return 0 (EOF) if (!sCurrentInputFile) return 0; int n = sCurrentInputFile->fDataRemain; if (n > max_size) n = max_size; memcpy(buf, sCurrentInputFile->fDataPtr, n); sCurrentInputFile->fDataPtr += n; sCurrentInputFile->fDataRemain -= n; result = n; return result; } nqc-3.1.r6/compiler/lexer.cpp0000600000175000017500000016460010631575236014244 0ustar blpblp#line 2 "lexer.cpp" /* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: c:\\winapps\\projects\\nqc/nqc/compiler/lexer.cpp,v 1.4 2005/03/16 19:58:02 jhansen Exp $ * */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include #if defined(__MWERKS__) && !__MACH__ && !YY_NEVER_INTERACTIVE #include #endif /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 89 #define YY_END_OF_BUFFER 90 static yyconst short int yy_accept[278] = { 0, 0, 0, 85, 85, 0, 0, 90, 83, 82, 3, 3, 2, 83, 83, 6, 83, 83, 83, 83, 83, 83, 80, 80, 83, 83, 83, 83, 78, 83, 83, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 83, 85, 87, 86, 20, 19, 19, 20, 20, 20, 20, 20, 20, 82, 6, 66, 0, 81, 6, 5, 63, 69, 57, 55, 71, 0, 53, 72, 54, 84, 1, 56, 80, 0, 75, 67, 65, 68, 76, 77, 78, 4, 64, 78, 78, 78, 78, 78, 78, 78, 78, 24, 78, 78, 78, 78, 21, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 58, 70, 85, 86, 86, 88, 0, 0, 0, 0, 11, 0, 0, 0, 0, 60, 1, 79, 62, 61, 78, 78, 78, 78, 78, 51, 78, 46, 78, 78, 78, 78, 78, 78, 78, 25, 78, 37, 78, 78, 78, 78, 78, 78, 48, 78, 78, 78, 78, 78, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 78, 78, 78, 78, 31, 78, 78, 78, 78, 22, 78, 36, 78, 78, 78, 52, 78, 49, 78, 47, 73, 38, 78, 0, 13, 12, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 45, 78, 78, 78, 78, 27, 35, 39, 78, 78, 74, 78, 78, 78, 50, 78, 23, 0, 14, 17, 9, 0, 0, 0, 15, 0, 78, 78, 78, 78, 41, 78, 78, 78, 78, 26, 29, 30, 8, 10, 0, 16, 0, 78, 78, 78, 78, 34, 78, 32, 33, 7, 18, 78, 44, 40, 43, 28, 78, 78, 42, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 2, 6, 7, 8, 1, 9, 10, 1, 1, 1, 11, 12, 1, 13, 1, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 1, 17, 18, 19, 1, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 22, 22, 1, 24, 1, 25, 26, 1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 22, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 23, 49, 22, 1, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[51] = { 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, 4, 1, 1, 1, 1, 4, 5, 5, 1, 1, 5, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; static yyconst short int yy_base[286] = { 0, 0, 0, 48, 50, 59, 105, 330, 331, 56, 331, 331, 331, 311, 321, 58, 309, 47, 308, 55, 56, 61, 55, 40, 59, 307, 62, 304, 0, 79, 305, 296, 57, 278, 57, 56, 283, 64, 279, 56, 278, 286, 67, 71, 276, 281, 74, 0, 331, 92, 331, 331, 331, 283, 79, 78, 270, 273, 284, 91, 117, 331, 303, 331, 307, 331, 331, 331, 331, 331, 331, 290, 331, 331, 331, 331, 0, 331, 105, 0, 289, 331, 331, 331, 288, 331, 0, 331, 331, 98, 261, 262, 265, 271, 82, 262, 268, 0, 255, 261, 254, 251, 0, 250, 255, 87, 260, 104, 264, 256, 246, 243, 253, 252, 331, 268, 0, 119, 134, 331, 253, 103, 254, 240, 119, 253, 254, 250, 236, 331, 0, 0, 331, 331, 231, 237, 245, 244, 107, 0, 228, 0, 246, 241, 242, 110, 243, 238, 224, 0, 227, 0, 231, 234, 218, 224, 219, 220, 0, 215, 223, 227, 227, 219, 331, 220, 222, 222, 217, 211, 219, 219, 211, 214, 215, 206, 213, 206, 198, 202, 196, 198, 203, 201, 0, 202, 190, 199, 187, 0, 201, 0, 186, 203, 186, 0, 183, 0, 198, 0, 0, 0, 195, 186, 331, 331, 192, 180, 190, 190, 174, 181, 186, 182, 177, 180, 0, 170, 177, 181, 168, 0, 0, 0, 171, 172, 0, 168, 162, 167, 0, 171, 0, 173, 331, 331, 331, 171, 172, 174, 331, 161, 154, 154, 157, 161, 0, 164, 148, 148, 149, 0, 0, 0, 331, 331, 160, 331, 154, 156, 133, 134, 127, 0, 121, 0, 0, 331, 331, 106, 0, 0, 0, 0, 96, 94, 0, 331, 158, 163, 168, 170, 175, 180, 185, 107 } ; static yyconst short int yy_def[286] = { 0, 277, 1, 278, 278, 279, 279, 277, 277, 277, 277, 277, 277, 277, 280, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 282, 277, 283, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 280, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 284, 277, 277, 285, 277, 277, 277, 277, 277, 277, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 282, 283, 283, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 284, 285, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 0, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yyconst short int yy_nxt[382] = { 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 28, 39, 28, 28, 40, 28, 28, 28, 28, 41, 42, 43, 28, 44, 45, 28, 46, 48, 48, 48, 48, 78, 78, 67, 59, 49, 64, 49, 51, 52, 60, 68, 65, 70, 71, 73, 78, 78, 75, 72, 74, 76, 80, 81, 79, 77, 83, 84, 87, 87, 94, 90, 91, 96, 102, 53, 54, 99, 114, 59, 55, 103, 97, 95, 110, 60, 56, 92, 106, 118, 100, 57, 119, 58, 51, 52, 124, 131, 107, 108, 111, 109, 121, 125, 122, 64, 78, 78, 123, 276, 115, 65, 143, 144, 153, 134, 277, 156, 154, 277, 180, 53, 54, 135, 166, 275, 55, 136, 137, 138, 157, 118, 56, 167, 119, 170, 274, 57, 273, 58, 186, 187, 181, 272, 171, 47, 47, 47, 47, 47, 50, 50, 50, 50, 50, 62, 62, 62, 62, 62, 86, 86, 116, 271, 270, 116, 116, 117, 269, 117, 117, 117, 130, 268, 130, 130, 130, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 185, 184, 183, 182, 179, 178, 177, 176, 175, 174, 173, 172, 169, 168, 165, 164, 163, 162, 161, 160, 159, 158, 155, 152, 151, 150, 149, 148, 147, 146, 145, 142, 141, 140, 139, 133, 132, 129, 64, 63, 128, 127, 126, 120, 113, 112, 105, 104, 101, 98, 93, 89, 88, 85, 82, 69, 66, 63, 61, 277, 7, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yyconst short int yy_chk[382] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 23, 23, 17, 9, 3, 15, 4, 5, 5, 9, 17, 15, 19, 19, 20, 22, 22, 21, 19, 20, 21, 24, 24, 22, 21, 26, 26, 29, 29, 34, 32, 32, 35, 39, 5, 5, 37, 46, 59, 5, 39, 35, 34, 43, 59, 5, 32, 42, 49, 37, 5, 49, 5, 6, 6, 55, 285, 42, 42, 43, 42, 54, 55, 54, 60, 78, 78, 54, 275, 46, 60, 94, 94, 105, 89, 117, 107, 105, 117, 138, 6, 6, 89, 121, 274, 6, 89, 89, 89, 107, 118, 6, 121, 118, 124, 269, 6, 264, 6, 145, 145, 138, 262, 124, 278, 278, 278, 278, 278, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 281, 281, 282, 261, 260, 282, 282, 283, 259, 283, 283, 283, 284, 258, 284, 284, 284, 256, 250, 249, 248, 247, 245, 244, 243, 242, 241, 239, 238, 237, 233, 231, 229, 228, 227, 225, 224, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 203, 202, 198, 196, 194, 193, 192, 190, 188, 187, 186, 185, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 163, 162, 161, 160, 159, 157, 156, 155, 154, 153, 152, 150, 148, 147, 146, 144, 143, 142, 140, 137, 136, 135, 134, 128, 127, 126, 125, 123, 122, 120, 115, 113, 112, 111, 110, 109, 108, 106, 104, 103, 101, 100, 99, 98, 96, 95, 93, 92, 91, 90, 84, 80, 71, 64, 62, 58, 57, 56, 53, 45, 44, 41, 40, 38, 36, 33, 31, 30, 27, 25, 18, 16, 14, 13, 7, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lex.l" #define INITIAL 0 #line 2 "lex.l" /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. */ #include #include #include "Symbol.h" #include "RCX_Constants.h" #include "JumpStmt.h" #include "Buffer.h" #include "parser.h" #include "Compiler.h" #include "Error.h" #include "Bytecode.h" #define kMaxFileDepth 16 #define kMaxFileCount 255 typedef struct InputFile { struct InputFile *fNext; int fSourceIndex; YY_BUFFER_STATE fBufferState; long fSavedOffset; const char* fDataPtr; int fDataRemain; } InputFile; static int sFileDepth = 0; static InputFile *sCurrentInputFile = 0; static int sSourceIndex = 0; static long sOffset = 0; static int sReturnWhitespace = 0; static int sInsideDirective = 0; static int sInsideProse = 0; static int FillBuffer(char *ptr, int max); #define YY_DECL int yylex(YYSTYPE &yylval) #define YY_USER_ACTION { sOffset += yyleng; } #define YY_INPUT(buf,res,max) (res = FillBuffer(buf, max)) #define Return(tok, val) do { yylval.fInt = val; return tok; } while(0) // this is a hack so that isatty() and fileno() aren't required for the Win32/macintosh builds #if defined(WIN32) || defined(macintosh) #define YY_NEVER_INTERACTIVE 1 #endif #define COMMENT 1 #define PREPROC 2 #line 610 "lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 79 "lex.l" #line 765 "lexer.cpp" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 331 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 82 "lex.l" ; YY_BREAK case 2: YY_RULE_SETUP #line 83 "lex.l" ; // hack for DOS EOF characters YY_BREAK case 3: YY_RULE_SETUP #line 85 "lex.l" { if (sInsideDirective) { sInsideDirective = 0; return NL; } } YY_BREAK case 4: YY_RULE_SETUP #line 86 "lex.l" { } YY_BREAK case 5: YY_RULE_SETUP #line 89 "lex.l" { return PP_GLOM; } YY_BREAK case 6: YY_RULE_SETUP #line 90 "lex.l" { if (sInsideDirective) return '#'; else { BEGIN(PREPROC); sInsideDirective = 1; } } YY_BREAK case 7: YY_RULE_SETUP #line 91 "lex.l" { BEGIN(INITIAL); return PP_INCLUDE; } YY_BREAK case 8: YY_RULE_SETUP #line 92 "lex.l" { BEGIN(INITIAL); return PP_DEFINE; } YY_BREAK case 9: YY_RULE_SETUP #line 93 "lex.l" { BEGIN(INITIAL); Return(PP_IFDEF, true); } YY_BREAK case 10: YY_RULE_SETUP #line 94 "lex.l" { BEGIN(INITIAL); Return(PP_IFDEF, false); } YY_BREAK case 11: YY_RULE_SETUP #line 95 "lex.l" { BEGIN(INITIAL); return PP_IF; } YY_BREAK case 12: YY_RULE_SETUP #line 96 "lex.l" { BEGIN(INITIAL); return PP_ELSE; } YY_BREAK case 13: YY_RULE_SETUP #line 97 "lex.l" { BEGIN(INITIAL); return PP_ELIF; } YY_BREAK case 14: YY_RULE_SETUP #line 98 "lex.l" { BEGIN(INITIAL); return PP_ENDIF; } YY_BREAK case 15: YY_RULE_SETUP #line 99 "lex.l" { BEGIN(INITIAL); return PP_UNDEF; } YY_BREAK case 16: YY_RULE_SETUP #line 100 "lex.l" { BEGIN(INITIAL); return PP_PRAGMA; } YY_BREAK case 17: YY_RULE_SETUP #line 101 "lex.l" { BEGIN(INITIAL); return PP_ERROR; } YY_BREAK case 18: YY_RULE_SETUP #line 102 "lex.l" { BEGIN(INITIAL); return PP_WARNING; } YY_BREAK case 19: YY_RULE_SETUP #line 103 "lex.l" { BEGIN(INITIAL); yyless(yyleng-1); return PP_UNKNOWN; } YY_BREAK case 20: YY_RULE_SETUP #line 104 "lex.l" { BEGIN(INITIAL); return PP_UNKNOWN; } YY_BREAK case 21: YY_RULE_SETUP #line 106 "lex.l" { return IF; } YY_BREAK case 22: YY_RULE_SETUP #line 107 "lex.l" { return ELSE; } YY_BREAK case 23: YY_RULE_SETUP #line 108 "lex.l" { return WHILE; } YY_BREAK case 24: YY_RULE_SETUP #line 109 "lex.l" { return DO; } YY_BREAK case 25: YY_RULE_SETUP #line 110 "lex.l" { return FOR; } YY_BREAK case 26: YY_RULE_SETUP #line 111 "lex.l" { return REPEAT; } YY_BREAK case 27: YY_RULE_SETUP #line 112 "lex.l" { yylval.fInt = Bytecode::kBreakFlow; return JUMP; } YY_BREAK case 28: YY_RULE_SETUP #line 113 "lex.l" { yylval.fInt = Bytecode::kContinueFlow; return JUMP; } YY_BREAK case 29: YY_RULE_SETUP #line 114 "lex.l" { yylval.fInt = Bytecode::kReturnFlow; return JUMP; } YY_BREAK case 30: YY_RULE_SETUP #line 115 "lex.l" { return SWITCH; } YY_BREAK case 31: YY_RULE_SETUP #line 116 "lex.l" { return CASE; } YY_BREAK case 32: YY_RULE_SETUP #line 117 "lex.l" { return DEFAULT; } YY_BREAK case 33: YY_RULE_SETUP #line 118 "lex.l" { return MONITOR; } YY_BREAK case 34: YY_RULE_SETUP #line 119 "lex.l" { return ACQUIRE; } YY_BREAK case 35: YY_RULE_SETUP #line 120 "lex.l" { return CATCH; } YY_BREAK case 36: YY_RULE_SETUP #line 121 "lex.l" { return GOTO; } YY_BREAK case 37: YY_RULE_SETUP #line 123 "lex.l" { return INT; } YY_BREAK case 38: YY_RULE_SETUP #line 124 "lex.l" { return T_VOID; } YY_BREAK case 39: YY_RULE_SETUP #line 125 "lex.l" { return T_CONST; } YY_BREAK case 40: YY_RULE_SETUP #line 126 "lex.l" { return SENSOR; } YY_BREAK case 41: YY_RULE_SETUP #line 127 "lex.l" { return TYPE; } YY_BREAK case 42: YY_RULE_SETUP #line 128 "lex.l" { return EVENT_SRC; } YY_BREAK case 43: YY_RULE_SETUP #line 129 "lex.l" { return TASKID; } YY_BREAK case 44: YY_RULE_SETUP #line 130 "lex.l" { return NOLIST; } YY_BREAK case 45: YY_RULE_SETUP #line 131 "lex.l" { return RES; } YY_BREAK case 46: YY_RULE_SETUP #line 132 "lex.l" { return ASM; } YY_BREAK case 47: YY_RULE_SETUP #line 133 "lex.l" { return TASK; } YY_BREAK case 48: YY_RULE_SETUP #line 134 "lex.l" { return SUB; } YY_BREAK case 49: YY_RULE_SETUP #line 135 "lex.l" { Return( TASKOP, kRCX_StopTaskOp); } YY_BREAK case 50: YY_RULE_SETUP #line 136 "lex.l" { Return( TASKOP, kRCX_StartTaskOp); } YY_BREAK case 51: YY_RULE_SETUP #line 137 "lex.l" { return ABS; } YY_BREAK case 52: YY_RULE_SETUP #line 138 "lex.l" { return SIGN; } YY_BREAK case 53: YY_RULE_SETUP #line 140 "lex.l" { Return( ASSIGN, kRCX_AddVar); } YY_BREAK case 54: YY_RULE_SETUP #line 141 "lex.l" { Return( ASSIGN, kRCX_SubVar); } YY_BREAK case 55: YY_RULE_SETUP #line 142 "lex.l" { Return( ASSIGN, kRCX_MulVar); } YY_BREAK case 56: YY_RULE_SETUP #line 143 "lex.l" { Return( ASSIGN, kRCX_DivVar); } YY_BREAK case 57: YY_RULE_SETUP #line 144 "lex.l" { Return( ASSIGN, kRCX_AndVar); } YY_BREAK case 58: YY_RULE_SETUP #line 145 "lex.l" { Return( ASSIGN, kRCX_OrVar); } YY_BREAK case 59: YY_RULE_SETUP #line 146 "lex.l" { Return( ASSIGN, kRCX_AbsVar); } YY_BREAK case 60: YY_RULE_SETUP #line 147 "lex.l" { Return( ASSIGN, kRCX_SgnVar); } YY_BREAK case 61: YY_RULE_SETUP #line 149 "lex.l" { Return( ASSIGN2, RIGHT); } YY_BREAK case 62: YY_RULE_SETUP #line 150 "lex.l" { Return( ASSIGN2, LEFT); } YY_BREAK case 63: YY_RULE_SETUP #line 151 "lex.l" { Return( ASSIGN2, '%'); } YY_BREAK case 64: YY_RULE_SETUP #line 152 "lex.l" { Return( ASSIGN2, '^'); } YY_BREAK case 65: YY_RULE_SETUP #line 154 "lex.l" { return REL_EQ; } YY_BREAK case 66: YY_RULE_SETUP #line 155 "lex.l" { return REL_NE; } YY_BREAK case 67: YY_RULE_SETUP #line 156 "lex.l" { return REL_LE; } YY_BREAK case 68: YY_RULE_SETUP #line 157 "lex.l" { return REL_GE; } YY_BREAK case 69: YY_RULE_SETUP #line 159 "lex.l" { return AND; } YY_BREAK case 70: YY_RULE_SETUP #line 160 "lex.l" { return OR; } YY_BREAK case 71: YY_RULE_SETUP #line 162 "lex.l" { Return( INCDEC, 1); } YY_BREAK case 72: YY_RULE_SETUP #line 163 "lex.l" { Return( INCDEC, 0); } YY_BREAK case 73: YY_RULE_SETUP #line 165 "lex.l" { return CTRUE; } YY_BREAK case 74: YY_RULE_SETUP #line 166 "lex.l" { return CFALSE; } YY_BREAK case 75: YY_RULE_SETUP #line 168 "lex.l" { return LEFT; } YY_BREAK case 76: YY_RULE_SETUP #line 169 "lex.l" { return RIGHT; } YY_BREAK case 77: YY_RULE_SETUP #line 171 "lex.l" { return INDIRECT; } YY_BREAK case 78: YY_RULE_SETUP #line 173 "lex.l" { yylval.fSymbol = Symbol::Get(yytext); return ID; } YY_BREAK case 79: YY_RULE_SETUP #line 174 "lex.l" { char*ptr; yylval.fInt = strtol(yytext, &ptr, 0); return NUMBER; } YY_BREAK case 80: YY_RULE_SETUP #line 175 "lex.l" { yylval.fInt = (int)atof(yytext); return NUMBER; } YY_BREAK case 81: YY_RULE_SETUP #line 177 "lex.l" { yytext[yyleng-1]=0; yylval.fString = yytext+1; return STRING; } YY_BREAK case 82: YY_RULE_SETUP #line 179 "lex.l" { if (sReturnWhitespace) return WS; } YY_BREAK case 83: YY_RULE_SETUP #line 182 "lex.l" { return yytext[0]; } YY_BREAK case 84: YY_RULE_SETUP #line 184 "lex.l" BEGIN(COMMENT); YY_BREAK case 85: YY_RULE_SETUP #line 185 "lex.l" /* eat anything that's not a '*' */ YY_BREAK case 86: YY_RULE_SETUP #line 186 "lex.l" /* eat up '*'s not followed by '/'s */ YY_BREAK case 87: YY_RULE_SETUP #line 187 "lex.l" /* eat up newlines */ YY_BREAK case 88: YY_RULE_SETUP #line 188 "lex.l" BEGIN(INITIAL); YY_BREAK case 89: YY_RULE_SETUP #line 191 "lex.l" ECHO; YY_BREAK #line 1293 "lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(PREPROC): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 277); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 191 "lex.l" void LexCurrentLocation(LexLocation &loc) { loc.fLength = yyleng; loc.fIndex = sSourceIndex; loc.fOffset = sOffset - yyleng; } void LexReturnWhitespace(int mode) { sReturnWhitespace = mode; } int LexFindAndPushFile(const char *name) { Buffer *b = Compiler::Get()->CreateBuffer(name); if (!b) { Error(kErr_FileOpen, name).RaiseLex(); return 0; } return LexPush(b); } int LexPush(Buffer *b) { InputFile *inputFile; int index; index = Compiler::Get()->AddBuffer(b); // make sure max file depth and file count haven't been exceeded if (sFileDepth == kMaxFileDepth || index > kMaxFileCount) return 0; // save line number and buffer in previous file if (sCurrentInputFile) { sCurrentInputFile->fSavedOffset = sOffset; sCurrentInputFile->fBufferState = YY_CURRENT_BUFFER; } inputFile = (InputFile *)malloc(sizeof(InputFile)); inputFile->fBufferState = yy_create_buffer(0, YY_BUF_SIZE); inputFile->fDataPtr = b->GetData(); inputFile->fDataRemain = b->GetLength(); inputFile->fSourceIndex = index; // link into list inputFile->fNext = sCurrentInputFile; sCurrentInputFile = inputFile; sFileDepth++; // switch to new buffer sOffset = 0; sSourceIndex = index; yy_switch_to_buffer(inputFile->fBufferState); return 1; } int yywrap() { InputFile *inputFile; // check for unterminated comments if (YY_START == COMMENT) { Error(kErr_UnterminatedComment).RaiseLex(); BEGIN(INITIAL); } // if no input files, just return if (sCurrentInputFile == 0) return 1; // pop an input file off the list inputFile = sCurrentInputFile; sCurrentInputFile = inputFile->fNext; sFileDepth--; // cleanup the input file yy_delete_buffer(YY_CURRENT_BUFFER); free(inputFile); // if no more files, just return 1 if (!sCurrentInputFile) return 1; // switch to next file yy_switch_to_buffer(sCurrentInputFile->fBufferState); sOffset = sCurrentInputFile->fSavedOffset; sSourceIndex = sCurrentInputFile->fSourceIndex; // tell yylex() to continue return 0; } void LexReset() { while(yywrap() == 0) ; } int FillBuffer(char *buf, int max_size) { int result; // if no files are pending, return 0 (EOF) if (!sCurrentInputFile) return 0; int n = sCurrentInputFile->fDataRemain; if (n > max_size) n = max_size; memcpy(buf, sCurrentInputFile->fDataPtr, n); sCurrentInputFile->fDataPtr += n; sCurrentInputFile->fDataRemain -= n; result = n; return result; } nqc-3.1.r6/compiler/LexLocation.h0000600000175000017500000000171110216070710014766 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __LexLocation_h #define __LexLocation_h class Buffer; #define kIllegalSrcIndex -1 typedef struct LexLocation { short fIndex; short fLength; long fOffset; } LexLocation; #endif nqc-3.1.r6/compiler/LocationNode.h0000600000175000017500000000236610216070706015137 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __LocationNode_h #define __LocationNode_h #ifndef __LexLocation_h #include "LexLocation.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif extern void LexCurrentLocation(LexLocation &loc); class LocationNode : public AutoFree { public: LocationNode(const LexLocation &loc) : fLocation(loc) {} LocationNode() { LexCurrentLocation(fLocation); } const LexLocation& GetLoc() const { return fLocation; } private: LexLocation fLocation; }; #endif nqc-3.1.r6/compiler/LogicalExpr.cpp0000600000175000017500000000415310216070702015315 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "LogicalExpr.h" #include "Bytecode.h" LogicalExpr::LogicalExpr (Expr *lhs, int op, Expr *rhs) : NodeExpr(lhs, rhs), fOp(op) { } Expr* LogicalExpr::Clone(Mapping *b) const { return new LogicalExpr(Get(0)->Clone(b), fOp, Get(1)->Clone(b)); } bool LogicalExpr::Evaluate(int &v) const { int v1, v2; bool d1, d2; bool b1, b2; bool dom; dom = (fOp==kLogicalOr) ? true : false; d1 = Get(0)->Evaluate(v1); d2 = Get(1)->Evaluate(v2); // convert to bool for easy check b1 = v1; b2 = v2; if ((d1 && (b1 == dom)) || (d2 && (b2 == dom))) { v = dom ? 1 : 0; return true; } if (d1 && d2) { v = dom ? 0 : 1; return true; } return false; } bool LogicalExpr::EmitBranch_(Bytecode &b, int label, bool condition) const { bool eitherOne; if (fOp == kLogicalOr) eitherOne = condition; else eitherOne = !condition; if (eitherOne) { /* test c1 -> label test c2 -> label */ if (!Get(0)->EmitBranch(b, label, condition)) return false; if (!Get(1)->EmitBranch(b, label, condition)) return false; } else { /* test !c1 -> out test c2->label out: */ int out = b.NewLabel(); if (!Get(0)->EmitBranch(b, out, !condition)) return false; if (!Get(1)->EmitBranch(b, label, condition)) return false; b.SetLabel(out); } return true; } nqc-3.1.r6/compiler/LogicalExpr.h0000600000175000017500000000257710216070700014770 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __LogicalExpr_h #define __LogicalExpr_h #include "NodeExpr.h" class LogicalExpr : public NodeExpr { public: enum { kLogicalOr = 0, kLogicalAnd }; LogicalExpr(Expr *lhs, int op, Expr *rhs); virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual bool EmitBranch_(Bytecode &b, int label, bool condition) const; // glue to emit values based on EmitBranch_() virtual RCX_Value EmitAny_(Bytecode &b) const { return EmitBoolAny(b); } virtual bool EmitTo_(Bytecode &b, int dst) const { return EmitBoolTo(b, dst); } private: int fOp; }; #endif nqc-3.1.r6/compiler/Macro.cpp0000600000175000017500000000216110216070674014152 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include using std::memcpy; #include "Macro.h" Macro::Macro(const Token *tokens, int count, int argCount) { fTokenCount = count; if (count) { fTokens = new Token[count]; memcpy(fTokens, tokens, sizeof(Token) * count); } else fTokens = nil; fArgCount = argCount; fMark = false; } Macro::~Macro() { delete [] fTokens; } nqc-3.1.r6/compiler/Macro.h0000600000175000017500000000257610216070670013625 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Macro_h #define __Macro_h #ifndef __Token_h #include "Token.h" #endif #ifndef __PTypes_h #include "PTypes.h" #endif class Macro { public: enum { kNoArgs = -1 }; Macro(const Token *tokens, int tokenCount, int argCount); ~Macro(); int GetTokenCount() const { return fTokenCount; } const Token* GetTokens() const { return fTokens; } int GetArgCount() const { return fArgCount; } bool IsMarked() const { return fMark; } void SetMark() { fMark = true; } void ClearMark() { fMark = false; } private: Token* fTokens; int fTokenCount; int fArgCount; bool fMark; }; #endif nqc-3.1.r6/compiler/Mapping.cpp0000600000175000017500000000242310216070576014506 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Mapping.h" #include "Expr.h" Mapping::Mapping() { } Mapping::~Mapping() { for(size_t i=0; iGetLValue(); } nqc-3.1.r6/compiler/Mapping.h0000600000175000017500000000233710216070574014155 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Mapping_h #define __Mapping_h #ifndef __Variable_h #include "Variable.h" #endif #include using std::vector; class Expr; class Mapping { public: Mapping(); ~Mapping(); void Add(int var, Expr *value); const Expr* Get(int var) const; int GetMappedVar(int var) const; private: struct Pair { Pair(int v, Expr *e) : fVar(v), fValue(e) {} int fVar; Expr* fValue; }; vector fPairs; }; #endif nqc-3.1.r6/compiler/ModExpr.cpp0000600000175000017500000000500210216070570014457 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ModExpr.h" #include "Bytecode.h" #include "RCX_Cmd.h" #define NON_VOLATILE_MASK (TYPEMASK(kRCX_VariableType) + \ TYPEMASK(kRCX_ConstantType)) Expr* ModExpr::Clone(Mapping *b) const { return new ModExpr(Get(0)->Clone(b), Get(1)->Clone(b)); } bool ModExpr::Evaluate(int &value) const { int v1, v2; if (!Get(0)->Evaluate(v1)) return false; if (!Get(1)->Evaluate(v2)) return false; value = v1 % v2; return true; } RCX_Value ModExpr::EmitAny_(Bytecode &b) const { int dst; dst = GetTempVar(b); if (dst < 0) return kIllegalEA; RCX_Value ea = RCX_VALUE(kRCX_VariableType, dst); if (EmitCalculation(b, dst)) { return ea; } else { b.ReleaseTempEA(ea); return kIllegalEA; } } bool ModExpr::EmitTo_(Bytecode &b, int dst) const { if (Get(1)->Contains(dst) || Get(0)->Contains(dst)) { RCX_Value ea; ea = EmitAny_(b); if (ea==kIllegalEA) return false; b.AddMove(dst, ea); b.ReleaseTempEA(ea); return true; } else { return EmitCalculation(b, dst); } } bool ModExpr::EmitCalculation(Bytecode &b, int dst) const { RCX_Value m, n; RCX_Cmd cmd; m = Get(0)->EmitConstrained(b, NON_VOLATILE_MASK); if (m == kIllegalEA) return false; n = Get(1)->EmitConstrained(b, NON_VOLATILE_MASK); if (n== kIllegalEA) { b.ReleaseTempEA(m); return false; } // dst = m b.AddMove(dst, m); // dst /= n cmd.MakeVar(kRCX_DivVar ,dst, n); b.Add(cmd); // dst *= n cmd.MakeVar(kRCX_MulVar, dst, n); b.Add(cmd); // dst -= m cmd.MakeVar(kRCX_SubVar, dst, m); b.Add(cmd); // dst *= -1 cmd.MakeVar(kRCX_MulVar, dst, RCX_VALUE(kRCX_ConstantType, -1)); b.Add(cmd); b.ReleaseTempEA(m); b.ReleaseTempEA(n); return true ; } nqc-3.1.r6/compiler/ModExpr.h0000600000175000017500000000226610216070564014140 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ModExpr_h #define __ModExpr_h #include "NodeExpr.h" class ModExpr : public NodeExpr { public: ModExpr(Expr *lhs, Expr *rhs) : NodeExpr(lhs, rhs) {}; virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; private: bool EmitCalculation(Bytecode &b, int dst) const; }; #endif nqc-3.1.r6/compiler/MonitorStmt.cpp0000600000175000017500000000642110216070560015405 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "MonitorStmt.h" #include "Bytecode.h" #include "Expr.h" #include "RCX_Cmd.h" #include "RCX_Target.h" #include "Error.h" #include "CatchStmt.h" #define SCOUT_MONITOR_MASK (TYPEMASK(kRCX_VariableType) + \ TYPEMASK(kRCX_ConstantType) + \ TYPEMASK(kRCX_RandomType)) MonitorStmt::MonitorStmt(Expr *events, Stmt* body, BlockStmt *handlers, const LexLocation &loc) : BinaryStmt(body, handlers), fEvents(events), fLocation(loc) { } MonitorStmt::~MonitorStmt() { delete fEvents; } void MonitorStmt::GetExprs(vector & v) const { v.push_back(fEvents); } void MonitorStmt::EmitActual(Bytecode &b) { if (!b.GetTarget()->fEvents) { Error(kErr_NoTargetEvents, b.GetTarget()->fName).Raise(&fLocation); return; } if (!b.BeginHandler(Bytecode::kEventHandler)) { Error(kErr_NoNestedEvents).Raise(&fLocation); return; } RCX_Value ea; RCX_Cmd cmd; int handlerLabel = b.NewLabel(); int endLabel = b.NewLabel(); // get EA of event mask if (b.GetTarget()->fType == kRCX_ScoutTarget) ea = fEvents->EmitConstrained(b, SCOUT_MONITOR_MASK); else ea = fEvents->EmitAny(b); if (ea==Expr::kIllegalEA) return; // start event monitoring cmd.Set(kRCX_StartEventMonOp, RCX_VALUE_TYPE(ea), RCX_VALUE_DATA(ea), RCX_VALUE_DATA(ea) >> 8, 0, 0); b.Add(cmd); b.AddFixup(Bytecode::kSignBitLongFixup, handlerLabel, 4, kRCX_SStartEventMonOp); b.ReleaseTempEA(ea); GetPrimary()->Emit(b); // end event monitoring cmd.Set(kRCX_ExitEventCheckOp); b.Add(cmd); // now iterate through handlers (which must be a block stmt BlockStmt *handlers = dynamic_cast(GetSecondary()); if (handlers) { for(Stmt *h=handlers->GetHead(); h; h=h->GetNext()) { b.AddJump(endLabel); b.SetLabel(handlerLabel); // prepare next handler test // handlerLabel = b.NewLabel(); b.NewLabel(); CatchStmt* cs = dynamic_cast(h); if (cs) { // conditional catch needs a daisy-chained label handlerLabel = b.NewLabel(); cs->SetLabel(handlerLabel); } else handlerLabel = kIllegalLabel; h->Emit(b); } } if (handlerLabel != kIllegalLabel) b.SetLabel(handlerLabel); b.SetLabel(endLabel); b.EndHandler(Bytecode::kEventHandler); } Stmt* MonitorStmt::CloneActual(Mapping *b) const { BlockStmt *s = GetSecondary() ? (BlockStmt*)GetSecondary()->Clone(b) : 0; return new MonitorStmt(fEvents->Clone(b), GetPrimary()->Clone(b), s, fLocation); } nqc-3.1.r6/compiler/MonitorStmt.h0000600000175000017500000000237610216070554015062 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __MonitorStmt_h #define __MonitorStmt_h #ifndef __BlockStmt_h #include "BlockStmt.h" #endif #ifndef __LexLocation_h #include "LexLocation.h" #endif class MonitorStmt : public BinaryStmt { public: MonitorStmt(Expr *events, Stmt *body, BlockStmt *handlers, const LexLocation &loc); ~MonitorStmt(); void GetExprs(vector & v) const; void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: Expr* fEvents; LexLocation fLocation; }; #endif nqc-3.1.r6/compiler/NegateExpr.cpp0000600000175000017500000000221610216070550015145 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "NegateExpr.h" Expr* NegateExpr::Clone(Mapping *b) const { return new NegateExpr(Get(0)->Clone(b)); } bool NegateExpr::EmitBranch_(Bytecode &b, int label, bool condition) const { return Get(0)->EmitBranch(b, label, !condition); } bool NegateExpr::Evaluate(int &value) const { if (!Get(0)->Evaluate(value)) return false; value = value ? 0 : 1; return true; } nqc-3.1.r6/compiler/NegateExpr.h0000600000175000017500000000245010216070544014615 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __NegateExpr_h #define __NegateExpr_h #include "NodeExpr.h" class NegateExpr : public NodeExpr { public: NegateExpr(Expr *e) : NodeExpr(e) {} virtual Expr* Clone(Mapping *b) const; virtual bool EmitBranch_(Bytecode &b, int label, bool condition) const; virtual bool Evaluate(int & value) const; // glue to emit values based on EmitBranch_() virtual RCX_Value EmitAny_(Bytecode &b) const { return EmitBoolAny(b); } virtual bool EmitTo_(Bytecode &b, int dst) const { return EmitBoolTo(b, dst); } }; #endif nqc-3.1.r6/compiler/NodeExpr.cpp0000600000175000017500000000313110216070540014623 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "NodeExpr.h" NodeExpr::NodeExpr(Expr *e) : Expr(e->GetLoc()) { fExprs[0] = e; fCount = 1; } NodeExpr::NodeExpr(Expr *a, Expr *b) : Expr(b->GetLoc()) { fExprs[0] = a; fExprs[1] = b; fCount = 2; } NodeExpr::NodeExpr(Expr *a, Expr *b, Expr *c) : Expr(b->GetLoc()) { fExprs[0] = a; fExprs[1] = b; fExprs[2] = c; fCount = 3; } NodeExpr::~NodeExpr() { for(int i=0; iContains(var)) return true; return false; } bool NodeExpr::PromiseConstant() const { for(int i=0; iPromiseConstant()) return false; return true; } void NodeExpr::GetExprs(vector &v) const { for(int i=0; i & /* v */) const; protected: Expr* Get(int i) { return fExprs[i]; } const Expr* Get(int i) const { return fExprs[i]; } private: static const int MAX_EXPRS = 3; Expr* fExprs[MAX_EXPRS]; int fCount; }; #endif nqc-3.1.r6/compiler/parse.cpp0000600000175000017500000023302310216070514014217 0ustar blpblp /* * A Bison parser, made from parse.y with Bison version GNU Bison version 1.24 */ #define YYBISON 1 /* Identify Bison output. */ #define OR 258 #define AND 259 #define REL_EQ 260 #define REL_NE 261 #define REL_LE 262 #define REL_GE 263 #define LEFT 264 #define RIGHT 265 #define UMINUS 266 #define INDIRECT 267 #define INCDEC 268 #define ABS 269 #define SIGN 270 #define TYPE 271 #define EVENT_SRC 272 #define LOWER_THAN_ELSE 273 #define ELSE 274 #define LOWER_THAN_EXPR_SHIFT 275 #define ID 276 #define NUMBER 277 #define ASSIGN 278 #define ASSIGN2 279 #define TASKOP 280 #define JUMP 281 #define TASK 282 #define SUB 283 #define STRING 284 #define PP_DEFINE 285 #define PP_INCLUDE 286 #define NL 287 #define WS 288 #define PP_ARG 289 #define PP_UNKNOWN 290 #define PP_IFDEF 291 #define PP_IF 292 #define PP_ELSE 293 #define PP_ELIF 294 #define PP_ENDIF 295 #define PP_UNDEF 296 #define PP_PRAGMA 297 #define PP_GLOM 298 #define PP_ERROR 299 #define PP_WARNING 300 #define IF 301 #define WHILE 302 #define DO 303 #define FOR 304 #define REPEAT 305 #define SWITCH 306 #define CASE 307 #define DEFAULT 308 #define MONITOR 309 #define CATCH 310 #define ACQUIRE 311 #define GOTO 312 #define ASM 313 #define INT 314 #define T_VOID 315 #define T_CONST 316 #define SENSOR 317 #define TASKID 318 #define NOLIST 319 #define RES 320 #define CTRUE 321 #define CFALSE 322 #line 1 "parse.y" /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. */ #line 19 "parse.y" // prevent redefinition of YYSTYPE in parser.h #define __PARSE_TAB_H // these classes must be defined prior to YYSTYPE #include "Fragment.h" #include "Resource.h" #include "BlockStmt.h" #include "Symbol.h" #include "Expr.h" #include "FunctionDef.h" #include "CallStmt.h" #include "AsmStmt.h" #include "CaseStmt.h" #include "DeclareStmt.h" #include "Fragment.h" #if __MWERKS__ #include #endif class Clause; class LocationNode; #line 45 "parse.y" typedef union { int fInt; bool fBool; Resource* fResource; Fragment* fFragment; Stmt* fStmt; BlockStmt* fBlock; Symbol* fSymbol; char* fString; Expr* fExpr; FunctionDef* fFunction; CallStmt* fCall; AsmStmt* fAsmStmt; Field* fField; CaseStmt* fCaseStmt; DeclareStmt* fDeclareStmt; LocationNode* fLocation; } YYSTYPE; #line 65 "parse.y" #include #include "IfStmt.h" #include "WhileStmt.h" #include "AsmStmt.h" #include "DoStmt.h" #include "RepeatStmt.h" #include "AssignStmt.h" #include "TaskStmt.h" #include "JumpStmt.h" #include "SwitchStmt.h" #include "ExprStmt.h" #include "RCX_Constants.h" #include "PreProc.h" #include "parser.h" #include "Program.h" #include "parse_util.h" #include "Program.h" #include "IncDecExpr.h" #include "AtomExpr.h" #include "TypeExpr.h" #include "Error.h" #include "MonitorStmt.h" #include "EventSrcExpr.h" #include "SensorExpr.h" #include "AssignMathStmt.h" #include "ForStmt.h" #include "RelExpr.h" #include "NegateExpr.h" #include "LogicalExpr.h" #include "TernaryExpr.h" #include "LabelStmt.h" #include "GotoStmt.h" #include "AddrOfExpr.h" #include "DerefExpr.h" #define yylex() (gPreProc->Get(yylval)) static LexLocation sSavedLoc; #line 155 "parse.y" static void yyerror(const char *msg); #ifndef YYLTYPE typedef struct yyltype { int timestamp; int first_line; int first_column; int last_line; int last_column; char *text; } yyltype; #define YYLTYPE yyltype #endif #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 328 #define YYFLAG -32768 #define YYNTBASE 93 #define YYTRANSLATE(x) ((unsigned)(x) <= 322 ? yytranslate[x] : 132) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 2, 2, 92, 22, 9, 2, 86, 35, 20, 19, 87, 18, 2, 21, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 83, 12, 88, 13, 4, 91, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 89, 2, 90, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 84, 7, 85, 24, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 5, 6, 10, 11, 14, 15, 16, 17, 23, 25, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 2, 5, 6, 10, 14, 18, 25, 32, 35, 42, 48, 50, 51, 57, 63, 68, 71, 73, 75, 76, 81, 84, 86, 89, 92, 96, 98, 101, 105, 109, 111, 113, 117, 120, 126, 130, 131, 136, 139, 140, 142, 144, 147, 152, 155, 157, 160, 167, 176, 183, 190, 197, 206, 215, 224, 235, 240, 246, 250, 255, 262, 266, 269, 271, 275, 279, 283, 285, 286, 288, 289, 291, 292, 295, 296, 299, 306, 309, 314, 318, 320, 321, 325, 327, 330, 334, 338, 342, 346, 350, 354, 358, 362, 366, 370, 374, 378, 382, 386, 390, 394, 397, 400, 403, 407, 411, 414, 417, 422, 427, 431, 434, 440, 443, 446, 449, 454, 459, 464, 467, 475, 481, 485, 492, 496, 497, 498, 502, 504, 505, 507, 510, 515, 522, 526, 528, 529 }; static const short yyrhs[] = { 94, 0, 94, 95, 0, 0, 74, 105, 83, 0, 126, 99, 126, 0, 126, 100, 126, 0, 126, 97, 84, 110, 85, 126, 0, 126, 96, 84, 110, 85, 126, 0, 129, 83, 0, 98, 75, 36, 86, 102, 35, 0, 43, 36, 86, 101, 35, 0, 79, 0, 0, 42, 36, 86, 35, 108, 0, 43, 36, 86, 35, 108, 0, 101, 87, 104, 36, 0, 104, 36, 0, 103, 0, 75, 0, 0, 103, 87, 104, 36, 0, 104, 36, 0, 74, 0, 76, 74, 0, 74, 9, 0, 76, 74, 9, 0, 77, 0, 74, 20, 0, 76, 74, 20, 0, 105, 87, 106, 0, 106, 0, 107, 0, 107, 88, 124, 0, 36, 126, 0, 36, 126, 89, 124, 90, 0, 20, 36, 126, 0, 0, 84, 109, 110, 85, 0, 110, 111, 0, 0, 83, 0, 108, 0, 121, 111, 0, 126, 36, 3, 111, 0, 1, 83, 0, 112, 0, 113, 126, 0, 62, 86, 124, 35, 126, 111, 0, 63, 126, 111, 62, 86, 124, 35, 83, 0, 65, 86, 124, 35, 126, 111, 0, 66, 86, 124, 35, 126, 111, 0, 61, 86, 124, 35, 126, 111, 0, 61, 86, 124, 35, 126, 111, 33, 111, 0, 69, 126, 86, 124, 35, 126, 108, 118, 0, 71, 126, 86, 124, 35, 126, 108, 117, 0, 64, 86, 115, 83, 116, 83, 115, 35, 126, 111, 0, 72, 36, 125, 83, 0, 73, 84, 127, 85, 83, 0, 125, 41, 83, 0, 40, 125, 36, 83, 0, 126, 36, 86, 122, 35, 83, 0, 74, 105, 83, 0, 114, 83, 0, 124, 0, 124, 38, 124, 0, 124, 39, 124, 0, 124, 88, 124, 0, 114, 0, 0, 124, 0, 0, 120, 0, 0, 118, 119, 0, 0, 70, 108, 0, 70, 126, 86, 124, 35, 108, 0, 70, 108, 0, 125, 67, 124, 3, 0, 125, 68, 3, 0, 123, 0, 0, 123, 87, 124, 0, 124, 0, 37, 125, 0, 124, 19, 124, 0, 124, 18, 124, 0, 124, 20, 124, 0, 124, 21, 124, 0, 124, 9, 124, 0, 124, 7, 124, 0, 124, 22, 124, 0, 124, 16, 124, 0, 124, 17, 124, 0, 124, 8, 124, 0, 124, 10, 124, 0, 124, 14, 124, 0, 124, 15, 124, 0, 124, 11, 124, 0, 124, 12, 124, 0, 124, 13, 124, 0, 81, 125, 0, 82, 125, 0, 26, 124, 0, 124, 6, 124, 0, 124, 5, 124, 0, 18, 124, 0, 24, 124, 0, 28, 86, 124, 35, 0, 29, 86, 124, 35, 0, 86, 124, 35, 0, 126, 36, 0, 126, 36, 89, 124, 90, 0, 91, 124, 0, 124, 27, 0, 27, 124, 0, 77, 86, 124, 35, 0, 30, 86, 124, 35, 0, 31, 86, 124, 35, 0, 126, 78, 0, 25, 86, 124, 35, 89, 124, 90, 0, 124, 4, 124, 3, 124, 0, 126, 9, 36, 0, 126, 9, 36, 89, 124, 90, 0, 126, 20, 36, 0, 0, 0, 127, 87, 128, 0, 128, 0, 0, 124, 0, 92, 124, 0, 92, 124, 3, 124, 0, 80, 124, 36, 84, 130, 85, 0, 130, 87, 131, 0, 131, 0, 0, 124, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 163, 167, 168, 171, 172, 173, 174, 175, 176, 180, 183, 186, 187, 190, 197, 200, 201, 204, 205, 206, 209, 210, 213, 214, 215, 216, 217, 218, 219, 223, 224, 227, 228, 231, 232, 233, 236, 236, 239, 240, 244, 245, 246, 247, 248, 249, 250, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 268, 269, 270, 271, 272, 273, 277, 278, 279, 280, 284, 285, 288, 289, 293, 294, 298, 299, 302, 303, 307, 310, 311, 314, 315, 318, 319, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 345, 346, 348, 349, 351, 352, 353, 354, 356, 357, 359, 360, 361, 362, 363, 364, 365, 366, 367, 370, 373, 376, 377, 378, 382, 383, 384, 388, 391, 392, 393, 396 }; static const char * const yytname[] = { "$","error","$undefined.","':'","'?'", "OR","AND","'|'","'^'","'&'","REL_EQ","REL_NE","'<'","'>'","REL_LE","REL_GE", "LEFT","RIGHT","'-'","'+'","'*'","'/'","'%'","UMINUS","'~'","INDIRECT","'!'", "INCDEC","ABS","SIGN","TYPE","EVENT_SRC","LOWER_THAN_ELSE","ELSE","LOWER_THAN_EXPR_SHIFT", "')'","ID","NUMBER","ASSIGN","ASSIGN2","TASKOP","JUMP","TASK","SUB","STRING", "PP_DEFINE","PP_INCLUDE","NL","WS","PP_ARG","PP_UNKNOWN","PP_IFDEF","PP_IF", "PP_ELSE","PP_ELIF","PP_ENDIF","PP_UNDEF","PP_PRAGMA","PP_GLOM","PP_ERROR","PP_WARNING", "IF","WHILE","DO","FOR","REPEAT","SWITCH","CASE","DEFAULT","MONITOR","CATCH", "ACQUIRE","GOTO","ASM","INT","T_VOID","T_CONST","SENSOR","TASKID","NOLIST","RES", "CTRUE","CFALSE","';'","'{'","'}'","'('","','","'='","'['","']'","'@'","'$'", "S","unit_list","unit","function_head","sub_head","nolist_opt","fragment","subfragment", "sarg_list","args","arg_list","arg_type","var_list","var_item","var_decl","block", "@1","stmt_list","stmt","control_stmt","misc_stmt","expr_stmt","opt_expr_stmt", "opt_expr","opt_handler","handler_list","evt_handler","handler","case","params", "param_list","expr","saveloc","loc","asm_list","asm_item","resource","res_data", "res_byte","" }; #endif static const short yyr1[] = { 0, 93, 94, 94, 95, 95, 95, 95, 95, 95, 96, 97, 98, 98, 99, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 104, 104, 104, 104, 104, 105, 105, 106, 106, 107, 107, 107, 109, 108, 110, 110, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 126, 127, 127, 127, 128, 128, 128, 129, 130, 130, 130, 131 }; static const short yyr2[] = { 0, 1, 2, 0, 3, 3, 3, 6, 6, 2, 6, 5, 1, 0, 5, 5, 4, 2, 1, 1, 0, 4, 2, 1, 2, 2, 3, 1, 2, 3, 3, 1, 1, 3, 2, 5, 3, 0, 4, 2, 0, 1, 1, 2, 4, 2, 1, 2, 6, 8, 6, 6, 6, 8, 8, 8, 10, 4, 5, 3, 4, 6, 3, 2, 1, 3, 3, 3, 1, 0, 1, 0, 1, 0, 2, 0, 2, 6, 2, 4, 3, 1, 0, 3, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 3, 2, 2, 4, 4, 3, 2, 5, 2, 2, 2, 4, 4, 4, 2, 7, 5, 3, 6, 3, 0, 0, 3, 1, 0, 1, 2, 4, 6, 3, 1, 0, 1 }; static const short yydefact[] = { 3, 127, 0, 127, 2, 13, 0, 0, 127, 0, 31, 32, 127, 127, 0, 127, 127, 0, 0, 0, 0, 126, 0, 126, 126, 127, 127, 0, 0, 0, 0, 12, 0, 0, 0, 127, 127, 9, 127, 34, 4, 0, 127, 107, 108, 127, 104, 116, 127, 127, 127, 127, 85, 127, 102, 103, 0, 114, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 115, 0, 0, 0, 112, 120, 0, 0, 40, 40, 0, 5, 6, 36, 127, 30, 33, 0, 0, 0, 0, 0, 0, 111, 0, 106, 105, 91, 95, 90, 96, 99, 100, 101, 97, 98, 93, 94, 87, 86, 88, 89, 92, 127, 123, 125, 127, 0, 0, 0, 0, 0, 0, 0, 109, 110, 118, 119, 117, 127, 138, 0, 136, 127, 0, 0, 0, 23, 0, 27, 0, 0, 0, 126, 0, 0, 127, 0, 0, 0, 127, 127, 0, 0, 0, 41, 37, 127, 42, 39, 46, 127, 0, 0, 64, 0, 0, 127, 20, 35, 127, 122, 134, 127, 0, 113, 14, 15, 25, 28, 24, 11, 0, 17, 45, 0, 127, 127, 0, 127, 127, 127, 0, 0, 126, 127, 0, 40, 8, 47, 63, 43, 127, 127, 127, 0, 127, 0, 112, 7, 19, 0, 18, 0, 0, 135, 124, 26, 29, 0, 0, 0, 0, 0, 68, 0, 0, 0, 127, 127, 0, 127, 131, 0, 129, 62, 0, 65, 66, 67, 59, 0, 80, 0, 127, 10, 0, 22, 121, 16, 60, 127, 127, 0, 127, 127, 127, 0, 0, 57, 132, 0, 127, 38, 79, 44, 0, 81, 84, 0, 0, 0, 127, 0, 70, 0, 0, 127, 127, 127, 58, 128, 0, 127, 21, 52, 48, 0, 127, 50, 51, 0, 0, 133, 61, 83, 0, 0, 0, 75, 73, 53, 49, 127, 54, 0, 55, 72, 0, 127, 74, 78, 56, 76, 0, 127, 0, 0, 77, 0, 0, 0 }; static const short yydefgoto[] = { 326, 1, 4, 32, 33, 34, 35, 36, 147, 218, 219, 148, 9, 10, 11, 165, 204, 126, 166, 167, 168, 169, 232, 280, 313, 311, 317, 314, 170, 273, 274, 171, 172, 28, 240, 241, 6, 138, 139 }; static const short yypact[] = {-32768, 16, -1, 912,-32768, -25, -50, 2,-32768, -53,-32768, -45, 912, 912, -42, 912, 912, -34, -4, -2, 5, -32768, 18,-32768,-32768, 912, 912, 1000, 17, 76, 77, -32768, 34, 35, 48,-32768,-32768,-32768,-32768, 41,-32768, -1, 912, 104, 104, 912, 104, 104, 912, 912, 912, 912,-32768, 912,-32768,-32768, 1033, 104, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912,-32768, 54, 96, 99, 50,-32768, 55, 56,-32768,-32768, 108,-32768,-32768,-32768, 912,-32768, 1588, 1065, 1097, 1129, 1161, 1193, 1225,-32768, 1514, 1634, 1655, 1675, 468, 545, 621, 621, 133, 133, 133, 133, 87, 87, 59, 59, 104, 104, 104, 772, 57,-32768, 912, 105, 1, 357, 435, 61, 284, 67, -32768,-32768,-32768,-32768,-32768, 912, 1588, -60,-32768, 912, 679, 75, 75, 11, 71,-32768, -11, 125, 79,-32768, 78, 80,-32768, 81, 82, 83,-32768,-32768, 127, 88, -1,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 90, 591, 767, -27, 65,-32768, 51,-32768, 912, 1612,-32768, 912, 703,-32768,-32768,-32768,-32768,-32768, 12,-32768, 23,-32768, -32768, 129, 912, 912, 591, 802, 912, 912, 84, 92, -32768, 193, 15,-32768,-32768,-32768,-32768,-32768, 912, 912, 912, 93, 912, 176, 3,-32768,-32768, 145, 94, 146, 727,-32768,-32768,-32768,-32768, 148, 103, 1257, 1289, 126, -32768, 106, 1321, 1353, 912, 912, 109, 912, 1588, -36, -32768,-32768, 513, 1588, 1588, 1588,-32768, 1539,-32768, 591, 843,-32768, 23,-32768,-32768,-32768,-32768,-32768,-32768, 101, 871,-32768,-32768, 1385, 1417,-32768, 1564, 110, 733,-32768, -32768,-32768, 161, 111, 1588, 164, 591, 591, 912, 114, 1588, 591, 591,-32768,-32768, 912,-32768,-32768, 118, 912, -32768, 169,-32768, 1449, 886,-32768,-32768, 75, 75, 1588, -32768, 1588, 591, 120, 170,-32768, 134,-32768,-32768,-32768, 139, 75,-32768,-32768, 591, 75,-32768,-32768,-32768,-32768, 128, 912, 1481, 75,-32768, 215, 216,-32768 }; static const short yypgoto[] = {-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -160, 64, 185,-32768, -141,-32768, -75, -167,-32768,-32768, -192, -68,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -3, -16, 86,-32768, -41,-32768,-32768, 49 }; #define YYLAST 1702 static const short yytable[] = { 27, 183, 184, 208, 231, 52, 250, 54, 55, 43, 44, 127, 46, 47, 212, 220, -1, 29, 30, 7, 185, 224, 56, 57, 188, 179, 79, 180, 230, 226, 40, 186, 225, 37, 41, 8, 143, 80, 38, 93, 213, 214, 94, 42, 45, 95, 96, 97, 98, 268, 99, 269, 48, 81, 31, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 79, 144, 189, 145, 146, 74, 75, 76, 49, 272, 50, 80, 77, 5, 129, 251, 2, 51, 123, 276, 39, 82, 3, 144, 242, 145, 146, 215, 41, 231, 53, 72, 73, 74, 75, 76, 292, 293, 83, 84, 77, 296, 297, 137, 85, 86, 141, 88, 89, 87, 90, 144, 217, 145, 146, 243, 91, 77, 121, 178, 192, 122, 308, 181, 120, 123, 142, 124, 125, 82, 128, 187, 140, 175, 319, 70, 71, 72, 73, 74, 75, 76, 177, 306, 307, 163, 77, 190, 191, 201, 193, 227, 194, 196, 197, 198, 235, 318, 202, 207, 221, 320, 247, 137, 236, 249, 252, 253, 254, 325, 256, 237, 257, 279, 260, 261, 228, 229, 266, 287, 233, 234, 289, 295, 290, 239, 291, 301, 303, 309, 312, 310, 244, 245, 246, 316, 248, 12, 173, 173, 322, 327, 328, 13, 14, 15, 16, 17, 18, 19, 20, 203, 92, 305, 288, 222, 21, 0, 264, 265, 0, 267, 0, 0, 0, 195, 0, 0, 0, 199, 200, 0, 0, 0, 275, 0, 205, 0, 0, 0, 206, 0, 173, 0, 281, 0, 216, 0, 0, 0, 0, 0, 239, 0, 0, 0, 22, 0, 0, 0, 23, 24, 294, 0, -130, 25, -130, 173, 0, 300, 26, 238, 0, 302, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 323, 0, 0, 0, 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, 173, 0, 0, 0, 0, 0, 0, 0, 277, 278, 0, 0, 282, 283, 0, 0, 0, 0, 0, 0, 0, 0, 149, 0, 0, 0, 0, 173, 173, 0, -127, 0, 173, 173, 298, 299, 0, 0, 176, 12, 0, -127, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 173, 0, 0, 0, -127, 21, 0, 315, 150, -126, 0, 0, 173, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 151, 152, 153, 154, 155, 156, -126, -126, 157, 0, 158, 159, 160, 161, 0, 0, 22, -127, 149, 0, 23, 24, 162, 163, 164, 25, -127, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -127, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -127, 21, 0, 0, 150, -126, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 151, 152, 153, 154, 155, 156, -126, -126, 157, 0, 158, 159, 160, 161, 0, 0, 22, -127, 149, 0, 23, 24, 162, 163, 174, 25, -127, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -127, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -127, 21, 0, 0, 150, -126, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 151, 152, 153, 154, 155, 156, -126, -126, 157, 0, 158, 159, 160, 161, 0, 0, 22, -127, 149, 0, 23, 24, 162, 163, 270, 25, -127, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -127, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -127, 21, 0, 0, 150, -126, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 151, 152, 153, 154, 155, 156, -126, -126, 157, 0, 158, 159, 160, 161, 0, 0, 22, -127, 0, 0, 23, 24, 162, 163, 0, 25, 0, 0, 0, 0, 26, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 12, 0, 0, 77, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 182, 21, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 12, 0, 0, 223, 77, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 209, 210, 0, 0, 21, 22, 0, 0, 0, 23, 24, 0, 255, 0, 25, 12, 0, 0, 0, 26, 238, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 23, 24, 211, 0, -137, 25, -137, 0, 12, 0, 26, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, -82, 22, 21, 0, 0, 23, 24, -69, 0, 0, 25, 12, 0, 0, 0, 26, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 12, 0, 0, 0, 21, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 22, -69, 0, 21, 23, 24, 0, 0, 0, 25, 12, 0, 0, 0, 26, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 22, 21, 0, 0, 23, 24, -71, 0, 0, 25, 0, 0, 0, 0, 26, 22, 0, 0, 0, 23, 24, 0, 0, 0, 25, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 23, 24, 0, 0, 0, 25, 0, 0, 0, 0, 26, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 78, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 100, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 130, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 131, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 132, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 133, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 134, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 135, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 258, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 259, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 262, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 263, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 284, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 285, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 304, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 324, 136, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 271, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 286, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77,-32768, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 0, 0, 0, 0, 77 }; static const short yycheck[] = { 3, 142, 143, 170, 196, 21, 3, 23, 24, 12, 13, 86, 15, 16, 41, 175, 0, 42, 43, 20, 9, 9, 25, 26, 35, 85, 9, 87, 195, 189, 83, 20, 20, 83, 87, 36, 35, 20, 36, 42, 67, 68, 45, 88, 86, 48, 49, 50, 51, 85, 53, 87, 86, 36, 79, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 9, 74, 87, 76, 77, 20, 21, 22, 86, 250, 86, 20, 27, 1, 91, 86, 74, 86, 89, 253, 8, 78, 80, 74, 83, 76, 77, 36, 87, 295, 86, 18, 19, 20, 21, 22, 277, 278, 36, 36, 27, 282, 283, 120, 84, 84, 123, 35, 36, 75, 38, 74, 75, 76, 77, 204, 89, 27, 36, 136, 150, 36, 303, 140, 84, 89, 35, 86, 86, 78, 36, 74, 89, 86, 315, 16, 17, 18, 19, 20, 21, 22, 89, 298, 299, 84, 27, 36, 83, 36, 86, 36, 86, 86, 86, 86, 86, 312, 84, 83, 177, 316, 83, 180, 86, 3, 35, 87, 36, 324, 36, 201, 83, 86, 62, 83, 193, 194, 83, 83, 197, 198, 35, 83, 87, 202, 36, 83, 33, 83, 70, 35, 209, 210, 211, 70, 213, 18, 126, 127, 86, 0, 0, 24, 25, 26, 27, 28, 29, 30, 31, 161, 41, 295, 269, 180, 37, -1, 235, 236, -1, 238, -1, -1, -1, 153, -1, -1, -1, 157, 158, -1, -1, -1, 251, -1, 164, -1, -1, -1, 168, -1, 170, -1, 261, -1, 174, -1, -1, -1, -1, -1, 269, -1, -1, -1, 77, -1, -1, -1, 81, 82, 279, -1, 85, 86, 87, 195, -1, 286, 91, 92, -1, 290, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, 243, -1, -1, -1, -1, -1, -1, 250, -1, -1, -1, -1, -1, -1, -1, 258, 259, -1, -1, 262, 263, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 277, 278, -1, 9, -1, 282, 283, 284, 285, -1, -1, 90, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, 303, -1, -1, -1, 36, 37, -1, 310, 40, 41, -1, -1, 315, 316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, -1, -1, 81, 82, 83, 84, -1, 86, -1, -1, -1, -1, 91, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, 18, -1, -1, 27, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 90, 37, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 18, -1, -1, 90, 27, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, 38, 39, -1, -1, 37, 77, -1, -1, -1, 81, 82, -1, 90, -1, 86, 18, -1, -1, -1, 91, 92, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, 81, 82, 88, -1, 85, 86, 87, -1, 18, -1, 91, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, 35, 77, 37, -1, -1, 81, 82, 83, -1, -1, 86, 18, -1, -1, -1, 91, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, 18, -1, -1, -1, 37, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, 77, 35, -1, 37, 81, 82, -1, -1, -1, 86, 18, -1, -1, -1, 91, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 77, 37, -1, -1, 81, 82, 83, -1, -1, 86, -1, -1, -1, -1, 91, 77, -1, -1, -1, 81, 82, -1, -1, -1, 86, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, 81, 82, -1, -1, -1, 86, -1, -1, -1, -1, 91, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, -1, 36, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ #ifndef alloca #include #endif /* alloca not defined. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT return(0) #define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else #define YYLEX yylex(&yylval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, YYLEX_PARAM) #else #define YYLEX yylex(&yylval) #endif #endif /* not YYLSP_NEEDED */ #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ int yyparse (void); #endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (from, to, count) char *from; char *to; int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (char *from, char *to, int count) { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 192 "bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; #else #define YYPARSE_PARAM #define YYPARSE_PARAM_DECL #endif int yyparse(YYPARSE_PARAM) YYPARSE_PARAM_DECL { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 163 "parse.y" { yyval.fInt = 0; ; break;} case 4: #line 171 "parse.y" { gProgram->AddGlobalDecls(yyvsp[-1].fBlock); ; break;} case 5: #line 172 "parse.y" { yyvsp[-1].fFragment->SetLocations(yyvsp[-2].fLocation, yyvsp[0].fLocation); ; break;} case 6: #line 173 "parse.y" { yyvsp[-1].fFragment->SetLocations(yyvsp[-2].fLocation, yyvsp[0].fLocation); ; break;} case 7: #line 174 "parse.y" { EndSubWithParams(yyvsp[-4].fFragment, yyvsp[-2].fBlock, yyvsp[-5].fLocation, yyvsp[0].fLocation); ; break;} case 8: #line 175 "parse.y" { EndFunction(yyvsp[-4].fFunction, yyvsp[-2].fBlock, yyvsp[-5].fLocation, yyvsp[0].fLocation); ; break;} case 9: #line 176 "parse.y" { gProgram->AddResource(yyvsp[-1].fResource); ; break;} case 10: #line 180 "parse.y" { yyval.fFunction = BeginFunction(yyvsp[-1].fFunction, yyvsp[-3].fSymbol, yyvsp[-5].fBool); ; break;} case 11: #line 183 "parse.y" { yyval.fFragment = BeginSubWithParams(yyvsp[-1].fFragment, yyvsp[-3].fSymbol); ; break;} case 12: #line 186 "parse.y" { yyval.fBool = 0; ; break;} case 13: #line 187 "parse.y" { yyval.fBool = 1; ; break;} case 14: #line 190 "parse.y" { yyval.fFragment = new Fragment(true, yyvsp[-3].fSymbol, yyvsp[0].fStmt); ; break;} case 15: #line 197 "parse.y" { yyval.fFragment = new Fragment(false, yyvsp[-3].fSymbol, yyvsp[0].fStmt); ; break;} case 16: #line 200 "parse.y" { yyval.fFragment = yyvsp[-3].fFragment; DefineSubArg(yyval.fFragment, yyvsp[0].fSymbol, yyvsp[-1].fInt); ; break;} case 17: #line 201 "parse.y" { yyval.fFragment = new Fragment(false); DefineSubArg(yyval.fFragment,yyvsp[0].fSymbol,yyvsp[-1].fInt); ; break;} case 19: #line 205 "parse.y" { yyval.fFunction = new FunctionDef(); ; break;} case 20: #line 206 "parse.y" { yyval.fFunction = new FunctionDef(); ; break;} case 21: #line 209 "parse.y" { yyval.fFunction = yyvsp[-3].fFunction; DefineArg(yyval.fFunction, yyvsp[0].fSymbol, yyvsp[-1].fInt); ; break;} case 22: #line 210 "parse.y" { yyval.fFunction = new FunctionDef(); DefineArg(yyval.fFunction,yyvsp[0].fSymbol,yyvsp[-1].fInt); ; break;} case 23: #line 213 "parse.y" { yyval.fInt = FunctionDef::kIntegerArg; ; break;} case 24: #line 214 "parse.y" { yyval.fInt = FunctionDef::kConstantArg; ; break;} case 25: #line 215 "parse.y" { yyval.fInt = FunctionDef::kReferenceArg; ; break;} case 26: #line 216 "parse.y" { yyval.fInt = FunctionDef::kConstRefArg; ; break;} case 27: #line 217 "parse.y" { yyval.fInt = FunctionDef::kSensorArg; ; break;} case 28: #line 218 "parse.y" { yyval.fInt = FunctionDef::kPointerArg; ; break;} case 29: #line 219 "parse.y" { yyval.fInt = FunctionDef::kConstPtrArg; ; break;} case 30: #line 223 "parse.y" { yyvsp[-2].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-2].fBlock; ; break;} case 31: #line 224 "parse.y" { yyval.fBlock = new BlockStmt(); yyval.fBlock->Add(yyvsp[0].fStmt); ; break;} case 32: #line 227 "parse.y" { yyval.fStmt = yyvsp[0].fDeclareStmt; ; break;} case 33: #line 228 "parse.y" { yyval.fStmt = yyvsp[-2].fDeclareStmt; yyvsp[-2].fDeclareStmt->SetInitialValue(yyvsp[0].fExpr); ; break;} case 34: #line 231 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-1].fSymbol, yyvsp[0].fLocation, 0, false, false); ; break;} case 35: #line 232 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-4].fSymbol, yyvsp[-3].fLocation, yyvsp[-1].fExpr, false, false); ; break;} case 36: #line 233 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-1].fSymbol, yyvsp[0].fLocation, 0, true, false); ; break;} case 37: #line 236 "parse.y" { BeginScope(); ; break;} case 38: #line 236 "parse.y" { yyval.fStmt = EndScope(yyvsp[-1].fBlock); ; break;} case 39: #line 239 "parse.y" { yyvsp[-1].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-1].fBlock; ; break;} case 40: #line 240 "parse.y" { yyval.fBlock = new BlockStmt(); ; break;} case 41: #line 244 "parse.y" { yyval.fStmt = new BlockStmt(); ; break;} case 43: #line 246 "parse.y" { yyval.fStmt = yyvsp[-1].fCaseStmt; yyvsp[-1].fCaseStmt->SetStmt(yyvsp[0].fStmt); ; break;} case 44: #line 247 "parse.y" { yyval.fStmt = new LabelStmt(yyvsp[-2].fSymbol, yyvsp[-3].fLocation->GetLoc(), yyvsp[0].fStmt); delete yyvsp[-3].fLocation; ; break;} case 45: #line 248 "parse.y" { yyerrok; yyval.fStmt = new BlockStmt(); ; break;} case 47: #line 250 "parse.y" { yyvsp[-1].fStmt->SetLocation(yyvsp[0].fLocation); ; break;} case 48: #line 255 "parse.y" { yyval.fStmt = new WhileStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 49: #line 256 "parse.y" { yyval.fStmt = new DoStmt(yyvsp[-2].fExpr, yyvsp[-5].fStmt); yyval.fStmt->SetLocation(yyvsp[-6].fLocation); ; break;} case 50: #line 257 "parse.y" { yyval.fStmt = new RepeatStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 51: #line 258 "parse.y" { yyval.fStmt = new SwitchStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 52: #line 259 "parse.y" { yyval.fStmt = new IfStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 53: #line 260 "parse.y" { yyval.fStmt = new IfStmt(yyvsp[-5].fExpr, yyvsp[-2].fStmt, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-3].fLocation); ; break;} case 54: #line 261 "parse.y" { yyval.fStmt = new MonitorStmt(yyvsp[-4].fExpr, yyvsp[-1].fStmt, yyvsp[0].fBlock, yyvsp[-6].fLocation->GetLoc()); delete yyvsp[-6].fLocation; yyval.fStmt->SetLocation(yyvsp[-2].fLocation); ; break;} case 55: #line 262 "parse.y" { yyval.fStmt = MakeAcquireStmt(yyvsp[-4].fExpr, yyvsp[-1].fStmt, yyvsp[0].fStmt, yyvsp[-6].fLocation); yyval.fStmt->SetLocation(yyvsp[-2].fLocation); ; break;} case 56: #line 263 "parse.y" { yyval.fStmt = new ForStmt(yyvsp[-7].fStmt, yyvsp[-5].fExpr, yyvsp[-3].fStmt, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 57: #line 264 "parse.y" { yyval.fStmt = new GotoStmt(yyvsp[-2].fSymbol, sSavedLoc); ; break;} case 58: #line 268 "parse.y" { yyval.fStmt = yyvsp[-2].fAsmStmt; ; break;} case 59: #line 269 "parse.y" { yyval.fStmt = new JumpStmt(yyvsp[-1].fInt, sSavedLoc); ; break;} case 60: #line 270 "parse.y" { yyval.fStmt = new TaskStmt((UByte)yyvsp[-3].fInt, yyvsp[-1].fSymbol, sSavedLoc); ; break;} case 61: #line 271 "parse.y" { yyval.fStmt = yyvsp[-2].fCall; yyvsp[-2].fCall->SetName(yyvsp[-4].fSymbol); yyvsp[-2].fCall->SetLocation(yyvsp[-5].fLocation->GetLoc()); delete yyvsp[-5].fLocation; ; break;} case 62: #line 272 "parse.y" { yyval.fStmt = yyvsp[-1].fBlock; ; break;} case 64: #line 277 "parse.y" { yyval.fStmt = new ExprStmt(yyvsp[0].fExpr); ; break;} case 65: #line 278 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = MakeAssignStmt(yyvsp[-2].fExpr, yyvsp[-1].fInt, yyvsp[0].fExpr); ; break;} case 66: #line 279 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = MakeAssign2Stmt(yyvsp[-2].fExpr, yyvsp[-1].fInt, yyvsp[0].fExpr); ; break;} case 67: #line 280 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = new AssignStmt(yyvsp[-2].fExpr, yyvsp[0].fExpr); ; break;} case 69: #line 285 "parse.y" { yyval.fStmt = 0; ; break;} case 71: #line 289 "parse.y" { yyval.fExpr = 0; ; break;} case 73: #line 294 "parse.y" { yyval.fStmt = 0; ; break;} case 74: #line 298 "parse.y" { yyvsp[-1].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-1].fBlock; ; break;} case 75: #line 299 "parse.y" { yyval.fBlock = new BlockStmt(); ; break;} case 76: #line 302 "parse.y" { yyval.fStmt = yyvsp[0].fStmt; ; break;} case 77: #line 303 "parse.y" { yyval.fStmt = MakeCatchStmt(yyvsp[-2].fExpr, yyvsp[0].fStmt, yyvsp[-4].fLocation); ; break;} case 78: #line 307 "parse.y" { yyval.fStmt = yyvsp[0].fStmt; ; break;} case 79: #line 310 "parse.y" { yyval.fCaseStmt = MakeCaseStmt(yyvsp[-1].fExpr, sSavedLoc); ; break;} case 80: #line 311 "parse.y" { yyval.fCaseStmt = new CaseStmt(CaseStmt::kDefaultValue, sSavedLoc); ; break;} case 82: #line 315 "parse.y" { yyval.fCall = new CallStmt(); ; break;} case 83: #line 318 "parse.y" { yyval.fCall = yyvsp[-2].fCall; yyval.fCall->AddParam(yyvsp[0].fExpr); ; break;} case 84: #line 319 "parse.y" { yyval.fCall = new CallStmt(); yyval.fCall->AddParam(yyvsp[0].fExpr); ; break;} case 85: #line 322 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, yyvsp[-1].fInt, sSavedLoc); ; break;} case 86: #line 323 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '+', yyvsp[0].fExpr); ; break;} case 87: #line 324 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '-', yyvsp[0].fExpr); ; break;} case 88: #line 325 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '*', yyvsp[0].fExpr); ; break;} case 89: #line 326 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '/', yyvsp[0].fExpr); ; break;} case 90: #line 327 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '&', yyvsp[0].fExpr); ; break;} case 91: #line 328 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '|', yyvsp[0].fExpr); ; break;} case 92: #line 329 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '%', yyvsp[0].fExpr); ; break;} case 93: #line 330 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, LEFT, yyvsp[0].fExpr); ; break;} case 94: #line 331 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, RIGHT, yyvsp[0].fExpr); ; break;} case 95: #line 332 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '^', yyvsp[0].fExpr); ; break;} case 96: #line 333 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kEqualTo, yyvsp[0].fExpr); ; break;} case 97: #line 334 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kLessOrEqual, yyvsp[0].fExpr); ; break;} case 98: #line 335 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kGreaterOrEqual, yyvsp[0].fExpr); ; break;} case 99: #line 336 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kNotEqualTo, yyvsp[0].fExpr); ; break;} case 100: #line 337 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kLessThan, yyvsp[0].fExpr); ; break;} case 101: #line 338 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kGreaterThan, yyvsp[0].fExpr); ; break;} case 102: #line 339 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, 1, sSavedLoc); ; break;} case 103: #line 340 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, 0, sSavedLoc); ; break;} case 104: #line 341 "parse.y" { yyval.fExpr = new NegateExpr(yyvsp[0].fExpr); ; break;} case 105: #line 342 "parse.y" { yyval.fExpr = new LogicalExpr(yyvsp[-2].fExpr, LogicalExpr::kLogicalAnd, yyvsp[0].fExpr); ; break;} case 106: #line 343 "parse.y" { yyval.fExpr = new LogicalExpr(yyvsp[-2].fExpr, LogicalExpr::kLogicalOr, yyvsp[0].fExpr); ; break;} case 107: #line 345 "parse.y" { yyval.fExpr = MakeBinaryExpr(new AtomExpr(kRCX_ConstantType, 0, yyvsp[0].fExpr->GetLoc()), '-', yyvsp[0].fExpr); ; break;} case 108: #line 346 "parse.y" { yyval.fExpr = MakeUnaryExpr('~', yyvsp[0].fExpr); ; break;} case 109: #line 348 "parse.y" { yyval.fExpr = MakeUnaryExpr(ABS, yyvsp[-1].fExpr); ; break;} case 110: #line 349 "parse.y" { yyval.fExpr = MakeUnaryExpr(SIGN, yyvsp[-1].fExpr); ; break;} case 111: #line 351 "parse.y" { yyval.fExpr = yyvsp[-1].fExpr; ; break;} case 112: #line 352 "parse.y" { yyval.fExpr = MakeVarExpr(yyvsp[0].fSymbol, yyvsp[-1].fLocation); ; break;} case 113: #line 353 "parse.y" { yyval.fExpr = MakeArrayExpr(yyvsp[-3].fSymbol, yyvsp[-4].fLocation, yyvsp[-1].fExpr); ; break;} case 114: #line 354 "parse.y" { yyval.fExpr = MakeValueExpr(yyvsp[0].fExpr); ; break;} case 115: #line 356 "parse.y" { yyval.fExpr = MakeIncDecExpr(yyvsp[-1].fExpr, yyvsp[0].fInt, false, yyvsp[-1].fExpr->GetLoc()); ; break;} case 116: #line 357 "parse.y" { yyval.fExpr = MakeIncDecExpr(yyvsp[0].fExpr, yyvsp[-1].fInt, true, yyvsp[0].fExpr->GetLoc()); ; break;} case 117: #line 359 "parse.y" { yyval.fExpr = new SensorExpr(yyvsp[-1].fExpr); ; break;} case 118: #line 360 "parse.y" { yyval.fExpr = new TypeExpr(yyvsp[-1].fExpr); ; break;} case 119: #line 361 "parse.y" { yyval.fExpr = new EventSrcExpr(yyvsp[-1].fExpr, gProgram->GetTarget()->fType); ; break;} case 120: #line 362 "parse.y" { yyval.fExpr = MakeTaskIdExpr(yyvsp[-1].fLocation); ; break;} case 121: #line 363 "parse.y" { yyval.fExpr = MakeIndirectExpr(yyvsp[-4].fExpr, yyvsp[-1].fExpr); ; break;} case 122: #line 364 "parse.y" { yyval.fExpr = new TernaryExpr(yyvsp[-4].fExpr, yyvsp[-2].fExpr, yyvsp[0].fExpr); ; break;} case 123: #line 365 "parse.y" { yyval.fExpr = MakeAddrOfExpr(yyvsp[0].fSymbol, yyvsp[-2].fLocation, (Expr *)0); ; break;} case 124: #line 366 "parse.y" { yyval.fExpr = MakeAddrOfExpr(yyvsp[-3].fSymbol, yyvsp[-5].fLocation, yyvsp[-1].fExpr); ; break;} case 125: #line 367 "parse.y" { yyval.fExpr = MakeDerefExpr(yyvsp[0].fSymbol, yyvsp[-2].fLocation); ; break;} case 126: #line 370 "parse.y" { LexCurrentLocation(sSavedLoc); ; break;} case 127: #line 373 "parse.y" { yyval.fLocation = new LocationNode(); ; break;} case 128: #line 376 "parse.y" { yyval.fAsmStmt = yyvsp[-2].fAsmStmt; yyvsp[-2].fAsmStmt->Add(yyvsp[0].fField); ; break;} case 129: #line 377 "parse.y" { yyval.fAsmStmt = new AsmStmt(); yyval.fAsmStmt->Add(yyvsp[0].fField); ; break;} case 130: #line 378 "parse.y" { yyval.fAsmStmt = new AsmStmt(); ; break;} case 131: #line 382 "parse.y" { yyval.fField = MakeConstField(yyvsp[0].fExpr); ; break;} case 132: #line 383 "parse.y" { yyval.fField = new EAField(yyvsp[0].fExpr); ; break;} case 133: #line 384 "parse.y" { yyval.fField = new EAField(yyvsp[-2].fExpr, GetConstantValue(yyvsp[0].fExpr)); ; break;} case 134: #line 388 "parse.y" { yyval.fResource=yyvsp[-1].fResource; yyvsp[-1].fResource->SetInfo((RCX_ChunkType)GetConstantValue(yyvsp[-4].fExpr), yyvsp[-3].fSymbol); ; break;} case 135: #line 391 "parse.y" { yyval.fResource = yyvsp[-2].fResource; yyvsp[-2].fResource->Add(yyvsp[0].fInt); ; break;} case 136: #line 392 "parse.y" { yyval.fResource = new Resource(); yyval.fResource->Add(yyvsp[0].fInt); ; break;} case 137: #line 393 "parse.y" { yyval.fResource = new Resource(); ; break;} case 138: #line 396 "parse.y" { yyval.fInt = GetConstantValue(yyvsp[0].fExpr); ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 487 "bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; } #line 400 "parse.y" void yyerror(const char *msg) { Error(kErr_Parser, msg).RaiseLex(); } nqc-3.1.r6/compiler/parse.tab.h0000600000175000017500000000340710216070472014435 0ustar blpblp// typedef union { int fInt; bool fBool; Resource* fResource; Fragment* fFragment; Stmt* fStmt; BlockStmt* fBlock; Symbol* fSymbol; char* fString; Expr* fExpr; FunctionDef* fFunction; CallStmt* fCall; AsmStmt* fAsmStmt; Field* fField; CaseStmt* fCaseStmt; DeclareStmt* fDeclareStmt; LocationNode* fLocation; } YYSTYPE; #define OR 258 #define AND 259 #define REL_EQ 260 #define REL_NE 261 #define REL_LE 262 #define REL_GE 263 #define LEFT 264 #define RIGHT 265 #define UMINUS 266 #define INDIRECT 267 #define INCDEC 268 #define ABS 269 #define SIGN 270 #define TYPE 271 #define EVENT_SRC 272 #define LOWER_THAN_ELSE 273 #define ELSE 274 #define LOWER_THAN_EXPR_SHIFT 275 #define ID 276 #define NUMBER 277 #define ASSIGN 278 #define ASSIGN2 279 #define TASKOP 280 #define JUMP 281 #define TASK 282 #define SUB 283 #define STRING 284 #define PP_DEFINE 285 #define PP_INCLUDE 286 #define NL 287 #define WS 288 #define PP_ARG 289 #define PP_UNKNOWN 290 #define PP_IFDEF 291 #define PP_IF 292 #define PP_ELSE 293 #define PP_ELIF 294 #define PP_ENDIF 295 #define PP_UNDEF 296 #define PP_PRAGMA 297 #define PP_GLOM 298 #define PP_ERROR 299 #define PP_WARNING 300 #define IF 301 #define WHILE 302 #define DO 303 #define FOR 304 #define REPEAT 305 #define SWITCH 306 #define CASE 307 #define DEFAULT 308 #define MONITOR 309 #define CATCH 310 #define ACQUIRE 311 #define GOTO 312 #define ASM 313 #define INT 314 #define T_VOID 315 #define T_CONST 316 #define SENSOR 317 #define TASKID 318 #define NOLIST 319 #define RES 320 #define CTRUE 321 #define CFALSE 322 extern YYSTYPE yylval; nqc-3.1.r6/compiler/parse.y0000600000175000017500000003053210216065402013705 0ustar blpblp%{ /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ %} %{ // prevent redefinition of YYSTYPE in parser.h #define __PARSE_TAB_H // these classes must be defined prior to YYSTYPE #include "Fragment.h" #include "Resource.h" #include "BlockStmt.h" #include "Symbol.h" #include "Expr.h" #include "FunctionDef.h" #include "CallStmt.h" #include "AsmStmt.h" #include "CaseStmt.h" #include "DeclareStmt.h" #include "Fragment.h" #if __MWERKS__ #include #endif class Clause; class LocationNode; %} %union { int fInt; bool fBool; Resource* fResource; Fragment* fFragment; Stmt* fStmt; BlockStmt* fBlock; Symbol* fSymbol; char* fString; Expr* fExpr; FunctionDef* fFunction; CallStmt* fCall; AsmStmt* fAsmStmt; Field* fField; CaseStmt* fCaseStmt; DeclareStmt* fDeclareStmt; LocationNode* fLocation; } %{ #include #include "IfStmt.h" #include "WhileStmt.h" #include "AsmStmt.h" #include "DoStmt.h" #include "RepeatStmt.h" #include "AssignStmt.h" #include "TaskStmt.h" #include "JumpStmt.h" #include "SwitchStmt.h" #include "ExprStmt.h" #include "RCX_Constants.h" #include "PreProc.h" #include "parser.h" #include "Program.h" #include "parse_util.h" #include "Program.h" #include "IncDecExpr.h" #include "AtomExpr.h" #include "TypeExpr.h" #include "Error.h" #include "MonitorStmt.h" #include "EventSrcExpr.h" #include "SensorExpr.h" #include "AssignMathStmt.h" #include "ForStmt.h" #include "RelExpr.h" #include "NegateExpr.h" #include "LogicalExpr.h" #include "TernaryExpr.h" #include "LabelStmt.h" #include "GotoStmt.h" #include "AddrOfExpr.h" #include "DerefExpr.h" #define yylex() (gPreProc->Get(yylval)) static LexLocation sSavedLoc; %} %nonassoc ':' '?' %left OR %left AND %left '|' %left '^' %left '&' %left REL_EQ REL_NE %left '<' '>' REL_LE REL_GE %left LEFT RIGHT %left '-' '+' %left '*' '/' '%' %right UMINUS '~' INDIRECT '!' %left INCDEC %nonassoc ABS SIGN TYPE EVENT_SRC %nonassoc LOWER_THAN_ELSE %nonassoc ELSE %nonassoc LOWER_THAN_EXPR_SHIFT %nonassoc ')' %token ID %token NUMBER ASSIGN ASSIGN2 TASKOP JUMP TASK SUB INCDEC %token STRING %token REL_GE REL_LE REL_EQ REL_NE %token PP_DEFINE PP_INCLUDE NL WS PP_ARG PP_UNKNOWN PP_IFDEF PP_IF PP_ELSE PP_ELIF PP_ENDIF PP_UNDEF %token PP_PRAGMA PP_GLOM PP_ERROR PP_WARNING %token IF WHILE DO FOR REPEAT SWITCH CASE DEFAULT MONITOR CATCH ACQUIRE GOTO %token ASM %token INT T_VOID T_CONST SENSOR TASKID NOLIST RES %token CTRUE CFALSE %type stmt block var_item handler evt_handler opt_handler control_stmt expr_stmt misc_stmt opt_expr_stmt %type var_decl %type stmt_list var_list handler_list %type S arg_type res_byte %type nolist_opt %type expr opt_expr %type args arg_list function_head %type params param_list %type asm_list %type asm_item %type case %type loc %type fragment sub_head subfragment sarg_list %type res_data resource %{ static void yyerror(const char *msg); %} %% S : unit_list { $$ = 0; } ; unit_list : unit_list unit | ; unit : INT var_list ';' { gProgram->AddGlobalDecls($2); } | loc fragment loc { $2->SetLocations($1, $3); } | loc subfragment loc { $2->SetLocations($1, $3); } | loc sub_head '{' stmt_list '}' loc { EndSubWithParams($2, $4, $1, $6); } | loc function_head '{' stmt_list '}' loc { EndFunction($2, $4, $1, $6); } | resource ';' { gProgram->AddResource($1); } ; function_head : nolist_opt T_VOID ID '(' args ')' { $$ = BeginFunction($5, $3, $1); } ; sub_head : SUB ID '(' sarg_list ')' { $$ = BeginSubWithParams($4, $2); } ; nolist_opt : NOLIST { $$ = 0; } | { $$ = 1; } ; fragment : TASK ID '(' ')' block { $$ = new Fragment(true, $2, $5); } ; //subfragment : SUB ID '(' sarg_list ')' '{' stmt_list '}' { $$ = CreateSubroutine($4, $2, $7); } // | SUB ID '(' ')' block { $$ = new Fragment(false, $2, $5); } // ; subfragment : SUB ID '(' ')' block { $$ = new Fragment(false, $2, $5); } ; sarg_list : sarg_list ',' arg_type ID { $$ = $1; DefineSubArg($$, $4, $3); } | arg_type ID { $$ = new Fragment(false); DefineSubArg($$,$2,$1); } ; args : arg_list | T_VOID { $$ = new FunctionDef(); } | { $$ = new FunctionDef(); } ; arg_list : arg_list ',' arg_type ID { $$ = $1; DefineArg($$, $4, $3); } | arg_type ID { $$ = new FunctionDef(); DefineArg($$,$2,$1); } ; arg_type : INT { $$ = FunctionDef::kIntegerArg; } | T_CONST INT { $$ = FunctionDef::kConstantArg; } | INT '&' { $$ = FunctionDef::kReferenceArg; } | T_CONST INT '&' { $$ = FunctionDef::kConstRefArg; } | SENSOR { $$ = FunctionDef::kSensorArg; } | INT '*' { $$ = FunctionDef::kPointerArg; } | T_CONST INT '*' { $$ = FunctionDef::kConstPtrArg; } ; var_list : var_list ',' var_item { $1->Add($3); $$ = $1; } | var_item { $$ = new BlockStmt(); $$->Add($1); } ; var_item : var_decl { $$ = $1; } | var_decl '=' expr { $$ = $1; $1->SetInitialValue($3); } ; var_decl : ID loc { $$ = MakeDeclareStmt($1, $2, 0, false, false); } | ID loc '[' expr ']'{ $$ = MakeDeclareStmt($1, $2, $4, false, false); } | '*' ID loc { $$ = MakeDeclareStmt($2, $3, 0, true, false); } ; block : '{' { BeginScope(); } stmt_list '}' { $$ = EndScope($3); } ; stmt_list : stmt_list stmt { $1->Add($2); $$ = $1; } | { $$ = new BlockStmt(); } ; stmt : ';' { $$ = new BlockStmt(); } | block | case stmt { $$ = $1; $1->SetStmt($2); } | loc ID ':' stmt { $$ = new LabelStmt($2, $1->GetLoc(), $4); delete $1; } | error ';' { yyerrok; $$ = new BlockStmt(); } | control_stmt | misc_stmt loc { $1->SetLocation($2); } ; control_stmt : WHILE '(' expr ')' loc stmt { $$ = new WhileStmt($3, $6); $$->SetLocation($5); } | DO loc stmt WHILE '(' expr ')' ';' { $$ = new DoStmt($6, $3); $$->SetLocation($2); } | REPEAT '(' expr ')' loc stmt { $$ = new RepeatStmt($3, $6); $$->SetLocation($5); } | SWITCH '(' expr ')' loc stmt { $$ = new SwitchStmt($3, $6); $$->SetLocation($5); } | IF '(' expr ')' loc stmt %prec LOWER_THAN_ELSE { $$ = new IfStmt($3, $6); $$->SetLocation($5); } | IF '(' expr ')' loc stmt ELSE stmt { $$ = new IfStmt($3, $6, $8); $$->SetLocation($5); } | MONITOR loc '(' expr ')' loc block handler_list { $$ = new MonitorStmt($4, $7, $8, $2->GetLoc()); delete $2; $$->SetLocation($6); } | ACQUIRE loc '(' expr ')' loc block opt_handler { $$ = MakeAcquireStmt($4, $7, $8, $2); $$->SetLocation($6); } | FOR '(' opt_expr_stmt ';' opt_expr ';' opt_expr_stmt ')' loc stmt { $$ = new ForStmt($3, $5, $7, $10); $$->SetLocation($9); } | GOTO ID saveloc ';' { $$ = new GotoStmt($2, sSavedLoc); } ; misc_stmt : ASM '{' asm_list '}' ';' { $$ = $3; } | saveloc JUMP ';' { $$ = new JumpStmt($2, sSavedLoc); } | TASKOP saveloc ID ';' { $$ = new TaskStmt((UByte)$1, $3, sSavedLoc); } | loc ID '(' params ')' ';' { $$ = $4; $4->SetName($2); $4->SetLocation($1->GetLoc()); delete $1; } | INT var_list ';' { $$ = $2; } | expr_stmt ';' ; expr_stmt : expr { $$ = new ExprStmt($1); } | expr ASSIGN expr { CheckLValue($1); $$ = MakeAssignStmt($1, $2, $3); } | expr ASSIGN2 expr { CheckLValue($1); $$ = MakeAssign2Stmt($1, $2, $3); } | expr '=' expr { CheckLValue($1); $$ = new AssignStmt($1, $3); } ; opt_expr_stmt : expr_stmt | { $$ = 0; } ; opt_expr : expr | { $$ = 0; } ; opt_handler : handler | { $$ = 0; } ; handler_list : handler_list evt_handler { $1->Add($2); $$ = $1; } | { $$ = new BlockStmt(); } ; evt_handler : CATCH block { $$ = $2; } | CATCH loc '(' expr ')' block { $$ = MakeCatchStmt($4, $6, $2); } ; handler : CATCH block { $$ = $2; } ; case : saveloc CASE expr ':' { $$ = MakeCaseStmt($3, sSavedLoc); } | saveloc DEFAULT ':' { $$ = new CaseStmt(CaseStmt::kDefaultValue, sSavedLoc); } ; params : param_list | { $$ = new CallStmt(); } ; param_list : param_list ',' expr { $$ = $1; $$->AddParam($3); } | expr { $$ = new CallStmt(); $$->AddParam($1); } ; expr : NUMBER saveloc { $$ = new AtomExpr(kRCX_ConstantType, $1, sSavedLoc); } | expr '+' expr { $$ = MakeBinaryExpr($1, '+', $3); } | expr '-' expr { $$ = MakeBinaryExpr($1, '-', $3); } | expr '*' expr { $$ = MakeBinaryExpr($1, '*', $3); } | expr '/' expr { $$ = MakeBinaryExpr($1, '/', $3); } | expr '&' expr { $$ = MakeBinaryExpr($1, '&', $3); } | expr '|' expr { $$ = MakeBinaryExpr($1, '|', $3); } | expr '%' expr { $$ = MakeBinaryExpr($1, '%', $3); } | expr LEFT expr { $$ = MakeBinaryExpr($1, LEFT, $3); } | expr RIGHT expr { $$ = MakeBinaryExpr($1, RIGHT, $3); } | expr '^' expr { $$ = MakeBinaryExpr($1, '^', $3); } | expr REL_EQ expr { $$ = new RelExpr($1, RelExpr::kEqualTo, $3); } | expr REL_LE expr { $$ = new RelExpr($1, RelExpr::kLessOrEqual, $3); } | expr REL_GE expr { $$ = new RelExpr($1, RelExpr::kGreaterOrEqual, $3); } | expr REL_NE expr { $$ = new RelExpr($1, RelExpr::kNotEqualTo, $3); } | expr '<' expr { $$ = new RelExpr($1, RelExpr::kLessThan, $3); } | expr '>' expr { $$ = new RelExpr($1, RelExpr::kGreaterThan, $3); } | CTRUE saveloc { $$ = new AtomExpr(kRCX_ConstantType, 1, sSavedLoc); } | CFALSE saveloc { $$ = new AtomExpr(kRCX_ConstantType, 0, sSavedLoc); } | '!' expr { $$ = new NegateExpr($2); } | expr AND expr { $$ = new LogicalExpr($1, LogicalExpr::kLogicalAnd, $3); } | expr OR expr { $$ = new LogicalExpr($1, LogicalExpr::kLogicalOr, $3); } | '-' expr %prec UMINUS { $$ = MakeBinaryExpr(new AtomExpr(kRCX_ConstantType, 0, $2->GetLoc()), '-', $2); } | '~' expr %prec UMINUS { $$ = MakeUnaryExpr('~', $2); } | ABS '(' expr ')' { $$ = MakeUnaryExpr(ABS, $3); } | SIGN '(' expr ')' { $$ = MakeUnaryExpr(SIGN, $3); } | '(' expr ')' { $$ = $2; } | loc ID { $$ = MakeVarExpr($2, $1); } | loc ID '[' expr ']' { $$ = MakeArrayExpr($2, $1, $4); } | '@' expr %prec UMINUS { $$ = MakeValueExpr($2); } | expr INCDEC { $$ = MakeIncDecExpr($1, $2, false, $1->GetLoc()); } | INCDEC expr %prec UMINUS { $$ = MakeIncDecExpr($2, $1, true, $2->GetLoc()); } | SENSOR '(' expr ')' { $$ = new SensorExpr($3); } | TYPE '(' expr ')' { $$ = new TypeExpr($3); } | EVENT_SRC '(' expr ')' { $$ = new EventSrcExpr($3, gProgram->GetTarget()->fType); } | loc TASKID { $$ = MakeTaskIdExpr($1); } | INDIRECT '(' expr ')' '[' expr ']' { $$ = MakeIndirectExpr($3, $6); } | expr '?' expr ':' expr { $$ = new TernaryExpr($1, $3, $5); } | loc '&' ID { $$ = MakeAddrOfExpr($3, $1, (Expr *)0); } | loc '&' ID '[' expr ']' { $$ = MakeAddrOfExpr($3, $1, $5); } | loc '*' ID { $$ = MakeDerefExpr($3, $1); } ; saveloc : %prec LOWER_THAN_EXPR_SHIFT { LexCurrentLocation(sSavedLoc); } ; loc : %prec LOWER_THAN_EXPR_SHIFT { $$ = new LocationNode(); } ; asm_list : asm_list ',' asm_item { $$ = $1; $1->Add($3); } | asm_item { $$ = new AsmStmt(); $$->Add($1); } | { $$ = new AsmStmt(); } ; asm_item : expr { $$ = MakeConstField($1); } | '$' expr { $$ = new EAField($2); } | '$' expr ':' expr { $$ = new EAField($2, GetConstantValue($4)); } ; resource : RES expr ID '{' res_data '}' { $$=$5; $5->SetInfo((RCX_ChunkType)GetConstantValue($2), $3); } ; res_data : res_data ',' res_byte { $$ = $1; $1->Add($3); } | res_byte { $$ = new Resource(); $$->Add($1); } | { $$ = new Resource(); } ; res_byte : expr { $$ = GetConstantValue($1); } ; %% void yyerror(const char *msg) { Error(kErr_Parser, msg).RaiseLex(); } nqc-3.1.r6/compiler/parser.h0000600000175000017500000000303010216070364014042 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __parser_h #define __parser_h // forward class declarations for YYSTYPE class Fragment; class Resource; class Stmt; class BlockStmt; class Symbol; class Condition; class Expr; class Buffer; class FunctionDef; class CallStmt; class AsmStmt; class Field; class CaseStmt; class DeclareStmt; class LocationNode; // get definition of YYSTYPE, yylval, etc #ifndef __PARSE_TAB_H #include "parse.tab.h" int yylex(YYSTYPE &tokenVal); #endif #ifndef _STDIO_H #include #endif // from parse.tab.c int yyparse(void); #ifndef __LexLocation_h #include "LexLocation.h" #endif void LexCurrentLocation(LexLocation &loc); int LexFindAndPushFile(const char *name); int LexPush(Buffer *buf); void LexReturnWhitespace(int mode); void LexReset(); #endif nqc-3.1.r6/compiler/parse_util.cpp0000600000175000017500000003061610216070402015253 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "parse_util.h" #include "Expr.h" #include "parser.h" #include "AssignStmt.h" #include "AssignMathStmt.h" #include "Symbol.h" #include "GosubStmt.h" #include "Program.h" #include "UnaryExpr.h" #include "BinaryExpr.h" #include "AtomExpr.h" #include "ValueExpr.h" #include "Error.h" #include "ModExpr.h" #include "CaseStmt.h" #include "FunctionDef.h" #include "AsmStmt.h" #include "ScopeStmt.h" #include "AcquireStmt.h" #include "DeclareStmt.h" #include "ArrayExpr.h" #include "TaskIdExpr.h" #include "IndirectExpr.h" #include "CatchStmt.h" #include "ShiftExpr.h" #include "IncDecExpr.h" #include "AddrOfExpr.h" #include "DerefExpr.h" #include "Resource.h" // template class to auto-delete an object upon destruction template class Deleter { public: Deleter(T *t) : t_(t) {}; ~Deleter() { delete t_; } private: T* t_; }; int GetConstantValue(const Expr *e) { Deleter d(e); int v = 0; bool ok; ok = e->Evaluate(v); if (!ok) Error(kErr_ConstantNeeded).Raise(&e->GetLoc()); return v; } int GetLValue(const Expr *e) { Deleter d(e); int lv = e->GetLValue(); if (lv==kIllegalVar) Error(kErr_LValueNeeded).Raise(&e->GetLoc()); return lv; } void CheckLValue(Expr *lval) { if (!lval->PotentialLValue()) Error(kErr_LValueNeeded).Raise(&lval->GetLoc()); } Expr *MakeUnaryExpr(int op, Expr *arg) { if (!UnaryExpr::NeedsConstant(op) || arg->PromiseConstant()) return new UnaryExpr(op, arg); // Swan target handles this elsewhere if (op == '~') { // special case transform ~x -> -1 - x return new BinaryExpr( new AtomExpr(kRCX_ConstantType, -1, arg->GetLoc()), '-', arg ); } Error(kErr_ConstantNeeded).RaiseLex(); // return a dummy expr so the parse tree is still valid return arg; } Expr *MakeBinaryExpr(Expr *lhs, int op, Expr *rhs) { if (!BinaryExpr::NeedsConstant(op) || (rhs->PromiseConstant() && lhs->PromiseConstant())) { return new BinaryExpr(lhs, op, rhs); } // modulo is a special case (Swan target handles this elsewhere) if (op == '%') { return new ModExpr(lhs, rhs); } // shifts are also special cases (Swan target handles these elsewhere) if (op == LEFT || op == RIGHT) { // right argument must be a constant if (rhs->PromiseConstant()) { return new ShiftExpr(lhs, rhs, (op==LEFT) ? ShiftExpr::kLeft : ShiftExpr::kRight); } // if rhs is not constant, this will just fall through to // the normal binary expression case, which is an error } // xor handled by a transform (Swan target handles this elsewhere if (op == '^') { // a^b -> (-1 - (a&b)) & (a | b) Expr *lhc = lhs->Clone(0); Expr *rhc = rhs->Clone(0); Expr *nand = new BinaryExpr( new AtomExpr(kRCX_ConstantType, -1, lhs->GetLoc()), '-', new BinaryExpr( lhc, '&', rhc ) ); return new BinaryExpr( nand, '&', new BinaryExpr(lhs, '|', rhs) ); } Error(kErr_ConstantNeeded).RaiseLex(); // return a dummy expr so the parse tree is still valid delete rhs; return lhs; } Expr *MakeValueExpr(Expr *e) { if (!e->PromiseConstant()) { Error(kErr_ConstantNeeded).RaiseLex(); // return a dummy expr so the parse tree is still valid return e; } // if e can be evaluated, return AtomExpr, otherwise return ValueExpr int value; if (e->Evaluate(value)) { Expr *newExpr; newExpr = new AtomExpr(RCX_VALUE_TYPE(value), RCX_VALUE_DATA_INT(value), e->GetLoc()); delete e; return newExpr; } else return new ValueExpr(e); } int VarCodeToChar(int op) { switch((RCX_VarCode)op) { case kRCX_AddVar: return '+'; case kRCX_SubVar: return '-'; case kRCX_MulVar: return '*'; case kRCX_DivVar: return '/'; case kRCX_AndVar: return '&'; case kRCX_OrVar: return '|'; case kRCX_NotVar: return '~'; case kRCX_ModVar: return '%'; case kRCX_ShlVar: return LEFT; case kRCX_ShrVar: return RIGHT; case kRCX_XOrVar: return '^'; } return 0; } Stmt *MakeAssignStmt(Expr *lhs, int op, Expr *rhs) { const RCX_Target *t = gProgram->GetTarget(); if ((t->fType != kRCX_SwanTarget) && (lhs->GetLValue()==kIllegalVar)) { switch((RCX_VarCode)op) { case kRCX_AbsVar: return new AssignStmt(lhs, MakeUnaryExpr(ABS, rhs)); case kRCX_SgnVar: return new AssignStmt(lhs, MakeUnaryExpr(SIGN, rhs)); default: return MakeAssign2Stmt(lhs, VarCodeToChar(op), rhs); } } else { return new AssignMathStmt(lhs, (RCX_VarCode)op, rhs); } } Stmt *MakeAssign2Stmt(Expr *lhs, int op, Expr *rhs) { const RCX_Target *t = gProgram->GetTarget(); if (t->fType == kRCX_SwanTarget) { // Swan has opcodes for %=, ^=, <<=, and >>= RCX_VarCode code; switch (op) { case '%' : code = kRCX_ModVar; break; case '^' : code = kRCX_XOrVar; break; case RIGHT : code = kRCX_ShrVar; break; default : code = kRCX_ShlVar; break; } return MakeAssignStmt(lhs, code, rhs); } else { Expr *dst = lhs->Clone(0); Expr *math = MakeBinaryExpr(lhs, op, rhs); return new AssignStmt(dst, math); } } Expr *MakeIncDecExpr(Expr *lhs, bool inc, bool pre, const LexLocation &loc) { return new IncDecExpr(GetLValue(lhs), inc, pre, loc); } CaseStmt* MakeCaseStmt(const Expr *e, const struct LexLocation &loc) { int v = GetConstantValue(e); if (v < -32768 || v > 32767) Error(kErr_CaseRange).RaiseLex(); return new CaseStmt(v, loc); } Stmt *MakeAcquireStmt(const Expr *e, Stmt *body, Stmt *handler, LocationNode *ln) { Deleter d(ln); int v = GetConstantValue(e); return new AcquireStmt(v, body, handler, ln->GetLoc()); } Stmt *MakeCatchStmt(const Expr *e, Stmt *body, LocationNode *ln) { Deleter d(ln); int v; if (e) v = GetConstantValue(e); else v = -1; return new CatchStmt(v, body, ln->GetLoc()); } void DefineSubArg(Fragment *f, const Symbol *name, int type) { const RCX_Target *t = gProgram->GetTarget(); if (!t->fSubParams) Error(kErr_NoTargetSubParams, t->fName).RaiseLex(); if (!f->AddArg(name, (FunctionDef::ArgType)type)) Error(kErr_SymRedef, name->GetKey()).RaiseLex(); } void DefineArg(FunctionDef *f, const Symbol *name, int type) { if (!f->AddArg(name, (FunctionDef::ArgType)type)) Error(kErr_SymRedef, name->GetKey()).RaiseLex(); } void BeginScope() { gProgram->PushScope(); } Stmt *EndScope(Stmt *body) { gProgram->PopScope(); return new ScopeStmt(body); } Fragment* CreateSubroutine(Fragment *f, Symbol *name, Stmt *body) { f->SetName(name); gProgram->PushScope(); f->CreateArgVars(); f->SetBody(body); gProgram->PopScope(); // f->CreateArgVars(); return f; } Fragment* BeginSubWithParams(Fragment *f, Symbol *name) { f->SetName(name); gProgram->PushScope(); f->CreateArgVars(); return f; } void EndSubWithParams(Fragment *f, Stmt *body, LocationNode *start, LocationNode *end) { f->SetLocations(start, end); f->SetBody(body); gProgram->PopScope(); } FunctionDef* BeginFunction(FunctionDef *f, const Symbol *name, bool listing) { f->SetName(name); gProgram->AddFunction(f); gProgram->PushScope(); f->CreateArgVars(); f->SetListingEnabled(listing); return f; } void EndFunction(FunctionDef *f, Stmt *body, LocationNode *start, LocationNode *end) { f->SetLocations(start, end); f->SetBody(body); gProgram->PopScope(); } ConstField *MakeConstField(Expr *e) { ConstField *c = new ConstField(e); if (!e->PromiseConstant()) { Error(kErr_ConstantNeeded).RaiseLex(); } return c; } Expr *MakeVarExpr(const Symbol *name, LocationNode *ln) { Deleter d(ln); bool array, ptr, stack; int var = gProgram->GetVar(name, array, ptr, stack); if (var == kIllegalVar) { // check to see if name is for resource const Resource *resource = gProgram->GetResource(name); if (resource) { return new AtomExpr(kRCX_ConstantType, resource->GetNumber() , ln->GetLoc()); } Error(kErr_UndefinedVar, name->GetKey()).Raise(&ln->GetLoc()); } else if (array) { Error(kErr_VarIsArray, name->GetKey()).Raise(&ln->GetLoc()); } return new AtomExpr(kRCX_VariableType, var, ln->GetLoc(), ptr); } Expr *MakeIndirectExpr(Expr *src, Expr *idx) { if (!src->PromiseConstant()) { Error(kErr_ConstantNeeded).RaiseLex(); delete src; return idx; } return new IndirectExpr(src, idx); } Expr *MakeTaskIdExpr(LocationNode *ln) { Deleter d(ln); return new TaskIdExpr(ln->GetLoc()); } Expr *MakeArrayExpr(const Symbol *name, LocationNode *ln, Expr *index) { Deleter d(ln); bool array, ptr, stack; int var = gProgram->GetVar(name, array, ptr, stack); if (var == kIllegalVar) { Error(kErr_UndefinedVar, name->GetKey()).Raise(&ln->GetLoc()); } else if (!array) { Error(kErr_VarIsNotArray, name->GetKey()).Raise(&ln->GetLoc()); } return new ArrayExpr(var, index); } Expr *MakeAddrOfExpr(const Symbol *name, LocationNode *ln, Expr * index) { Deleter d(ln); bool array, ptr, stack; int value=0; int var = gProgram->GetVar(name, array, ptr, stack); if (var == kIllegalVar) { Error(kErr_UndefinedVar, name->GetKey()).Raise(&ln->GetLoc()); } else if (array) { // if the expression is a constant then we can take the address of it if (index) { if (!index->Evaluate(value)) { Error(kErr_AddrOfNonConstantIndex).Raise(&ln->GetLoc()); } } } return new AddrOfExpr(var, value, ln->GetLoc()); } Expr *MakeDerefExpr(const Symbol *name, LocationNode *ln) { Deleter d(ln); bool array, ptr, stack; const RCX_Target *t = gProgram->GetTarget(); if (!t->SourceWritable(kRCX_IndirectType)) Error(kErr_NoTargetIndirect, t->fName).Raise(&ln->GetLoc()); int var = gProgram->GetVar(name, array, ptr, stack); if (var == kIllegalVar) { Error(kErr_UndefinedVar, name->GetKey()).Raise(&ln->GetLoc()); } else if (array) { Error(kErr_VarIsArray, name->GetKey()).Raise(&ln->GetLoc()); } else if (!ptr) { Error(kErr_VarIsNotPointer, name->GetKey()).Raise(&ln->GetLoc()); } return new DerefExpr(var, ln->GetLoc()); } DeclareStmt *MakeDeclareStmt(const Symbol *name, LocationNode *ln, Expr *arraySize, bool ptr, bool stack) { Deleter d(ln); int var = gProgram->CreateVar(name, arraySize, ptr, stack); int size = 1; if (arraySize) { const RCX_Target *t = gProgram->GetTarget(); if (!t->fArrays) Error(kErr_NoTargetArrays, t->fName).Raise(&ln->GetLoc()); if (!arraySize->Evaluate(size)) { Error(kErr_ConstantNeeded).Raise(&arraySize->GetLoc()); } delete arraySize; } if (ptr) { } return new DeclareStmt(name, var, ln->GetLoc(), size, ptr, stack); } nqc-3.1.r6/compiler/parse_util.h0000600000175000017500000000620410216070372014722 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __parse_util_h #define __parse_util_h #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __LocationNode_h #include "LocationNode.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif class Expr; class Stmt; class Condition; class Symbol; class CaseStmt; class FunctionDef; class Fragment; class ConstField; class DeclareStmt; class AssignStmt; extern void LexCurrentLocation(LexLocation &loc); extern Expr *MakeBinaryExpr(Expr *lhs, int op, Expr *rhs); extern Expr *MakeUnaryExpr(int op, Expr *arg); extern Expr *MakeValueExpr(Expr *e); extern Expr *MakeIndirectExpr(Expr *src, Expr *idx); extern int GetConstantValue(const Expr *e); extern int GetLValue(const Expr *e); extern Stmt* MakeCall(Symbol *name, const struct LexLocation &loc); extern CaseStmt* MakeCaseStmt(const Expr *e, const struct LexLocation &loc); extern void DefineSubArg(Fragment *f, const Symbol *name, int type); extern Fragment* CreateSubroutine(Fragment *f, Symbol *name, Stmt *body); extern Fragment* BeginSubWithParams(Fragment *f, Symbol *name); extern void EndSubWithParams(Fragment *f, Stmt *body, LocationNode *start, LocationNode *end); extern void DefineArg(FunctionDef *f, const Symbol *name, int type); extern FunctionDef* BeginFunction(FunctionDef *f, const Symbol *name, bool listing); extern void EndFunction(FunctionDef *f, Stmt *body, LocationNode *start, LocationNode *end); extern ConstField* MakeConstField(Expr *e); extern Expr *MakeVarExpr(const Symbol *name, LocationNode *loc); extern Expr *MakeTaskIdExpr(LocationNode *ln); extern Expr *MakeArrayExpr(const Symbol *name, LocationNode *loc, Expr *index); extern Expr *MakeAddrOfExpr(const Symbol *name, LocationNode *ln, Expr *index); extern Expr *MakeDerefExpr(const Symbol *name, LocationNode *ln); extern Expr *MakeIncDecExpr(Expr *lhs, bool inc, bool pre, const LexLocation &loc); extern Stmt* MakeAcquireStmt(const Expr *e, Stmt *body, Stmt *handler, LocationNode *ln); extern Stmt* MakeCatchStmt(const Expr *e, Stmt *body, LocationNode *ln); extern DeclareStmt *MakeDeclareStmt(const Symbol *name, LocationNode *loc, Expr *arraySize, bool ptr, bool stack); extern void CheckLValue(Expr *lval); extern Stmt* MakeAssignStmt(Expr *lhs, int op, Expr *rhs); extern Stmt* MakeAssign2Stmt(Expr *lhs, int op, Expr *rhs); extern void BeginScope(); extern Stmt* EndScope(Stmt *body); #endif nqc-3.1.r6/compiler/PreProc.cpp0000600000175000017500000002376110216070306014464 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * PreProc reads tokens from the Lexer and emits a preprocessed token stream. * The entire process is 'pulled' by calling PreProc::Get(), which in turn calls * down through the layers of the Preprocessor: * * Get() - dispatches directives (DoInclude(), DoDefine(), etc) * When processing a directive, GetRawToken() is called - in effect, macro * substitution happens on playback, not record. * * GetReplacedToken() - matches ID tokens against macros, and pushes the macro * definition when a macro is used. Use this call when macro calls should * be expanded. * * GetRawToken() - maintains the queue of expansions, subsitutes arguments during * expansion, manages the lexer (calls yylex(), maintains fNLRead, etc) * */ #include #include "PreProc.h" #include "Symbol.h" #include "Macro.h" #include "Expansion.h" #include "Program.h" #include "Error.h" // make sure we get an error if we try to use yylval #define yylval // values for argCount #define kErrorArgs -2 PreProc *gPreProc = new PreProc(); PreProc::PreProc() { fActive = fConditional.IsActive(); fEndOfFiles = false; } PreProc::~PreProc() { } int PreProc::Get(TokenVal &v) { int t; long x; // read token from lexer, and process any preprocessor commands; while(1) { t = GetReplacedToken(v); // strip newlines if (t==NL) continue; fNLRead = false; // check for end if (t==0) { if (!fConditional.IsTopLevel()) Error(kErr_UnterminatedIfdef).RaiseLex(); return 0; } // preprocessor commands switch(t) { case PP_INCLUDE: if (fActive) DoInclude(); break; case PP_DEFINE: if (fActive) DoDefine(); DiscardLine(); break; case PP_IFDEF: DoIfdef((bool)v.fInt); fActive = fConditional.IsActive(); DiscardLine(); break; case PP_IF: fParser.Parse(x); fConditional.If(x ? true : false); fActive = fConditional.IsActive(); DiscardLine(); break; case PP_ELIF: fActive=true; fParser.Parse(x); if (!fConditional.Elif(x ? true : false)) Error(kErr_UnexpectedElse, "#elif").RaiseLex(); else fActive = fConditional.IsActive(); DiscardLine(); break; case PP_ELSE: if (!fConditional.Else()) Error(kErr_UnexpectedElse, "#else").RaiseLex(); else fActive = fConditional.IsActive(); DiscardLine(); break; case PP_ENDIF: if (!fConditional.Endif()) Error(kErr_UnexpectedElse, "#endif").RaiseLex(); else fActive = fConditional.IsActive(); DiscardLine(); break; case PP_UNDEF: DoUndef(); DiscardLine(); break; case PP_PRAGMA: if (fActive) { if (!DoPragma()) Error(kWarn_IllegalPragma).RaiseLex(); } DiscardLine(); break; case PP_ERROR: Error(kErr_ErrorDirective).RaiseLex(); DiscardLine(); break; case PP_WARNING: Error(kWarn_WarningDirective).RaiseLex(); DiscardLine(); break; case PP_UNKNOWN: if (fActive) Error(kErr_UnknownDirective).RaiseLex(); DiscardLine(); break; default: if (fActive) return t; break; } } } int PreProc::GetReplacedToken(TokenVal &v) { int t; while(1) { t = GetRawToken(v); // macro substitution if (t==ID && (v.fSymbol->IsDefined()) && fActive) { BeginExpansion(v.fSymbol); } else return t; } } int PreProc::GetRawToken(TokenVal &v) { int t; while(1) { Expansion *e = fExpList.GetHead(); if (e) { if (e->IsDone()) { fExpList.RemoveHead(); delete e; } else { t = e->NextToken(v); if (t == PP_ARG) { fExpList.InsertHead(new Expansion(e, v.fInt)); } else return t; } } else { if (fEndOfFiles) { return 0; } t = yylex(v); if (t==NL) fNLRead = true; else if (t==0) fEndOfFiles = true; return t; } } } bool PreProc::DoInclude() { TokenVal v; int t = GetRawToken(v); DiscardLine(); if (t != STRING) { Error(kErr_IncludeNeedsName).RaiseLex(); return false; } if (!LexFindAndPushFile(v.fString)) { Error(kErr_FileOpen, v.fString); return false; } return true; } bool PreProc::DoDefine() { Symbol *s; TokenVal v; int t; int argCount; t = GetRawToken(v); if (t != ID) { Error(kErr_SymbolNameNeeded, "#define").RaiseLex(); return false; } s = v.fSymbol; if (s->IsDefined()) { Error(kErr_DefineRedef, s->GetKey()).RaiseLex(); return false; } argCount = ReadDefineArgs(); if (argCount == kErrorArgs) return false; // hack to detect empty macro if (fNLRead) { s->Define(new Macro(0, nil, -1)); return true; } ReadDefineBody(); s->Define(new Macro(&fTokenBuf[0], fTokenBuf.size(), argCount)); return true; } void PreProc::ReadDefineBody() { int t; TokenVal v; int count = 0; fTokenBuf.resize(0); int argnum; while(1) { t = GetRawToken(v); switch(t) { case 0: case NL: return; case ID: argnum = MatchArg(v.fSymbol); if (argnum != -1) { t = PP_ARG; v.fInt = argnum; } break; } fTokenBuf.resize(count+1); fTokenBuf[count].fType = t; fTokenBuf[count].fValue = v; count++; } } int PreProc::MatchArg(const Symbol *s) { size_t i; for(i=0; iGetDefinition(); if (def->IsMarked()) { Error(kErr_CircularDef, s->GetKey()).RaiseLex(); return false; } e = new Expansion(def); if (!ReadExpansionArgs(e)) { delete e; Error(kErr_WrongArgCount, s->GetKey()).RaiseLex(); return false; } fExpList.InsertHead(e); return true; } bool PreProc::ReadExpansionArgs(Expansion *e) { int argCount = e->GetArgCount(); int t; TokenVal v; if (argCount == Macro::kNoArgs) return true; t = GetRawToken(v); if (t != '(') return false; for(int i=0; iSetArg(i, &fTokenBuf[0], fTokenBuf.size()); return true; } fTokenBuf.resize(count+1); fTokenBuf[count].fType = t; fTokenBuf[count].fValue = v; count++; } } bool PreProc::DoIfdef(bool b) { TokenVal v; int t; bool defined; t = GetRawToken(v); if (t != ID) { Error(kErr_SymbolNameNeeded, "#ifdef / #ifndef").RaiseLex(); return false; } defined = v.fSymbol->IsDefined(); fConditional.If(b == defined); return true; } bool PreProc::DoUndef() { TokenVal v; int t; t = GetRawToken(v); if (t != ID) { Error(kErr_SymbolNameNeeded, "#undef").RaiseLex(); return false; } v.fSymbol->Undefine(); return true; } bool PreProc::DoPragma() { TokenVal v; int t = GetRawToken(v); if (t != ID) return false; const char *pragma = v.fSymbol->GetKey(); if (strcmp(pragma, "noinit") == 0) { gProgram->SetInitName(0, 0); return true; } else if (strcmp(pragma, "init") == 0) { t = GetRawToken(v); if (t != ID) return false; LexLocation loc; LexCurrentLocation(loc); gProgram->SetInitName(v.fSymbol, &loc); return true; } else if (strcmp(pragma, "reserve") == 0) { int start, end; t = GetRawToken(v); if (t != NUMBER) return false; start = v.fInt; t = GetRawToken(v); if (t == NUMBER) end = v.fInt; else if (t == NL) end = start; else return false; if (!gProgram->ReserveVars(start, end)) Error(kErr_CouldNotReserveVars).RaiseLex(); return true; } return false; } void PreProc::DiscardLine() { TokenVal v; int t; if (fNLRead) return; while((t=GetRawToken(v)) != 0) { if (t==NL) return; } } nqc-3.1.r6/compiler/PreProc.h0000600000175000017500000000404610216070276014132 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __PreProc_h #define __PreProc_h #ifndef __Token_h #include "Token.h" #endif #ifndef __PListS_h #include "PListS.h" #endif #ifndef __CondParser_h #include "CondParser.h" #endif #ifndef __Conditional_h #include "Conditional.h" #endif #include using std::vector; class Symbol; class Expansion; class PreProc { public: PreProc(); ~PreProc(); // get fully preprocessed token int Get(TokenVal &v); // get after substitution but before directive processing int GetReplacedToken(TokenVal &v); // get next queued token (either from macro or file) int GetRawToken(TokenVal &v); private: bool DoDefine(); bool DoInclude(); int DoSimpleDefine(Symbol *s); int DoMacroDefine(Symbol *s); bool DoIfdef(bool b); bool DoUndef(); bool DoPragma(); int ReadDefineArgs(); void ReadDefineBody(); int MatchArg(const Symbol *s); void DiscardLine(); bool BeginExpansion(Symbol *s); bool ReadExpansionArgs(Expansion *e); bool ReadExpansionArg(Expansion *e, int i, int delim); bool fNLRead; PListS fExpList; vector fArguments; vector fTokenBuf; Conditional fConditional; bool fActive; CondParser fParser; bool fEndOfFiles; }; extern PreProc *gPreProc; #endif nqc-3.1.r6/compiler/Program.cpp0000600000175000017500000002146210216070270014515 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Program.h" #include "Fragment.h" #include "RCX_Image.h" #include "Bytecode.h" #include "parser.h" #include "Symbol.h" #include "BlockStmt.h" #include "CallStmt.h" #include "FunctionDef.h" #include "Error.h" #include "RCX_Target.h" #include "VarTranslator.h" #include "DeclareStmt.h" #include "PDebug.h" #include "Resource.h" Program *gProgram; Program::Program(const RCX_Target *target) : fVarAllocator(target->fMaxGlobalVars, target->fMaxTaskVars) { fTarget = target; // set fFragNumbers array to the first available number for each type for(int i=0; ifRanges[i].fBase; } fChunkNumbers[kRCX_TaskChunk]++; // leave room for main fMainAdded = false; fScopes.InsertHead(new Scope()); fInitName = Symbol::Get("_init"); fInitLocation.fIndex = kIllegalSrcIndex; fGlobalDecls = new BlockStmt(); fVirtualVarCount = 0; } Program::~Program() { while(Fragment *f=fTasks.RemoveHead()) delete f; while(Fragment *f=fSubs.RemoveHead()) delete f; while(Scope *s=fScopes.RemoveHead()) delete s; while(FunctionDef *func = fFunctions.RemoveHead()) delete func; delete fGlobalDecls; } int Program::AddFragment(Fragment *f) { CheckName(f->GetName()); if (f->IsTask()) { if (f->GetName() == Symbol::Get("main")) { // main task is added to head of list and uses the base numer fMainAdded = true; fTasks.InsertHead(f); return fTarget->fRanges[kRCX_TaskChunk].fBase; } else { fTasks.InsertTail(f); } } else { fSubs.InsertTail(f); } int type = f->GetChunkType(); return fChunkNumbers[type]++; } void Program::AddFunction(FunctionDef *f) { CheckName(f->GetName()); fFunctions.InsertTail(f); } void Program::AddGlobalDecls(BlockStmt *b) { // 'b' should be a block statement containing // one or more DeclareStmt instances. Simply move // all of the children of b to the fGlobalDecls // block. Later on (in AllocateGlobals() we'll check // to make sure they are really DeclareStmts while(Stmt *s = b->RemoveHead()) { fGlobalDecls->Add(s); } delete b; } void Program::AddResource(Resource *r) { CheckName(r->GetName()); RCX_ChunkType type = r->GetType(); if (type < kRCX_SoundChunk || type >= kRCX_ChunkTypeCount) { Error(kErr_BadResourceType).RaiseLex(); return; } if (fChunkNumbers[type] >= fTarget->GetChunkLimit(type)) { Error(kErr_TooManyResources, fTarget->fRanges[type].fCount).RaiseLex(); return; } r->SetNumber(fChunkNumbers[type]++); fResources.InsertTail(r); } void Program::CheckName(const Symbol *name) { if (Defined(name)) Error(kErr_SymRedef, name->GetKey()).RaiseLex(); } int Program::CreateVar(const Symbol *name, bool array, bool ptr, bool stack) { int var; var = NextVirtualVar(); if (fScopes.GetHead()->GetNext()==0) { // global var // probably should remember the name somewhere } DefineVar(name, var, array, ptr, stack); return var; } int Program::NextVirtualVar() { return kVirtualVarBase + fVirtualVarCount++; } void Program::DefineVar(const Symbol *name, int var, bool array, bool ptr, bool stack) { Scope *s = fScopes.GetHead(); if (s->Contains(name)) { Error(kErr_SymRedef, name->GetKey()).RaiseLex(); } else s->Define(name, var, array, ptr, stack); } int Program::GetVar(const Symbol *name, bool &array, bool &ptr, bool &stack) { int var = fScopes.GetHead()->Lookup(name, array, ptr, stack); if (var == kIllegalVar) Error(kErr_Undeclared, name->GetKey()); return var; } void Program::SetInitName(Symbol *name, LexLocation *location) { fInitName = name; if (location) { fInitLocation = *location; } else { fInitLocation.fIndex = kIllegalSrcIndex; } } #include "RCX_SpyboticsLinker.h" RCX_Image* Program::CreateImage() { RCX_Image *image; image = new RCX_Image(); image->SetTargetType(fTarget->fType); if (!AllocateGlobals(image)) return image; if (!PrepareMainTask()) return image; if (!CheckFragments()) return image; // emit subs for(Fragment *sub=fSubs.GetHead(); sub; sub=sub->GetNext()) EncodeFragment(image, sub); // emit tasks for(Fragment *task=fTasks.GetHead(); task; task=task->GetNext()) EncodeFragment(image, task); // copy resources for(Resource *r=fResources.GetHead(); r; r=r->GetNext()) { image->AddChunk(r->GetType(), r->GetNumber(), r->GetData(), r->GetLength(), r->GetName()->GetKey(), 0, 0); } return image; } void Program::EncodeFragment(RCX_Image *image, Fragment *f) { Bytecode *b = new Bytecode(fVarAllocator, fTarget, image); // determine variable allocation mode int mode; if (f->IsTask()) mode = VarAllocator::kTaskMode; else if (f->GetTaskID() == Fragment::kMultiTaskID) mode = VarAllocator::kMultiSubMode; else mode = VarAllocator::kSingleSubMode; fVarAllocator.Begin(mode); f->Emit(*b); image->AddChunk(f->GetChunkType(), f->GetNumber(), b->GetData(), b->GetLength(), f->GetName()->GetKey(), b->GetSourceTags(), b->GetSourceTagCount()); f->SetLocalMask(fVarAllocator.End()); delete b; } bool Program::PrepareMainTask() { // find main if (!fMainAdded) { Error(kErr_UndefinedMain).Raise(0); return false; } // insert block into main task so we have a place for init code Fragment *mainTask = fTasks.GetHead(); BlockStmt *mainBlock = new BlockStmt(); mainBlock->Add(mainTask->GetBody()); mainTask->SetBody(mainBlock); // insert call for init routine into main task if (fInitName) { FunctionDef *f = gProgram->GetFunction(fInitName); if (f) { CallStmt *call = new CallStmt(); call->SetName(fInitName); call->SetLocation(fInitLocation); mainBlock->Prepend(call); } else { Error(kErr_UnknownInit, fInitName->GetKey()).Raise(0); return false; } } // insert init stmts into main task mainBlock->Prepend(fGlobalDecls); fGlobalDecls = 0; return true; } bool Program::CheckFragments() { bool ok = true; if (fChunkNumbers[kRCX_TaskChunk] > fTarget->GetChunkLimit(kRCX_TaskChunk)) { Error(kErr_TooManyTasks, fTarget->fRanges[kRCX_TaskChunk].fCount).Raise(0); ok = false; } if (fChunkNumbers[kRCX_SubChunk] > fTarget->GetChunkLimit(kRCX_SubChunk)) { Error(kErr_TooManySubs, fTarget->fRanges[kRCX_SubChunk].fCount).Raise(0); ok = false; } Fragment *f; for(f=fTasks.GetHead(); f; f=f->GetNext()) { f->Check(); } for(f=fSubs.GetHead(); f; f=f->GetNext()) { f->Check(); } return ok; } bool Program::Defined(const Symbol *name) const { if (Find(fTasks, name)) return true; if (Find(fSubs, name)) return true; if (Find(fFunctions, name)) return true; if (Find(fResources, name)) return true; return fScopes.GetTail()->Contains(name); } Scope* Program::PushScope() { Scope *s = new Scope(); fScopes.InsertHead(s); return s; } void Program::PopScope() { delete fScopes.RemoveHead(); } bool Program::AllocateGlobals(RCX_Image *image) { for(Stmt *s=fGlobalDecls->GetHead(); s; s=s->GetNext()) { DeclareStmt *dec = dynamic_cast(s); PASSERT(dec); int from = dec->GetVar(); // global scope int to = fVarAllocator.Allocate(false, false, dec->GetCount()); if (to == kIllegalVar) { Error(kErr_NoMoreVars).Raise(&dec->GetLoc()); return false; } image->SetVariable(to, dec->GetName()->GetKey()); TranslateVar(from, to); } return true; } void Program::TranslateVar(int from, int to) { VarTranslator vt(from, to); for(Fragment *f=fTasks.GetHead(); f; f=f->GetNext()) Apply(f->GetBody(), vt); for(Fragment *f=fSubs.GetHead(); f; f=f->GetNext()) Apply(f->GetBody(), vt); for(FunctionDef *f=fFunctions.GetHead(); f; f=f->GetNext()) Apply(f->GetBody(), vt); Apply(fGlobalDecls, vt); } bool Program::ReserveVars(int start, int end) { if (end < start) return false; for(int v=start; v<=end; ++v) if (!fVarAllocator.Reserve(v)) return false; return true; } nqc-3.1.r6/compiler/Program.h0000600000175000017500000000747610216070262014174 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Program_h #define __Program_h #ifndef __PListS_h #include "PListS.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __RCX_Target_h #include "RCX_Target.h" #endif #ifndef __Scope_h #include "Scope.h" #endif #ifndef __Variable_h #include "Variable.h" #endif #ifndef __VarAllocator_h #include "VarAllocator.h" #endif #ifndef __LexLocation_h #include "LexLocation.h" #endif #ifndef __Fragment_h #include "Fragment.h" #endif #ifndef __FunctionDef_h #include "FunctionDef.h" #endif #ifndef __Resource_h #include "Resource.h" #endif #include using std::vector; class Fragment; class Resource; class FunctionDef; class Symbol; class RCX_Image; class Stmt; class BlockStmt; // useful templates to search through a list of named items template T*Find(PListS &list, const Symbol *name) { for(T *t = list.GetHead(); t; t=t->GetNext()) { if (t->GetName() == name) return t; } return 0; } template const T*Find(const PListS &list, const Symbol *name) { for(T *t = list.GetHead(); t; t=t->GetNext()) { if (t->GetName() == name) return t; } return 0; } class Program { public: Program(const RCX_Target *target); ~Program(); const RCX_Target* GetTarget() const { return fTarget; } // adding tasks and other stuff... int AddFragment(Fragment *f); void AddResource(Resource *r); void AddFunction(FunctionDef *f); void AddGlobalDecls(BlockStmt *s); RCX_Image *CreateImage(); // variable allocation, etc. int CreateVar(const Symbol *name, bool array, bool ptr, bool stack); int GetVar(const Symbol *name, bool &array, bool &ptr, bool &stack); int NextVirtualVar(); void DefineVar(const Symbol *name, int var, bool array, bool ptr, bool stack); // getting tasks, etc Fragment* GetTask(const Symbol *name) { return Find(fTasks, name); } Fragment* GetSub(const Symbol *name) { return Find(fSubs, name); } FunctionDef* GetFunction(const Symbol *name) { return Find(fFunctions, name); } const Resource* GetResource(const Symbol *name) const { return Find(fResources, name); } // check all symbols (tasks, variables, etc) bool Defined(const Symbol *name) const; Scope* PushScope(); void PopScope(); void SetInitName(Symbol *name, LexLocation *location); bool ReserveVars(int start, int end); private: void EncodeFragment(RCX_Image *image, Fragment *f); void CheckName(const Symbol *name); bool AllocateGlobals(RCX_Image *image); bool SetMainTask(); bool PrepareMainTask(); bool CheckFragments(); void TranslateVar(int from, int to); // fields VarAllocator fVarAllocator; PListS fTasks; PListS fSubs; PListS fFunctions; PListS fResources; bool fMainAdded; int fChunkNumbers[kRCX_ChunkTypeCount]; PListS fScopes; Symbol* fInitName; LexLocation fInitLocation; BlockStmt* fGlobalDecls; const RCX_Target* fTarget; int fVirtualVarCount; }; extern Program *gProgram; #endif nqc-3.1.r6/compiler/rcx1.nqh0000600000175000017500000001460010216070216013763 0ustar blpblp/* * rcx.nqh - version 2.0 * Copyright (C) 1998,1999 Dave Baum * * CyberMaster definitions by Laurentino Martins * * This file is part of nqc, the Not Quite C compiler for the RCX * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * This file defines various system constants and macros to be used * with the RCX. Most of the real functionality of the RCX is * defined here rather than within nqcc itself. * */ // this is a copy of the NQC 1.3 rcx.nqh file /************************** * input **************************/ // constants for selecting sensors #define IN_1 Input(0) #define IN_2 Input(1) #define IN_3 Input(2) #ifdef __CM // alternative names for input sensors #define IN_L IN_1 // Left sensor #define IN_M IN_2 // Middle sensor #define IN_R IN_3 // Right sensor #endif // modes for SensorMode() and IN_CFG() #define SMODE_RAW 0x00 #define SMODE_BOOL 0x20 #define SMODE_EDGE 0x40 #define SMODE_PULSE 0x60 #define SMODE_PERCENT 0x80 #ifdef __RCX #define SMODE_CELSIUS 0xa0 #define SMODE_FAHRENHEIT 0xc0 #define SMODE_ANGLE 0xe0 #endif #define SensorMode(sensor, mode) asm { 0x42, $sensor : 0x03000200, (mode) } #ifdef __RCX // types for SensorType() and IN_CFG() #define STYPE_SWITCH 1 #define STYPE_TEMP 2 #define STYPE_LIGHT 3 #define STYPE_ANGLE 4 // input configurations - used in calls to Sensor() #define IN_CFG(type,mode) (((type)<<8) + (mode)) #define IN_SWITCH IN_CFG(STYPE_SWITCH, SMODE_BOOL) #define IN_PULSE IN_CFG(STYPE_SWITCH, SMODE_PULSE) #define IN_EDGE IN_CFG(STYPE_SWITCH, SMODE_EDGE) #define IN_LIGHT IN_CFG(STYPE_LIGHT, SMODE_PERCENT) #define IN_ANGLE IN_CFG(STYPE_ANGLE, SMODE_ANGLE) // set a sensor's type #define SensorType(sensor, type) asm { 0x32, $sensor : 0x03000200, (type) } // set a sensor's type and mode using a config - e.g. Sensor(IN_1, IN_LIGHT); #define Sensor(sensor, tm) do { SensorType(sensor, tm>>8); \ SensorMode(sensor, tm); } while (false) #endif /************************** * ouput **************************/ // constants for selecting outputs #define OUT_A (1 << 0) #define OUT_B (1 << 1) #define OUT_C (1 << 2) // output modes #define OUT_FLOAT 0 #define OUT_OFF 0x40 #define OUT_ON 0x80 // output directions #define OUT_REV 0 #define OUT_FLIP 0x40 #define OUT_FWD 0x80 // speeds #define OUT_LOW 1 #define OUT_HALF 4 #define OUT_FULL 7 // output functions #define OutputMode(o, m) asm { 0x21, (o) + (m) } #define OutputDir(o, d) asm { 0xe1, (o) + (d) } #define OutputPower(o, p) asm { 0x13, (o), $p : 0x1000015} #define Fwd(o, p) do { OutputDir(o,OUT_FWD); \ OutputMode(o,OUT_ON); \ OutputPower(o,p); } while(false) #define Rev(o, p) do { OutputDir(o,OUT_REV); \ OutputMode(o,OUT_ON); \ OutputPower(o,p); } while(false) #define Off(o) OutputMode(o, OUT_OFF) #define Float(o) OutputMode(o, OUT_FLOAT) #define Toggle(o) OutputDir((o), OUT_FLIP) // CyberMaster specific stuff #ifdef __CM // alternate names for motors #define OUT_L OUT_A // Left motor #define OUT_R OUT_B // Right motor #define OUT_X OUT_C // External motor #define Drive(m0, m1) asm { 0x41, DIRSPEED(m0) | DIRSPEED(m1)<<4 } #define OnWait(m, n, t) asm { 0xc2, (m)<<4 | DIRSPEED(n), t } #define OnWaitDifferent(m, n0, n1, n2, t) asm { 0x53, (m)<<4 | DIRSPEED(n0), DIRSPEED(n1)<<4 | DIRSPEED(n2), t } // Aux. function: Transforms a number between -7 and 7 to a 4 bit sequence: // Bits: 1..3 - Speed: 0 to 7 // Bit : 4 - Direction: 1 if v>=0, 0 if v<0 #define DIRSPEED(v) ((v)&8^8|((v)*(((v)>>3)*2^1))&7) #endif /************************** * data sources **************************/ #define Timer(n) @(0x10000 + (n)) #define Random(n) @(0x40000 + (n)) #define Input(n) @(0x90000 + (n)) #define InputType(n) @(0xa0000 + (n)) #define InputMode(n) @(0xb0000 + (n)) #ifdef __RCX // RCX specific data sources #define Program() @(0x8) #define InputRaw(n) @(0xc0000 + (n)) #define InputBool(n) @(0xd0000 + (n)) #define Watch() @(0xe0000) #define Message() @(0xf0000) #endif #ifdef __CM // CM specific data sources #define TachoCount(n) @(0x50000 + (n)-1) // Use OUT_x as parameter #define TachoSpeed(n) @(0x60000 + (n)-1) // Use OUT_x as parameter #define ExternalMotorRunning() @(0x70002) // Refered in the SDK as MotorCurrent(2). Non zero if external motor running. #define AGC() @(0x100000) // Automatic Gain Control #endif /************************** * miscellaneous **************************/ // wait for a condition to become true #define wait(c) while(!(c)) // playing sounds and notes #define PlaySound(x) asm { 0x51, x } #define PlayNote(f, d) asm { 0x23, (f), (f)>>8, (d) } // sleep for v ticks (10ms per tick) #define Sleep(v) asm { 0x43, $v : 0x0015} #define ClearTimer(n) asm { 0xa1, n } #define ClearSensor(sensor) asm { 0xd1, $sensor : 0x03000200 } #define StopAllTasks() asm { 0x50 } #ifdef __RCX // set the display mode #define Display(v) asm { 0x33, $v : 0x0005} // IR message support #define SendMessage(v) asm { 0xb2, $v : 0x1000005 } #define ClearMessage() asm { 0x90 } // Data logging #define SetDatalog(size) asm { 0x52, (size), (size)>>8 } #define Datalog(v) asm { 0x62, $v : 0x1004203} #define UploadDatalog(s, n) asm { 0xa4, (s), (s)>>8, (n), (n)>>8 } // set the system clock #define SetWatch(h, m) asm { 0x22, (h), (m) } // support for controlling the IRMode #define IR_LO 0 #define IR_HI 1 #define IRMode(m) asm { 0x31, m } #endif #ifdef __CM #define ClearTachoCounter(m) asm { 0x11, (m) } #endif #pragma noinit nqc-3.1.r6/compiler/rcx1_nqh.h0000600000175000017500000005360110216070206014275 0ustar blpblp// static const char rcx1_nqh[] = { 47,42,'\n',32,42,32,114,99,120,46,110,113,104,32,45,32, 118,101,114,115,105,111,110,32,50,46,48,'\n',32,42,32,67, 111,112,121,114,105,103,104,116,32,40,67,41,32,49,57,57, 56,44,49,57,57,57,32,68,97,118,101,32,66,97,117,109, '\n',32,42,'\n',32,42,32,67,121,98,101,114,77,97,115,116, 101,114,32,100,101,102,105,110,105,116,105,111,110,115,32,98, 121,32,76,97,117,114,101,110,116,105,110,111,32,77,97,114, 116,105,110,115,'\n',32,42,'\n',32,42,32,84,104,105,115,32, 102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32, 110,113,99,44,32,116,104,101,32,78,111,116,32,81,117,105, 116,101,32,67,32,99,111,109,112,105,108,101,114,32,102,111, 114,32,116,104,101,32,82,67,88,'\n',32,42,'\n',32,42,32, 84,104,101,32,99,111,110,116,101,110,116,115,32,111,102,32, 116,104,105,115,32,102,105,108,101,32,97,114,101,32,115,117, 98,106,101,99,116,32,116,111,32,116,104,101,32,77,111,122, 105,108,108,97,32,80,117,98,108,105,99,32,76,105,99,101, 110,115,101,'\n',32,42,32,86,101,114,115,105,111,110,32,49, 46,48,32,40,116,104,101,32,34,76,105,99,101,110,115,101, 34,41,59,32,121,111,117,32,109,97,121,32,110,111,116,32, 117,115,101,32,116,104,105,115,32,102,105,108,101,32,101,120, 99,101,112,116,32,105,110,'\n',32,42,32,99,111,109,112,108, 105,97,110,99,101,32,119,105,116,104,32,116,104,101,32,76, 105,99,101,110,115,101,46,32,89,111,117,32,109,97,121,32, 111,98,116,97,105,110,32,97,32,99,111,112,121,32,111,102, 32,116,104,101,32,76,105,99,101,110,115,101,32,97,116,'\n', 32,42,32,104,116,116,112,58,47,47,119,119,119,46,109,111, 122,105,108,108,97,46,111,114,103,47,77,80,76,47,'\n',32, 42,'\n',32,42,32,83,111,102,116,119,97,114,101,32,100,105, 115,116,114,105,98,117,116,101,100,32,117,110,100,101,114,32, 116,104,101,32,76,105,99,101,110,115,101,32,105,115,32,100, 105,115,116,114,105,98,117,116,101,100,32,111,110,32,97,110, 32,34,65,83,32,73,83,34,'\n',32,42,32,98,97,115,105, 115,44,32,87,73,84,72,79,85,84,32,87,65,82,82,65, 78,84,89,32,79,70,32,65,78,89,32,75,73,78,68,44, 32,101,105,116,104,101,114,32,101,120,112,114,101,115,115,32, 111,114,32,105,109,112,108,105,101,100,46,32,83,101,101,32, 116,104,101,'\n',32,42,32,76,105,99,101,110,115,101,32,102, 111,114,32,116,104,101,32,115,112,101,99,105,102,105,99,32, 108,97,110,103,117,97,103,101,32,103,111,118,101,114,110,105, 110,103,32,114,105,103,104,116,115,32,97,110,100,32,108,105, 109,105,116,97,116,105,111,110,115,'\n',32,42,32,117,110,100, 101,114,32,116,104,101,32,76,105,99,101,110,115,101,46,'\n', 32,42,'\n',32,42,32,84,104,101,32,73,110,105,116,105,97, 108,32,68,101,118,101,108,111,112,101,114,32,111,102,32,116, 104,105,115,32,99,111,100,101,32,105,115,32,68,97,118,105, 100,32,66,97,117,109,46,'\n',32,42,32,80,111,114,116,105, 111,110,115,32,99,114,101,97,116,101,100,32,98,121,32,68, 97,118,105,100,32,66,97,117,109,32,97,114,101,32,67,111, 112,121,114,105,103,104,116,32,40,67,41,32,49,57,57,56, 32,68,97,118,105,100,32,66,97,117,109,46,'\n',32,42,32, 65,108,108,32,82,105,103,104,116,115,32,82,101,115,101,114, 118,101,100,46,'\n',32,42,47,'\n',32,'\n',47,42,'\n',32,42, 32,32,84,104,105,115,32,102,105,108,101,32,100,101,102,105, 110,101,115,32,118,97,114,105,111,117,115,32,115,121,115,116, 101,109,32,99,111,110,115,116,97,110,116,115,32,97,110,100, 32,109,97,99,114,111,115,32,116,111,32,98,101,32,117,115, 101,100,'\n',32,42,32,32,119,105,116,104,32,116,104,101,32, 82,67,88,46,32,32,77,111,115,116,32,111,102,32,116,104, 101,32,114,101,97,108,32,102,117,110,99,116,105,111,110,97, 108,105,116,121,32,111,102,32,116,104,101,32,82,67,88,32, 105,115,'\n',32,42,32,32,100,101,102,105,110,101,100,32,104, 101,114,101,32,114,97,116,104,101,114,32,116,104,97,110,32, 119,105,116,104,105,110,32,110,113,99,99,32,105,116,115,101, 108,102,46,'\n',32,42,'\n',32,42,47,'\n','\n','\n',47,47,32, 116,104,105,115,32,105,115,32,97,32,99,111,112,121,32,111, 102,32,116,104,101,32,78,81,67,32,49,46,51,32,114,99, 120,46,110,113,104,32,102,105,108,101,'\n','\n',47,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,'\n',32,42,32,105,110,112,117,116, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n',47, 47,32,99,111,110,115,116,97,110,116,115,32,102,111,114,32, 115,101,108,101,99,116,105,110,103,32,115,101,110,115,111,114, 115,'\n',35,100,101,102,105,110,101,32,73,78,95,49,9,73, 110,112,117,116,40,48,41,'\n',35,100,101,102,105,110,101,32, 73,78,95,50,9,73,110,112,117,116,40,49,41,'\n',35,100, 101,102,105,110,101,32,73,78,95,51,9,73,110,112,117,116, 40,50,41,'\n','\n',35,105,102,100,101,102,32,95,95,67,77, '\n',47,47,32,97,108,116,101,114,110,97,116,105,118,101,32, 110,97,109,101,115,32,102,111,114,32,105,110,112,117,116,32, 115,101,110,115,111,114,115,'\n',35,100,101,102,105,110,101,32, 73,78,95,76,32,73,78,95,49,32,47,47,32,76,101,102, 116,32,115,101,110,115,111,114,'\n',35,100,101,102,105,110,101, 32,73,78,95,77,32,73,78,95,50,32,47,47,32,77,105, 100,100,108,101,32,115,101,110,115,111,114,'\n',35,100,101,102, 105,110,101,32,73,78,95,82,32,73,78,95,51,32,47,47, 32,82,105,103,104,116,32,115,101,110,115,111,114,'\n',35,101, 110,100,105,102,'\n','\n',47,47,32,109,111,100,101,115,32,102, 111,114,32,83,101,110,115,111,114,77,111,100,101,40,41,32, 97,110,100,32,73,78,95,67,70,71,40,41,'\n',35,100,101, 102,105,110,101,32,83,77,79,68,69,95,82,65,87,9,9, 48,120,48,48,'\n',35,100,101,102,105,110,101,32,83,77,79, 68,69,95,66,79,79,76,9,9,48,120,50,48,'\n',35,100, 101,102,105,110,101,32,83,77,79,68,69,95,69,68,71,69, 9,9,48,120,52,48,'\n',35,100,101,102,105,110,101,32,83, 77,79,68,69,95,80,85,76,83,69,9,9,48,120,54,48, '\n',35,100,101,102,105,110,101,32,83,77,79,68,69,95,80, 69,82,67,69,78,84,9,48,120,56,48,'\n',35,105,102,100, 101,102,32,95,95,82,67,88,'\n',35,100,101,102,105,110,101, 32,83,77,79,68,69,95,67,69,76,83,73,85,83,9,48, 120,97,48,'\n',35,100,101,102,105,110,101,32,83,77,79,68, 69,95,70,65,72,82,69,78,72,69,73,84,32,48,120,99, 48,'\n',35,100,101,102,105,110,101,32,83,77,79,68,69,95, 65,78,71,76,69,9,9,48,120,101,48,'\n',35,101,110,100, 105,102,'\n','\n',35,100,101,102,105,110,101,32,83,101,110,115, 111,114,77,111,100,101,40,115,101,110,115,111,114,44,32,109, 111,100,101,41,9,97,115,109,32,123,32,48,120,52,50,44, 32,36,115,101,110,115,111,114,32,58,32,48,120,48,51,48, 48,48,50,48,48,44,32,40,109,111,100,101,41,32,125,'\n', '\n',35,105,102,100,101,102,32,95,95,82,67,88,'\n',47,47, 32,116,121,112,101,115,32,102,111,114,32,83,101,110,115,111, 114,84,121,112,101,40,41,32,97,110,100,32,73,78,95,67, 70,71,40,41,'\n',35,100,101,102,105,110,101,32,83,84,89, 80,69,95,83,87,73,84,67,72,9,49,'\n',35,100,101,102, 105,110,101,32,83,84,89,80,69,95,84,69,77,80,9,9, 50,'\n',35,100,101,102,105,110,101,32,83,84,89,80,69,95, 76,73,71,72,84,9,9,51,'\n',35,100,101,102,105,110,101, 32,83,84,89,80,69,95,65,78,71,76,69,9,9,52,'\n', '\n',47,47,32,105,110,112,117,116,32,99,111,110,102,105,103, 117,114,97,116,105,111,110,115,32,45,32,117,115,101,100,32, 105,110,32,99,97,108,108,115,32,116,111,32,83,101,110,115, 111,114,40,41,'\n',35,100,101,102,105,110,101,32,73,78,95, 67,70,71,40,116,121,112,101,44,109,111,100,101,41,9,40, 40,40,116,121,112,101,41,60,60,56,41,32,43,32,40,109, 111,100,101,41,41,'\n',35,100,101,102,105,110,101,32,73,78, 95,83,87,73,84,67,72,9,73,78,95,67,70,71,40,83, 84,89,80,69,95,83,87,73,84,67,72,44,32,83,77,79, 68,69,95,66,79,79,76,41,'\n',35,100,101,102,105,110,101, 9,73,78,95,80,85,76,83,69,9,73,78,95,67,70,71, 40,83,84,89,80,69,95,83,87,73,84,67,72,44,32,83, 77,79,68,69,95,80,85,76,83,69,41,'\n',35,100,101,102, 105,110,101,32,73,78,95,69,68,71,69,9,9,73,78,95, 67,70,71,40,83,84,89,80,69,95,83,87,73,84,67,72, 44,32,83,77,79,68,69,95,69,68,71,69,41,'\n',35,100, 101,102,105,110,101,32,73,78,95,76,73,71,72,84,9,73, 78,95,67,70,71,40,83,84,89,80,69,95,76,73,71,72, 84,44,32,32,83,77,79,68,69,95,80,69,82,67,69,78, 84,41,'\n',35,100,101,102,105,110,101,32,73,78,95,65,78, 71,76,69,9,73,78,95,67,70,71,40,83,84,89,80,69, 95,65,78,71,76,69,44,32,32,83,77,79,68,69,95,65, 78,71,76,69,41,'\n','\n',47,47,32,115,101,116,32,97,32, 115,101,110,115,111,114,39,115,32,116,121,112,101,'\n',35,100, 101,102,105,110,101,32,83,101,110,115,111,114,84,121,112,101, 40,115,101,110,115,111,114,44,32,116,121,112,101,41,9,97, 115,109,32,123,32,48,120,51,50,44,32,36,115,101,110,115, 111,114,32,58,32,48,120,48,51,48,48,48,50,48,48,44, 32,40,116,121,112,101,41,32,125,'\n','\n',47,47,32,115,101, 116,32,97,32,115,101,110,115,111,114,39,115,32,116,121,112, 101,32,97,110,100,32,109,111,100,101,32,117,115,105,110,103, 32,97,32,99,111,110,102,105,103,32,45,32,101,46,103,46, 32,83,101,110,115,111,114,40,73,78,95,49,44,32,73,78, 95,76,73,71,72,84,41,59,'\n',35,100,101,102,105,110,101, 32,83,101,110,115,111,114,40,115,101,110,115,111,114,44,32, 116,109,41,9,100,111,32,123,32,83,101,110,115,111,114,84, 121,112,101,40,115,101,110,115,111,114,44,32,116,109,62,62, 56,41,59,32,92,'\n',9,9,9,9,9,9,9,9,9,32, 83,101,110,115,111,114,77,111,100,101,40,115,101,110,115,111, 114,44,32,116,109,41,59,32,125,32,119,104,105,108,101,32, 40,102,97,108,115,101,41,32,'\n','\n',35,101,110,100,105,102, '\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n', 32,42,32,111,117,112,117,116,'\n',32,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,47,'\n','\n',47,47,32,99,111,110,115,116,97, 110,116,115,32,102,111,114,32,115,101,108,101,99,116,105,110, 103,32,111,117,116,112,117,116,115,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,65,9,40,49,32,60,60,32,48,41, '\n',35,100,101,102,105,110,101,32,79,85,84,95,66,9,40, 49,32,60,60,32,49,41,'\n',35,100,101,102,105,110,101,32, 79,85,84,95,67,9,40,49,32,60,60,32,50,41,'\n','\n', 47,47,32,111,117,116,112,117,116,32,109,111,100,101,115,'\n', 35,100,101,102,105,110,101,32,79,85,84,95,70,76,79,65, 84,9,48,'\n',35,100,101,102,105,110,101,32,79,85,84,95, 79,70,70,9,9,48,120,52,48,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,79,78,9,9,48,120,56,48,'\n','\n', 47,47,32,111,117,116,112,117,116,32,100,105,114,101,99,116, 105,111,110,115,'\n',35,100,101,102,105,110,101,32,79,85,84, 95,82,69,86,9,9,48,'\n',35,100,101,102,105,110,101,32, 79,85,84,95,70,76,73,80,9,48,120,52,48,'\n',35,100, 101,102,105,110,101,32,79,85,84,95,70,87,68,9,9,48, 120,56,48,'\n','\n',47,47,32,115,112,101,101,100,115,'\n',35, 100,101,102,105,110,101,32,79,85,84,95,76,79,87,9,9, 49,'\n',35,100,101,102,105,110,101,32,79,85,84,95,72,65, 76,70,9,52,'\n',35,100,101,102,105,110,101,32,79,85,84, 95,70,85,76,76,9,55,'\n','\n',47,47,32,111,117,116,112, 117,116,32,102,117,110,99,116,105,111,110,115,'\n',35,100,101, 102,105,110,101,32,79,117,116,112,117,116,77,111,100,101,40, 111,44,32,109,41,9,97,115,109,32,123,32,48,120,50,49, 44,32,40,111,41,32,43,32,40,109,41,32,125,'\n',35,100, 101,102,105,110,101,32,79,117,116,112,117,116,68,105,114,40, 111,44,32,100,41,9,9,97,115,109,32,123,32,48,120,101, 49,44,32,40,111,41,32,43,32,40,100,41,32,125,'\n',35, 100,101,102,105,110,101,32,79,117,116,112,117,116,80,111,119, 101,114,40,111,44,32,112,41,9,97,115,109,9,123,32,48, 120,49,51,44,32,40,111,41,44,32,36,112,32,58,32,48, 120,49,48,48,48,48,49,53,125,'\n','\n',35,100,101,102,105, 110,101,32,70,119,100,40,111,44,32,112,41,9,100,111,32, 123,32,9,79,117,116,112,117,116,68,105,114,40,111,44,79, 85,84,95,70,87,68,41,59,32,92,'\n',9,9,9,9,9, 9,9,79,117,116,112,117,116,77,111,100,101,40,111,44,79, 85,84,95,79,78,41,59,32,92,'\n',9,9,9,9,9,9, 9,79,117,116,112,117,116,80,111,119,101,114,40,111,44,112, 41,59,32,125,32,119,104,105,108,101,40,102,97,108,115,101, 41,'\n',9,9,9,9,9,9,9,'\n',35,100,101,102,105,110, 101,32,82,101,118,40,111,44,32,112,41,9,100,111,32,123, 9,79,117,116,112,117,116,68,105,114,40,111,44,79,85,84, 95,82,69,86,41,59,32,92,'\n',9,9,9,9,9,9,9, 79,117,116,112,117,116,77,111,100,101,40,111,44,79,85,84, 95,79,78,41,59,32,92,'\n',9,9,9,9,9,9,9,79, 117,116,112,117,116,80,111,119,101,114,40,111,44,112,41,59, 32,125,32,119,104,105,108,101,40,102,97,108,115,101,41,'\n', 9,9,9,9,9,9,9,'\n',35,100,101,102,105,110,101,32, 79,102,102,40,111,41,9,9,9,9,79,117,116,112,117,116, 77,111,100,101,40,111,44,32,79,85,84,95,79,70,70,41, '\n',35,100,101,102,105,110,101,32,70,108,111,97,116,40,111, 41,9,9,9,79,117,116,112,117,116,77,111,100,101,40,111, 44,32,79,85,84,95,70,76,79,65,84,41,'\n',35,100,101, 102,105,110,101,32,84,111,103,103,108,101,40,111,41,9,9, 9,79,117,116,112,117,116,68,105,114,40,40,111,41,44,32, 79,85,84,95,70,76,73,80,41,'\n','\n','\n',47,47,32,67, 121,98,101,114,77,97,115,116,101,114,32,115,112,101,99,105, 102,105,99,32,115,116,117,102,102,'\n',35,105,102,100,101,102, 32,95,95,67,77,'\n',47,47,32,97,108,116,101,114,110,97, 116,101,32,110,97,109,101,115,32,102,111,114,32,109,111,116, 111,114,115,'\n',35,100,101,102,105,110,101,32,79,85,84,95, 76,32,79,85,84,95,65,32,47,47,32,76,101,102,116,32, 109,111,116,111,114,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,82,32,79,85,84,95,66,32,47,47,32,82,105,103, 104,116,32,109,111,116,111,114,'\n',35,100,101,102,105,110,101, 32,79,85,84,95,88,32,79,85,84,95,67,32,47,47,32, 69,120,116,101,114,110,97,108,32,109,111,116,111,114,'\n','\n', 35,100,101,102,105,110,101,32,68,114,105,118,101,40,109,48, 44,32,109,49,41,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,97,115,109,32,123,32, 48,120,52,49,44,32,68,73,82,83,80,69,69,68,40,109, 48,41,32,124,32,68,73,82,83,80,69,69,68,40,109,49, 41,60,60,52,32,125,'\n',35,100,101,102,105,110,101,32,79, 110,87,97,105,116,40,109,44,32,110,44,32,116,41,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,97,115,109,32,123,32,48,120,99,50,44,32,40,109,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 41,44,32,116,32,125,'\n',35,100,101,102,105,110,101,32,79, 110,87,97,105,116,68,105,102,102,101,114,101,110,116,40,109, 44,32,110,48,44,32,110,49,44,32,110,50,44,32,116,41, 32,97,115,109,32,123,32,48,120,53,51,44,32,40,109,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 48,41,44,32,68,73,82,83,80,69,69,68,40,110,49,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 50,41,44,32,116,32,125,'\n','\n',47,47,32,65,117,120,46, 32,102,117,110,99,116,105,111,110,58,32,84,114,97,110,115, 102,111,114,109,115,32,97,32,110,117,109,98,101,114,32,98, 101,116,119,101,101,110,32,45,55,32,97,110,100,32,55,32, 116,111,32,97,32,52,32,98,105,116,32,115,101,113,117,101, 110,99,101,58,32,'\n',47,47,32,66,105,116,115,58,32,49, 46,46,51,32,45,32,83,112,101,101,100,58,32,48,32,116, 111,32,55,'\n',47,47,32,66,105,116,32,58,32,52,32,32, 32,32,45,32,68,105,114,101,99,116,105,111,110,58,32,49, 32,105,102,32,118,62,61,48,44,32,48,32,105,102,32,118, 60,48,'\n',35,100,101,102,105,110,101,32,68,73,82,83,80, 69,69,68,40,118,41,9,9,40,40,118,41,38,56,94,56, 124,40,40,118,41,42,40,40,40,118,41,62,62,51,41,42, 50,94,49,41,41,38,55,41,'\n','\n','\n',35,101,110,100,105, 102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,100,97,116,97,32,115,111,117,114,99,101,115, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n',32,'\n', 35,100,101,102,105,110,101,32,84,105,109,101,114,40,110,41, 9,9,64,40,48,120,49,48,48,48,48,32,43,32,40,110, 41,41,'\n',35,100,101,102,105,110,101,32,82,97,110,100,111, 109,40,110,41,9,9,64,40,48,120,52,48,48,48,48,32, 43,32,40,110,41,41,'\n',35,100,101,102,105,110,101,32,73, 110,112,117,116,40,110,41,9,9,64,40,48,120,57,48,48, 48,48,32,43,32,40,110,41,41,'\n',35,100,101,102,105,110, 101,32,73,110,112,117,116,84,121,112,101,40,110,41,9,64, 40,48,120,97,48,48,48,48,32,43,32,40,110,41,41,'\n', 35,100,101,102,105,110,101,32,73,110,112,117,116,77,111,100, 101,40,110,41,9,64,40,48,120,98,48,48,48,48,32,43, 32,40,110,41,41,'\n','\n',35,105,102,100,101,102,32,95,95, 82,67,88,'\n',47,47,32,82,67,88,32,115,112,101,99,105, 102,105,99,32,100,97,116,97,32,115,111,117,114,99,101,115, '\n',35,100,101,102,105,110,101,32,80,114,111,103,114,97,109, 40,41,32,32,32,9,64,40,48,120,56,41,'\n',35,100,101, 102,105,110,101,32,73,110,112,117,116,82,97,119,40,110,41, 9,9,64,40,48,120,99,48,48,48,48,32,43,32,40,110, 41,41,'\n',35,100,101,102,105,110,101,32,73,110,112,117,116, 66,111,111,108,40,110,41,9,64,40,48,120,100,48,48,48, 48,32,43,32,40,110,41,41,'\n',35,100,101,102,105,110,101, 32,87,97,116,99,104,40,41,9,9,9,64,40,48,120,101, 48,48,48,48,41,'\n',35,100,101,102,105,110,101,32,77,101, 115,115,97,103,101,40,41,9,9,64,40,48,120,102,48,48, 48,48,41,'\n',35,101,110,100,105,102,'\n','\n',35,105,102,100, 101,102,32,95,95,67,77,'\n',47,47,32,67,77,32,115,112, 101,99,105,102,105,99,32,100,97,116,97,32,115,111,117,114, 99,101,115,'\n',35,100,101,102,105,110,101,32,84,97,99,104, 111,67,111,117,110,116,40,110,41,32,32,32,32,32,32,32, 32,32,32,64,40,48,120,53,48,48,48,48,32,43,32,40, 110,41,45,49,41,32,47,47,32,85,115,101,32,79,85,84, 95,120,32,97,115,32,112,97,114,97,109,101,116,101,114,'\n', 35,100,101,102,105,110,101,32,84,97,99,104,111,83,112,101, 101,100,40,110,41,32,32,32,32,32,32,32,32,32,32,64, 40,48,120,54,48,48,48,48,32,43,32,40,110,41,45,49, 41,32,47,47,32,85,115,101,32,79,85,84,95,120,32,97, 115,32,112,97,114,97,109,101,116,101,114,'\n',35,100,101,102, 105,110,101,32,69,120,116,101,114,110,97,108,77,111,116,111, 114,82,117,110,110,105,110,103,40,41,32,64,40,48,120,55, 48,48,48,50,41,32,32,32,32,32,32,32,32,32,47,47, 32,82,101,102,101,114,101,100,32,105,110,32,116,104,101,32, 83,68,75,32,97,115,32,77,111,116,111,114,67,117,114,114, 101,110,116,40,50,41,46,32,78,111,110,32,122,101,114,111, 32,105,102,32,101,120,116,101,114,110,97,108,32,109,111,116, 111,114,32,114,117,110,110,105,110,103,46,'\n',35,100,101,102, 105,110,101,32,65,71,67,40,41,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,64,40,48,120,49, 48,48,48,48,48,41,32,32,32,32,32,32,32,32,47,47, 32,65,117,116,111,109,97,116,105,99,32,71,97,105,110,32, 67,111,110,116,114,111,108,'\n',35,101,110,100,105,102,'\n','\n', '\n',47,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,'\n',32,42,32, 109,105,115,99,101,108,108,97,110,101,111,117,115,'\n',32,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,47,'\n','\n',47,47,32,119, 97,105,116,32,102,111,114,32,97,32,99,111,110,100,105,116, 105,111,110,32,116,111,32,98,101,99,111,109,101,32,116,114, 117,101,'\n',35,100,101,102,105,110,101,32,119,97,105,116,40, 99,41,9,9,119,104,105,108,101,40,33,40,99,41,41,'\n', '\n',47,47,32,112,108,97,121,105,110,103,32,115,111,117,110, 100,115,32,97,110,100,32,110,111,116,101,115,'\n',35,100,101, 102,105,110,101,32,80,108,97,121,83,111,117,110,100,40,120, 41,9,9,97,115,109,32,123,32,48,120,53,49,44,32,120, 32,125,'\n',35,100,101,102,105,110,101,32,80,108,97,121,78, 111,116,101,40,102,44,32,100,41,9,9,97,115,109,32,123, 32,48,120,50,51,44,32,40,102,41,44,32,40,102,41,62, 62,56,44,32,40,100,41,32,125,'\n','\n',47,47,32,115,108, 101,101,112,32,102,111,114,32,118,32,116,105,99,107,115,32, 40,49,48,109,115,32,112,101,114,32,116,105,99,107,41,'\n', 35,100,101,102,105,110,101,32,83,108,101,101,112,40,118,41, 9,97,115,109,32,123,32,48,120,52,51,44,32,36,118,32, 58,32,48,120,48,48,49,53,125,'\n','\n','\n',35,100,101,102, 105,110,101,32,67,108,101,97,114,84,105,109,101,114,40,110, 41,9,97,115,109,32,123,32,48,120,97,49,44,32,110,32, 125,'\n',35,100,101,102,105,110,101,32,67,108,101,97,114,83, 101,110,115,111,114,40,115,101,110,115,111,114,41,9,97,115, 109,9,123,32,48,120,100,49,44,32,36,115,101,110,115,111, 114,32,58,32,48,120,48,51,48,48,48,50,48,48,32,125, '\n','\n',35,100,101,102,105,110,101,32,83,116,111,112,65,108, 108,84,97,115,107,115,40,41,9,97,115,109,32,123,32,48, 120,53,48,32,125,'\n','\n',35,105,102,100,101,102,32,95,95, 82,67,88,'\n',47,47,32,115,101,116,32,116,104,101,32,100, 105,115,112,108,97,121,32,109,111,100,101,'\n',35,100,101,102, 105,110,101,32,68,105,115,112,108,97,121,40,118,41,9,97, 115,109,32,123,32,48,120,51,51,44,32,36,118,32,58,32, 48,120,48,48,48,53,125,'\n','\n',47,47,32,73,82,32,109, 101,115,115,97,103,101,32,115,117,112,112,111,114,116,'\n',35, 100,101,102,105,110,101,32,83,101,110,100,77,101,115,115,97, 103,101,40,118,41,9,97,115,109,32,123,32,48,120,98,50, 44,32,36,118,32,58,32,48,120,49,48,48,48,48,48,53, 32,125,'\n',35,100,101,102,105,110,101,32,67,108,101,97,114, 77,101,115,115,97,103,101,40,41,9,97,115,109,32,123,32, 48,120,57,48,32,125,'\n','\n',47,47,32,68,97,116,97,32, 108,111,103,103,105,110,103,'\n',35,100,101,102,105,110,101,32, 83,101,116,68,97,116,97,108,111,103,40,115,105,122,101,41, 9,97,115,109,9,123,32,48,120,53,50,44,32,40,115,105, 122,101,41,44,32,40,115,105,122,101,41,62,62,56,32,125, '\n',35,100,101,102,105,110,101,32,68,97,116,97,108,111,103, 40,118,41,9,9,9,97,115,109,32,123,32,48,120,54,50, 44,32,36,118,32,58,32,48,120,49,48,48,52,50,48,51, 125,'\n',35,100,101,102,105,110,101,32,85,112,108,111,97,100, 68,97,116,97,108,111,103,40,115,44,32,110,41,9,97,115, 109,32,123,32,48,120,97,52,44,32,40,115,41,44,32,40, 115,41,62,62,56,44,32,40,110,41,44,32,40,110,41,62, 62,56,32,125,'\n','\n',47,47,32,115,101,116,32,116,104,101, 32,115,121,115,116,101,109,32,99,108,111,99,107,'\n',35,100, 101,102,105,110,101,32,83,101,116,87,97,116,99,104,40,104, 44,32,109,41,32,32,9,97,115,109,32,123,32,48,120,50, 50,44,32,40,104,41,44,32,40,109,41,32,125,'\n','\n',47, 47,32,115,117,112,112,111,114,116,32,102,111,114,32,99,111, 110,116,114,111,108,108,105,110,103,32,116,104,101,32,73,82, 77,111,100,101,'\n',35,100,101,102,105,110,101,32,73,82,95, 76,79,32,48,'\n',35,100,101,102,105,110,101,32,73,82,95, 72,73,32,49,'\n',35,100,101,102,105,110,101,32,73,82,77, 111,100,101,40,109,41,32,32,32,32,32,32,97,115,109,32, 123,32,48,120,51,49,44,32,109,32,125,'\n',35,101,110,100, 105,102,'\n','\n',35,105,102,100,101,102,32,95,95,67,77,'\n', 35,100,101,102,105,110,101,32,67,108,101,97,114,84,97,99, 104,111,67,111,117,110,116,101,114,40,109,41,32,97,115,109, 32,123,32,48,120,49,49,44,32,40,109,41,32,125,'\n',35, 101,110,100,105,102,'\n','\n',35,112,114,97,103,109,97,32,110, 111,105,110,105,116,'\n',}; nqc-3.1.r6/compiler/rcx2.nqh0000600000175000017500000016707110326010612013773 0ustar blpblp/* * rcx.nqh - version 3.1r5 * Copyright (C) 1998-2005 Dave Baum, John Hansen * * CyberMaster definitions by Laurentino Martins * Spybot definitions by John Hansen * Swan definitions by John Hansen * * This file is part of nqc, the Not Quite C compiler for the RCX * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * This file defines various system constants and macros to be used * with the RCX. Most of the real functionality of the RCX is * defined here rather than within nqcc itself. * */ // internal constants for asm statements #define __ASM_SMALL_VALUE 0x01000000 #define __ASM_NO_TYPE 0x02000000 #define __ASM_NO_LOCAL 0x04000000 // commonly used restrictors #if __RCX==2 || defined(__SPY) || defined(__SWAN) // no restriction #define __ASM_SRC_BASIC 0 #define __ASM_SRC_EXT 0 #else #define __ASM_SRC_BASIC 0x000005 // constant or variable #define __ASM_SRC_EXT 0x000015 // constant, variable, or random #endif /************************** * sensors **************************/ #define S1 0 #define S2 1 #define S3 2 // reading a sensor's value and type #define SensorValue(n) @(0x90000 + (__sensor(n))) #ifndef __SPY #define SensorType(n) @(0xa0000 + (__sensor(n))) #endif // constants for selecting sensors - also a shorthand to read the sensor's value #define SENSOR_1 SensorValue(S1) #define SENSOR_2 SensorValue(S2) #define SENSOR_3 SensorValue(S3) __nolist void ClearSensor(__sensor sensor) { asm { 0xd1, $sensor : 0x03000200}; } #ifdef __CM // CM has alternative names for sensors #define SENSOR_L SENSOR_1 // Left sensor #define SENSOR_M SENSOR_2 // Middle sensor #define SENSOR_R SENSOR_3 // Right sensor #endif #if defined(__RCX) || defined(__CM) || defined(__SWAN) // RCX and CM support sensor modes #define SENSOR_MODE_RAW 0x00 #define SENSOR_MODE_BOOL 0x20 #define SENSOR_MODE_EDGE 0x40 #define SENSOR_MODE_PULSE 0x60 #define SENSOR_MODE_PERCENT 0x80 #if defined(__RCX) || defined(__SWAN) // RCX has some extra modes #define SENSOR_MODE_CELSIUS 0xa0 #define SENSOR_MODE_FAHRENHEIT 0xc0 #define SENSOR_MODE_ROTATION 0xe0 #endif // __RCX or __SWAN #define SensorMode(n) @(0xb0000 + (__sensor(n))) // read the sensor mode __nolist void SetSensorMode(__sensor sensor, const int mode) { asm { 0x42, $sensor : 0x03000200, mode }; } #endif // defined(__RCX) || defined(__CM) || defined(__SWAN) #if defined(__SPY) // SPY doesn't shift the mode over 5 bits in SensorMode(), // so constants are different from RCX #define SENSOR_MODE_RAW 0x00 #define SENSOR_MODE_BOOL 0x01 #define SENSOR_MODE_PERCENT 0x04 #define SensorMode(n) @(0xb0000 + (__sensor(n))) // read the sensor mode __nolist void SetSensorMode(__sensor sensor, const int mode) { asm { 0x42, $sensor : 0x03000200, mode << 5 }; } #endif #if defined(__RCX) || defined(__SWAN) // RCX supports sensor types // types for SetSensorType() #define SENSOR_TYPE_NONE 0 #define SENSOR_TYPE_TOUCH 1 #define SENSOR_TYPE_TEMPERATURE 2 #define SENSOR_TYPE_LIGHT 3 #define SENSOR_TYPE_ROTATION 4 #if defined(__SWAN) #define SENSOR_TYPE_ACTIVE_RAW 5 #endif // type/mode combinations for SetSensor() #define _SENSOR_CFG(type,mode) (((type)<<8) + (mode)) #define SENSOR_TOUCH _SENSOR_CFG(SENSOR_TYPE_TOUCH, SENSOR_MODE_BOOL) #define SENSOR_LIGHT _SENSOR_CFG(SENSOR_TYPE_LIGHT, SENSOR_MODE_PERCENT) #define SENSOR_ROTATION _SENSOR_CFG(SENSOR_TYPE_ROTATION, SENSOR_MODE_ROTATION) #define SENSOR_CELSIUS _SENSOR_CFG(SENSOR_TYPE_TEMPERATURE, SENSOR_MODE_CELSIUS) #define SENSOR_FAHRENHEIT _SENSOR_CFG(SENSOR_TYPE_TEMPERATURE, SENSOR_MODE_FAHRENHEIT) #define SENSOR_PULSE _SENSOR_CFG(SENSOR_TYPE_TOUCH, SENSOR_MODE_PULSE) #define SENSOR_EDGE _SENSOR_CFG(SENSOR_TYPE_TOUCH, SENSOR_MODE_EDGE) #define SensorValueBool(n) @(0xd0000 + (__sensor(n))) // read the boolean value of a sensor // set a sensor's type __nolist void SetSensorType(__sensor sensor, const int type) { asm { 0x32, $sensor : 0x03000200, (type) }; } // set a sensor's type and mode using a config - e.g. SetSensor(SENSOR_1, SENSOR_LIGHT); __nolist void SetSensor(__sensor sensor, const int tm) { SetSensorType(sensor, tm>>8); SetSensorMode(sensor, tm); } #endif #ifdef __SCOUT // Scout has some special routines to configure the light sensor __nolist void CalibrateSensor() { asm { 0xc0 }; } __nolist void SetSensorClickTime(const int &x) { asm { 0xe3, $x : __ASM_SRC_BASIC }; } __nolist void SetSensorHysteresis(const int &x) { asm { 0xd3, $x : __ASM_SRC_BASIC }; } __nolist void SetSensorLowerLimit(const int &x) { asm { 0xc3, $x : __ASM_SRC_BASIC }; } __nolist void SetSensorUpperLimit(const int &x) { asm { 0xb3, $x : __ASM_SRC_BASIC }; } #endif #if defined(__RCX) || defined(__SCOUT) || defined(__SPY) || defined(__SWAN) // RCX and Scout support reading the raw value #define SensorValueRaw(n) @(0xc0000 + (__sensor(n))) #endif /************************** * outputs **************************/ // constants for selecting outputs #define OUT_A 0x01 #define OUT_B 0x02 #define OUT_C 0x04 #define OUT_AB 0x03 #define OUT_AC 0x05 #define OUT_BC 0x06 #define OUT_ABC 0x07 #ifdef __SWAN #define OUT_D 0x08 #define OUT_E 0x10 #define OUT_F 0x20 #endif // __SWAN // output modes #define OUT_FLOAT 0 #define OUT_OFF 0x40 #define OUT_ON 0x80 // output directions #define OUT_REV 0 #define OUT_TOGGLE 0x40 #define OUT_FWD 0x80 // output power levels #define OUT_LOW 0 #define OUT_HALF 3 #define OUT_FULL 7 // output functions __nolist void SetOutput(const int o, const int m) { asm { 0x21, (o) + (m) }; } __nolist void SetDirection(const int o, const int d) { asm { 0xe1, (o) + (d) }; } __nolist void SetPower(const int o, const int &p) { asm { 0x13, (o), $p : __ASM_SMALL_VALUE + __ASM_SRC_EXT}; } __nolist void On(const int o) { SetOutput(o, OUT_ON); } __nolist void Off(const int o) { SetOutput(o, OUT_OFF); } __nolist void Float(const int o) { SetOutput(o, OUT_FLOAT); } __nolist void Toggle(const int o) { SetDirection(o, OUT_TOGGLE); } __nolist void Fwd(const int o) { SetDirection(o, OUT_FWD); } __nolist void Rev(const int o) { SetDirection(o, OUT_REV); } __nolist void OnFwd(const int o) { Fwd(o); On(o); } __nolist void OnRev(const int o) { Rev(o); On(o); } __nolist void OnFor(const int o, const int &t) { On(o); Wait(t); Off(o); } #define OutputStatus(n) @(0x030000 + (n)) // read the output status #ifdef __CM // CyberMaster specific stuff // alternate names for motors #define OUT_L OUT_A // Left motor #define OUT_R OUT_B // Right motor #define OUT_X OUT_C // External motor #define Drive(m0, m1) asm { 0x41, DIRSPEED(m0) | DIRSPEED(m1)<<4 } #define OnWait(m, n, t) asm { 0xc2, (m)<<4 | DIRSPEED(n), t } #define OnWaitDifferent(m, n0, n1, n2, t) asm { 0x53, (m)<<4 | DIRSPEED(n0), DIRSPEED(n1)<<4 | DIRSPEED(n2), t } // Aux. function: Transforms a number between -7 and 7 to a 4 bit sequence: // Bits: 1..3 - Speed: 0 to 7 // Bit : 4 - Direction: 1 if v>=0, 0 if v<0 #define DIRSPEED(v) ((v)&8^8|((v)*(((v)>>3)*2^1))&7) // reading the tacho, etc. #define TachoCount(n) @(0x50000 + (n)-1) // Use OUT_x as parameter #define TachoSpeed(n) @(0x60000 + (n)-1) // Use OUT_x as parameter #define ExternalMotorRunning() @(0x70002) // Refered in the SDK as MotorCurrent(2). Non zero if external motor running. #define ClearTachoCounter(m) asm { 0x11, (m) } #endif #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) // Scout and RCX2 have global versions of output control __nolist void SetGlobalOutput(const int o, const int m) { asm { 0x67, (o) + (m) }; } __nolist void SetGlobalDirection(const int o, const int d) { asm { 0x77, (o) + (d) }; } __nolist void SetMaxPower(const int o, const int &p) { asm { 0xa3, (o), $p : __ASM_SMALL_VALUE + __ASM_SRC_EXT}; } __nolist void EnableOutput(const int o) { SetGlobalOutput(o, OUT_ON); } __nolist void DisableOutput(const int o) { SetGlobalOutput(o, OUT_OFF); } __nolist void InvertOutput(const int o) { SetGlobalDirection(o, OUT_REV); } __nolist void ObvertOutput(const int o) { SetGlobalDirection(o, OUT_FWD); } #define GlobalOutputStatus(n) @(0x110000 + (n)) // read the global status #endif #if defined(__SCOUT) || defined(__SPY) // Scout has a light #define LIGHT_ON 0x80 #define LIGHT_OFF 0 __nolist void SetLight(const int x) { asm { 0x87, x }; } #endif /************************** * sound **************************/ // sounds - for PlaySound() #define SOUND_CLICK 0 #define SOUND_DOUBLE_BEEP 1 #define SOUND_DOWN 2 #define SOUND_UP 3 #define SOUND_LOW_BEEP 4 #define SOUND_FAST_UP 5 #if defined(__SWAN) #define SOUND_SHORT_BLIP 6 #define SOUND_EXCEPTION 7 #endif // playing a system sound #if defined(__SPY) // Spy can play variable or constant sounds __nolist void PlaySound(const int &x) { if (__type(x)==2) asm { 0x51, $x : 0x3000004 }; else asm { 0xe7, $x : 0x3000001 }; } #else __nolist void PlaySound(const int x) { asm { 0x51, x }; } #endif // playing a note #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) // RCX2 and Scout can play variable or constant frequency __nolist void PlayTone(const int ¬e, const int dur) { if (__type(note)==2) asm { 0x23, $note : 0x2000004, dur }; else asm { 0x02, $note : 0x3000001, dur}; } #else // RCX1 and CM need constant frequency __nolist void PlayTone(const int f, const int d) { asm { 0x23, (f), (f)>>8, (d) }; } #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) // RCX2 __nolist void MuteSound() { asm { 0xd0 }; } __nolist void UnmuteSound() { asm { 0xe0 }; } __nolist void ClearSound() { asm { 0x80 }; } #elif defined(__SCOUT) // SCOUT __nolist void MuteSound() { asm { 0x57, 0x80 }; } __nolist void UnmuteSound() { asm { 0x57, 0xc0 }; } __nolist void SelectSounds(const int group) { asm { 0x57, group }; } #endif /************************** * Display **************************/ #if defined(__RCX) || defined(__SWAN) // set the display mode __nolist void SelectDisplay(const int &v) { asm { 0x33, $v : __ASM_SRC_BASIC}; } // display modes - for SelectDisplay #define DISPLAY_WATCH 0 #define DISPLAY_SENSOR_1 1 #define DISPLAY_SENSOR_2 2 #define DISPLAY_SENSOR_3 3 #define DISPLAY_OUT_A 4 #define DISPLAY_OUT_B 5 #define DISPLAY_OUT_C 6 #if __RCX==2 || defined(__SWAN) #define DISPLAY_USER 7 __nolist void SetUserDisplay(const int &v, const int prec) { asm { 0xe5, 0, prec, $v : __ASM_NO_LOCAL }; } #endif #if defined(__SWAN) #define DISPLAY_EXCEPTION 8 #endif #endif /************************** * communication **************************/ #if defined(__SPY) || defined(__SCOUT) #if defined(__SPY) #define VLL() @(0xf0000) // read the message buffer #endif // Scout and Spybot can send VLL commands __nolist void SendVLL(const int &x) { asm { 0xe2, $x : __ASM_SMALL_VALUE + __ASM_SRC_BASIC}; } #endif #if defined(__RCX) || defined(__SCOUT) || defined(__SWAN) // Scout and RCX have IR message capability #define Message() @(0xf0000) // read the message buffer __nolist void SendMessage(const int &v) { asm { 0xb2, $v : __ASM_SMALL_VALUE + __ASM_SRC_BASIC}; } __nolist void ClearMessage() { asm { 0x90 }; } #if __RCX==2 || defined(__SWAN) __nolist void SetMessage(const int m) { asm { 0xf7, m }; } #endif #if defined(__SWAN) #define MessageParam() @(0xf0001) // read the msg param __nolist void SendMessageWithParam(const int &m, const int &p) { asm { 0xc3, $m : __ASM_SMALL_VALUE + __ASM_SRC_EXT, $p : __ASM_SRC_EXT}; } __nolist void SetMessageByteParam(const int m, const int p) { asm { 0xa2, m, p}; } __nolist void SetMessageWordParam(const int m, const int p) { asm { 0xb3, m, p, p>>8}; } __nolist void SetMessageVariableParam(const int &m, const int &p) { asm { 0xc4, $m : __ASM_SMALL_VALUE + __ASM_SRC_EXT, $p : __ASM_SRC_EXT}; } #endif #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) #if __RCX==2 || defined(__SWAN) // serial communication sources #define SerialPacket() @(0x210010) #define SerialComm() @(0x210011) __nolist void SetSerialPacket(const int &v) { Set(SerialPacket(), v); } __nolist void SetSerialComm(const int &v) { Set(SerialComm(), v); } // values for SerPacket #define SERIAL_PACKET_DEFAULT 0 // raw serial, no checksum, no preamble #define SERIAL_PACKET_PREAMBLE 1 #define SERIAL_PACKET_NEGATED 2 // includes checksum #define SERIAL_PACKET_CHECKSUM 4 // use this for checksum w/o negated #define SERIAL_PACKET_RCX (SERIAL_PACKET_PREAMBLE + SERIAL_PACKET_NEGATED) #define SERIAL_PACKET_RC 0 // default #define SERIAL_PACKET_SPYBOT 0 // values for SerComm #define SERIAL_COMM_DEFAULT 0 #define SERIAL_COMM_4800 1 // default is 2400 baud #define SERIAL_COMM_76KHZ 2 // default is 38kHz #define SERIAL_COMM_DUTY25 4 // default is 50% duty cycle #define SERIAL_COMM_RCX 0 #define SERIAL_COMM_RC 7 // 4800/76KHZ/25% #define SERIAL_COMM_SPYBOT 7 // was SERIAL_COMM_4800 + SERIAL_COMM_76KHZ #ifdef __SWAN #define SERIAL_COMM_9600 8 #define DefaultSerialPacket() @(0x210012) #define DefaultSerialComm() @(0x210013) __nolist void SetDefaultSerialPacket(const int &v) { Set(DefaultSerialPacket(), v); } __nolist void SetDefaultSerialComm(const int &v) { Set(DefaultSerialComm(), v); } #endif // API for interacting with Spybot and other RC components #define MSG_BROADCAST 0x8a #define MSG_LINKCAST 0x89 #define MSG_DIRECT 0x88 // base addresses for uart data #define UART_BOT 0 #define UART_CTRL 7 #define UART_PING 9 #define UART_RC 11 __nolist void InitSpybotComm() { SetSerialPacket(SERIAL_PACKET_SPYBOT); SetSerialComm(SERIAL_COMM_SPYBOT); } __nolist void SendSpybotMsg() { SendSerial(UART_BOT, 7); } __nolist void SetSpybotMessage(const int &nMode, const int &nMyID, const int &nAddress, const int &nCmd, const int &nHiByte, const int &nLoByte) { SetSerialData(UART_BOT+0,nMode); SetSerialData(UART_BOT+1,nMyID); SetSerialData(UART_BOT+2,nAddress); SetSerialData(UART_BOT+3,nCmd); SetSerialData(UART_BOT+4,nHiByte); SetSerialData(UART_BOT+5,nLoByte); SetSerialData(UART_BOT+6,0-nMode-nMyID-nAddress-nCmd-nHiByte-nLoByte); // SetSerialData(UART_BOT+6,0x100-((nMode+nMyID+nAddress+nCmd+nHiByte+nLoByte)&0xff)); } __nolist void SendSpybotMessage(const int &nMode, const int &nMyID, const int &nAddress, const int &nCmd, const int &nHiByte, const int &nLoByte) { InitSpybotComm(); SetSpybotMessage(nMode, nMyID, nAddress, nCmd, nHiByte, nLoByte); SendSpybotMsg(); } // Spybot controller commands #define SPY_CTRL_BTN_1 0x01 #define SPY_CTRL_BTN_2 0x02 #define SPY_CTRL_BTN_3 0x03 #define SPY_CTRL_BTN_4 0x04 #define SPY_CTRL_BTN_5 0x05 #define SPY_CTRL_RCX_1 0x06 //RCX to Spybot specific #define SPY_CTRL_RCX_2 0x07 #define SPY_CTRL_RCX_3 0x08 #define SPY_CTRL_RCX_4 0x09 #define SPY_CTRL_RCX_5 0x0a #define SPY_CTRL_RCX_6 0x0b #define SPY_CTRL_RCX_7 0x0c #define SPY_CTRL_RCX_8 0x0d #define __SPY_CTRL_CMD 0x90 __nolist void SendSpybotCtrlMsg() { SendSerial(UART_CTRL, 2); } __nolist void SetSpybotCtrlMessage(const int &nMyID, const int &nMsg) { SetSerialData(UART_CTRL+0,__SPY_CTRL_CMD+nMyID); SetSerialData(UART_CTRL+1,(nMsg * 16) + ((0 - ((__SPY_CTRL_CMD+nMyID) / 16) - (__SPY_CTRL_CMD+nMyID) - nMsg) & 0x0f)); } __nolist void SendSpybotCtrlMessage(const int &nMyID, const int &nMsg) { InitSpybotComm(); SetSpybotCtrlMessage(nMyID, nMsg); SendSpybotCtrlMsg(); } __nolist void SendSpybotCtrlPingMsg() { SendSerial(UART_PING, 2); } __nolist void SetSpybotCtrlPingMessage(const int &nID) { SetSerialData(UART_PING+0,__SPY_CTRL_CMD+nID); SetSerialData(UART_PING+1,(0 - ((__SPY_CTRL_CMD+nID) / 16) - (__SPY_CTRL_CMD+nID)) & 0x0f); } __nolist void SendSpybotCtrlPingMessage(const int &nID) { InitSpybotComm(); SetSpybotCtrlPingMessage(nID); SendSpybotCtrlPingMsg(); } __nolist void SendSpybotPingMsg() { SendSerial(UART_PING, 4); } __nolist void SetSpybotPing(const int &nLinkID, const int &nMyID, const int &nInfo) { SetSerialData(UART_PING+0,0x80+(nLinkID&0x7)); SetSerialData(UART_PING+1,nMyID); SetSerialData(UART_PING+2,nInfo); SetSerialData(UART_PING+3,0-(0x80+(nLinkID&0x7))-nMyID-nInfo); // SetSerialData(UART_PING+3,0x100-((0x80+(nLinkID&0x7)+nMyID+nInfo)&0xff)); } __nolist void SendSpybotPing(const int &nLinkID, const int &nMyID, const int &nInfo) { InitSpybotComm(); SetSpybotPing(nLinkID, nMyID, nInfo); SendSpybotPingMsg(); } // RC channels and commands #define RC_CHANNEL_1 0x50 #define RC_CHANNEL_2 0x60 #define RC_CHANNEL_3 0x70 #define RC_CMD_FLOAT 0x00 #define RC_CMD_FWD 0x07 #define RC_CMD_OFF 0x08 #define RC_CMD_REV 0x0f __nolist void InitRCComm() { SetSerialPacket(SERIAL_PACKET_RC); SetSerialComm(SERIAL_COMM_RC); } __nolist void SendRCMsg() { SendSerial(UART_RC, 2); } __nolist void SetRCMessage(const int &nChannel, const int &nLeft, const int &nRight) { SetSerialData(UART_RC+0,nChannel + nLeft); SetSerialData(UART_RC+1,(nRight * 16) + ((0 - nRight - nLeft - (nChannel / 16)) & 0x0f)); } __nolist void SendRCMessage(const int &nChannel, const int &nLeft, const int &nRight) { InitRCComm(); SetRCMessage(nChannel, nLeft, nRight); SendRCMsg(); } #endif // Link ID constants for RCX2/Swan SendSpybotPing and Spybot API #define ID_NONE 0 #define ID_CTRL_1 1 #define ID_CTRL_2 2 #define ID_CTRL_3 3 #define ID_CTRL_4 4 #define ID_CTRL_5 5 #define ID_CTRL_6 6 #define ID_PC 7 // my robot ID min and max values #define ID_BOT_MIN 8 #define ID_BOT_MAX 255 // commands #define CMD_TYPE_MASK 0x00f0 #define CMD_TYPE_GAME 0x10 #define CMD_GAME_START 0x10 #define CMD_GAME_COMMAND 0x11 #define CMD_GAME_GETVAR 0x12 #define CMD_GAME_VALUE 0x13 #define CMD_GAME_WIN 0x14 #define CMD_GAME_LOSE 0x15 #define CMD_GAME_BLINK 0x16 #define CMD_GAME_GIVE 0x17 #define CMD_GAME_TAKE 0x18 #define CMD_FROM_RCX2 0x1f //fire command protocol: , 0x20 + , , // param1: target aspect (ie front, back, front left...) // param2: strength #define CMD_TYPE_FIRE 0x20 #define CMD_FIRE_LASER 0x21 #define CMD_FIRE_SPINNER 0x22 #define CMD_FIRE_ELECTRONET 0x23 //react to special ability command protocol: , 0x30 + , , // param1: range // param2: strength/time #define CMD_TYPE_REACT_TO 0x30 #define CMD_REACT_TO_GIGAMESH 0x31 #define CMD_REACT_TO_SNAPTRAX 0x32 #define CMD_REACT_TO_SHADOWSTRIKE 0x33 #define CMD_REACT_TO_TECHNOJAW 0x34 //activate token in another bot tell protocol: , 0x40 + , , // param1: 0 // param2: time #define CMD_TYPE_TELL x040 #define CMD_TELL_MAGNET 0x41 #define CMD_TELL_REPULSE 0x42 #define CMD_TELL_FLASHBLIND 0x43 #define CMD_TELL_FREEZE 0x44 #define CMD_TELL_SLOW 0x45 #define CMD_TELL_REVERSE 0x46 #define CMD_TELL_DIZZY 0x47 #define CMD_TELL_TAKECONTROL 0x48 #define CMD_TYPE_USER 0x50 #define CMD_TYPE_SPARE 0x60 #define CMD_SMART_BOMB 0x61 #define CMD_TYPE_VLL 0x70 #define SerialData(n) @(0x210000 + (n)) // data for SendSer __nolist void SetSerialData(const int n, const int &v) { Set(SerialData(n), v); } __nolist void SendSerial(const int first, const int count) { asm { 0xc2, first, count }; } #if defined(__SPY) #define SERIAL_TYPE 0x10 #define SERIAL_TYPE_SPYBOT 0 #define SERIAL_TYPE_RCX 1 #define SERIAL_TYPE_RC 2 #define SERIAL_TYPE_USER 3 #define SerialType() @(0x210010) __nolist void SetSerialType(const int &t) { Set(SerialType(), t); } #define SERIAL_BAUD 0x11 #define SERIAL_BAUD_2400 0 #define SERIAL_BAUD_4800 1 #define SERIAL_BAUD_9600 2 #define SerialBaud() @(0x210011) __nolist void SetSerialBaud(const int &b) { Set(SerialBaud(), b); } #define SERIAL_CHANNEL 0x12 #define SERIAL_CHANNEL_IR 0 #define SERIAL_CHANNEL_PC 1 #define SerialChannel() @(0x210012) __nolist void SetSerialChannel(const int &c) { Set(SerialChannel(), c); } #define SERIAL_PREAMBLE_POS 0x13 #define SerialPreamblePos() @(0x210013) __nolist void SetSerialPreamblePos(const int &p) { Set(SerialPreamblePos(), p); } #define SERIAL_PREAMBLE_LEN 0x14 #define SerialPreambleLen() @(0x210014) __nolist void SetSerialPreambleLen(const int &l) { Set(SerialPreambleLen(), l); } #define SERIAL_CHECKSUM 0x15 #define SERIAL_CHECKSUM_NONE 0 #define SERIAL_CHECKSUM_SUM 0x04 #define SERIAL_CHECKSUM_ZERO_SUM 0x08 #define SerialChecksum() @(0x210015) __nolist void SetSerialChecksum(const int &n) { Set(SerialChecksum(), n); } #define SERIAL_BIPHASE 0x16 #define SERIAL_BIPHASE_OFF 0 #define SERIAL_BIPHASE_ON 0xff #define SerialBiPhase() @(0x210016) __nolist void SetSerialBiPhase(const int &n) { Set(SerialBiPhase(), n); } #define MSG_NONE 0 #define MSG_IR 1 #define MSG_PC 2 #define RxMessageLock() @(0x210017) __nolist void SetRxMessageLock(const int &l) { Set(RxMessageLock(), l); } #define RxMessageIndex() @(0x210018) #define RxMessageChannel() @(0x210019) // returns MSG_IR or MSG_PC #define RxMessageID(c) @(0x210019 + (c)) // c == MSG_IR or MSG_PC #define MSG_INDEX 0 #define MSG_COMMAND 1 #define MSG_HI_BYTE 2 #define MSG_LO_BYTE 3 #define COMMAND_CONTROLLER 0x40 #define INDEX_LINKCAST 0x40 #define INDEX_BROADCAST 0x80 #define INDEX_INVALID 0x20 #define RxMessage(c, n) @(0x210018 + (c*4) + (n)) // c == MSG_IR or MSG_PC; 4 bytes #endif #endif /************************** * Timers **************************/ #define T1 0 #define T2 1 #define T3 2 #ifndef __SCOUT #define T4 3 #endif #define Timer(n) @(0x10000 + (n)) // read a timer's value __nolist void ClearTimer(const int n) { asm { 0xa1, n }; } #ifdef __SCOUT __nolist void SetTimerLimit(const int n, const int &x) { asm { 0xc4, n, $x : __ASM_SRC_EXT }; } #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) __nolist void SetTimer(const int n, const int &v) { Set(Timer(n), v); } #define FastTimer(n) @(0x1a0000 + (n)) #endif /************************** * Counters **************************/ #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) // Scout, RCX2, Spy, and Swan have counter support #define Counter(n) @(0x150000 + (n)) // read a counter __nolist void IncCounter(const int c) { asm { 0x97, c }; } __nolist void DecCounter(const int c) { asm { 0xA7, c }; } __nolist void ClearCounter(const int c) { asm { 0xb7, c}; } #ifdef __SCOUT __nolist void SetCounterLimit(const int c, const int &l) { asm { 0xd4, c, $l : __ASM_SRC_EXT }; } #endif #endif /************************** * Events **************************/ #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) // Scout, RCX2, Spy, and Swan have basic event support #define ActiveEvents(n) @(0x170000 + (n)) #define EVENT_MASK(e) (1 << (e)) #if defined(__SCOUT) // only constant masks allowed __nolist void Event(const int e) { asm { 0x03, 2, e, e>>8 }; } #else __nolist void Event(const int &e) { asm { 0x03, $e }; } #endif #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) #if __RCX==2 || defined(__SWAN) #define CurrentEvents() ActiveEvents(10) #else #define CurrentEvents() ActiveEvents(16) #endif #define EVENT_TYPE_PRESSED 0 #define EVENT_TYPE_RELEASED 1 #define EVENT_TYPE_LOW 8 #define EVENT_TYPE_NORMAL 9 #define EVENT_TYPE_HIGH 10 #define EVENT_TYPE_CLICK 11 #ifdef __SPY // these all correspond to using VLL() as the source #define EVENT_TYPE_ENTRY_FOUND 4 #define EVENT_TYPE_MSG_DISCARD 6 #define EVENT_TYPE_MSG_RECEIVED 13 #define EVENT_TYPE_VLL_MSG_RECEIVED 14 #define EVENT_TYPE_ENTRY_CHANGED 15 #else #define EVENT_TYPE_PULSE 2 #define EVENT_TYPE_EDGE 3 #define EVENT_TYPE_FASTCHANGE 7 #define EVENT_TYPE_DOUBLECLICK 12 #define EVENT_TYPE_MESSAGE 14 #endif #if defined(__SWAN) #define EVENT_TYPE_4 4 #define EVENT_TYPE_5 5 #define EVENT_TYPE_6 6 #define EVENT_TYPE_VIRTUAL_MOTOR_CHANGE 4 #define EVENT_TYPE_VIRTUAL_MOTOR_POWER 5 #define EVENT_TYPE_VIRTUAL_SENSOR_DEF 6 #define EVENT_TYPE_INFRARED_IDLE 13 #define EVENT_TYPE_RESET 16 #endif #define SetEvent(e,s,t) __SetEvent(e,__event_src(s),t) __nolist void __SetEvent(const int evt, const int src, const int type) { asm { 0x93, evt, src, type}; } __nolist void ClearEvent(const int evt) { asm { 0x93, evt, 0, 16 }; } __nolist void ClearAllEvents() { asm { 0x06 }; } __nolist void CalibrateEvent(const int evt, const int low, const int hi, const int hyst) { asm { 0x04, evt, hi, low, hyst }; } #define EventState(n) @(0x190000 + (n)) #define UpperLimit(n) @(0x1c0000 + (n)) #define LowerLimit(n) @(0x1d0000 + (n)) #define Hysteresis(n) @(0x1e0000 + (n)) #define ClickTime(n) @(0x1f0000 + (n)) __nolist void SetUpperLimit(const int evt, const int &v) { Set(UpperLimit(evt), v); } __nolist void SetLowerLimit(const int evt, const int &v) { Set(LowerLimit(evt), v); } __nolist void SetHysteresis(const int evt, const int &v) { Set(Hysteresis(evt), v); } __nolist void SetClickTime(const int evt, const int &v) { Set(ClickTime(evt), v); } #if __RCX==2 || defined(__SWAN) #define ClickCounter(n) @(0x1b0000 + (n)) __nolist void SetClickCounter(const int evt, const int &v) { Set(ClickCounter(evt), v); } #endif #endif #if __SCOUT // event codes #define EVENT_1_PRESSED (1 << 0) #define EVENT_1_RELEASED (1 << 1) #define EVENT_2_PRESSED (1 << 2) #define EVENT_2_RELEASED (1 << 3) #define EVENT_LIGHT_HIGH (1 << 4) #define EVENT_LIGHT_NORMAL (1 << 5) #define EVENT_LIGHT_LOW (1 << 6) #define EVENT_LIGHT_CLICK (1 << 7) #define EVENT_LIGHT_DOUBLECLICK (1 << 8) #define EVENT_COUNTER_0 (1 << 9) #define EVENT_COUNTER_1 (1 << 10) #define EVENT_TIMER_0 (1 << 11) #define EVENT_TIMER_1 (1 << 12) #define EVENT_TIMER_2 (1 << 13) #define EVENT_MESSAGE (1 << 14) #endif /************************** * General **************************/ // wait for a condition to become true #define until(c) while(!(c)) // sleep for v ticks (10ms per tick) __nolist void Wait(const int &v) { asm { 0x43, $v : __ASM_SRC_EXT}; } __nolist void StopAllTasks() { asm { 0x50 }; } __nolist void SetSleepTime(const int t) { asm { 0xb1, t }; } __nolist void SleepNow() { asm { 0x60 }; } #if defined(__RCX) || defined(__SCOUT) || defined(__SWAN) // Scout and RCX #define TX_POWER_LO 0 #define TX_POWER_HI 1 __nolist void SetTxPower(const int p) { asm { 0x31, p }; } #endif #if defined(__RCX) || defined(__SWAN) // RCX and Swan only... // Data logging __nolist void CreateDatalog(const int size) { asm { 0x52, (size), (size)>>8 }; } __nolist void AddToDatalog(const int &v) { asm { 0x62, $v : __ASM_NO_LOCAL + __ASM_SMALL_VALUE + 0x004203}; } __nolist void UploadDatalog(const int s, const int n) { asm { 0xa4, (s), (s)>>8, (n), (n)>>8 }; } // the system clock #define Watch() @(0xe0000) // read the system clock __nolist void SetWatch(const int h, const int m) { asm { 0x22, h, m }; } #if __RCX==2 || defined(__SWAN) // requires RCX2 firmware newer than firm0328.lgo (or Swan firmware) #define DatalogType(n) @@(0x2625)[(n)] #define DatalogValue(n) @@(0x2827)[(n)] #define DatalogByte(n) @@(0x2a29)[(n)] #endif #endif #if defined(__SCOUT) // Scout - special functions __nolist void SetScoutRules(const int m, const int t, const int l, const int tm, const int fx) { asm { 0xd5, m, t, l, tm, fx }; } #define SCOUT_MODE_STANDALONE 0 #define SCOUT_MODE_POWER 1 __nolist void SetScoutMode(const int s) { asm { 0x47, s}; } __nolist void SetEventFeedback(const int &x) { asm { 0x83, $x : __ASM_SRC_BASIC}; } #endif #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) __nolist void SetPriority(const int p) { asm { 0xd7, p }; } #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) __nolist void Set(const int &dst, const int &src) { asm { 0x05, $dst : __ASM_SMALL_VALUE, $src }; } #endif #if __RCX==2 || defined(__SWAN) __nolist void SelectProgram(const int n) { asm { 0x91, n }; } #endif #if defined(__SCOUT) || __RCX==2 || defined(__SPY) || defined(__SWAN) // constants for acquire() #define ACQUIRE_OUT_A (1 << 0) #define ACQUIRE_OUT_B (1 << 1) #define ACQUIRE_SOUND (1 << 2) #define ACQUIRE_OUT_C (1 << 3) #endif #if defined(__SPY) #define ACQUIRE_LED (1 << 4) #endif #if __RCX==2 || defined(__SWAN) // more constants for acqurie() - RCX2 only #define ACQUIRE_USER_1 (1 << 4) #define ACQUIRE_USER_2 (1 << 5) #define ACQUIRE_USER_3 (1 << 6) #define ACQUIRE_USER_4 (1 << 7) #endif /************************** * Other data sources **************************/ #define Random(n) @(0x40000 + (n)) // a random number #if __RCX==2 || defined(__SPY) || defined(__SWAN) __nolist void SetRandomSeed(const int &v) { Set(Random(0), v); } #endif #ifdef __RCX || defined(__SWAN) // RCX specific data sources #define Program() @(0x80000) // currently active program #endif #ifdef __CM // CM specific data sources #define AGC() @(0x100000) // Automatic Gain Control #endif #if defined(__SCOUT) #define ScoutRules(n) @(0x120000 + (n)) #define TimerLimit(n) @(0x140000 + (n)) #define CounterLimit(n) @(0x160000 + (n)) #define EventFeedback() @(0x180000) #endif #if __RCX==2 || defined(__SPY) || defined(__SWAN) #define BatteryLevel() @(0x220000) #define FirmwareVersion() @(0x230000) #define Indirect(n) @(0x240000 + (n)) // indirect variable registers __nolist void SetIndirectVar(const int &v, const int &n) { asm { 0x05, 0x24, $v : 0x3000001, $n }; } #endif /************************** * Default initialization **************************/ __nolist void _init() { SetPower(OUT_A + OUT_B + OUT_C, OUT_FULL); Fwd(OUT_A + OUT_B + OUT_C); } /************************** * Scout compatibility API **************************/ #ifdef __SCOUT_COMPAT /* * Scout support was initially released with preliminary APIs that * were styled after the LASM mnemonics. Unfortunately, these mnemonics * led to some rather inconsistent APIs. In order to align the Scout * API with the RCX 2.0 API a number of calls have been changed. The * official calls appear in the various sections above. The section * below is a temporary hack to ease the transition between the old * and new Scout APIs. All of old calls that were dropped (or changed) * in the new API appear below, but with a preceding underscore. For * example, the old GSetOutput() call now appears as _GSetOutput(). * If you are in a hurry to get your old Scout program working, you * can just prepend underscores to the various obsolete calls. However, * a longer term fix is to use the new APIs above. */ // global output functions void _GSetOutput(const int o, const int m) { asm { 0x67, (o) + (m) }; } void _GSetDirection(const int o, const int d) { asm { 0x77, (o) + (d) }; } void _GSetPower(const int o, const int &p) { asm { 0xa3, (o), $p : 0x1000015}; } void _GOn(const int o) { _GSetOutput(o, OUT_ON); } void _GOff(const int o) { _GSetOutput(o, OUT_OFF); } void _GFloat(const int o) { _GSetOutput(o, OUT_FLOAT); } void _GToggle(const int o) { _GSetDirection(o, OUT_TOGGLE); } void _GFwd(const int o) { _GSetDirection(o, OUT_FWD); } void _GRev(const int o) { _GSetDirection(o, OUT_REV); } void _GOnFwd(const int o) { _GFwd(o); GOn(o); } void _GOnRev(const int o) { _GRev(o); GOn(o); } void _GOnFor(const int o, const int &t) { GOn(o); Wait(t); GOff(o); } void _WaitEvents(const int &mask) { asm { 0xb4, $mask : __ASM_SRC_EXT, 3, 0x27, 0x81 }; } // use monitor() // light sensor void _LSBlink(const int &x) { asm { 0xe3, $x : 0x0005 }; } // use SetSensorBlink void _LSCal() { asm { 0xc0 }; } // use CalibrateSensor void _LSHyst(const int &x) { asm { 0xd3, $x : 0x0005 }; } // use SetSensorHyst void _LSLower(const int &x) { asm { 0xc3, $x : 0x0005 }; } // use SetSensorLower void _LSUpper(const int &x) { asm { 0xb3, $x : 0x0005 }; } // use SetSensorUpper // other void _Rules(const int m, const int t, const int l, const int tm, const int fx) { asm { 0xd5, m, t, l, tm, fx }; } // see SetScoutRules void _Scout(const int s) { asm { 0x47, s}; } // SetScoutMode void _SetFeedback(const int &x) { asm { 0x83, $x : 0x0005}; } // SetEventFeedback void _Sound(const int x) { asm { 0x57, x }; } // use MuteSound, UnmuteSound and SelectSounds void _VLL(const int &x) { asm { 0xe2, $x : 0x1000005}; } // use SendVLL void _RTS() { asm { 0xf6 }; } // don't ever need this // use these for calling subroutines...for example: // // local(0) = 1; // Call(3); // #define local(n) (@((n) + 10)) void Call(const int n) { asm { 0x17, n }; } #endif // __SCOUT_COMPAT #if defined(__SCOUT) #endif /************************** * Spybot-specific API **************************/ #if defined(__SPY) // LED's may be set/checked manually #define LED(n) @(0x160000 + (n)) // LED control registers __nolist void SetLED(const int mode, const int &v) { Set(LED(mode), v); } // constants for the mode argument in SetLED() #define LED_MODE_ON 0 #define LED_MODE_BLINK 1 #define LED_MODE_DURATION 2 #define LED_MODE_SCALE 3 #define LED_MODE_SCALE_BLINK 4 #define LED_MODE_SCALE_DURATION 5 #define LED_MODE_RED_SCALE 6 #define LED_MODE_RED_SCALE_BLINK 7 #define LED_MODE_GREEN_SCALE 8 #define LED_MODE_GREEN_SCALE_BLINK 9 #define LED_MODE_YELLOW 10 #define LED_MODE_YELLOW_BLINK 11 #define LED_MODE_YELLOW_DURATION 12 #define LED_MODE_VLL 13 #define LED_MODE_VLL_BLINK 14 #define LED_MODE_VLL_DURATION 15 // ROM animations (for the front LEDs) #define ANIMATION_SCAN 0 #define ANIMATION_SPARKLE 1 #define ANIMATION_FLASH 2 #define ANIMATION_RED_TO_GREEN 3 #define ANIMATION_GREEN_TO_RED 4 #define ANIMATION_POINT_FORWARD 5 #define ANIMATION_ALARM 6 #define ANIMATION_THINKING 7 // macro for defining a user animation: // ANIMATION my_animation { 1, 10, 2, 10, 4, 10, 2, 10, 255, 255 }; // #define ANIMATION __res 3 // function to start a given animation __nolist void SetAnimation(const int t) { asm { 0xc7, t }; } #define AnimateLED(f, t) f, t #define RepeatAnimation() 0xFF, 0 #define SOUNDEFFECT __res 2 #define Gate(o, p) 0x62, p, o #define GateOff() 0x70 #define Glide(s, p, t) 0x45, t, s & 0xFF, s >> 8, p & 0xFF, p >> 8 #define Vibrato(s, p, t) 0x55, t, s & 0xFF, s >> 8, p & 0xFF, p >> 8 #define WaitEffect(t) 0x21, t #define FixedWaitEffect(t) 0x81, t #define Tone(f, t) 0x33, t, f & 0xFF, f >> 8 #define FixedTone(f, t) 0x93, t, f & 0xFF, f >> 8 #define RepeatEffect() 0x10 #define EffectSound() @(0x350000) // Sound Effects control registers (0,1) #define EffectTime() @(0x350001) __nolist void SetEffectSound(const int &s) { Set(EffectSound(), s); } __nolist void SetEffectTime(const int &t) { Set(EffectTime(), t); } #define TARGET_NONE 255 #define RANGE_NOWHERE 0 #define RANGE_ANYWHERE 1 #define RANGE_THERE 2 #define RANGE_HERE 3 #define DIRECTION_LEFT 0 #define DIRECTION_LEFT_OF_CENTER 1 #define DIRECTION_CENTER 2 #define DIRECTION_RIGHT_OF_CENTER 3 #define DIRECTION_RIGHT 4 #define ASPECT_FRONT_LEFT 0 #define ASPECT_FRONT 1 #define ASPECT_FRONT_RIGHT 2 #define ASPECT_BACK_RIGHT 3 #define ASPECT_BACK 4 #define ASPECT_BACK_LEFT 5 #define SPY_TARGETID 0 #define SPY_NOTE 1 #define SPY_LINKID 2 #define SPY_RANGE 3 #define SPY_DIRECTION 4 #define SPY_ASPECT 5 #define SPY_INFO 6 #define SPY_SHORTID 7 #define REL_GT 0x00 #define REL_LT 0x40 #define REL_EQ 0x80 #define REL_NE 0xc0 __nolist void FindWorld(int &v, const int relsrc, const int crit, const int& thresh) { asm { 0xd5, $v : 0x3000001, 0x2a + relsrc, crit + __type(thresh), $thresh : __ASM_NO_TYPE }; } __nolist void ClearWorld() { asm { 0x36 }; } #define Target(n) @(0x320000 + n) __nolist void SetTargetID(const int &v) { Set(Target(SPY_TARGETID), v); } __nolist void SetTargetNote(const int &v) { Set(Target(SPY_NOTE), v); } #define World(i, n) @@(0x322a+(i))[(n)] #define WorldShortID(n) @@(0x322a+SPY_SHORTID)[(n)] #define WorldLinkID(n) @@(0x322a+SPY_LINKID)[(n)] #define WorldRange(n) @@(0x322a+SPY_RANGE)[(n)] #define WorldDirection(n) @@(0x322a+SPY_DIRECTION)[(n)] #define WorldAspect(n) @@(0x322a+SPY_ASPECT)[(n)] #define WorldNote(n) @@(0x322a+SPY_NOTE)[(n)] __nolist void GetWorld(const int n, int &t, int &v) { asm { 0x14, $v : __ASM_NO_TYPE + __ASM_SMALL_VALUE, 0x2a + n, $t : __ASM_NO_TYPE + __ASM_SMALL_VALUE, 0x00 }; } __nolist void GetWorldShortID(int &t, int &v) { GetWorld(SPY_SHORTID, t, v); } __nolist void GetWorldLinkID(int &t, int &v) { GetWorld(SPY_LINKID, t, v); } __nolist void GetWorldRange(int &t, int &v) { GetWorld(SPY_RANGE, t, v); } __nolist void GetWorldDirection(int &t, int &v) { GetWorld(SPY_DIRECTION, t, v); } __nolist void GetWorldAspect(int &t, int &v) { GetWorld(SPY_ASPECT, t, v); } __nolist void GetWorldNote(int &t, int &v) { GetWorld(SPY_NOTE, t, v); } __nolist void SetWorldNote(int &t, const int &v) { asm { 0x05, 0x2b, $t : __ASM_NO_TYPE + __ASM_SMALL_VALUE, $v}; } #define Stack(n) @(0x120000 + (n)) __nolist void Push(const int &v) { asm { 0xe3, $v }; } __nolist void Pop(const int n) { asm { 0x01, n }; } __nolist void SetStack(const int i, const int &v) { Set(Stack(i), v); } #define TIMER_RUNNING 1 #define TIMER_STOPPED 0 #define TimerState(n) @(0x130000 + (n)) __nolist void SetTimerState(const int n, const int &s) { Set(TimerState(n), s); } #define CurrentTaskID() @(0x200000) #define PingControl(n) @(0x330000 + (n)) // 51 #define PingData() PingControl(0) __nolist void SetPingData(const int &d) { Set(PingData(), d); } #define PingInterval() PingControl(1) __nolist void SetPingInterval(const int &i) { Set(PingInterval(), i); } #define PingID() PingControl(2) #define BeaconControl(n) @(0x340000 + (n)) // 52 #define LinkID() BeaconControl(0) __nolist void SetLinkID(const int &n) { Set(LinkID(), n); } #define RC_CHANNEL_BROADCAST 0 #define RC_CHANNEL_1 1 #define RC_CHANNEL_2 2 #define RC_CHANNEL_3 3 #define RC_CHANNEL_DISABLED 4 #define RCRxChannel() BeaconControl(1) __nolist void SetRCRxChannel(const int &c) { Set(RCRxChannel(), c); } #define RCTxChannel() BeaconControl(2) __nolist void SetRCTxChannel(const int &c) { Set(RCTxChannel(), c); } #define RCTXMODE_SINGLE_SHOT 0 #define RCTXMODE_CONTINUOUS 1 #define RCTxMode() BeaconControl(3) __nolist void SetRCTxMode(const int &m) { Set(RCTxMode(), m); } #define EEPROM(n) @@(0x1436)[(n)] __nolist void SetEEPROM(const int &i, const int &d) { Set(EEPROM(i), d); } __nolist void StartTask(const int t) { asm { 0x71, t}; } __nolist void StopTask(const int t) { asm { 0x81, t}; } // EEPROM indices #define EEPROM_MOTORCONTROL 0x00 #define EEPROM_SPECIES 0x01 #define EEPROM_LONGID 0x02 #define EEPROM_USERLEVEL 0x06 #define EEPROM_DEFAULTPINGRATE 0x07 #define EEPROM_RUNS 0x08 #define EEPROM_WINS 0x0a #define EEPROM_LOSSES 0x0c #define EEPROM_POINTS 0x0e #define EEPROM_PLAYSECONDS 0x10 #define EEPROM_TOTALPLAYTIME 0x12 #define EEPROM_MAXBOTS 0x16 #define EEPROM_MISSIONID 0x17 #define EEPROM_MISSIONSPLAYED 0x18 #define EEPROM_MISSIONPOINTS 0x1c #define EEPROM_HIGHSCORE 0x1e #define EEPROM_ROBOTNAME 0x20 #define EEPROM_BIRTHDATE 0x40 #define EEPROM_BOTDATA 0x46 #define EEPROM_STATUS 0x47 #define EEPROM_FIRSTTOKEN 0x48 #define EEPROM_LASTTOKEN 0x7e #define EEPROM_MAXTOKENS 28 //spare: 0x80 - 0xff //MotorControl (eeprom[eMotorControl]): #define MOTORCONTROL_NORMALSPEEDMASK 0x07 #define MOTORCONTROL_SLOWSPEEDMASK 0x38 #define MOTORCONTROL_LEFTDIR 0x40 #define MOTORCONTROL_RIGHTDIR 0x80 //Species (eeprom[eSpecies] values) #define SPECIES_GIGAMESH 1 #define SPECIES_SNAPTRAX 2 #define SPECIES_SHADOWSTRIKE 3 #define SPECIES_TECHNOJAW 4 //Status (eeprom[eStatus] values) #define STATUS_INITIALIZING 0x01 #define STATUS_DOWNLOADING 0x02 #define STATUS_LOCKED 0x04 //bits 3-7 spare //Battery voltage #define BATTERY_MAX 4600 #define BATTERY_LOW 3400 #define BATTERY_MIN 2700 // Controller buttons #define CONTROLLER_BUTTON1 0x0100 #define CONTROLLER_BUTTON2 0x0200 #define CONTROLLER_BUTTON3 0x0001 #define CONTROLLER_BUTTON4 0x0101 #define CONTROLLER_BUTTON5 0x0201 // ROM subroutines // interaction subroutines __nolist void SendSpybotMessage(const int &nIndex, const int &nCmd, const int &nHiByte, const int &nLoByte) { asm { 0xe3, $nIndex }; asm { 0xe3, $nCmd }; asm { 0xe3, $nHiByte }; asm { 0xe3, $nLoByte }; asm { 0x17, 34 }; asm { 0x01, 4 }; } __nolist void SendRCXMessage(const int &nMessage) { asm { 0xe3, $nMessage, 0x17, 37, 0x01, 1 }; } __nolist void SendAllRangeMessage(const int &nMessage, const int &nData) { asm { 0xe3, $nMessage, 0xe3, $nData, 0x17, 38, 0x01, 2 }; } // utils subroutines __nolist void Disp(const int &display) { asm { 0xe3, $display, 0x17, 42, 0x01, 1 }; } #define MOVE_BASIC 0x0100 #define MOVE_RANDOM 0x0200 #define MOVE_FANCY 0x0300 #define MOVE_SLOWDOWN 0x0400 #define MOVE_SPEEDUP 0x0500 #define MOVE_MASK 0x00ff #define MOVE_TYPE_MASK 0xff00 #define MOVE_BASIC_FORWARD MOVE_BASIC + 1 #define MOVE_BASIC_BACKWARD MOVE_BASIC + 2 #define MOVE_BASIC_SPIN_LEFT MOVE_BASIC + 3 #define MOVE_BASIC_SPIN_RIGHT MOVE_BASIC + 4 #define MOVE_BASIC_TURN_LEFT MOVE_BASIC + 5 #define MOVE_BASIC_TURN_RIGHT MOVE_BASIC + 6 #define MOVE_BASIC_AVOID_LEFT MOVE_BASIC + 7 #define MOVE_BASIC_AVOID_RIGHT MOVE_BASIC + 8 #define MOVE_BASIC_REST MOVE_BASIC + 9 #define MOVE_BASIC_STOP MOVE_BASIC + 10 #define MOVE_RANDOM_FORWARD MOVE_RANDOM + 1 #define MOVE_RANDOM_BACKWARD MOVE_RANDOM + 2 #define MOVE_RANDOM_SPIN_LEFT MOVE_RANDOM + 3 #define MOVE_RANDOM_SPIN_RIGHT MOVE_RANDOM + 4 #define MOVE_RANDOM_TURN_LEFT MOVE_RANDOM + 5 #define MOVE_RANDOM_TURN_RIGHT MOVE_RANDOM + 6 #define MOVE_RANDOM_REST MOVE_RANDOM + 7 #define MOVE_FANCY_ZIGZAG MOVE_FANCY + 1 #define MOVE_FANCY_SHAKE MOVE_FANCY + 2 #define MOVE_FANCY_SCAN MOVE_FANCY + 3 #define MOVE_FANCY_STEP MOVE_FANCY + 4 #define MOVE_FANCY_STEP_BACK MOVE_FANCY + 5 #define MOVE_FANCY_SEARCH MOVE_FANCY + 6 #define MOVE_FANCY_FAKE_LEFT MOVE_FANCY + 7 #define MOVE_FANCY_RAKE_RIGHT MOVE_FANCY + 8 #define MOVE_FANCY_BUG_FORWARD MOVE_FANCY + 9 #define MOVE_FANCY_LAZY MOVE_FANCY + 10 #define MOVE_FANCY_WALK MOVE_FANCY + 11 #define MOVE_FANCY_WALK_BACK MOVE_FANCY + 12 #define MOVE_FANCY_DANCE MOVE_FANCY + 13 #define MOVE_SLOWDOWN_FORWARD MOVE_SLOWDOWN + 1 #define MOVE_SLOWDOWN_BACKWARD MOVE_SLOWDOWN + 2 #define MOVE_SLOWDOWN_SPIN_LEFT MOVE_SLOWDOWN + 3 #define MOVE_SLOWDOWN_SPIN_RIGHT MOVE_SLOWDOWN + 4 #define MOVE_SPEEDUP_FORWARD MOVE_SPEEDUP + 1 #define MOVE_SPEEDUP_BACKWARD MOVE_SPEEDUP + 2 #define MOVE_SPEEDUP_SPIN_LEFT MOVE_SPEEDUP + 3 #define MOVE_SPEEDUP_SPIN_RIGHT MOVE_SPEEDUP + 4 __nolist void BasicMove (const int &move, const int &time) { asm { 0xe3, $move, 0xe3, $time, 0x17, 43, 0x01, 2 }; } // nSound is 0-79, -1 = no sound // nDisplay is LED animation (0-15) to play, -1 = no animation // nMovement is from the *Move routines defined below, -1 = no move // nRepeat is number of times to repeat motion // ntime is in 10ms steps __nolist void Action (const int &nSound, const int &nDisplay, const int &nMovement, const int &nRepeat, const int &nTime) { asm { 0xe3, $nSound }; asm { 0xe3, $nDisplay }; asm { 0xe3, $nMovement }; asm { 0xe3, $nRepeat }; asm { 0xe3, $nTime }; asm { 0x17, 44 }; asm { 0x01, 5 }; } __nolist void RandomMove (const int &move, const int &time) { asm { 0xe3, $move, 0xe3, $time, 0x17, 46, 0x01, 2 }; } __nolist void FancyMove (const int &move, const int &time) { asm { 0xe3, $move, 0xe3, $time, 0x17, 47, 0x01, 2 }; } __nolist void SlowDownMove (const int &move, const int &time) { asm { 0xe3, $move, 0xe3, $time, 0x17, 48, 0x01, 2 }; } __nolist void SpeedUpMove (const int &move, const int &time) { asm { 0xe3, $move, 0xe3, $time, 0x17, 49, 0x01, 2 }; } // Adds a value to a 2 byte location in EEprom __nolist void Sum2Mem (const int &nMem, const int &nValue) { asm { 0xe3, $nMem, 0xe3, $nValue, 0x17, 50, 0x01, 2 }; } // Adds a value to a 4 byte location in EEprom __nolist void Sum4Mem (const int &nMem, const int &nValue) { asm { 0xe3, $nMem, 0xe3, $nValue, 0x17, 51, 0x01, 2 }; } #define SOUND_NONE -1 #define SOUND_SHOCKED 6 #define SOUND_FIRE_LASER 7 #define SOUND_FIRE_ELECTRONET 8 #define SOUND_FIRE_SPINNER 9 #define SOUND_HIT_BY_LASER 10 #define SOUND_HIT_BY_ELECTRONET 11 #define SOUND_HIT_BY_SPINNER 12 #define SOUND_TAG 13 #define SOUND_CRASH 14 #define SOUND_FIGHT 15 #define SOUND_GOT_IT 16 #define SOUND_GENERAL_ALERT 17 #define SOUND_OUT_OF_ENERGY_ALERT 18 #define SOUND_LOW_ENERGY_ALERT 19 #define SOUND_SCORE_ALERT 20 #define SOUND_TIME_ALERT 21 #define SOUND_PROXIMITY_ALERT 22 #define SOUND_DANGER_ALERT 23 #define SOUND_BOMB_ALERT 24 #define SOUND_FINAL_COUNTDOWN 25 #define SOUND_TICK_TOCK 26 #define SOUND_GOTO 27 #define SOUND_SCAN 28 #define SOUND_POINT_TO 29 #define SOUND_ACTIVATE_SHIELDS 30 #define SOUND_ACTIVATE_REFLECT 31 #define SOUND_ACTIVATE_CLOAK 32 #define SOUND_ACTIVATE_FLASH_BLIND 33 #define SOUND_MAGNET 34 #define SOUND_QUAD_DAMAGE 35 #define SOUND_REPULSE 36 #define SOUND_TURBO 37 #define SOUND_FREEZE 38 #define SOUND_SLOW 39 #define SOUND_REVERSE 40 #define SOUND_DIZZY 41 #define SOUND_BOOST 42 #define SOUND_DEACTIVATE_SHIELDS 43 #define SOUND_DEACTIVATE_REFLECT 44 #define SOUND_DEACTIVATE_CLOAK 45 #define SOUND_REFLECT 46 #define SOUND_EXPLOSION 47 #define SOUND_BIG_EXPLOSION 48 #define SOUND_PLACE_BOMB 49 #define SOUND_HIT_BY_WIND 50 #define SOUND_OUCH 51 #define SOUND_GEIGER 52 #define SOUND_WHISTLE 53 #define SOUND_IM_IT 54 #define SOUND_HELP 55 #define SOUND_SIREN 56 #define SOUND_BURNT 57 #define SOUND_GRINDED 58 #define SOUND_SMACKED 59 #define SOUND_TRILL_UP 60 #define SOUND_TRILL_DOWN 61 #define SOUND_YELL 62 #define SOUND_WHISPER 63 #define LED_RED1 0x01 #define LED_RED2 0x02 #define LED_RED3 0x04 #define LED_GREEN1 0x08 #define LED_GREEN2 0x10 #define LED_GREEN3 0x20 #define LED_YELLOW 0x40 #define LED_ALL_RED LED_RED1 + LED_RED2 + LED_RED3 #define LED_ALL_GREEN LED_GREEN1 + LED_GREEN2 + LED_GREEN3 #define LED_ALL_RED_GREEN LED_ALL_RED + LED_ALL_GREEN #define LED_ALL LED_ALL_RED_GREEN + LED_YELLOW #endif // __SPY /************************** * Swan-specific API **************************/ #if defined(__SWAN) /********************************************************** * Motors **********************************************************/ // Motor #define MTR_A 0 #define MTR_B 1 #define MTR_C 2 #define MTR_D 3 #define MTR_E 4 #define MTR_F 5 // MotorPowerDirection #define MPD_FWD 0x80 #define MPD_REV 0x40 #define MPD_FLOAT 0xC0 #define MPD_OFF 0x00 // MotorState #define MS_FLOAT 0x00 #define MS_BRAKE 0x40 #define MS_FWD 0x88 #define MS_REV 0x80 #define SMOTOR_FWD 0x08 #define MTR_FWD_POWER_1 0x88 #define MTR_FWD_POWER_2 0x89 #define MTR_FWD_POWER_3 0x8A #define MTR_FWD_POWER_4 0x8B #define MTR_FWD_POWER_5 0x8C #define MTR_FWD_POWER_6 0x8D #define MTR_FWD_POWER_7 0x8E #define MTR_FWD_POWER_8 0x8F #define MTR_REV_POWER_1 0x80 #define MTR_REV_POWER_2 0x81 #define MTR_REV_POWER_3 0x82 #define MTR_REV_POWER_4 0x83 #define MTR_REV_POWER_5 0x84 #define MTR_REV_POWER_6 0x85 #define MTR_REV_POWER_7 0x86 #define MTR_REV_POWER_8 0x87 #define MTR_FLOAT_POWER_1 0x00 #define MTR_FLOAT_POWER_2 0x01 #define MTR_FLOAT_POWER_3 0x02 #define MTR_FLOAT_POWER_4 0x03 #define MTR_FLOAT_POWER_5 0x04 #define MTR_FLOAT_POWER_6 0x05 #define MTR_FLOAT_POWER_7 0x06 #define MTR_FLOAT_POWER_8 0x07 #define MTR_BRAKE_POWER_1 0x40 #define MTR_BRAKE_POWER_2 0x41 #define MTR_BRAKE_POWER_3 0x42 #define MTR_BRAKE_POWER_4 0x43 #define MTR_BRAKE_POWER_5 0x44 #define MTR_BRAKE_POWER_6 0x45 #define MTR_BRAKE_POWER_7 0x46 #define MTR_BRAKE_POWER_8 0x47 #define MotorPowerSigned(n) @(0x050000 + (n)) __nolist void SetMotorPowerSigned(const int n, const int &v) { Set(MotorPowerSigned(n), v); } #define MotorBrakePower(n) @(0x070000 + (n)) __nolist void SetMotorBrakePower(const int n, const int &v) { Set(MotorBrakePower(n), v); } #define MotorPower8(n) @(0x200000 + (n)) __nolist void SetMotorPower8(const int n, const int &v) { Set(MotorPower8(n), v); } #define MotorPower128(n) @(0x100000 + (n)) __nolist void SetMotorPower128(const int n, const int &v) { Set(MotorPower128(n), v); } /********************************************************** * Event sources **********************************************************/ // EventSensorType #define EST_SENSOR_1 0 #define EST_SENSOR_2 1 #define EST_SENSOR_3 2 #define EST_TIMER_1 3 #define EST_TIMER_2 4 #define EST_TIMER_3 5 #define EST_TIMER_4 6 #define EST_LAST_IR_MSG 7 #define EST_COUNTER_1 8 #define EST_COUNTER_2 9 #define EST_COUNTER_3 10 #define EST_USER_EVENT_0 11 #define EST_USER_EVENT_1 12 #define EST_USER_EVENT_2 13 #define EST_USER_EVENT_3 14 #define EST_USER_EVENT_4 15 #define EST_VIRTUAL_MOTOR 11 #define EST_VIRTUAL_SENSOR 12 #define EST_WAIT_FOR_MSG 13 #define EST_INFRARED_STATUS 14 #define EST_SENSOR_UNUSED 16 // EventStates #define ES_BELOW_LOWER 0 #define ES_BETWEEN 1 #define ES_ABOVE_UPPER 2 #define ES_UNDETERMINED 3 #define EventType(n) @(0x120000 + (n)) __nolist void SetEventType(const int n, const int &v) { Set(EventType(n), v); } #define EventSrc(n) @(0x130000 + (n)) __nolist void SetEventSrc(const int n, const int &v) { Set(EventSrc(n), v); } #define EventCounts(n) @(0x140000 + (n)) __nolist void SetEventCounts(const int n, const int &v) { Set(EventCounts(n), v); } /********************************************************** * 1 MS Timer **********************************************************/ #define MSTimer(n) @(0x160000 + (n)) __nolist void ResetMSTimer(const int n) { Set(MSTimer(n), 0); } __nolist void WaitMS(const int &v) { asm { 0x47, $v : __ASM_SRC_EXT}; } /********************************************************** * System settings **********************************************************/ #define System(n) @(0x180000 + (n)) __nolist void SetSystem(const int n, const int &v) { Set(System(n), v); } #define SYS_BATTERY_LEVEL 0 // R/O #define ImmediateBatteryLevel() System(SYS_BATTERY_LEVEL) #define SYS_DEBUG_TASK_MODE 1 // R/O #define DebugTaskMode() System(SYS_DEBUG_TASK_MODE) #define SYS_MEMORY_MAP_ADDRESS 2 // R/O #define MemoryMapAddress() System(SYS_MEMORY_MAP_ADDRESS) #define SYS_CURRENT_TASK 3 // R/O #define CurrentTask() System(SYS_CURRENT_TASK) #define SYS_SERIAL_LINK_STATUS 4 // R/O #define SerialLinkStatus() System(SYS_SERIAL_LINK_STATUS) #define SLS_WAIT_FOR_MSG 0 #define SLS_RECEIVING_MSG 1 #define SLS_TRANSMITTING 2 #define SLS_UNKNOWN 3 #define SYS_OPCODES_PER_TIMESLICE 5 // R/W (100x only) #define OpcodesPerTimeslice() System(SYS_OPCODES_PER_TIMESLICE) __nolist void SetOpcodesPerTimeslice(const int &v) { Set(OpcodesPerTimeslice(), v); } #define SYS_MOTOR_TRANSITION_DELAY 6 // R/W #define MotorTransitionDelay() System(SYS_MOTOR_TRANSITION_DELAY) __nolist void SetMotorTransitionDelay(const int &v) { Set(MotorTransitionDelay(), v); } #define SYS_SENSOR_REFRESH_RATE 7 // R/W #define SensorRefreshRate() System(SYS_SENSOR_REFRESH_RATE) __nolist void SetSensorRefreshRate(const int &v) { Set(SensorRefreshRate(), v); } #define SYS_EXPANDED_RC_MESSAGES 8 // R/W #define ExpandedRemoteMessages() System(SYS_EXPANDED_RC_MESSAGES) __nolist void SetExpandedRemoteMessages(const int &v) { Set(ExpandedRemoteMessages(), v); } #define SYS_LCD_REFRESH_RATE 9 // R/W (100ms ticks) #define LCDRefreshRate() System(SYS_LCD_REFRESH_RATE) __nolist void SetLCDRefreshRate(const int &v) { Set(LCDRefreshRate(), v); } #define SYS_NO_POWER_DOWN_ON_AC 10 // R/W (true/false) #define NoPowerDownOnAC() System(SYS_NO_POWER_DOWN_ON_AC) __nolist void SetNoPowerDownOnAC(const int &v) { Set(NoPowerDownOnAC(), v); } #define SYS_DEFAULT_TASK_STACK_SIZE 11 // R/W #define DefaultStackSize() System(SYS_DEFAULT_TASK_STACK_SIZE) __nolist void SetDefaultStackSize(const int &v) { Set(DefaultStackSize(), v); } #define SYS_TASK_ACQUIRE_PRIORITY 12 // R/W #define TaskAcquirePriority() System(SYS_TASK_ACQUIRE_PRIORITY) __nolist void SetTaskAcquirePriority(const int &v) { Set(TaskAcquirePriority(), v); } #define SYS_TRANSMITTER_RANGE 13 // R/W (0/1) ??? #define TransmitterRange() System(SYS_TRANSMITTER_RANGE) #define SYS_FLOAT_DURING_INACTIVE_PWM 14 // R/W (true/false) #define FloatDuringInactivePWM() System(SYS_FLOAT_DURING_INACTIVE_PWM) __nolist void SetFloatDuringInactivePWM(const int &v) { Set(FloatDuringInactivePWM(), v); } #define SYS_ROT_ERRORS_COUNT 15 // R/W #define RotErrorsCount() System(SYS_ROT_ERRORS_COUNT) #define SYS_ROT_DEBOUNCED_GLITCHES 16 // R/W debug #define RotDebouncedGlitches() System(SYS_ROT_DEBOUNCED_GLITCHES) #define SYS_PREAMBLE_SIZE 17 // R/W (0..3) #define SystemPreambleSize() System(SYS_PREAMBLE_SIZE) __nolist void SetSystemPreambleSize(const int &v) { Set(SystemPreambleSize(), v); } #define SYS_UNSOLICITED_MESSAGES 18 // R/W (true/false) #define UnsolicitedMessages() System(SYS_UNSOLICITED_MESSAGES) #define SYS_EXPANDED_SUBROUTINES 19 // R/W (true/false) #define ExpandedSubroutines() System(SYS_EXPANDED_SUBROUTINES) __nolist void SetExpandedSubroutines(const int &v) { Set(ExpandedSubroutines(), v); } #define SYS_POWER_DOWN_DELAY 20 // R/W #define PowerDownDelay() System(SYS_POWER_DOWN_DELAY) #define SYS_WATCH_FORMAT 21 // R/W #define WatchFormat() System(SYS_WATCH_FORMAT) __nolist void SetWatchFormat(const int &v) { Set(WatchFormat(), v); } #define FMT_HHMM 0 #define FMT_MMSS 1 #define FMT_MSSTENTHS 2 #define SYS_SENSOR_MISSED_CONVERSIONS 22 // R/W debug #define MissedSensorADConversions() System(SYS_SENSOR_MISSED_CONVERSIONS) #define SYS_IGNORE_MESSAGES_CPU 23 #define IgnoreMessagesCPU() System(SYS_IGNORE_MESSAGES_CPU) #define SYS_COMM_ERRORS_TIMEOUT 24 #define CommErrorsTimeout() System(SYS_COMM_ERRORS_TIMEOUT) #define SYS_COMM_ERRORS_PARITY 25 #define CommErrorsParity() System(SYS_COMM_ERRORS_PARITY) #define SYS_COMM_ERRORS_FRAMING 26 #define CommErrorsFraming() System(SYS_COMM_ERRORS_FRAMING) #define SYS_COMM_ERRORS_OVERRUN 27 #define CommErrorsOverrun() System(SYS_COMM_ERRORS_OVERRUN) #define SYS_INTER_CHAR_TIMEOUT 28 // R/W #define InterCharTimeout() System(SYS_INTER_CHAR_TIMEOUT) __nolist void SetInterCharTimeout(const int &v) { Set(InterCharTimeout(), v); } #define SYS_TASK_SCHEDULING_PRIORITY 29 // R/W #define TaskSchedulingPriority() System(SYS_TASK_SCHEDULING_PRIORITY) __nolist void SetTaskSchedulingPriority(const int &v) { Set(TaskSchedulingPriority(), v); } #define SYS_VOLUME 30 // R/W #define Volume() System(SYS_VOLUME) __nolist void SetVolume(const int &v) { Set(Volume(), v); } #define MAX_VOLUME 16 #define SYS_SOUND_PLAYING 31 // R/O (true/false) #define SoundActive() System(SYS_SOUND_PLAYING) #define SYS_PLAY_SOUNDS 32 // R/W (true/false) #define PlaySounds() System(SYS_PLAY_SOUNDS) __nolist void SetPlaySounds(const int &v) { Set(PlaySounds(), v); } #define SYS_QUEUED_SOUND_COUNT 33 // R/O #define QueuedSoundCount() System(SYS_QUEUED_SOUND_COUNT) #define SYS_SENSOR_STARTUP_DELAY 34 #define SensorStartupDelay() System(SYS_SENSOR_STARTUP_DELAY) __nolist void SetSensorStartupDelay(const int &v) { Set(SensorStartupDelay(), v); } #define SYS_SENSOR_DELAY_CYCLES 35 #define SensorDelayCycles() System(SYS_SENSOR_DELAY_CYCLES) #define SYS_SENSOR_REFRESH_STATE 36 #define SensorRefreshState() System(SYS_SENSOR_REFRESH_STATE) #define SYS_SENSOR_SCAN_COUNT 37 #define SensorScanCount() System(SYS_SENSOR_SCAN_COUNT) #define SYS_DATALOG_SIZE 38 // R/W #define DatalogSize() System(SYS_DATALOG_SIZE) // InfraredReceiveMode #define IRM_ACCEPT_ALL 0 #define IRM_ACCEPT_USER 1 #define IRM_DISCARD 2 /********************************************************** * Global Variables & Indirect Intrinsic sources **********************************************************/ #define IntrinsicIndGlobal(n) @(0x060000 + (n)) #define GlobalVar(n) @@(0x2b2c)[(n)] /* #define srcIndexedGlobalConst 47 #define srcStackVar 49 #define srcConstantVar 50 #define srcFunctionRetValWord 51 #define srcVarByte 54 #define srcVarWord 55 #define srcTaskStackVarByte 57 #define srcTaskStackVarWord 58 #define srcTaskVar 60 */ #define StackAddress(n) @(0x3d0000 + (n)) #define StackSize(n) @(0x3e0000 + (n)) /********************************************************** * New opcodes **********************************************************/ // ClearCommandAction #define CLR_TIMERS 0x01 #define CLR_INPUTS 0x02 #define CLR_VARIABLES 0x04 #define CLR_TASK_STACK 0x08 #define CLR_EVENTS 0x10 #define CLR_BREAKPOINTS 0x20 #define CLR_DATALOG 0x40 __nolist void ClearAll(const int &nCmdFlags) { asm { 0xc7, $nCmdFlags : (__ASM_NO_TYPE | __ASM_SMALL_VALUE) }; } __nolist void BitSet(const int &result, const int &operand) { asm { 0x7e, $result : __ASM_SRC_EXT, $operand : __ASM_SRC_EXT }; } __nolist void BitClear(const int &result, const int &operand) { asm { 0x7f, $result : __ASM_SRC_EXT, $operand : __ASM_SRC_EXT }; } __nolist void Negate(const int &result, const int &operand) { asm { 0x9b, $result : __ASM_SRC_EXT, $operand : __ASM_SRC_EXT }; } /* #define opWaitTimerValue 0x7A #define opSetMotorState 0xF1 */ #endif // __SWAN nqc-3.1.r6/compiler/rcx2_nqh.h0000600000175000017500000062730610326244710014314 0ustar blpblpstatic const char rcx2_nqh[]={ 47,42,'\n',32,42,32,114,99,120,46,110,113,104,32,45,32, 118,101,114,115,105,111,110,32,51,46,49,114,53,'\n',32,42, 32,67,111,112,121,114,105,103,104,116,32,40,67,41,32,49, 57,57,56,45,50,48,48,53,32,68,97,118,101,32,66,97, 117,109,44,32,74,111,104,110,32,72,97,110,115,101,110,'\n', 32,42,'\n',32,42,32,67,121,98,101,114,77,97,115,116,101, 114,32,100,101,102,105,110,105,116,105,111,110,115,32,98,121, 32,76,97,117,114,101,110,116,105,110,111,32,77,97,114,116, 105,110,115,'\n',32,42,32,83,112,121,98,111,116,32,100,101, 102,105,110,105,116,105,111,110,115,32,98,121,32,74,111,104, 110,32,72,97,110,115,101,110,'\n',32,42,32,83,119,97,110, 32,100,101,102,105,110,105,116,105,111,110,115,32,98,121,32, 74,111,104,110,32,72,97,110,115,101,110,'\n',32,42,'\n',32, 42,32,84,104,105,115,32,102,105,108,101,32,105,115,32,112, 97,114,116,32,111,102,32,110,113,99,44,32,116,104,101,32, 78,111,116,32,81,117,105,116,101,32,67,32,99,111,109,112, 105,108,101,114,32,102,111,114,32,116,104,101,32,82,67,88, '\n',32,42,'\n',32,42,32,84,104,101,32,99,111,110,116,101, 110,116,115,32,111,102,32,116,104,105,115,32,102,105,108,101, 32,97,114,101,32,115,117,98,106,101,99,116,32,116,111,32, 116,104,101,32,77,111,122,105,108,108,97,32,80,117,98,108, 105,99,32,76,105,99,101,110,115,101,'\n',32,42,32,86,101, 114,115,105,111,110,32,49,46,48,32,40,116,104,101,32,34, 76,105,99,101,110,115,101,34,41,59,32,121,111,117,32,109, 97,121,32,110,111,116,32,117,115,101,32,116,104,105,115,32, 102,105,108,101,32,101,120,99,101,112,116,32,105,110,'\n',32, 42,32,99,111,109,112,108,105,97,110,99,101,32,119,105,116, 104,32,116,104,101,32,76,105,99,101,110,115,101,46,32,89, 111,117,32,109,97,121,32,111,98,116,97,105,110,32,97,32, 99,111,112,121,32,111,102,32,116,104,101,32,76,105,99,101, 110,115,101,32,97,116,'\n',32,42,32,104,116,116,112,58,47, 47,119,119,119,46,109,111,122,105,108,108,97,46,111,114,103, 47,77,80,76,47,'\n',32,42,'\n',32,42,32,83,111,102,116, 119,97,114,101,32,100,105,115,116,114,105,98,117,116,101,100, 32,117,110,100,101,114,32,116,104,101,32,76,105,99,101,110, 115,101,32,105,115,32,100,105,115,116,114,105,98,117,116,101, 100,32,111,110,32,97,110,32,34,65,83,32,73,83,34,'\n', 32,42,32,98,97,115,105,115,44,32,87,73,84,72,79,85, 84,32,87,65,82,82,65,78,84,89,32,79,70,32,65,78, 89,32,75,73,78,68,44,32,101,105,116,104,101,114,32,101, 120,112,114,101,115,115,32,111,114,32,105,109,112,108,105,101, 100,46,32,83,101,101,32,116,104,101,'\n',32,42,32,76,105, 99,101,110,115,101,32,102,111,114,32,116,104,101,32,115,112, 101,99,105,102,105,99,32,108,97,110,103,117,97,103,101,32, 103,111,118,101,114,110,105,110,103,32,114,105,103,104,116,115, 32,97,110,100,32,108,105,109,105,116,97,116,105,111,110,115, '\n',32,42,32,117,110,100,101,114,32,116,104,101,32,76,105, 99,101,110,115,101,46,'\n',32,42,'\n',32,42,32,84,104,101, 32,73,110,105,116,105,97,108,32,68,101,118,101,108,111,112, 101,114,32,111,102,32,116,104,105,115,32,99,111,100,101,32, 105,115,32,68,97,118,105,100,32,66,97,117,109,46,'\n',32, 42,32,80,111,114,116,105,111,110,115,32,99,114,101,97,116, 101,100,32,98,121,32,68,97,118,105,100,32,66,97,117,109, 32,97,114,101,32,67,111,112,121,114,105,103,104,116,32,40, 67,41,32,49,57,57,56,32,68,97,118,105,100,32,66,97, 117,109,46,'\n',32,42,32,65,108,108,32,82,105,103,104,116, 115,32,82,101,115,101,114,118,101,100,46,'\n',32,42,'\n',32, 42,32,80,111,114,116,105,111,110,115,32,99,114,101,97,116, 101,100,32,98,121,32,74,111,104,110,32,72,97,110,115,101, 110,32,97,114,101,32,67,111,112,121,114,105,103,104,116,32, 40,67,41,32,50,48,48,53,32,74,111,104,110,32,72,97, 110,115,101,110,46,'\n',32,42,32,65,108,108,32,82,105,103, 104,116,115,32,82,101,115,101,114,118,101,100,46,'\n',32,42, '\n',32,42,47,'\n','\n',47,42,'\n',32,42,32,32,84,104,105, 115,32,102,105,108,101,32,100,101,102,105,110,101,115,32,118, 97,114,105,111,117,115,32,115,121,115,116,101,109,32,99,111, 110,115,116,97,110,116,115,32,97,110,100,32,109,97,99,114, 111,115,32,116,111,32,98,101,32,117,115,101,100,'\n',32,42, 32,32,119,105,116,104,32,116,104,101,32,82,67,88,46,32, 32,77,111,115,116,32,111,102,32,116,104,101,32,114,101,97, 108,32,102,117,110,99,116,105,111,110,97,108,105,116,121,32, 111,102,32,116,104,101,32,82,67,88,32,105,115,'\n',32,42, 32,32,100,101,102,105,110,101,100,32,104,101,114,101,32,114, 97,116,104,101,114,32,116,104,97,110,32,119,105,116,104,105, 110,32,110,113,99,99,32,105,116,115,101,108,102,46,'\n',32, 42,'\n',32,42,47,'\n','\n','\n','\n',47,47,32,105,110,116,101, 114,110,97,108,32,99,111,110,115,116,97,110,116,115,32,102, 111,114,32,97,115,109,32,115,116,97,116,101,109,101,110,116, 115,'\n',35,100,101,102,105,110,101,9,95,95,65,83,77,95, 83,77,65,76,76,95,86,65,76,85,69,9,48,120,48,49, 48,48,48,48,48,48,'\n',35,100,101,102,105,110,101,32,95, 95,65,83,77,95,78,79,95,84,89,80,69,9,9,48,120, 48,50,48,48,48,48,48,48,'\n',35,100,101,102,105,110,101, 32,95,95,65,83,77,95,78,79,95,76,79,67,65,76,9, 9,48,120,48,52,48,48,48,48,48,48,'\n','\n','\n',47,47, 32,99,111,109,109,111,110,108,121,32,117,115,101,100,32,114, 101,115,116,114,105,99,116,111,114,115,'\n',35,105,102,32,95, 95,82,67,88,61,61,50,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,80,89,41,32,124,124,32,100,101,102, 105,110,101,100,40,95,95,83,87,65,78,41,'\n',9,47,47, 32,110,111,32,114,101,115,116,114,105,99,116,105,111,110,'\n', 9,35,100,101,102,105,110,101,32,95,95,65,83,77,95,83, 82,67,95,66,65,83,73,67,9,48,'\n',9,35,100,101,102, 105,110,101,32,95,95,65,83,77,95,83,82,67,95,69,88, 84,9,48,'\n',35,101,108,115,101,'\n',9,35,100,101,102,105, 110,101,9,95,95,65,83,77,95,83,82,67,95,66,65,83, 73,67,9,48,120,48,48,48,48,48,53,9,47,47,32,99, 111,110,115,116,97,110,116,32,111,114,32,118,97,114,105,97, 98,108,101,'\n',9,35,100,101,102,105,110,101,32,95,95,65, 83,77,95,83,82,67,95,69,88,84,9,48,120,48,48,48, 48,49,53,9,47,47,32,99,111,110,115,116,97,110,116,44, 32,118,97,114,105,97,98,108,101,44,32,111,114,32,114,97, 110,100,111,109,'\n',35,101,110,100,105,102,'\n','\n','\n','\n',47, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,'\n',32,42,32,115,101, 110,115,111,114,115,'\n',32,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,47,'\n','\n',35,100,101,102,105,110,101,32,83,49,9,48, '\n',35,100,101,102,105,110,101,32,83,50,9,49,'\n',35,100, 101,102,105,110,101,32,83,51,9,50,'\n','\n',47,47,32,114, 101,97,100,105,110,103,32,97,32,115,101,110,115,111,114,39, 115,32,118,97,108,117,101,32,97,110,100,32,116,121,112,101, '\n',35,100,101,102,105,110,101,32,83,101,110,115,111,114,86, 97,108,117,101,40,110,41,9,9,64,40,48,120,57,48,48, 48,48,32,43,32,40,95,95,115,101,110,115,111,114,40,110, 41,41,41,'\n','\n','\n',35,105,102,110,100,101,102,32,95,95, 83,80,89,'\n',9,35,100,101,102,105,110,101,32,83,101,110, 115,111,114,84,121,112,101,40,110,41,9,64,40,48,120,97, 48,48,48,48,32,43,32,40,95,95,115,101,110,115,111,114, 40,110,41,41,41,'\n',35,101,110,100,105,102,'\n','\n','\n',47, 47,32,99,111,110,115,116,97,110,116,115,32,102,111,114,32, 115,101,108,101,99,116,105,110,103,32,115,101,110,115,111,114, 115,32,45,32,97,108,115,111,32,97,32,115,104,111,114,116, 104,97,110,100,32,116,111,32,114,101,97,100,32,116,104,101, 32,115,101,110,115,111,114,39,115,32,118,97,108,117,101,'\n', 35,100,101,102,105,110,101,32,83,69,78,83,79,82,95,49, 9,83,101,110,115,111,114,86,97,108,117,101,40,83,49,41, '\n',35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 50,9,83,101,110,115,111,114,86,97,108,117,101,40,83,50, 41,'\n',35,100,101,102,105,110,101,32,83,69,78,83,79,82, 95,51,9,83,101,110,115,111,114,86,97,108,117,101,40,83, 51,41,'\n','\n','\n',95,95,110,111,108,105,115,116,32,118,111, 105,100,32,67,108,101,97,114,83,101,110,115,111,114,40,95, 95,115,101,110,115,111,114,32,115,101,110,115,111,114,41,32, 123,32,97,115,109,32,123,32,48,120,100,49,44,32,36,115, 101,110,115,111,114,32,58,32,48,120,48,51,48,48,48,50, 48,48,125,59,32,125,'\n','\n','\n',35,105,102,100,101,102,32, 95,95,67,77,'\n',9,47,47,32,67,77,32,104,97,115,32, 97,108,116,101,114,110,97,116,105,118,101,32,110,97,109,101, 115,32,102,111,114,32,115,101,110,115,111,114,115,'\n',9,35, 100,101,102,105,110,101,32,83,69,78,83,79,82,95,76,32, 83,69,78,83,79,82,95,49,32,47,47,32,76,101,102,116, 32,115,101,110,115,111,114,'\n',9,35,100,101,102,105,110,101, 32,83,69,78,83,79,82,95,77,32,83,69,78,83,79,82, 95,50,32,47,47,32,77,105,100,100,108,101,32,115,101,110, 115,111,114,'\n',9,35,100,101,102,105,110,101,32,83,69,78, 83,79,82,95,82,32,83,69,78,83,79,82,95,51,32,47, 47,32,82,105,103,104,116,32,115,101,110,115,111,114,'\n',35, 101,110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102,105, 110,101,100,40,95,95,82,67,88,41,32,124,124,32,100,101, 102,105,110,101,100,40,95,95,67,77,41,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,87,65,78,41,'\n',9, 47,47,32,82,67,88,32,97,110,100,32,67,77,32,115,117, 112,112,111,114,116,32,115,101,110,115,111,114,32,109,111,100, 101,115,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,77,79,68,69,95,82,65,87,9,9,9,48,120, 48,48,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,77,79,68,69,95,66,79,79,76,9,9,48,120, 50,48,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,77,79,68,69,95,69,68,71,69,9,9,48,120, 52,48,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,77,79,68,69,95,80,85,76,83,69,9,9,48, 120,54,48,'\n',9,35,100,101,102,105,110,101,32,83,69,78, 83,79,82,95,77,79,68,69,95,80,69,82,67,69,78,84, 9,9,48,120,56,48,'\n',9,35,105,102,32,100,101,102,105, 110,101,100,40,95,95,82,67,88,41,32,124,124,32,100,101, 102,105,110,101,100,40,95,95,83,87,65,78,41,'\n',9,9, 47,47,32,82,67,88,32,104,97,115,32,115,111,109,101,32, 101,120,116,114,97,32,109,111,100,101,115,'\n',9,9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,77,79,68, 69,95,67,69,76,83,73,85,83,9,48,120,97,48,'\n',9, 9,35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 77,79,68,69,95,70,65,72,82,69,78,72,69,73,84,9, 48,120,99,48,'\n',9,9,35,100,101,102,105,110,101,32,83, 69,78,83,79,82,95,77,79,68,69,95,82,79,84,65,84, 73,79,78,9,48,120,101,48,'\n',9,35,101,110,100,105,102, 32,47,47,32,95,95,82,67,88,32,111,114,32,95,95,83, 87,65,78,'\n','\n','\n',9,35,100,101,102,105,110,101,32,83, 101,110,115,111,114,77,111,100,101,40,110,41,9,9,64,40, 48,120,98,48,48,48,48,32,43,32,40,95,95,115,101,110, 115,111,114,40,110,41,41,41,9,47,47,32,114,101,97,100, 32,116,104,101,32,115,101,110,115,111,114,32,109,111,100,101, '\n','\n','\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,83,101,110,115,111,114,77,111,100,101,40, 95,95,115,101,110,115,111,114,32,115,101,110,115,111,114,44, 32,99,111,110,115,116,32,105,110,116,32,109,111,100,101,41, 9,123,32,97,115,109,32,123,32,48,120,52,50,44,32,36, 115,101,110,115,111,114,32,58,32,48,120,48,51,48,48,48, 50,48,48,44,32,109,111,100,101,32,125,59,32,125,'\n',35, 101,110,100,105,102,32,47,47,32,100,101,102,105,110,101,100, 40,95,95,82,67,88,41,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,67,77,41,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,87,65,78,41,'\n','\n','\n',35,105, 102,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, '\n',9,47,47,32,83,80,89,32,100,111,101,115,110,39,116, 32,115,104,105,102,116,32,116,104,101,32,109,111,100,101,32, 111,118,101,114,32,53,32,98,105,116,115,32,105,110,32,83, 101,110,115,111,114,77,111,100,101,40,41,44,'\n',9,47,47, 32,115,111,32,99,111,110,115,116,97,110,116,115,32,97,114, 101,32,100,105,102,102,101,114,101,110,116,32,102,114,111,109, 32,82,67,88,'\n',9,35,100,101,102,105,110,101,32,83,69, 78,83,79,82,95,77,79,68,69,95,82,65,87,9,9,48, 120,48,48,'\n',9,35,100,101,102,105,110,101,32,83,69,78, 83,79,82,95,77,79,68,69,95,66,79,79,76,9,48,120, 48,49,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,77,79,68,69,95,80,69,82,67,69,78,84,9, 48,120,48,52,'\n',9,35,100,101,102,105,110,101,32,83,101, 110,115,111,114,77,111,100,101,40,110,41,9,9,64,40,48, 120,98,48,48,48,48,32,43,32,40,95,95,115,101,110,115, 111,114,40,110,41,41,41,9,47,47,32,114,101,97,100,32, 116,104,101,32,115,101,110,115,111,114,32,109,111,100,101,'\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,83,101,110,115,111,114,77,111,100,101,40,95,95,115, 101,110,115,111,114,32,115,101,110,115,111,114,44,32,99,111, 110,115,116,32,105,110,116,32,109,111,100,101,41,9,123,32, 97,115,109,32,123,32,48,120,52,50,44,32,36,115,101,110, 115,111,114,32,58,32,48,120,48,51,48,48,48,50,48,48, 44,32,109,111,100,101,32,60,60,32,53,32,125,59,32,125, '\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,100,101, 102,105,110,101,100,40,95,95,82,67,88,41,32,124,124,32, 100,101,102,105,110,101,100,40,95,95,83,87,65,78,41,'\n', 9,47,47,32,82,67,88,32,115,117,112,112,111,114,116,115, 32,115,101,110,115,111,114,32,116,121,112,101,115,'\n','\n',9, 47,47,32,116,121,112,101,115,32,102,111,114,32,83,101,116, 83,101,110,115,111,114,84,121,112,101,40,41,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,84,89,80, 69,95,78,79,78,69,9,48,'\n',9,35,100,101,102,105,110, 101,32,83,69,78,83,79,82,95,84,89,80,69,95,84,79, 85,67,72,9,49,'\n',9,35,100,101,102,105,110,101,32,83, 69,78,83,79,82,95,84,89,80,69,95,84,69,77,80,69, 82,65,84,85,82,69,9,50,'\n',9,35,100,101,102,105,110, 101,32,83,69,78,83,79,82,95,84,89,80,69,95,76,73, 71,72,84,9,51,'\n',9,35,100,101,102,105,110,101,32,83, 69,78,83,79,82,95,84,89,80,69,95,82,79,84,65,84, 73,79,78,9,52,'\n','\n',9,35,105,102,32,100,101,102,105, 110,101,100,40,95,95,83,87,65,78,41,'\n',9,9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,84,89,80, 69,95,65,67,84,73,86,69,95,82,65,87,32,53,'\n',9, 35,101,110,100,105,102,'\n','\n','\n',9,47,47,32,116,121,112, 101,47,109,111,100,101,32,99,111,109,98,105,110,97,116,105, 111,110,115,32,102,111,114,32,83,101,116,83,101,110,115,111, 114,40,41,'\n',9,35,100,101,102,105,110,101,32,95,83,69, 78,83,79,82,95,67,70,71,40,116,121,112,101,44,109,111, 100,101,41,9,40,40,40,116,121,112,101,41,60,60,56,41, 32,43,32,40,109,111,100,101,41,41,'\n',9,35,100,101,102, 105,110,101,32,83,69,78,83,79,82,95,84,79,85,67,72, 9,9,95,83,69,78,83,79,82,95,67,70,71,40,83,69, 78,83,79,82,95,84,89,80,69,95,84,79,85,67,72,44, 32,83,69,78,83,79,82,95,77,79,68,69,95,66,79,79, 76,41,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,76,73,71,72,84,9,9,95,83,69,78,83,79, 82,95,67,70,71,40,83,69,78,83,79,82,95,84,89,80, 69,95,76,73,71,72,84,44,32,83,69,78,83,79,82,95, 77,79,68,69,95,80,69,82,67,69,78,84,41,'\n',9,35, 100,101,102,105,110,101,32,83,69,78,83,79,82,95,82,79, 84,65,84,73,79,78,9,9,95,83,69,78,83,79,82,95, 67,70,71,40,83,69,78,83,79,82,95,84,89,80,69,95, 82,79,84,65,84,73,79,78,44,32,83,69,78,83,79,82, 95,77,79,68,69,95,82,79,84,65,84,73,79,78,41,'\n', 9,35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 67,69,76,83,73,85,83,9,9,95,83,69,78,83,79,82, 95,67,70,71,40,83,69,78,83,79,82,95,84,89,80,69, 95,84,69,77,80,69,82,65,84,85,82,69,44,32,83,69, 78,83,79,82,95,77,79,68,69,95,67,69,76,83,73,85, 83,41,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,70,65,72,82,69,78,72,69,73,84,9,95,83, 69,78,83,79,82,95,67,70,71,40,83,69,78,83,79,82, 95,84,89,80,69,95,84,69,77,80,69,82,65,84,85,82, 69,44,32,83,69,78,83,79,82,95,77,79,68,69,95,70, 65,72,82,69,78,72,69,73,84,41,'\n',9,35,100,101,102, 105,110,101,9,83,69,78,83,79,82,95,80,85,76,83,69, 9,9,95,83,69,78,83,79,82,95,67,70,71,40,83,69, 78,83,79,82,95,84,89,80,69,95,84,79,85,67,72,44, 32,83,69,78,83,79,82,95,77,79,68,69,95,80,85,76, 83,69,41,'\n',9,35,100,101,102,105,110,101,32,83,69,78, 83,79,82,95,69,68,71,69,9,9,95,83,69,78,83,79, 82,95,67,70,71,40,83,69,78,83,79,82,95,84,89,80, 69,95,84,79,85,67,72,44,32,83,69,78,83,79,82,95, 77,79,68,69,95,69,68,71,69,41,'\n','\n','\n',9,35,100, 101,102,105,110,101,32,83,101,110,115,111,114,86,97,108,117, 101,66,111,111,108,40,110,41,9,64,40,48,120,100,48,48, 48,48,32,43,32,40,95,95,115,101,110,115,111,114,40,110, 41,41,41,9,47,47,32,114,101,97,100,32,116,104,101,32, 98,111,111,108,101,97,110,32,118,97,108,117,101,32,111,102, 32,97,32,115,101,110,115,111,114,'\n','\n','\n',9,47,47,32, 115,101,116,32,97,32,115,101,110,115,111,114,39,115,32,116, 121,112,101,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,83,101,110,115,111,114,84,121,112,101, 40,95,95,115,101,110,115,111,114,32,115,101,110,115,111,114, 44,32,99,111,110,115,116,32,105,110,116,32,116,121,112,101, 41,9,32,123,32,97,115,109,32,123,32,48,120,51,50,44, 32,36,115,101,110,115,111,114,32,58,32,48,120,48,51,48, 48,48,50,48,48,44,32,40,116,121,112,101,41,32,125,59, 32,125,'\n','\n','\n',9,47,47,32,115,101,116,32,97,32,115, 101,110,115,111,114,39,115,32,116,121,112,101,32,97,110,100, 32,109,111,100,101,32,117,115,105,110,103,32,97,32,99,111, 110,102,105,103,32,45,32,101,46,103,46,32,83,101,116,83, 101,110,115,111,114,40,83,69,78,83,79,82,95,49,44,32, 83,69,78,83,79,82,95,76,73,71,72,84,41,59,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,83,101,110,115,111,114,40,95,95,115,101,110,115,111,114, 32,115,101,110,115,111,114,44,32,99,111,110,115,116,32,105, 110,116,32,116,109,41,9,123,32,83,101,116,83,101,110,115, 111,114,84,121,112,101,40,115,101,110,115,111,114,44,32,116, 109,62,62,56,41,59,32,83,101,116,83,101,110,115,111,114, 77,111,100,101,40,115,101,110,115,111,114,44,32,116,109,41, 59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102, 100,101,102,32,95,95,83,67,79,85,84,'\n',9,47,47,32, 83,99,111,117,116,32,104,97,115,32,115,111,109,101,32,115, 112,101,99,105,97,108,32,114,111,117,116,105,110,101,115,32, 116,111,32,99,111,110,102,105,103,117,114,101,32,116,104,101, 32,108,105,103,104,116,32,115,101,110,115,111,114,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,67,97,108, 105,98,114,97,116,101,83,101,110,115,111,114,40,41,9,9, 9,123,32,97,115,109,32,123,32,48,120,99,48,32,125,59, 32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,83,101,110,115,111,114,67,108,105,99,107, 84,105,109,101,40,99,111,110,115,116,32,105,110,116,32,38, 120,41,9,123,32,97,115,109,32,123,32,48,120,101,51,44, 32,36,120,32,58,32,95,95,65,83,77,95,83,82,67,95, 66,65,83,73,67,32,125,59,32,125,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,83,101,110, 115,111,114,72,121,115,116,101,114,101,115,105,115,40,99,111, 110,115,116,32,105,110,116,32,38,120,41,9,123,32,97,115, 109,32,123,32,48,120,100,51,44,32,36,120,32,58,32,95, 95,65,83,77,95,83,82,67,95,66,65,83,73,67,32,125, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,83,101,110,115,111,114,76,111,119,101, 114,76,105,109,105,116,40,99,111,110,115,116,32,105,110,116, 32,38,120,41,9,123,32,97,115,109,32,123,32,48,120,99, 51,44,32,36,120,32,58,32,95,95,65,83,77,95,83,82, 67,95,66,65,83,73,67,32,125,59,32,125,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,110,115,111,114,85,112,112,101,114,76,105,109,105,116,40, 99,111,110,115,116,32,105,110,116,32,38,120,41,9,123,32, 97,115,109,32,123,32,48,120,98,51,44,32,36,120,32,58, 32,95,95,65,83,77,95,83,82,67,95,66,65,83,73,67, 32,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35, 105,102,32,100,101,102,105,110,101,100,40,95,95,82,67,88, 41,32,124,124,32,100,101,102,105,110,101,100,40,95,95,83, 67,79,85,84,41,32,124,124,32,100,101,102,105,110,101,100, 40,95,95,83,80,89,41,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,87,65,78,41,'\n',9,47,47,32,82, 67,88,32,97,110,100,32,83,99,111,117,116,32,115,117,112, 112,111,114,116,32,114,101,97,100,105,110,103,32,116,104,101, 32,114,97,119,32,118,97,108,117,101,'\n',9,35,100,101,102, 105,110,101,32,83,101,110,115,111,114,86,97,108,117,101,82, 97,119,40,110,41,9,64,40,48,120,99,48,48,48,48,32, 43,32,40,95,95,115,101,110,115,111,114,40,110,41,41,41, '\n',35,101,110,100,105,102,'\n','\n','\n','\n',47,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,'\n',32,42,32,111,117,116,112,117,116, 115,'\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n', '\n',47,47,32,99,111,110,115,116,97,110,116,115,32,102,111, 114,32,115,101,108,101,99,116,105,110,103,32,111,117,116,112, 117,116,115,'\n',35,100,101,102,105,110,101,32,79,85,84,95, 65,9,48,120,48,49,'\n',35,100,101,102,105,110,101,32,79, 85,84,95,66,9,48,120,48,50,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,67,9,48,120,48,52,'\n','\n',35,100, 101,102,105,110,101,32,79,85,84,95,65,66,9,48,120,48, 51,'\n',35,100,101,102,105,110,101,32,79,85,84,95,65,67, 9,48,120,48,53,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,66,67,9,48,120,48,54,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,65,66,67,9,48,120,48,55,'\n','\n', 35,105,102,100,101,102,32,95,95,83,87,65,78,'\n',9,35, 100,101,102,105,110,101,32,79,85,84,95,68,9,48,120,48, 56,'\n',9,35,100,101,102,105,110,101,32,79,85,84,95,69, 9,48,120,49,48,'\n',9,35,100,101,102,105,110,101,32,79, 85,84,95,70,9,48,120,50,48,'\n',35,101,110,100,105,102, 32,47,47,32,95,95,83,87,65,78,'\n','\n','\n',47,47,32, 111,117,116,112,117,116,32,109,111,100,101,115,'\n',35,100,101, 102,105,110,101,32,79,85,84,95,70,76,79,65,84,9,48, '\n',35,100,101,102,105,110,101,32,79,85,84,95,79,70,70, 9,9,48,120,52,48,'\n',35,100,101,102,105,110,101,32,79, 85,84,95,79,78,9,9,48,120,56,48,'\n','\n','\n',47,47, 32,111,117,116,112,117,116,32,100,105,114,101,99,116,105,111, 110,115,'\n',35,100,101,102,105,110,101,32,79,85,84,95,82, 69,86,9,9,48,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,84,79,71,71,76,69,9,48,120,52,48,'\n',35,100, 101,102,105,110,101,32,79,85,84,95,70,87,68,9,9,48, 120,56,48,'\n','\n','\n',47,47,32,111,117,116,112,117,116,32, 112,111,119,101,114,32,108,101,118,101,108,115,'\n',35,100,101, 102,105,110,101,32,79,85,84,95,76,79,87,9,9,48,'\n', 35,100,101,102,105,110,101,32,79,85,84,95,72,65,76,70, 9,51,'\n',35,100,101,102,105,110,101,32,79,85,84,95,70, 85,76,76,9,55,'\n','\n','\n',47,47,32,111,117,116,112,117, 116,32,102,117,110,99,116,105,111,110,115,'\n',95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,79,117,116, 112,117,116,40,99,111,110,115,116,32,105,110,116,32,111,44, 32,99,111,110,115,116,32,105,110,116,32,109,41,9,123,32, 97,115,109,32,123,32,48,120,50,49,44,32,40,111,41,32, 43,32,40,109,41,32,125,59,32,125,'\n',95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,68,105,114,101, 99,116,105,111,110,40,99,111,110,115,116,32,105,110,116,32, 111,44,32,99,111,110,115,116,32,105,110,116,32,100,41,9, 123,32,97,115,109,32,123,32,48,120,101,49,44,32,40,111, 41,32,43,32,40,100,41,32,125,59,32,125,'\n',95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,80,111, 119,101,114,40,99,111,110,115,116,32,105,110,116,32,111,44, 32,99,111,110,115,116,32,105,110,116,32,38,112,41,9,123, 32,97,115,109,32,123,32,48,120,49,51,44,32,40,111,41, 44,32,36,112,32,58,32,95,95,65,83,77,95,83,77,65, 76,76,95,86,65,76,85,69,32,43,32,95,95,65,83,77, 95,83,82,67,95,69,88,84,125,59,32,125,'\n','\n','\n',95, 95,110,111,108,105,115,116,32,118,111,105,100,32,79,110,40, 99,111,110,115,116,32,105,110,116,32,111,41,9,123,32,83, 101,116,79,117,116,112,117,116,40,111,44,32,79,85,84,95, 79,78,41,59,32,125,'\n',95,95,110,111,108,105,115,116,32, 118,111,105,100,32,79,102,102,40,99,111,110,115,116,32,105, 110,116,32,111,41,9,123,32,83,101,116,79,117,116,112,117, 116,40,111,44,32,79,85,84,95,79,70,70,41,59,32,125, '\n',95,95,110,111,108,105,115,116,32,118,111,105,100,32,70, 108,111,97,116,40,99,111,110,115,116,32,105,110,116,32,111, 41,32,123,32,83,101,116,79,117,116,112,117,116,40,111,44, 32,79,85,84,95,70,76,79,65,84,41,59,32,125,'\n',95, 95,110,111,108,105,115,116,32,118,111,105,100,32,84,111,103, 103,108,101,40,99,111,110,115,116,32,105,110,116,32,111,41, 32,123,32,83,101,116,68,105,114,101,99,116,105,111,110,40, 111,44,32,79,85,84,95,84,79,71,71,76,69,41,59,32, 125,'\n',95,95,110,111,108,105,115,116,32,118,111,105,100,32, 70,119,100,40,99,111,110,115,116,32,105,110,116,32,111,41, 9,123,32,83,101,116,68,105,114,101,99,116,105,111,110,40, 111,44,32,79,85,84,95,70,87,68,41,59,32,125,'\n',95, 95,110,111,108,105,115,116,32,118,111,105,100,32,82,101,118, 40,99,111,110,115,116,32,105,110,116,32,111,41,9,123,32, 83,101,116,68,105,114,101,99,116,105,111,110,40,111,44,32, 79,85,84,95,82,69,86,41,59,32,125,'\n',95,95,110,111, 108,105,115,116,32,118,111,105,100,32,79,110,70,119,100,40, 99,111,110,115,116,32,105,110,116,32,111,41,9,123,32,70, 119,100,40,111,41,59,32,79,110,40,111,41,59,32,125,'\n', 95,95,110,111,108,105,115,116,32,118,111,105,100,32,79,110, 82,101,118,40,99,111,110,115,116,32,105,110,116,32,111,41, 9,123,32,82,101,118,40,111,41,59,32,79,110,40,111,41, 59,32,125,'\n',95,95,110,111,108,105,115,116,32,118,111,105, 100,32,79,110,70,111,114,40,99,111,110,115,116,32,105,110, 116,32,111,44,32,99,111,110,115,116,32,105,110,116,32,38, 116,41,9,123,32,79,110,40,111,41,59,32,87,97,105,116, 40,116,41,59,32,79,102,102,40,111,41,59,32,125,'\n','\n', '\n',35,100,101,102,105,110,101,32,79,117,116,112,117,116,83, 116,97,116,117,115,40,110,41,9,9,64,40,48,120,48,51, 48,48,48,48,32,43,32,40,110,41,41,9,47,47,32,114, 101,97,100,32,116,104,101,32,111,117,116,112,117,116,32,115, 116,97,116,117,115,'\n','\n','\n',35,105,102,100,101,102,32,95, 95,67,77,'\n',9,47,47,32,67,121,98,101,114,77,97,115, 116,101,114,32,115,112,101,99,105,102,105,99,32,115,116,117, 102,102,'\n',9,47,47,32,97,108,116,101,114,110,97,116,101, 32,110,97,109,101,115,32,102,111,114,32,109,111,116,111,114, 115,'\n',9,35,100,101,102,105,110,101,32,79,85,84,95,76, 32,79,85,84,95,65,32,47,47,32,76,101,102,116,32,109, 111,116,111,114,'\n',9,35,100,101,102,105,110,101,32,79,85, 84,95,82,32,79,85,84,95,66,32,47,47,32,82,105,103, 104,116,32,109,111,116,111,114,'\n',9,35,100,101,102,105,110, 101,32,79,85,84,95,88,32,79,85,84,95,67,32,47,47, 32,69,120,116,101,114,110,97,108,32,109,111,116,111,114,'\n', '\n','\n',9,35,100,101,102,105,110,101,32,68,114,105,118,101, 40,109,48,44,32,109,49,41,9,9,9,9,97,115,109,32, 123,32,48,120,52,49,44,32,68,73,82,83,80,69,69,68, 40,109,48,41,32,124,32,68,73,82,83,80,69,69,68,40, 109,49,41,60,60,52,32,125,'\n',9,35,100,101,102,105,110, 101,32,79,110,87,97,105,116,40,109,44,32,110,44,32,116, 41,9,9,9,9,97,115,109,32,123,32,48,120,99,50,44, 32,40,109,41,60,60,52,32,124,32,68,73,82,83,80,69, 69,68,40,110,41,44,32,116,32,125,'\n',9,35,100,101,102, 105,110,101,32,79,110,87,97,105,116,68,105,102,102,101,114, 101,110,116,40,109,44,32,110,48,44,32,110,49,44,32,110, 50,44,32,116,41,9,97,115,109,32,123,32,48,120,53,51, 44,32,40,109,41,60,60,52,32,124,32,68,73,82,83,80, 69,69,68,40,110,48,41,44,32,68,73,82,83,80,69,69, 68,40,110,49,41,60,60,52,32,124,32,68,73,82,83,80, 69,69,68,40,110,50,41,44,32,116,32,125,'\n','\n','\n',9, 47,47,32,65,117,120,46,32,102,117,110,99,116,105,111,110, 58,32,84,114,97,110,115,102,111,114,109,115,32,97,32,110, 117,109,98,101,114,32,98,101,116,119,101,101,110,32,45,55, 32,97,110,100,32,55,32,116,111,32,97,32,52,32,98,105, 116,32,115,101,113,117,101,110,99,101,58,'\n',9,47,47,32, 66,105,116,115,58,32,49,46,46,51,32,45,32,83,112,101, 101,100,58,32,48,32,116,111,32,55,'\n',9,47,47,32,66, 105,116,32,58,32,52,32,32,32,32,45,32,68,105,114,101, 99,116,105,111,110,58,32,49,32,105,102,32,118,62,61,48, 44,32,48,32,105,102,32,118,60,48,'\n',9,35,100,101,102, 105,110,101,32,68,73,82,83,80,69,69,68,40,118,41,9, 9,40,40,118,41,38,56,94,56,124,40,40,118,41,42,40, 40,40,118,41,62,62,51,41,42,50,94,49,41,41,38,55, 41,'\n','\n','\n',9,47,47,32,114,101,97,100,105,110,103,32, 116,104,101,32,116,97,99,104,111,44,32,101,116,99,46,'\n', 9,35,100,101,102,105,110,101,32,84,97,99,104,111,67,111, 117,110,116,40,110,41,9,9,64,40,48,120,53,48,48,48, 48,32,43,32,40,110,41,45,49,41,32,47,47,32,85,115, 101,32,79,85,84,95,120,32,97,115,32,112,97,114,97,109, 101,116,101,114,'\n',9,35,100,101,102,105,110,101,32,84,97, 99,104,111,83,112,101,101,100,40,110,41,9,9,64,40,48, 120,54,48,48,48,48,32,43,32,40,110,41,45,49,41,32, 47,47,32,85,115,101,32,79,85,84,95,120,32,97,115,32, 112,97,114,97,109,101,116,101,114,'\n',9,35,100,101,102,105, 110,101,32,69,120,116,101,114,110,97,108,77,111,116,111,114, 82,117,110,110,105,110,103,40,41,9,64,40,48,120,55,48, 48,48,50,41,9,47,47,32,82,101,102,101,114,101,100,32, 105,110,32,116,104,101,32,83,68,75,32,97,115,32,77,111, 116,111,114,67,117,114,114,101,110,116,40,50,41,46,32,78, 111,110,32,122,101,114,111,32,105,102,32,101,120,116,101,114, 110,97,108,32,109,111,116,111,114,32,114,117,110,110,105,110, 103,46,'\n','\n','\n',9,35,100,101,102,105,110,101,32,67,108, 101,97,114,84,97,99,104,111,67,111,117,110,116,101,114,40, 109,41,32,97,115,109,32,123,32,48,120,49,49,44,32,40, 109,41,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105, 102,32,100,101,102,105,110,101,100,40,95,95,83,67,79,85, 84,41,32,124,124,32,95,95,82,67,88,61,61,50,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, 32,124,124,32,100,101,102,105,110,101,100,40,95,95,83,87, 65,78,41,'\n',9,47,47,32,83,99,111,117,116,32,97,110, 100,32,82,67,88,50,32,104,97,118,101,32,103,108,111,98, 97,108,32,118,101,114,115,105,111,110,115,32,111,102,32,111, 117,116,112,117,116,32,99,111,110,116,114,111,108,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 71,108,111,98,97,108,79,117,116,112,117,116,40,99,111,110, 115,116,32,105,110,116,32,111,44,32,99,111,110,115,116,32, 105,110,116,32,109,41,9,123,32,97,115,109,32,123,32,48, 120,54,55,44,32,40,111,41,32,43,32,40,109,41,32,125, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,71,108,111,98,97,108,68,105,114,101, 99,116,105,111,110,40,99,111,110,115,116,32,105,110,116,32, 111,44,32,99,111,110,115,116,32,105,110,116,32,100,41,9, 123,32,97,115,109,32,123,32,48,120,55,55,44,32,40,111, 41,32,43,32,40,100,41,32,125,59,32,125,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,77, 97,120,80,111,119,101,114,40,99,111,110,115,116,32,105,110, 116,32,111,44,32,99,111,110,115,116,32,105,110,116,32,38, 112,41,9,123,32,97,115,109,32,123,32,48,120,97,51,44, 32,40,111,41,44,32,36,112,32,58,32,95,95,65,83,77, 95,83,77,65,76,76,95,86,65,76,85,69,32,43,32,95, 95,65,83,77,95,83,82,67,95,69,88,84,125,59,32,125, '\n','\n','\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,69,110,97,98,108,101,79,117,116,112,117,116,40,99, 111,110,115,116,32,105,110,116,32,111,41,32,123,32,83,101, 116,71,108,111,98,97,108,79,117,116,112,117,116,40,111,44, 32,79,85,84,95,79,78,41,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,68,105,115,97,98, 108,101,79,117,116,112,117,116,40,99,111,110,115,116,32,105, 110,116,32,111,41,32,123,32,83,101,116,71,108,111,98,97, 108,79,117,116,112,117,116,40,111,44,32,79,85,84,95,79, 70,70,41,59,32,125,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,73,110,118,101,114,116,79,117,116,112, 117,116,40,99,111,110,115,116,32,105,110,116,32,111,41,32, 123,32,83,101,116,71,108,111,98,97,108,68,105,114,101,99, 116,105,111,110,40,111,44,32,79,85,84,95,82,69,86,41, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,79,98,118,101,114,116,79,117,116,112,117,116,40, 99,111,110,115,116,32,105,110,116,32,111,41,32,123,32,83, 101,116,71,108,111,98,97,108,68,105,114,101,99,116,105,111, 110,40,111,44,32,79,85,84,95,70,87,68,41,59,32,125, '\n','\n','\n',9,35,100,101,102,105,110,101,32,71,108,111,98, 97,108,79,117,116,112,117,116,83,116,97,116,117,115,40,110, 41,9,9,64,40,48,120,49,49,48,48,48,48,32,43,32, 40,110,41,41,9,47,47,32,114,101,97,100,32,116,104,101, 32,103,108,111,98,97,108,32,115,116,97,116,117,115,'\n',35, 101,110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102,105, 110,101,100,40,95,95,83,67,79,85,84,41,32,124,124,32, 100,101,102,105,110,101,100,40,95,95,83,80,89,41,'\n',9, 47,47,32,83,99,111,117,116,32,104,97,115,32,97,32,108, 105,103,104,116,'\n',9,35,100,101,102,105,110,101,32,76,73, 71,72,84,95,79,78,9,48,120,56,48,'\n',9,35,100,101, 102,105,110,101,32,76,73,71,72,84,95,79,70,70,9,48, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,76,105,103,104,116,40,99,111,110,115,116,32,105, 110,116,32,120,41,9,123,32,97,115,109,32,123,32,48,120, 56,55,44,32,120,32,125,59,32,125,'\n',35,101,110,100,105, 102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,115,111,117,110,100,'\n',32,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,47,'\n','\n',47,47,32,115,111,117,110,100, 115,32,45,32,102,111,114,32,80,108,97,121,83,111,117,110, 100,40,41,'\n',35,100,101,102,105,110,101,32,83,79,85,78, 68,95,67,76,73,67,75,9,9,48,'\n',35,100,101,102,105, 110,101,32,83,79,85,78,68,95,68,79,85,66,76,69,95, 66,69,69,80,9,49,'\n',35,100,101,102,105,110,101,32,83, 79,85,78,68,95,68,79,87,78,9,9,50,'\n',35,100,101, 102,105,110,101,32,83,79,85,78,68,95,85,80,9,9,51, '\n',35,100,101,102,105,110,101,32,83,79,85,78,68,95,76, 79,87,95,66,69,69,80,9,9,52,'\n',35,100,101,102,105, 110,101,32,83,79,85,78,68,95,70,65,83,84,95,85,80, 9,9,53,'\n','\n',35,105,102,32,100,101,102,105,110,101,100, 40,95,95,83,87,65,78,41,'\n',9,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,83,72,79,82,84,95,66,76, 73,80,9,54,'\n',9,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,69,88,67,69,80,84,73,79,78,9,9,55, '\n',35,101,110,100,105,102,'\n','\n','\n',47,47,32,112,108,97, 121,105,110,103,32,97,32,115,121,115,116,101,109,32,115,111, 117,110,100,'\n',35,105,102,32,100,101,102,105,110,101,100,40, 95,95,83,80,89,41,'\n',9,47,47,32,83,112,121,32,99, 97,110,32,112,108,97,121,32,118,97,114,105,97,98,108,101, 32,111,114,32,99,111,110,115,116,97,110,116,32,115,111,117, 110,100,115,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,80,108,97,121,83,111,117,110,100,40,99,111,110, 115,116,32,105,110,116,32,38,120,41,'\n',9,123,'\n',9,9, 105,102,32,40,95,95,116,121,112,101,40,120,41,61,61,50, 41,'\n',9,9,9,97,115,109,32,123,32,48,120,53,49,44, 32,36,120,32,58,32,48,120,51,48,48,48,48,48,52,32, 125,59,'\n',9,9,101,108,115,101,'\n',9,9,9,97,115,109, 32,123,32,48,120,101,55,44,32,36,120,32,58,32,48,120, 51,48,48,48,48,48,49,32,125,59,'\n',9,125,'\n',35,101, 108,115,101,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,80,108,97,121,83,111,117,110,100,40,99,111,110, 115,116,32,105,110,116,32,120,41,9,9,123,32,97,115,109, 32,123,32,48,120,53,49,44,32,120,32,125,59,32,125,'\n', 35,101,110,100,105,102,'\n','\n','\n',47,47,32,112,108,97,121, 105,110,103,32,97,32,110,111,116,101,'\n',35,105,102,32,100, 101,102,105,110,101,100,40,95,95,83,67,79,85,84,41,32, 124,124,32,95,95,82,67,88,61,61,50,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,80,89,41,32,124,124, 32,100,101,102,105,110,101,100,40,95,95,83,87,65,78,41, '\n',9,47,47,32,82,67,88,50,32,97,110,100,32,83,99, 111,117,116,32,99,97,110,32,112,108,97,121,32,118,97,114, 105,97,98,108,101,32,111,114,32,99,111,110,115,116,97,110, 116,32,102,114,101,113,117,101,110,99,121,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,80,108,97,121,84, 111,110,101,40,99,111,110,115,116,32,105,110,116,32,38,110, 111,116,101,44,32,99,111,110,115,116,32,105,110,116,32,100, 117,114,41,'\n',9,123,'\n',9,9,105,102,32,40,95,95,116, 121,112,101,40,110,111,116,101,41,61,61,50,41,'\n',9,9, 9,97,115,109,32,123,32,48,120,50,51,44,32,36,110,111, 116,101,32,58,32,48,120,50,48,48,48,48,48,52,44,32, 100,117,114,32,125,59,'\n',9,9,101,108,115,101,'\n',9,9, 9,97,115,109,32,123,32,48,120,48,50,44,32,36,110,111, 116,101,32,58,32,48,120,51,48,48,48,48,48,49,44,32, 100,117,114,125,59,'\n',9,125,'\n',35,101,108,115,101,'\n',9, 47,47,32,82,67,88,49,32,97,110,100,32,67,77,32,110, 101,101,100,32,99,111,110,115,116,97,110,116,32,102,114,101, 113,117,101,110,99,121,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,80,108,97,121,84,111,110,101,40,99, 111,110,115,116,32,105,110,116,32,102,44,32,99,111,110,115, 116,32,105,110,116,32,100,41,9,123,32,97,115,109,32,123, 32,48,120,50,51,44,32,40,102,41,44,32,40,102,41,62, 62,56,44,32,40,100,41,32,125,59,32,125,'\n',35,101,110, 100,105,102,'\n','\n','\n',35,105,102,32,95,95,82,67,88,61, 61,50,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,80,89,41,32,124,124,32,100,101,102,105,110,101,100,40, 95,95,83,87,65,78,41,'\n',9,47,47,32,82,67,88,50, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 77,117,116,101,83,111,117,110,100,40,41,9,123,32,97,115, 109,32,123,32,48,120,100,48,32,125,59,32,125,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,85,110,109, 117,116,101,83,111,117,110,100,40,41,32,9,123,32,97,115, 109,32,123,32,48,120,101,48,32,125,59,32,125,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,67,108,101, 97,114,83,111,117,110,100,40,41,32,9,123,32,97,115,109, 32,123,32,48,120,56,48,32,125,59,32,125,'\n',35,101,108, 105,102,32,100,101,102,105,110,101,100,40,95,95,83,67,79, 85,84,41,'\n',9,47,47,32,83,67,79,85,84,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,77,117,116, 101,83,111,117,110,100,40,41,9,123,32,97,115,109,32,123, 32,48,120,53,55,44,32,48,120,56,48,32,125,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 85,110,109,117,116,101,83,111,117,110,100,40,41,9,123,32, 97,115,109,32,123,32,48,120,53,55,44,32,48,120,99,48, 32,125,59,32,125,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,108,101,99,116,83,111,117,110,100, 115,40,99,111,110,115,116,32,105,110,116,32,103,114,111,117, 112,41,9,123,32,97,115,109,32,123,32,48,120,53,55,44, 32,103,114,111,117,112,32,125,59,32,125,'\n',35,101,110,100, 105,102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,'\n',32,42,32,68,105,115,112,108,97,121,'\n',32,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,47,'\n','\n',35,105,102,32,100, 101,102,105,110,101,100,40,95,95,82,67,88,41,32,124,124, 32,100,101,102,105,110,101,100,40,95,95,83,87,65,78,41, '\n',9,47,47,32,115,101,116,32,116,104,101,32,100,105,115, 112,108,97,121,32,109,111,100,101,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,108,101,99,116,68, 105,115,112,108,97,121,40,99,111,110,115,116,32,105,110,116, 32,38,118,41,32,123,32,97,115,109,32,123,32,48,120,51, 51,44,32,36,118,32,58,32,95,95,65,83,77,95,83,82, 67,95,66,65,83,73,67,125,59,32,125,'\n','\n',9,47,47, 32,100,105,115,112,108,97,121,32,109,111,100,101,115,32,45, 32,102,111,114,32,83,101,108,101,99,116,68,105,115,112,108, 97,121,'\n',9,35,100,101,102,105,110,101,32,68,73,83,80, 76,65,89,95,87,65,84,67,72,9,9,48,'\n',9,35,100, 101,102,105,110,101,32,68,73,83,80,76,65,89,95,83,69, 78,83,79,82,95,49,9,49,'\n',9,35,100,101,102,105,110, 101,32,68,73,83,80,76,65,89,95,83,69,78,83,79,82, 95,50,9,50,'\n',9,35,100,101,102,105,110,101,32,68,73, 83,80,76,65,89,95,83,69,78,83,79,82,95,51,9,51, '\n',9,35,100,101,102,105,110,101,32,68,73,83,80,76,65, 89,95,79,85,84,95,65,9,9,52,'\n',9,35,100,101,102, 105,110,101,32,68,73,83,80,76,65,89,95,79,85,84,95, 66,9,9,53,'\n',9,35,100,101,102,105,110,101,32,68,73, 83,80,76,65,89,95,79,85,84,95,67,9,9,54,'\n','\n', 9,35,105,102,32,95,95,82,67,88,61,61,50,32,124,124, 32,100,101,102,105,110,101,100,40,95,95,83,87,65,78,41, '\n',9,9,35,100,101,102,105,110,101,32,68,73,83,80,76, 65,89,95,85,83,69,82,9,55,'\n',9,9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,85,115,101, 114,68,105,115,112,108,97,121,40,99,111,110,115,116,32,105, 110,116,32,38,118,44,32,99,111,110,115,116,32,105,110,116, 32,112,114,101,99,41,32,123,32,97,115,109,32,123,32,48, 120,101,53,44,32,48,44,32,112,114,101,99,44,32,36,118, 32,58,32,95,95,65,83,77,95,78,79,95,76,79,67,65, 76,32,125,59,32,125,'\n',9,35,101,110,100,105,102,'\n','\n', 9,35,105,102,32,100,101,102,105,110,101,100,40,95,95,83, 87,65,78,41,'\n',9,9,35,100,101,102,105,110,101,32,68, 73,83,80,76,65,89,95,69,88,67,69,80,84,73,79,78, 9,56,'\n',9,35,101,110,100,105,102,'\n',35,101,110,100,105, 102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,99,111,109,109,117,110,105,99,97,116,105,111, 110,'\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n', 35,105,102,32,100,101,102,105,110,101,100,40,95,95,83,80, 89,41,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,67,79,85,84,41,'\n',9,35,105,102,32,100,101,102,105, 110,101,100,40,95,95,83,80,89,41,'\n',9,9,35,100,101, 102,105,110,101,32,86,76,76,40,41,9,9,64,40,48,120, 102,48,48,48,48,41,9,47,47,32,114,101,97,100,32,116, 104,101,32,109,101,115,115,97,103,101,32,98,117,102,102,101, 114,'\n',9,35,101,110,100,105,102,'\n',9,47,47,32,83,99, 111,117,116,32,97,110,100,32,83,112,121,98,111,116,32,99, 97,110,32,115,101,110,100,32,86,76,76,32,99,111,109,109, 97,110,100,115,'\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,110,100,86,76,76,40,99,111,110,115, 116,32,105,110,116,32,38,120,41,9,123,32,97,115,109,32, 123,32,48,120,101,50,44,32,36,120,32,58,32,95,95,65, 83,77,95,83,77,65,76,76,95,86,65,76,85,69,32,43, 32,95,95,65,83,77,95,83,82,67,95,66,65,83,73,67, 125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105, 102,32,100,101,102,105,110,101,100,40,95,95,82,67,88,41, 32,124,124,32,100,101,102,105,110,101,100,40,95,95,83,67, 79,85,84,41,32,124,124,32,100,101,102,105,110,101,100,40, 95,95,83,87,65,78,41,'\n',9,47,47,32,83,99,111,117, 116,32,97,110,100,32,82,67,88,32,104,97,118,101,32,73, 82,32,109,101,115,115,97,103,101,32,99,97,112,97,98,105, 108,105,116,121,'\n',9,35,100,101,102,105,110,101,32,77,101, 115,115,97,103,101,40,41,9,9,9,64,40,48,120,102,48, 48,48,48,41,9,47,47,32,114,101,97,100,32,116,104,101, 32,109,101,115,115,97,103,101,32,98,117,102,102,101,114,'\n', '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,110,100,77,101,115,115,97,103,101,40,99,111,110,115, 116,32,105,110,116,32,38,118,41,9,123,32,97,115,109,32, 123,32,48,120,98,50,44,32,36,118,32,58,32,95,95,65, 83,77,95,83,77,65,76,76,95,86,65,76,85,69,32,43, 32,95,95,65,83,77,95,83,82,67,95,66,65,83,73,67, 125,59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,67,108,101,97,114,77,101,115,115,97,103,101, 40,41,9,9,123,32,97,115,109,32,123,32,48,120,57,48, 32,125,59,32,125,'\n','\n',9,35,105,102,32,95,95,82,67, 88,61,61,50,32,124,124,32,100,101,102,105,110,101,100,40, 95,95,83,87,65,78,41,'\n',9,9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,77,101,115,115,97, 103,101,40,99,111,110,115,116,32,105,110,116,32,109,41,9, 123,32,97,115,109,32,123,32,48,120,102,55,44,32,109,32, 125,59,32,125,'\n',9,35,101,110,100,105,102,'\n','\n','\n',9, 35,105,102,32,100,101,102,105,110,101,100,40,95,95,83,87, 65,78,41,'\n',9,9,35,100,101,102,105,110,101,32,77,101, 115,115,97,103,101,80,97,114,97,109,40,41,9,9,64,40, 48,120,102,48,48,48,49,41,32,47,47,32,114,101,97,100, 32,116,104,101,32,109,115,103,32,112,97,114,97,109,'\n',9, 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,110,100,77,101,115,115,97,103,101,87,105,116,104,80,97, 114,97,109,40,99,111,110,115,116,32,105,110,116,32,38,109, 44,32,99,111,110,115,116,32,105,110,116,32,38,112,41,'\n', 9,9,32,32,123,32,97,115,109,32,123,32,48,120,99,51, 44,32,36,109,32,58,32,95,95,65,83,77,95,83,77,65, 76,76,95,86,65,76,85,69,32,43,32,95,95,65,83,77, 95,83,82,67,95,69,88,84,44,32,36,112,32,58,32,95, 95,65,83,77,95,83,82,67,95,69,88,84,125,59,32,125, '\n',9,9,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,77,101,115,115,97,103,101,66,121,116,101,80, 97,114,97,109,40,99,111,110,115,116,32,105,110,116,32,109, 44,32,99,111,110,115,116,32,105,110,116,32,112,41,32,123, 32,97,115,109,32,123,32,48,120,97,50,44,32,109,44,32, 112,125,59,32,125,'\n',9,9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,77,101,115,115,97,103,101, 87,111,114,100,80,97,114,97,109,40,99,111,110,115,116,32, 105,110,116,32,109,44,32,99,111,110,115,116,32,105,110,116, 32,112,41,32,123,32,97,115,109,32,123,32,48,120,98,51, 44,32,109,44,32,112,44,32,112,62,62,56,125,59,32,125, '\n',9,9,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,77,101,115,115,97,103,101,86,97,114,105,97, 98,108,101,80,97,114,97,109,40,99,111,110,115,116,32,105, 110,116,32,38,109,44,32,99,111,110,115,116,32,105,110,116, 32,38,112,41,'\n',9,9,32,32,123,32,97,115,109,32,123, 32,48,120,99,52,44,32,36,109,32,58,32,95,95,65,83, 77,95,83,77,65,76,76,95,86,65,76,85,69,32,43,32, 95,95,65,83,77,95,83,82,67,95,69,88,84,44,32,36, 112,32,58,32,95,95,65,83,77,95,83,82,67,95,69,88, 84,125,59,32,125,'\n',9,35,101,110,100,105,102,'\n','\n',35, 101,110,100,105,102,'\n','\n','\n',35,105,102,32,95,95,82,67, 88,61,61,50,32,124,124,32,100,101,102,105,110,101,100,40, 95,95,83,80,89,41,32,124,124,32,100,101,102,105,110,101, 100,40,95,95,83,87,65,78,41,'\n',32,32,35,105,102,32, 95,95,82,67,88,61,61,50,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,87,65,78,41,'\n',9,47,47,32, 115,101,114,105,97,108,32,99,111,109,109,117,110,105,99,97, 116,105,111,110,32,115,111,117,114,99,101,115,'\n',9,35,100, 101,102,105,110,101,32,83,101,114,105,97,108,80,97,99,107, 101,116,40,41,9,64,40,48,120,50,49,48,48,49,48,41, '\n',9,35,100,101,102,105,110,101,32,83,101,114,105,97,108, 67,111,109,109,40,41,9,64,40,48,120,50,49,48,48,49, 49,41,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,83,101,114,105,97,108,80,97,99,107,101, 116,40,99,111,110,115,116,32,105,110,116,32,38,118,41,9, 123,32,83,101,116,40,83,101,114,105,97,108,80,97,99,107, 101,116,40,41,44,32,118,41,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,83,101, 114,105,97,108,67,111,109,109,40,99,111,110,115,116,32,105, 110,116,32,38,118,41,9,123,32,83,101,116,40,83,101,114, 105,97,108,67,111,109,109,40,41,44,32,118,41,59,32,125, '\n','\n',9,47,47,32,118,97,108,117,101,115,32,102,111,114, 32,83,101,114,80,97,99,107,101,116,'\n',9,35,100,101,102, 105,110,101,32,83,69,82,73,65,76,95,80,65,67,75,69, 84,95,68,69,70,65,85,76,84,9,48,9,47,47,32,114, 97,119,32,115,101,114,105,97,108,44,32,110,111,32,99,104, 101,99,107,115,117,109,44,32,110,111,32,112,114,101,97,109, 98,108,101,'\n',9,35,100,101,102,105,110,101,32,83,69,82, 73,65,76,95,80,65,67,75,69,84,95,80,82,69,65,77, 66,76,69,9,49,'\n',9,35,100,101,102,105,110,101,32,83, 69,82,73,65,76,95,80,65,67,75,69,84,95,78,69,71, 65,84,69,68,9,50,9,47,47,32,105,110,99,108,117,100, 101,115,32,99,104,101,99,107,115,117,109,'\n',9,35,100,101, 102,105,110,101,32,83,69,82,73,65,76,95,80,65,67,75, 69,84,95,67,72,69,67,75,83,85,77,9,52,9,47,47, 32,117,115,101,32,116,104,105,115,32,102,111,114,32,99,104, 101,99,107,115,117,109,32,119,47,111,32,110,101,103,97,116, 101,100,'\n','\n',9,35,100,101,102,105,110,101,32,83,69,82, 73,65,76,95,80,65,67,75,69,84,95,82,67,88,9,40, 83,69,82,73,65,76,95,80,65,67,75,69,84,95,80,82, 69,65,77,66,76,69,32,43,32,83,69,82,73,65,76,95, 80,65,67,75,69,84,95,78,69,71,65,84,69,68,41,'\n', 9,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 80,65,67,75,69,84,95,82,67,9,48,9,47,47,32,100, 101,102,97,117,108,116,'\n',9,35,100,101,102,105,110,101,32, 83,69,82,73,65,76,95,80,65,67,75,69,84,95,83,80, 89,66,79,84,9,48,'\n','\n',9,47,47,32,118,97,108,117, 101,115,32,102,111,114,32,83,101,114,67,111,109,109,'\n',9, 35,100,101,102,105,110,101,32,83,69,82,73,65,76,95,67, 79,77,77,95,68,69,70,65,85,76,84,9,48,'\n',9,35, 100,101,102,105,110,101,32,83,69,82,73,65,76,95,67,79, 77,77,95,52,56,48,48,9,49,9,47,47,32,100,101,102, 97,117,108,116,32,105,115,32,50,52,48,48,32,98,97,117, 100,'\n',9,35,100,101,102,105,110,101,32,83,69,82,73,65, 76,95,67,79,77,77,95,55,54,75,72,90,9,50,9,47, 47,32,100,101,102,97,117,108,116,32,105,115,32,51,56,107, 72,122,'\n',9,35,100,101,102,105,110,101,32,83,69,82,73, 65,76,95,67,79,77,77,95,68,85,84,89,50,53,9,52, 9,47,47,32,100,101,102,97,117,108,116,32,105,115,32,53, 48,37,32,100,117,116,121,32,99,121,99,108,101,'\n','\n',9, 35,100,101,102,105,110,101,32,83,69,82,73,65,76,95,67, 79,77,77,95,82,67,88,9,9,48,'\n',9,35,100,101,102, 105,110,101,32,83,69,82,73,65,76,95,67,79,77,77,95, 82,67,9,9,55,9,47,47,32,52,56,48,48,47,55,54, 75,72,90,47,50,53,37,'\n',9,35,100,101,102,105,110,101, 32,83,69,82,73,65,76,95,67,79,77,77,95,83,80,89, 66,79,84,9,55,9,47,47,32,119,97,115,32,83,69,82, 73,65,76,95,67,79,77,77,95,52,56,48,48,32,43,32, 83,69,82,73,65,76,95,67,79,77,77,95,55,54,75,72, 90,'\n','\n',9,35,105,102,100,101,102,32,95,95,83,87,65, 78,'\n',9,9,35,100,101,102,105,110,101,32,83,69,82,73, 65,76,95,67,79,77,77,95,57,54,48,48,9,56,'\n',9, 9,35,100,101,102,105,110,101,32,68,101,102,97,117,108,116, 83,101,114,105,97,108,80,97,99,107,101,116,40,41,9,64, 40,48,120,50,49,48,48,49,50,41,'\n',9,9,35,100,101, 102,105,110,101,32,68,101,102,97,117,108,116,83,101,114,105, 97,108,67,111,109,109,40,41,9,64,40,48,120,50,49,48, 48,49,51,41,'\n',9,9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,68,101,102,97,117,108,116,83, 101,114,105,97,108,80,97,99,107,101,116,40,99,111,110,115, 116,32,105,110,116,32,38,118,41,9,123,32,83,101,116,40, 68,101,102,97,117,108,116,83,101,114,105,97,108,80,97,99, 107,101,116,40,41,44,32,118,41,59,32,125,'\n',9,9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 68,101,102,97,117,108,116,83,101,114,105,97,108,67,111,109, 109,40,99,111,110,115,116,32,105,110,116,32,38,118,41,9, 123,32,83,101,116,40,68,101,102,97,117,108,116,83,101,114, 105,97,108,67,111,109,109,40,41,44,32,118,41,59,32,125, '\n',9,35,101,110,100,105,102,'\n','\n',9,47,47,32,65,80, 73,32,102,111,114,32,105,110,116,101,114,97,99,116,105,110, 103,32,119,105,116,104,32,83,112,121,98,111,116,32,97,110, 100,32,111,116,104,101,114,32,82,67,32,99,111,109,112,111, 110,101,110,116,115,'\n',9,35,100,101,102,105,110,101,32,77, 83,71,95,66,82,79,65,68,67,65,83,84,9,48,120,56, 97,'\n',9,35,100,101,102,105,110,101,32,77,83,71,95,76, 73,78,75,67,65,83,84,9,48,120,56,57,'\n',9,35,100, 101,102,105,110,101,32,77,83,71,95,68,73,82,69,67,84, 9,48,120,56,56,'\n','\n',9,47,47,32,98,97,115,101,32, 97,100,100,114,101,115,115,101,115,32,102,111,114,32,117,97, 114,116,32,100,97,116,97,'\n',9,35,100,101,102,105,110,101, 32,85,65,82,84,95,66,79,84,9,48,'\n',9,35,100,101, 102,105,110,101,32,85,65,82,84,95,67,84,82,76,9,55, '\n',9,35,100,101,102,105,110,101,32,85,65,82,84,95,80, 73,78,71,9,57,'\n',9,35,100,101,102,105,110,101,32,85, 65,82,84,95,82,67,9,9,49,49,'\n','\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,73,110,105,116,83, 112,121,98,111,116,67,111,109,109,40,41,'\n',9,123,'\n',9, 9,83,101,116,83,101,114,105,97,108,80,97,99,107,101,116, 40,83,69,82,73,65,76,95,80,65,67,75,69,84,95,83, 80,89,66,79,84,41,59,'\n',9,9,83,101,116,83,101,114, 105,97,108,67,111,109,109,40,83,69,82,73,65,76,95,67, 79,77,77,95,83,80,89,66,79,84,41,59,'\n',9,125,'\n', '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,110,100,83,112,121,98,111,116,77,115,103,40,41,9, 123,32,83,101,110,100,83,101,114,105,97,108,40,85,65,82, 84,95,66,79,84,44,32,55,41,59,32,125,'\n','\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 83,112,121,98,111,116,77,101,115,115,97,103,101,40,99,111, 110,115,116,32,105,110,116,32,38,110,77,111,100,101,44,32, 99,111,110,115,116,32,105,110,116,32,38,110,77,121,73,68, 44,'\n',9,32,32,99,111,110,115,116,32,105,110,116,32,38, 110,65,100,100,114,101,115,115,44,32,99,111,110,115,116,32, 105,110,116,32,38,110,67,109,100,44,32,99,111,110,115,116, 32,105,110,116,32,38,110,72,105,66,121,116,101,44,32,99, 111,110,115,116,32,105,110,116,32,38,110,76,111,66,121,116, 101,41,'\n',9,123,'\n',9,9,83,101,116,83,101,114,105,97, 108,68,97,116,97,40,85,65,82,84,95,66,79,84,43,48, 44,110,77,111,100,101,41,59,'\n',9,9,83,101,116,83,101, 114,105,97,108,68,97,116,97,40,85,65,82,84,95,66,79, 84,43,49,44,110,77,121,73,68,41,59,'\n',9,9,83,101, 116,83,101,114,105,97,108,68,97,116,97,40,85,65,82,84, 95,66,79,84,43,50,44,110,65,100,100,114,101,115,115,41, 59,'\n',9,9,83,101,116,83,101,114,105,97,108,68,97,116, 97,40,85,65,82,84,95,66,79,84,43,51,44,110,67,109, 100,41,59,'\n',9,9,83,101,116,83,101,114,105,97,108,68, 97,116,97,40,85,65,82,84,95,66,79,84,43,52,44,110, 72,105,66,121,116,101,41,59,'\n',9,9,83,101,116,83,101, 114,105,97,108,68,97,116,97,40,85,65,82,84,95,66,79, 84,43,53,44,110,76,111,66,121,116,101,41,59,'\n',9,9, 83,101,116,83,101,114,105,97,108,68,97,116,97,40,85,65, 82,84,95,66,79,84,43,54,44,48,45,110,77,111,100,101, 45,110,77,121,73,68,45,110,65,100,100,114,101,115,115,45, 110,67,109,100,45,110,72,105,66,121,116,101,45,110,76,111, 66,121,116,101,41,59,'\n',47,47,9,9,83,101,116,83,101, 114,105,97,108,68,97,116,97,40,85,65,82,84,95,66,79, 84,43,54,44,48,120,49,48,48,45,40,40,110,77,111,100, 101,43,110,77,121,73,68,43,110,65,100,100,114,101,115,115, 43,110,67,109,100,43,110,72,105,66,121,116,101,43,110,76, 111,66,121,116,101,41,38,48,120,102,102,41,41,59,'\n',9, 125,'\n','\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,110,100,83,112,121,98,111,116,77,101,115,115, 97,103,101,40,99,111,110,115,116,32,105,110,116,32,38,110, 77,111,100,101,44,32,99,111,110,115,116,32,105,110,116,32, 38,110,77,121,73,68,44,'\n',9,32,32,99,111,110,115,116, 32,105,110,116,32,38,110,65,100,100,114,101,115,115,44,32, 99,111,110,115,116,32,105,110,116,32,38,110,67,109,100,44, 32,99,111,110,115,116,32,105,110,116,32,38,110,72,105,66, 121,116,101,44,32,99,111,110,115,116,32,105,110,116,32,38, 110,76,111,66,121,116,101,41,'\n',9,123,'\n',9,9,73,110, 105,116,83,112,121,98,111,116,67,111,109,109,40,41,59,'\n', 9,9,83,101,116,83,112,121,98,111,116,77,101,115,115,97, 103,101,40,110,77,111,100,101,44,32,110,77,121,73,68,44, 32,110,65,100,100,114,101,115,115,44,32,110,67,109,100,44, 32,110,72,105,66,121,116,101,44,32,110,76,111,66,121,116, 101,41,59,'\n',9,9,83,101,110,100,83,112,121,98,111,116, 77,115,103,40,41,59,'\n',9,125,'\n','\n',9,47,47,32,83, 112,121,98,111,116,32,99,111,110,116,114,111,108,108,101,114, 32,99,111,109,109,97,110,100,115,'\n',9,35,100,101,102,105, 110,101,32,83,80,89,95,67,84,82,76,95,66,84,78,95, 49,9,48,120,48,49,'\n',9,35,100,101,102,105,110,101,32, 83,80,89,95,67,84,82,76,95,66,84,78,95,50,9,48, 120,48,50,'\n',9,35,100,101,102,105,110,101,32,83,80,89, 95,67,84,82,76,95,66,84,78,95,51,9,48,120,48,51, '\n',9,35,100,101,102,105,110,101,32,83,80,89,95,67,84, 82,76,95,66,84,78,95,52,9,48,120,48,52,'\n',9,35, 100,101,102,105,110,101,32,83,80,89,95,67,84,82,76,95, 66,84,78,95,53,9,48,120,48,53,'\n',9,35,100,101,102, 105,110,101,32,83,80,89,95,67,84,82,76,95,82,67,88, 95,49,9,48,120,48,54,9,47,47,82,67,88,32,116,111, 32,83,112,121,98,111,116,32,115,112,101,99,105,102,105,99, '\n',9,35,100,101,102,105,110,101,32,83,80,89,95,67,84, 82,76,95,82,67,88,95,50,9,48,120,48,55,'\n',9,35, 100,101,102,105,110,101,32,83,80,89,95,67,84,82,76,95, 82,67,88,95,51,9,48,120,48,56,'\n',9,35,100,101,102, 105,110,101,32,83,80,89,95,67,84,82,76,95,82,67,88, 95,52,9,48,120,48,57,'\n',9,35,100,101,102,105,110,101, 32,83,80,89,95,67,84,82,76,95,82,67,88,95,53,9, 48,120,48,97,'\n',9,35,100,101,102,105,110,101,32,83,80, 89,95,67,84,82,76,95,82,67,88,95,54,9,48,120,48, 98,'\n',9,35,100,101,102,105,110,101,32,83,80,89,95,67, 84,82,76,95,82,67,88,95,55,9,48,120,48,99,'\n',9, 35,100,101,102,105,110,101,32,83,80,89,95,67,84,82,76, 95,82,67,88,95,56,9,48,120,48,100,'\n','\n',9,35,100, 101,102,105,110,101,32,95,95,83,80,89,95,67,84,82,76, 95,67,77,68,9,48,120,57,48,'\n','\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,110,100,83,112, 121,98,111,116,67,116,114,108,77,115,103,40,41,9,123,32, 83,101,110,100,83,101,114,105,97,108,40,85,65,82,84,95, 67,84,82,76,44,32,50,41,59,32,125,'\n','\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 112,121,98,111,116,67,116,114,108,77,101,115,115,97,103,101, 40,99,111,110,115,116,32,105,110,116,32,38,110,77,121,73, 68,44,32,99,111,110,115,116,32,105,110,116,32,38,110,77, 115,103,41,'\n',9,123,'\n',9,9,83,101,116,83,101,114,105, 97,108,68,97,116,97,40,85,65,82,84,95,67,84,82,76, 43,48,44,95,95,83,80,89,95,67,84,82,76,95,67,77, 68,43,110,77,121,73,68,41,59,'\n',9,9,83,101,116,83, 101,114,105,97,108,68,97,116,97,40,85,65,82,84,95,67, 84,82,76,43,49,44,40,110,77,115,103,32,42,32,49,54, 41,32,43,32,40,40,48,32,45,32,40,40,95,95,83,80, 89,95,67,84,82,76,95,67,77,68,43,110,77,121,73,68, 41,32,47,32,49,54,41,32,45,32,40,95,95,83,80,89, 95,67,84,82,76,95,67,77,68,43,110,77,121,73,68,41, 32,45,32,110,77,115,103,41,32,38,32,48,120,48,102,41, 41,59,'\n',9,125,'\n','\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,110,100,83,112,121,98,111,116, 67,116,114,108,77,101,115,115,97,103,101,40,99,111,110,115, 116,32,105,110,116,32,38,110,77,121,73,68,44,32,99,111, 110,115,116,32,105,110,116,32,38,110,77,115,103,41,'\n',9, 123,'\n',9,9,73,110,105,116,83,112,121,98,111,116,67,111, 109,109,40,41,59,'\n',9,9,83,101,116,83,112,121,98,111, 116,67,116,114,108,77,101,115,115,97,103,101,40,110,77,121, 73,68,44,32,110,77,115,103,41,59,'\n',9,9,83,101,110, 100,83,112,121,98,111,116,67,116,114,108,77,115,103,40,41, 59,'\n',9,125,'\n','\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,110,100,83,112,121,98,111,116,67, 116,114,108,80,105,110,103,77,115,103,40,41,9,123,32,83, 101,110,100,83,101,114,105,97,108,40,85,65,82,84,95,80, 73,78,71,44,32,50,41,59,32,125,'\n','\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,83,112, 121,98,111,116,67,116,114,108,80,105,110,103,77,101,115,115, 97,103,101,40,99,111,110,115,116,32,105,110,116,32,38,110, 73,68,41,'\n',9,123,'\n',9,9,83,101,116,83,101,114,105, 97,108,68,97,116,97,40,85,65,82,84,95,80,73,78,71, 43,48,44,95,95,83,80,89,95,67,84,82,76,95,67,77, 68,43,110,73,68,41,59,'\n',9,9,83,101,116,83,101,114, 105,97,108,68,97,116,97,40,85,65,82,84,95,80,73,78, 71,43,49,44,40,48,32,45,32,40,40,95,95,83,80,89, 95,67,84,82,76,95,67,77,68,43,110,73,68,41,32,47, 32,49,54,41,32,45,32,40,95,95,83,80,89,95,67,84, 82,76,95,67,77,68,43,110,73,68,41,41,32,38,32,48, 120,48,102,41,59,'\n',9,125,'\n','\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,110,100,83,112,121, 98,111,116,67,116,114,108,80,105,110,103,77,101,115,115,97, 103,101,40,99,111,110,115,116,32,105,110,116,32,38,110,73, 68,41,'\n',9,123,'\n',9,9,73,110,105,116,83,112,121,98, 111,116,67,111,109,109,40,41,59,'\n',9,9,83,101,116,83, 112,121,98,111,116,67,116,114,108,80,105,110,103,77,101,115, 115,97,103,101,40,110,73,68,41,59,'\n',9,9,83,101,110, 100,83,112,121,98,111,116,67,116,114,108,80,105,110,103,77, 115,103,40,41,59,'\n',9,125,'\n','\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,110,100,83,112,121, 98,111,116,80,105,110,103,77,115,103,40,41,9,123,32,83, 101,110,100,83,101,114,105,97,108,40,85,65,82,84,95,80, 73,78,71,44,32,52,41,59,32,125,'\n','\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,83,112, 121,98,111,116,80,105,110,103,40,99,111,110,115,116,32,105, 110,116,32,38,110,76,105,110,107,73,68,44,32,99,111,110, 115,116,32,105,110,116,32,38,110,77,121,73,68,44,32,99, 111,110,115,116,32,105,110,116,32,38,110,73,110,102,111,41, '\n',9,123,'\n',9,9,83,101,116,83,101,114,105,97,108,68, 97,116,97,40,85,65,82,84,95,80,73,78,71,43,48,44, 48,120,56,48,43,40,110,76,105,110,107,73,68,38,48,120, 55,41,41,59,'\n',9,9,83,101,116,83,101,114,105,97,108, 68,97,116,97,40,85,65,82,84,95,80,73,78,71,43,49, 44,110,77,121,73,68,41,59,'\n',9,9,83,101,116,83,101, 114,105,97,108,68,97,116,97,40,85,65,82,84,95,80,73, 78,71,43,50,44,110,73,110,102,111,41,59,'\n',9,9,83, 101,116,83,101,114,105,97,108,68,97,116,97,40,85,65,82, 84,95,80,73,78,71,43,51,44,48,45,40,48,120,56,48, 43,40,110,76,105,110,107,73,68,38,48,120,55,41,41,45, 110,77,121,73,68,45,110,73,110,102,111,41,59,'\n',47,47, 9,9,83,101,116,83,101,114,105,97,108,68,97,116,97,40, 85,65,82,84,95,80,73,78,71,43,51,44,48,120,49,48, 48,45,40,40,48,120,56,48,43,40,110,76,105,110,107,73, 68,38,48,120,55,41,43,110,77,121,73,68,43,110,73,110, 102,111,41,38,48,120,102,102,41,41,59,'\n',9,125,'\n','\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,110,100,83,112,121,98,111,116,80,105,110,103,40,99,111, 110,115,116,32,105,110,116,32,38,110,76,105,110,107,73,68, 44,32,99,111,110,115,116,32,105,110,116,32,38,110,77,121, 73,68,44,32,99,111,110,115,116,32,105,110,116,32,38,110, 73,110,102,111,41,'\n',9,123,'\n',9,9,73,110,105,116,83, 112,121,98,111,116,67,111,109,109,40,41,59,'\n',9,9,83, 101,116,83,112,121,98,111,116,80,105,110,103,40,110,76,105, 110,107,73,68,44,32,110,77,121,73,68,44,32,110,73,110, 102,111,41,59,'\n',9,9,83,101,110,100,83,112,121,98,111, 116,80,105,110,103,77,115,103,40,41,59,'\n',9,125,'\n','\n', 9,47,47,32,82,67,32,99,104,97,110,110,101,108,115,32, 97,110,100,32,99,111,109,109,97,110,100,115,'\n',9,35,100, 101,102,105,110,101,32,82,67,95,67,72,65,78,78,69,76, 95,49,9,48,120,53,48,'\n',9,35,100,101,102,105,110,101, 32,82,67,95,67,72,65,78,78,69,76,95,50,9,48,120, 54,48,'\n',9,35,100,101,102,105,110,101,32,82,67,95,67, 72,65,78,78,69,76,95,51,9,48,120,55,48,'\n','\n',9, 35,100,101,102,105,110,101,32,82,67,95,67,77,68,95,70, 76,79,65,84,9,48,120,48,48,'\n',9,35,100,101,102,105, 110,101,32,82,67,95,67,77,68,95,70,87,68,9,48,120, 48,55,'\n',9,35,100,101,102,105,110,101,32,82,67,95,67, 77,68,95,79,70,70,9,48,120,48,56,'\n',9,35,100,101, 102,105,110,101,32,82,67,95,67,77,68,95,82,69,86,9, 48,120,48,102,'\n','\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,73,110,105,116,82,67,67,111,109,109,40, 41,'\n',9,123,'\n',9,9,83,101,116,83,101,114,105,97,108, 80,97,99,107,101,116,40,83,69,82,73,65,76,95,80,65, 67,75,69,84,95,82,67,41,59,'\n',9,9,83,101,116,83, 101,114,105,97,108,67,111,109,109,40,83,69,82,73,65,76, 95,67,79,77,77,95,82,67,41,59,'\n',9,125,'\n','\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 110,100,82,67,77,115,103,40,41,9,123,32,83,101,110,100, 83,101,114,105,97,108,40,85,65,82,84,95,82,67,44,32, 50,41,59,32,125,'\n','\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,82,67,77,101,115,115,97, 103,101,40,99,111,110,115,116,32,105,110,116,32,38,110,67, 104,97,110,110,101,108,44,32,99,111,110,115,116,32,105,110, 116,32,38,110,76,101,102,116,44,32,99,111,110,115,116,32, 105,110,116,32,38,110,82,105,103,104,116,41,'\n',9,123,'\n', 9,9,83,101,116,83,101,114,105,97,108,68,97,116,97,40, 85,65,82,84,95,82,67,43,48,44,110,67,104,97,110,110, 101,108,32,43,32,110,76,101,102,116,41,59,'\n',9,9,83, 101,116,83,101,114,105,97,108,68,97,116,97,40,85,65,82, 84,95,82,67,43,49,44,40,110,82,105,103,104,116,32,42, 32,49,54,41,32,43,32,40,40,48,32,45,32,110,82,105, 103,104,116,32,45,32,110,76,101,102,116,32,45,32,40,110, 67,104,97,110,110,101,108,32,47,32,49,54,41,41,32,38, 32,48,120,48,102,41,41,59,'\n',9,125,'\n','\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,110,100, 82,67,77,101,115,115,97,103,101,40,99,111,110,115,116,32, 105,110,116,32,38,110,67,104,97,110,110,101,108,44,32,99, 111,110,115,116,32,105,110,116,32,38,110,76,101,102,116,44, 32,99,111,110,115,116,32,105,110,116,32,38,110,82,105,103, 104,116,41,'\n',9,123,'\n',9,9,73,110,105,116,82,67,67, 111,109,109,40,41,59,'\n',9,9,83,101,116,82,67,77,101, 115,115,97,103,101,40,110,67,104,97,110,110,101,108,44,32, 110,76,101,102,116,44,32,110,82,105,103,104,116,41,59,'\n', 9,9,83,101,110,100,82,67,77,115,103,40,41,59,'\n',9, 125,'\n','\n','\n',32,32,35,101,110,100,105,102,'\n','\n',32,32, 47,47,32,76,105,110,107,32,73,68,32,99,111,110,115,116, 97,110,116,115,32,102,111,114,32,82,67,88,50,47,83,119, 97,110,32,83,101,110,100,83,112,121,98,111,116,80,105,110, 103,32,97,110,100,32,83,112,121,98,111,116,32,65,80,73, '\n',32,32,35,100,101,102,105,110,101,32,73,68,95,78,79, 78,69,9,48,'\n',32,32,35,100,101,102,105,110,101,32,73, 68,95,67,84,82,76,95,49,9,49,'\n',32,32,35,100,101, 102,105,110,101,32,73,68,95,67,84,82,76,95,50,9,50, '\n',32,32,35,100,101,102,105,110,101,32,73,68,95,67,84, 82,76,95,51,9,51,'\n',32,32,35,100,101,102,105,110,101, 32,73,68,95,67,84,82,76,95,52,9,52,'\n',32,32,35, 100,101,102,105,110,101,32,73,68,95,67,84,82,76,95,53, 9,53,'\n',32,32,35,100,101,102,105,110,101,32,73,68,95, 67,84,82,76,95,54,9,54,'\n',32,32,35,100,101,102,105, 110,101,32,73,68,95,80,67,9,9,55,'\n','\n',32,32,47, 47,32,109,121,32,114,111,98,111,116,32,73,68,32,109,105, 110,32,97,110,100,32,109,97,120,32,118,97,108,117,101,115, '\n',32,32,35,100,101,102,105,110,101,32,73,68,95,66,79, 84,95,77,73,78,9,56,'\n',32,32,35,100,101,102,105,110, 101,32,73,68,95,66,79,84,95,77,65,88,9,50,53,53, '\n','\n',32,32,47,47,32,99,111,109,109,97,110,100,115,'\n', 32,32,35,100,101,102,105,110,101,32,67,77,68,95,84,89, 80,69,95,77,65,83,75,9,9,48,120,48,48,102,48,'\n', '\n',32,32,35,100,101,102,105,110,101,32,67,77,68,95,84, 89,80,69,95,71,65,77,69,9,9,48,120,49,48,'\n',32, 32,35,100,101,102,105,110,101,32,67,77,68,95,71,65,77, 69,95,83,84,65,82,84,9,48,120,49,48,'\n',32,32,35, 100,101,102,105,110,101,32,67,77,68,95,71,65,77,69,95, 67,79,77,77,65,78,68,9,48,120,49,49,'\n',32,32,35, 100,101,102,105,110,101,32,67,77,68,95,71,65,77,69,95, 71,69,84,86,65,82,9,48,120,49,50,'\n',32,32,35,100, 101,102,105,110,101,32,67,77,68,95,71,65,77,69,95,86, 65,76,85,69,9,48,120,49,51,'\n',32,32,35,100,101,102, 105,110,101,32,67,77,68,95,71,65,77,69,95,87,73,78, 9,9,48,120,49,52,'\n',32,32,35,100,101,102,105,110,101, 32,67,77,68,95,71,65,77,69,95,76,79,83,69,9,9, 48,120,49,53,'\n',32,32,35,100,101,102,105,110,101,32,67, 77,68,95,71,65,77,69,95,66,76,73,78,75,9,48,120, 49,54,'\n',32,32,35,100,101,102,105,110,101,32,67,77,68, 95,71,65,77,69,95,71,73,86,69,9,9,48,120,49,55, '\n',32,32,35,100,101,102,105,110,101,32,67,77,68,95,71, 65,77,69,95,84,65,75,69,9,9,48,120,49,56,'\n','\n', 32,32,35,100,101,102,105,110,101,32,67,77,68,95,70,82, 79,77,95,82,67,88,50,9,9,48,120,49,102,'\n','\n',47, 47,102,105,114,101,32,99,111,109,109,97,110,100,32,112,114, 111,116,111,99,111,108,58,32,60,110,66,111,116,62,44,32, 48,120,50,48,32,43,32,60,102,105,114,101,67,111,109,109, 97,110,100,62,44,32,60,112,97,114,97,109,49,62,44,32, 60,112,97,114,97,109,50,62,'\n',47,47,9,9,112,97,114, 97,109,49,58,32,116,97,114,103,101,116,32,97,115,112,101, 99,116,32,40,105,101,32,102,114,111,110,116,44,32,98,97, 99,107,44,32,102,114,111,110,116,32,108,101,102,116,46,46, 46,41,'\n',47,47,9,9,112,97,114,97,109,50,58,32,115, 116,114,101,110,103,116,104,'\n',32,32,35,100,101,102,105,110, 101,32,67,77,68,95,84,89,80,69,95,70,73,82,69,9, 9,48,120,50,48,'\n',32,32,35,100,101,102,105,110,101,32, 67,77,68,95,70,73,82,69,95,76,65,83,69,82,9,48, 120,50,49,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,70,73,82,69,95,83,80,73,78,78,69,82,9,48, 120,50,50,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,70,73,82,69,95,69,76,69,67,84,82,79,78,69, 84,9,48,120,50,51,'\n','\n',47,47,114,101,97,99,116,32, 116,111,32,115,112,101,99,105,97,108,32,97,98,105,108,105, 116,121,32,99,111,109,109,97,110,100,32,112,114,111,116,111, 99,111,108,58,32,60,110,66,111,116,62,44,32,48,120,51, 48,32,43,32,60,115,112,101,99,105,101,115,62,44,32,60, 112,97,114,97,109,49,62,44,32,60,112,97,114,97,109,50, 62,'\n',47,47,9,9,112,97,114,97,109,49,58,32,114,97, 110,103,101,'\n',47,47,9,9,112,97,114,97,109,50,58,32, 115,116,114,101,110,103,116,104,47,116,105,109,101,'\n',32,32, 35,100,101,102,105,110,101,32,67,77,68,95,84,89,80,69, 95,82,69,65,67,84,95,84,79,9,9,48,120,51,48,'\n', 32,32,35,100,101,102,105,110,101,32,67,77,68,95,82,69, 65,67,84,95,84,79,95,71,73,71,65,77,69,83,72,9, 9,48,120,51,49,'\n',32,32,35,100,101,102,105,110,101,32, 67,77,68,95,82,69,65,67,84,95,84,79,95,83,78,65, 80,84,82,65,88,9,9,48,120,51,50,'\n',32,32,35,100, 101,102,105,110,101,32,67,77,68,95,82,69,65,67,84,95, 84,79,95,83,72,65,68,79,87,83,84,82,73,75,69,9, 48,120,51,51,'\n',32,32,35,100,101,102,105,110,101,32,67, 77,68,95,82,69,65,67,84,95,84,79,95,84,69,67,72, 78,79,74,65,87,9,48,120,51,52,'\n','\n',47,47,97,99, 116,105,118,97,116,101,32,116,111,107,101,110,32,105,110,32, 97,110,111,116,104,101,114,32,98,111,116,32,116,101,108,108, 32,112,114,111,116,111,99,111,108,58,32,60,110,66,111,116, 62,44,32,48,120,52,48,32,43,32,60,115,112,101,99,105, 101,115,62,44,32,60,112,97,114,97,109,49,62,44,32,60, 112,97,114,97,109,50,62,'\n',47,47,9,9,112,97,114,97, 109,49,58,32,48,'\n',47,47,9,9,112,97,114,97,109,50, 58,32,116,105,109,101,'\n',32,32,35,100,101,102,105,110,101, 32,67,77,68,95,84,89,80,69,95,84,69,76,76,9,9, 120,48,52,48,'\n',32,32,35,100,101,102,105,110,101,32,67, 77,68,95,84,69,76,76,95,77,65,71,78,69,84,9,48, 120,52,49,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,84,69,76,76,95,82,69,80,85,76,83,69,9,48, 120,52,50,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,84,69,76,76,95,70,76,65,83,72,66,76,73,78, 68,9,48,120,52,51,'\n',32,32,35,100,101,102,105,110,101, 32,67,77,68,95,84,69,76,76,95,70,82,69,69,90,69, 9,48,120,52,52,'\n',32,32,35,100,101,102,105,110,101,32, 67,77,68,95,84,69,76,76,95,83,76,79,87,9,9,48, 120,52,53,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,84,69,76,76,95,82,69,86,69,82,83,69,9,48, 120,52,54,'\n',32,32,35,100,101,102,105,110,101,32,67,77, 68,95,84,69,76,76,95,68,73,90,90,89,9,48,120,52, 55,'\n',32,32,35,100,101,102,105,110,101,32,67,77,68,95, 84,69,76,76,95,84,65,75,69,67,79,78,84,82,79,76, 9,48,120,52,56,'\n','\n',32,32,35,100,101,102,105,110,101, 32,67,77,68,95,84,89,80,69,95,85,83,69,82,9,9, 48,120,53,48,'\n',32,32,35,100,101,102,105,110,101,32,67, 77,68,95,84,89,80,69,95,83,80,65,82,69,9,48,120, 54,48,'\n',32,32,35,100,101,102,105,110,101,32,67,77,68, 95,83,77,65,82,84,95,66,79,77,66,9,48,120,54,49, '\n',32,32,35,100,101,102,105,110,101,32,67,77,68,95,84, 89,80,69,95,86,76,76,9,9,48,120,55,48,'\n','\n','\n', '\n',32,32,35,100,101,102,105,110,101,32,83,101,114,105,97, 108,68,97,116,97,40,110,41,9,64,40,48,120,50,49,48, 48,48,48,32,43,32,40,110,41,41,32,47,47,32,100,97, 116,97,32,102,111,114,32,83,101,110,100,83,101,114,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,83,101,114,105,97,108,68,97,116,97,40,99,111,110, 115,116,32,105,110,116,32,110,44,32,99,111,110,115,116,32, 105,110,116,32,38,118,41,9,123,32,83,101,116,40,83,101, 114,105,97,108,68,97,116,97,40,110,41,44,32,118,41,59, 32,125,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,110,100,83,101,114,105,97,108,40,99,111, 110,115,116,32,105,110,116,32,102,105,114,115,116,44,32,99, 111,110,115,116,32,105,110,116,32,99,111,117,110,116,41,9, 123,32,97,115,109,32,123,32,48,120,99,50,44,32,102,105, 114,115,116,44,32,99,111,117,110,116,32,125,59,32,125,'\n', '\n',32,32,35,105,102,32,100,101,102,105,110,101,100,40,95, 95,83,80,89,41,'\n','\n',9,35,100,101,102,105,110,101,32, 83,69,82,73,65,76,95,84,89,80,69,9,9,48,120,49, 48,'\n',9,35,100,101,102,105,110,101,32,83,69,82,73,65, 76,95,84,89,80,69,95,83,80,89,66,79,84,9,48,'\n', 9,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 84,89,80,69,95,82,67,88,9,9,49,'\n',9,35,100,101, 102,105,110,101,32,83,69,82,73,65,76,95,84,89,80,69, 95,82,67,9,9,50,'\n',9,35,100,101,102,105,110,101,32, 83,69,82,73,65,76,95,84,89,80,69,95,85,83,69,82, 9,51,'\n',9,35,100,101,102,105,110,101,32,83,101,114,105, 97,108,84,121,112,101,40,41,32,64,40,48,120,50,49,48, 48,49,48,41,'\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,101,114,105,97,108,84,121,112, 101,40,99,111,110,115,116,32,105,110,116,32,38,116,41,32, 123,32,83,101,116,40,83,101,114,105,97,108,84,121,112,101, 40,41,44,32,116,41,59,32,125,'\n','\n',9,35,100,101,102, 105,110,101,32,83,69,82,73,65,76,95,66,65,85,68,9, 9,48,120,49,49,'\n',9,35,100,101,102,105,110,101,32,83, 69,82,73,65,76,95,66,65,85,68,95,50,52,48,48,9, 48,'\n',9,35,100,101,102,105,110,101,32,83,69,82,73,65, 76,95,66,65,85,68,95,52,56,48,48,9,49,'\n',9,35, 100,101,102,105,110,101,32,83,69,82,73,65,76,95,66,65, 85,68,95,57,54,48,48,9,50,'\n',9,35,100,101,102,105, 110,101,32,83,101,114,105,97,108,66,97,117,100,40,41,32, 64,40,48,120,50,49,48,48,49,49,41,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,83,101, 114,105,97,108,66,97,117,100,40,99,111,110,115,116,32,105, 110,116,32,38,98,41,32,123,32,83,101,116,40,83,101,114, 105,97,108,66,97,117,100,40,41,44,32,98,41,59,32,125, '\n','\n',9,35,100,101,102,105,110,101,32,83,69,82,73,65, 76,95,67,72,65,78,78,69,76,9,9,48,120,49,50,'\n', 9,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 67,72,65,78,78,69,76,95,73,82,9,48,'\n',9,35,100, 101,102,105,110,101,32,83,69,82,73,65,76,95,67,72,65, 78,78,69,76,95,80,67,9,49,'\n',9,35,100,101,102,105, 110,101,32,83,101,114,105,97,108,67,104,97,110,110,101,108, 40,41,32,64,40,48,120,50,49,48,48,49,50,41,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,83,101,114,105,97,108,67,104,97,110,110,101,108,40,99, 111,110,115,116,32,105,110,116,32,38,99,41,32,123,32,83, 101,116,40,83,101,114,105,97,108,67,104,97,110,110,101,108, 40,41,44,32,99,41,59,32,125,'\n','\n',9,35,100,101,102, 105,110,101,32,83,69,82,73,65,76,95,80,82,69,65,77, 66,76,69,95,80,79,83,9,48,120,49,51,'\n',9,35,100, 101,102,105,110,101,32,83,101,114,105,97,108,80,114,101,97, 109,98,108,101,80,111,115,40,41,32,64,40,48,120,50,49, 48,48,49,51,41,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,83,101,114,105,97,108,80,114, 101,97,109,98,108,101,80,111,115,40,99,111,110,115,116,32, 105,110,116,32,38,112,41,32,123,32,83,101,116,40,83,101, 114,105,97,108,80,114,101,97,109,98,108,101,80,111,115,40, 41,44,32,112,41,59,32,125,'\n','\n',9,35,100,101,102,105, 110,101,32,83,69,82,73,65,76,95,80,82,69,65,77,66, 76,69,95,76,69,78,9,48,120,49,52,'\n',9,35,100,101, 102,105,110,101,32,83,101,114,105,97,108,80,114,101,97,109, 98,108,101,76,101,110,40,41,32,64,40,48,120,50,49,48, 48,49,52,41,'\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,101,114,105,97,108,80,114,101, 97,109,98,108,101,76,101,110,40,99,111,110,115,116,32,105, 110,116,32,38,108,41,32,123,32,83,101,116,40,83,101,114, 105,97,108,80,114,101,97,109,98,108,101,76,101,110,40,41, 44,32,108,41,59,32,125,'\n','\n',9,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,67,72,69,67,75,83,85, 77,9,9,48,120,49,53,'\n',9,35,100,101,102,105,110,101, 32,83,69,82,73,65,76,95,67,72,69,67,75,83,85,77, 95,78,79,78,69,9,48,'\n',9,35,100,101,102,105,110,101, 32,83,69,82,73,65,76,95,67,72,69,67,75,83,85,77, 95,83,85,77,9,48,120,48,52,'\n',9,35,100,101,102,105, 110,101,32,83,69,82,73,65,76,95,67,72,69,67,75,83, 85,77,95,90,69,82,79,95,83,85,77,9,48,120,48,56, '\n',9,35,100,101,102,105,110,101,32,83,101,114,105,97,108, 67,104,101,99,107,115,117,109,40,41,32,64,40,48,120,50, 49,48,48,49,53,41,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,83,101,114,105,97,108,67, 104,101,99,107,115,117,109,40,99,111,110,115,116,32,105,110, 116,32,38,110,41,32,123,32,83,101,116,40,83,101,114,105, 97,108,67,104,101,99,107,115,117,109,40,41,44,32,110,41, 59,32,125,'\n','\n',9,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,66,73,80,72,65,83,69,9,9,48,120, 49,54,'\n',9,35,100,101,102,105,110,101,32,83,69,82,73, 65,76,95,66,73,80,72,65,83,69,95,79,70,70,9,48, '\n',9,35,100,101,102,105,110,101,32,83,69,82,73,65,76, 95,66,73,80,72,65,83,69,95,79,78,9,48,120,102,102, '\n',9,35,100,101,102,105,110,101,32,83,101,114,105,97,108, 66,105,80,104,97,115,101,40,41,32,64,40,48,120,50,49, 48,48,49,54,41,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,83,101,114,105,97,108,66,105, 80,104,97,115,101,40,99,111,110,115,116,32,105,110,116,32, 38,110,41,32,123,32,83,101,116,40,83,101,114,105,97,108, 66,105,80,104,97,115,101,40,41,44,32,110,41,59,32,125, '\n','\n',9,35,100,101,102,105,110,101,32,77,83,71,95,78, 79,78,69,9,48,'\n',9,35,100,101,102,105,110,101,32,77, 83,71,95,73,82,9,9,49,'\n',9,35,100,101,102,105,110, 101,32,77,83,71,95,80,67,9,9,50,'\n',9,35,100,101, 102,105,110,101,32,82,120,77,101,115,115,97,103,101,76,111, 99,107,40,41,32,64,40,48,120,50,49,48,48,49,55,41, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,82,120,77,101,115,115,97,103,101,76,111,99,107, 40,99,111,110,115,116,32,105,110,116,32,38,108,41,32,123, 32,83,101,116,40,82,120,77,101,115,115,97,103,101,76,111, 99,107,40,41,44,32,108,41,59,32,125,'\n','\n',9,35,100, 101,102,105,110,101,32,82,120,77,101,115,115,97,103,101,73, 110,100,101,120,40,41,32,64,40,48,120,50,49,48,48,49, 56,41,'\n',9,35,100,101,102,105,110,101,32,82,120,77,101, 115,115,97,103,101,67,104,97,110,110,101,108,40,41,32,64, 40,48,120,50,49,48,48,49,57,41,32,47,47,32,114,101, 116,117,114,110,115,32,77,83,71,95,73,82,32,111,114,32, 77,83,71,95,80,67,'\n',9,35,100,101,102,105,110,101,32, 82,120,77,101,115,115,97,103,101,73,68,40,99,41,32,64, 40,48,120,50,49,48,48,49,57,32,43,32,40,99,41,41, 32,47,47,32,99,32,61,61,32,77,83,71,95,73,82,32, 111,114,32,77,83,71,95,80,67,'\n','\n',9,35,100,101,102, 105,110,101,32,77,83,71,95,73,78,68,69,88,9,48,'\n', 9,35,100,101,102,105,110,101,32,77,83,71,95,67,79,77, 77,65,78,68,9,49,'\n',9,35,100,101,102,105,110,101,32, 77,83,71,95,72,73,95,66,89,84,69,9,50,'\n',9,35, 100,101,102,105,110,101,32,77,83,71,95,76,79,95,66,89, 84,69,9,51,'\n','\n',9,35,100,101,102,105,110,101,32,67, 79,77,77,65,78,68,95,67,79,78,84,82,79,76,76,69, 82,9,48,120,52,48,'\n','\n',9,35,100,101,102,105,110,101, 32,73,78,68,69,88,95,76,73,78,75,67,65,83,84,9, 48,120,52,48,'\n',9,35,100,101,102,105,110,101,32,73,78, 68,69,88,95,66,82,79,65,68,67,65,83,84,9,48,120, 56,48,'\n',9,35,100,101,102,105,110,101,32,73,78,68,69, 88,95,73,78,86,65,76,73,68,9,48,120,50,48,'\n','\n', 9,35,100,101,102,105,110,101,32,82,120,77,101,115,115,97, 103,101,40,99,44,32,110,41,32,64,40,48,120,50,49,48, 48,49,56,32,43,32,40,99,42,52,41,32,43,32,40,110, 41,41,32,47,47,32,99,32,61,61,32,77,83,71,95,73, 82,32,111,114,32,77,83,71,95,80,67,59,32,52,32,98, 121,116,101,115,'\n','\n',32,32,35,101,110,100,105,102,'\n','\n', 35,101,110,100,105,102,'\n','\n','\n','\n',47,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,'\n',32,42,32,84,105,109,101,114,115,'\n', 32,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n',35,100, 101,102,105,110,101,32,84,49,9,48,'\n',35,100,101,102,105, 110,101,32,84,50,9,49,'\n',35,100,101,102,105,110,101,32, 84,51,9,50,'\n','\n',35,105,102,110,100,101,102,32,95,95, 83,67,79,85,84,'\n',9,35,100,101,102,105,110,101,32,84, 52,9,51,'\n',35,101,110,100,105,102,'\n','\n','\n',35,100,101, 102,105,110,101,32,84,105,109,101,114,40,110,41,9,64,40, 48,120,49,48,48,48,48,32,43,32,40,110,41,41,9,47, 47,32,114,101,97,100,32,97,32,116,105,109,101,114,39,115, 32,118,97,108,117,101,'\n','\n',95,95,110,111,108,105,115,116, 32,118,111,105,100,32,67,108,101,97,114,84,105,109,101,114, 40,99,111,110,115,116,32,105,110,116,32,110,41,32,123,9, 97,115,109,32,123,32,48,120,97,49,44,32,110,32,125,59, 32,125,'\n','\n','\n',35,105,102,100,101,102,32,95,95,83,67, 79,85,84,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,84,105,109,101,114,76,105,109,105,116, 40,99,111,110,115,116,32,105,110,116,32,110,44,32,99,111, 110,115,116,32,105,110,116,32,38,120,41,9,123,32,97,115, 109,32,123,32,48,120,99,52,44,32,110,44,32,36,120,32, 58,32,95,95,65,83,77,95,83,82,67,95,69,88,84,32, 125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105, 102,32,95,95,82,67,88,61,61,50,32,124,124,32,100,101, 102,105,110,101,100,40,95,95,83,80,89,41,32,124,124,32, 100,101,102,105,110,101,100,40,95,95,83,87,65,78,41,'\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,84,105,109,101,114,40,99,111,110,115,116,32,105,110, 116,32,110,44,32,99,111,110,115,116,32,105,110,116,32,38, 118,41,9,32,123,32,83,101,116,40,84,105,109,101,114,40, 110,41,44,32,118,41,59,32,125,'\n',9,35,100,101,102,105, 110,101,32,70,97,115,116,84,105,109,101,114,40,110,41,9, 64,40,48,120,49,97,48,48,48,48,32,43,32,40,110,41, 41,'\n',35,101,110,100,105,102,'\n','\n','\n','\n',47,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,'\n',32,42,32,67,111,117,110,116, 101,114,115,'\n',32,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47, '\n','\n','\n',35,105,102,32,100,101,102,105,110,101,100,40,95, 95,83,67,79,85,84,41,32,124,124,32,95,95,82,67,88, 61,61,50,32,124,124,32,100,101,102,105,110,101,100,40,95, 95,83,80,89,41,32,124,124,32,100,101,102,105,110,101,100, 40,95,95,83,87,65,78,41,'\n',9,47,47,32,83,99,111, 117,116,44,32,82,67,88,50,44,32,83,112,121,44,32,97, 110,100,32,83,119,97,110,32,104,97,118,101,32,99,111,117, 110,116,101,114,32,115,117,112,112,111,114,116,'\n',9,35,100, 101,102,105,110,101,32,67,111,117,110,116,101,114,40,110,41, 9,64,40,48,120,49,53,48,48,48,48,32,43,32,40,110, 41,41,9,47,47,32,114,101,97,100,32,97,32,99,111,117, 110,116,101,114,'\n','\n','\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,73,110,99,67,111,117,110,116,101,114, 40,99,111,110,115,116,32,105,110,116,32,99,41,32,123,32, 97,115,109,32,123,32,48,120,57,55,44,32,99,32,125,59, 32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,68,101,99,67,111,117,110,116,101,114,40,99,111,110, 115,116,32,105,110,116,32,99,41,32,123,32,97,115,109,32, 123,32,48,120,65,55,44,32,99,32,125,59,32,125,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,67,108, 101,97,114,67,111,117,110,116,101,114,40,99,111,110,115,116, 32,105,110,116,32,99,41,32,123,32,97,115,109,32,123,32, 48,120,98,55,44,32,99,125,59,32,125,'\n','\n',9,35,105, 102,100,101,102,32,95,95,83,67,79,85,84,'\n',9,9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 67,111,117,110,116,101,114,76,105,109,105,116,40,99,111,110, 115,116,32,105,110,116,32,99,44,32,99,111,110,115,116,32, 105,110,116,32,38,108,41,32,123,32,97,115,109,32,123,32, 48,120,100,52,44,32,99,44,32,36,108,32,58,32,95,95, 65,83,77,95,83,82,67,95,69,88,84,32,125,59,32,125, '\n',9,35,101,110,100,105,102,'\n',35,101,110,100,105,102,'\n', '\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n',32, 42,32,69,118,101,110,116,115,'\n',32,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,47,'\n','\n','\n',35,105,102,32,100,101,102,105, 110,101,100,40,95,95,83,67,79,85,84,41,32,124,124,32, 95,95,82,67,88,61,61,50,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,80,89,41,32,124,124,32,100,101, 102,105,110,101,100,40,95,95,83,87,65,78,41,'\n',9,47, 47,32,83,99,111,117,116,44,32,82,67,88,50,44,32,83, 112,121,44,32,97,110,100,32,83,119,97,110,32,104,97,118, 101,32,98,97,115,105,99,32,101,118,101,110,116,32,115,117, 112,112,111,114,116,'\n',9,35,100,101,102,105,110,101,32,65, 99,116,105,118,101,69,118,101,110,116,115,40,110,41,9,64, 40,48,120,49,55,48,48,48,48,32,43,32,40,110,41,41, '\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84,95, 77,65,83,75,40,101,41,9,40,49,32,60,60,32,40,101, 41,41,'\n','\n','\n',9,35,105,102,32,100,101,102,105,110,101, 100,40,95,95,83,67,79,85,84,41,'\n',9,9,47,47,32, 111,110,108,121,32,99,111,110,115,116,97,110,116,32,109,97, 115,107,115,32,97,108,108,111,119,101,100,'\n',9,9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,69,118,101,110, 116,40,99,111,110,115,116,32,105,110,116,32,101,41,9,123, 32,97,115,109,32,123,32,48,120,48,51,44,32,50,44,32, 101,44,32,101,62,62,56,32,125,59,32,125,'\n',9,35,101, 108,115,101,'\n',9,9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,69,118,101,110,116,40,99,111,110,115,116,32, 105,110,116,32,38,101,41,9,123,32,97,115,109,32,123,32, 48,120,48,51,44,32,36,101,32,125,59,32,125,'\n',9,35, 101,110,100,105,102,'\n',35,101,110,100,105,102,'\n','\n','\n',35, 105,102,32,95,95,82,67,88,61,61,50,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,80,89,41,32,124,124, 32,100,101,102,105,110,101,100,40,95,95,83,87,65,78,41, '\n',9,35,105,102,32,95,95,82,67,88,61,61,50,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,87,65,78, 41,'\n',9,9,35,100,101,102,105,110,101,32,67,117,114,114, 101,110,116,69,118,101,110,116,115,40,41,32,65,99,116,105, 118,101,69,118,101,110,116,115,40,49,48,41,'\n',9,35,101, 108,115,101,'\n',9,9,35,100,101,102,105,110,101,32,67,117, 114,114,101,110,116,69,118,101,110,116,115,40,41,32,65,99, 116,105,118,101,69,118,101,110,116,115,40,49,54,41,'\n',9, 35,101,110,100,105,102,'\n','\n','\n',9,35,100,101,102,105,110, 101,32,69,86,69,78,84,95,84,89,80,69,95,80,82,69, 83,83,69,68,9,48,'\n',9,35,100,101,102,105,110,101,32, 69,86,69,78,84,95,84,89,80,69,95,82,69,76,69,65, 83,69,68,9,49,'\n',9,35,100,101,102,105,110,101,32,69, 86,69,78,84,95,84,89,80,69,95,76,79,87,9,9,56, '\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84,95, 84,89,80,69,95,78,79,82,77,65,76,9,57,'\n',9,35, 100,101,102,105,110,101,32,69,86,69,78,84,95,84,89,80, 69,95,72,73,71,72,9,9,49,48,'\n',9,35,100,101,102, 105,110,101,32,69,86,69,78,84,95,84,89,80,69,95,67, 76,73,67,75,9,49,49,'\n','\n',9,35,105,102,100,101,102, 32,95,95,83,80,89,'\n',9,9,47,47,32,116,104,101,115, 101,32,97,108,108,32,99,111,114,114,101,115,112,111,110,100, 32,116,111,32,117,115,105,110,103,32,86,76,76,40,41,32, 97,115,32,116,104,101,32,115,111,117,114,99,101,'\n',9,9, 35,100,101,102,105,110,101,32,69,86,69,78,84,95,84,89, 80,69,95,69,78,84,82,89,95,70,79,85,78,68,9,9, 52,'\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,84,89,80,69,95,77,83,71,95,68,73,83,67,65, 82,68,9,9,54,'\n',9,9,35,100,101,102,105,110,101,32, 69,86,69,78,84,95,84,89,80,69,95,77,83,71,95,82, 69,67,69,73,86,69,68,9,9,49,51,'\n',9,9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,84,89,80,69, 95,86,76,76,95,77,83,71,95,82,69,67,69,73,86,69, 68,9,49,52,'\n',9,9,35,100,101,102,105,110,101,32,69, 86,69,78,84,95,84,89,80,69,95,69,78,84,82,89,95, 67,72,65,78,71,69,68,9,49,53,'\n',9,35,101,108,115, 101,'\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,84,89,80,69,95,80,85,76,83,69,9,50,'\n',9, 9,35,100,101,102,105,110,101,32,69,86,69,78,84,95,84, 89,80,69,95,69,68,71,69,9,9,51,'\n',9,9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,84,89,80,69, 95,70,65,83,84,67,72,65,78,71,69,9,55,'\n',9,9, 35,100,101,102,105,110,101,32,69,86,69,78,84,95,84,89, 80,69,95,68,79,85,66,76,69,67,76,73,67,75,9,49, 50,'\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,84,89,80,69,95,77,69,83,83,65,71,69,9,49, 52,'\n',9,35,101,110,100,105,102,'\n','\n',9,35,105,102,32, 100,101,102,105,110,101,100,40,95,95,83,87,65,78,41,'\n', 9,9,35,100,101,102,105,110,101,32,69,86,69,78,84,95, 84,89,80,69,95,52,9,9,9,52,'\n',9,9,35,100,101, 102,105,110,101,32,69,86,69,78,84,95,84,89,80,69,95, 53,9,9,9,53,'\n',9,9,35,100,101,102,105,110,101,32, 69,86,69,78,84,95,84,89,80,69,95,54,9,9,9,54, '\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78,84, 95,84,89,80,69,95,86,73,82,84,85,65,76,95,77,79, 84,79,82,95,67,72,65,78,71,69,9,52,'\n',9,9,35, 100,101,102,105,110,101,32,69,86,69,78,84,95,84,89,80, 69,95,86,73,82,84,85,65,76,95,77,79,84,79,82,95, 80,79,87,69,82,9,53,'\n',9,9,35,100,101,102,105,110, 101,32,69,86,69,78,84,95,84,89,80,69,95,86,73,82, 84,85,65,76,95,83,69,78,83,79,82,95,68,69,70,9, 54,'\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,84,89,80,69,95,73,78,70,82,65,82,69,68,95, 73,68,76,69,9,49,51,'\n',9,9,35,100,101,102,105,110, 101,32,69,86,69,78,84,95,84,89,80,69,95,82,69,83, 69,84,9,9,49,54,'\n',9,35,101,110,100,105,102,'\n','\n', '\n',9,35,100,101,102,105,110,101,32,83,101,116,69,118,101, 110,116,40,101,44,115,44,116,41,9,95,95,83,101,116,69, 118,101,110,116,40,101,44,95,95,101,118,101,110,116,95,115, 114,99,40,115,41,44,116,41,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,95,95,83,101,116,69,118,101, 110,116,40,99,111,110,115,116,32,105,110,116,32,101,118,116, 44,32,99,111,110,115,116,32,105,110,116,32,115,114,99,44, 32,99,111,110,115,116,32,105,110,116,32,116,121,112,101,41, '\n',9,9,123,32,97,115,109,32,123,32,48,120,57,51,44, 32,101,118,116,44,32,115,114,99,44,32,116,121,112,101,125, 59,32,125,'\n','\n','\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,67,108,101,97,114,69,118,101,110,116,40, 99,111,110,115,116,32,105,110,116,32,101,118,116,41,9,123, 32,97,115,109,32,123,32,48,120,57,51,44,32,101,118,116, 44,32,48,44,32,49,54,32,125,59,32,125,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,67,108,101,97, 114,65,108,108,69,118,101,110,116,115,40,41,9,123,32,97, 115,109,32,123,32,48,120,48,54,32,125,59,32,125,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,67,97, 108,105,98,114,97,116,101,69,118,101,110,116,40,99,111,110, 115,116,32,105,110,116,32,101,118,116,44,32,99,111,110,115, 116,32,105,110,116,32,108,111,119,44,32,99,111,110,115,116, 32,105,110,116,32,104,105,44,32,99,111,110,115,116,32,105, 110,116,32,104,121,115,116,41,'\n',9,9,123,32,97,115,109, 32,123,32,48,120,48,52,44,32,101,118,116,44,32,104,105, 44,32,108,111,119,44,32,104,121,115,116,32,125,59,32,125, '\n','\n','\n',9,35,100,101,102,105,110,101,32,69,118,101,110, 116,83,116,97,116,101,40,110,41,9,64,40,48,120,49,57, 48,48,48,48,32,43,32,40,110,41,41,'\n',9,35,100,101, 102,105,110,101,32,85,112,112,101,114,76,105,109,105,116,40, 110,41,9,64,40,48,120,49,99,48,48,48,48,32,43,32, 40,110,41,41,'\n',9,35,100,101,102,105,110,101,32,76,111, 119,101,114,76,105,109,105,116,40,110,41,9,64,40,48,120, 49,100,48,48,48,48,32,43,32,40,110,41,41,'\n',9,35, 100,101,102,105,110,101,32,72,121,115,116,101,114,101,115,105, 115,40,110,41,9,64,40,48,120,49,101,48,48,48,48,32, 43,32,40,110,41,41,'\n',9,35,100,101,102,105,110,101,32, 67,108,105,99,107,84,105,109,101,40,110,41,9,64,40,48, 120,49,102,48,48,48,48,32,43,32,40,110,41,41,'\n','\n', '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,85,112,112,101,114,76,105,109,105,116,40,99,111, 110,115,116,32,105,110,116,32,101,118,116,44,32,99,111,110, 115,116,32,105,110,116,32,38,118,41,32,9,123,32,83,101, 116,40,85,112,112,101,114,76,105,109,105,116,40,101,118,116, 41,44,32,118,41,59,32,125,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,76,111,119,101,114, 76,105,109,105,116,40,99,111,110,115,116,32,105,110,116,32, 101,118,116,44,32,99,111,110,115,116,32,105,110,116,32,38, 118,41,32,9,123,32,83,101,116,40,76,111,119,101,114,76, 105,109,105,116,40,101,118,116,41,44,32,118,41,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,72,121,115,116,101,114,101,115,105,115,40,99,111, 110,115,116,32,105,110,116,32,101,118,116,44,32,99,111,110, 115,116,32,105,110,116,32,38,118,41,32,9,123,32,83,101, 116,40,72,121,115,116,101,114,101,115,105,115,40,101,118,116, 41,44,32,118,41,59,32,125,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,67,108,105,99,107, 84,105,109,101,40,99,111,110,115,116,32,105,110,116,32,101, 118,116,44,32,99,111,110,115,116,32,105,110,116,32,38,118, 41,32,9,123,32,83,101,116,40,67,108,105,99,107,84,105, 109,101,40,101,118,116,41,44,32,118,41,59,32,125,'\n','\n', '\n',9,35,105,102,32,95,95,82,67,88,61,61,50,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,87,65,78, 41,'\n',9,9,35,100,101,102,105,110,101,32,67,108,105,99, 107,67,111,117,110,116,101,114,40,110,41,9,64,40,48,120, 49,98,48,48,48,48,32,43,32,40,110,41,41,'\n',9,9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,67,108,105,99,107,67,111,117,110,116,101,114,40,99,111, 110,115,116,32,105,110,116,32,101,118,116,44,32,99,111,110, 115,116,32,105,110,116,32,38,118,41,32,9,123,32,83,101, 116,40,67,108,105,99,107,67,111,117,110,116,101,114,40,101, 118,116,41,44,32,118,41,59,32,125,'\n',9,35,101,110,100, 105,102,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32, 95,95,83,67,79,85,84,'\n',9,47,47,32,101,118,101,110, 116,32,99,111,100,101,115,'\n',9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,49,95,80,82,69,83,83,69,68, 9,9,40,49,32,60,60,32,48,41,'\n',9,35,100,101,102, 105,110,101,32,69,86,69,78,84,95,49,95,82,69,76,69, 65,83,69,68,9,40,49,32,60,60,32,49,41,'\n',9,35, 100,101,102,105,110,101,32,69,86,69,78,84,95,50,95,80, 82,69,83,83,69,68,9,9,40,49,32,60,60,32,50,41, '\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84,95, 50,95,82,69,76,69,65,83,69,68,9,40,49,32,60,60, 32,51,41,'\n',9,35,100,101,102,105,110,101,32,69,86,69, 78,84,95,76,73,71,72,84,95,72,73,71,72,9,40,49, 32,60,60,32,52,41,'\n',9,35,100,101,102,105,110,101,32, 69,86,69,78,84,95,76,73,71,72,84,95,78,79,82,77, 65,76,9,40,49,32,60,60,32,53,41,'\n',9,35,100,101, 102,105,110,101,32,69,86,69,78,84,95,76,73,71,72,84, 95,76,79,87,9,9,40,49,32,60,60,32,54,41,'\n',9, 35,100,101,102,105,110,101,32,69,86,69,78,84,95,76,73, 71,72,84,95,67,76,73,67,75,9,40,49,32,60,60,32, 55,41,'\n',9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,76,73,71,72,84,95,68,79,85,66,76,69,67,76, 73,67,75,9,40,49,32,60,60,32,56,41,'\n',9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,67,79,85,78, 84,69,82,95,48,9,9,40,49,32,60,60,32,57,41,'\n', 9,35,100,101,102,105,110,101,32,69,86,69,78,84,95,67, 79,85,78,84,69,82,95,49,9,9,40,49,32,60,60,32, 49,48,41,'\n',9,35,100,101,102,105,110,101,32,69,86,69, 78,84,95,84,73,77,69,82,95,48,9,9,40,49,32,60, 60,32,49,49,41,'\n',9,35,100,101,102,105,110,101,32,69, 86,69,78,84,95,84,73,77,69,82,95,49,9,9,40,49, 32,60,60,32,49,50,41,'\n',9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,84,73,77,69,82,95,50,9,9, 40,49,32,60,60,32,49,51,41,'\n',9,35,100,101,102,105, 110,101,32,69,86,69,78,84,95,77,69,83,83,65,71,69, 9,9,40,49,32,60,60,32,49,52,41,'\n',35,101,110,100, 105,102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,'\n',32,42,32,71,101,110,101,114,97,108,'\n',32,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,47,'\n','\n','\n',47,47,32,119, 97,105,116,32,102,111,114,32,97,32,99,111,110,100,105,116, 105,111,110,32,116,111,32,98,101,99,111,109,101,32,116,114, 117,101,'\n',35,100,101,102,105,110,101,32,117,110,116,105,108, 40,99,41,9,119,104,105,108,101,40,33,40,99,41,41,'\n', '\n','\n',47,47,32,115,108,101,101,112,32,102,111,114,32,118, 32,116,105,99,107,115,32,40,49,48,109,115,32,112,101,114, 32,116,105,99,107,41,'\n',95,95,110,111,108,105,115,116,32, 118,111,105,100,32,87,97,105,116,40,99,111,110,115,116,32, 105,110,116,32,38,118,41,9,123,32,97,115,109,32,123,32, 48,120,52,51,44,32,36,118,32,58,32,95,95,65,83,77, 95,83,82,67,95,69,88,84,125,59,32,125,'\n','\n',95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,116,111,112, 65,108,108,84,97,115,107,115,40,41,9,9,123,32,97,115, 109,32,123,32,48,120,53,48,32,125,59,32,125,'\n',95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 108,101,101,112,84,105,109,101,40,99,111,110,115,116,32,105, 110,116,32,116,41,9,123,32,97,115,109,32,123,32,48,120, 98,49,44,32,116,32,125,59,32,125,'\n',95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,108,101,101,112,78,111, 119,40,41,32,9,9,123,32,97,115,109,32,123,32,48,120, 54,48,32,125,59,32,125,'\n','\n','\n',35,105,102,32,100,101, 102,105,110,101,100,40,95,95,82,67,88,41,32,124,124,32, 100,101,102,105,110,101,100,40,95,95,83,67,79,85,84,41, 32,124,124,32,100,101,102,105,110,101,100,40,95,95,83,87, 65,78,41,'\n',9,47,47,32,83,99,111,117,116,32,97,110, 100,32,82,67,88,'\n',9,35,100,101,102,105,110,101,32,84, 88,95,80,79,87,69,82,95,76,79,9,48,'\n',9,35,100, 101,102,105,110,101,32,84,88,95,80,79,87,69,82,95,72, 73,9,49,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,84,120,80,111,119,101,114,40,99,111, 110,115,116,32,105,110,116,32,112,41,9,123,32,97,115,109, 32,123,32,48,120,51,49,44,32,112,32,125,59,32,125,'\n', 35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102, 105,110,101,100,40,95,95,82,67,88,41,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,87,65,78,41,'\n',9, 47,47,32,82,67,88,32,97,110,100,32,83,119,97,110,32, 111,110,108,121,46,46,46,'\n','\n',9,47,47,32,68,97,116, 97,32,108,111,103,103,105,110,103,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,67,114,101,97,116,101,68, 97,116,97,108,111,103,40,99,111,110,115,116,32,105,110,116, 32,115,105,122,101,41,9,123,32,97,115,109,32,123,32,48, 120,53,50,44,32,40,115,105,122,101,41,44,32,40,115,105, 122,101,41,62,62,56,32,125,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,65,100,100,84,111, 68,97,116,97,108,111,103,40,99,111,110,115,116,32,105,110, 116,32,38,118,41,9,123,32,97,115,109,32,123,32,48,120, 54,50,44,32,36,118,32,58,32,95,95,65,83,77,95,78, 79,95,76,79,67,65,76,32,43,32,95,95,65,83,77,95, 83,77,65,76,76,95,86,65,76,85,69,32,43,32,48,120, 48,48,52,50,48,51,125,59,32,125,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,85,112,108,111,97,100, 68,97,116,97,108,111,103,40,99,111,110,115,116,32,105,110, 116,32,115,44,32,99,111,110,115,116,32,105,110,116,32,110, 41,32,123,32,97,115,109,32,123,32,48,120,97,52,44,32, 40,115,41,44,32,40,115,41,62,62,56,44,32,40,110,41, 44,32,40,110,41,62,62,56,32,125,59,32,125,'\n','\n','\n', 9,47,47,32,116,104,101,32,115,121,115,116,101,109,32,99, 108,111,99,107,'\n',9,35,100,101,102,105,110,101,32,87,97, 116,99,104,40,41,9,9,64,40,48,120,101,48,48,48,48, 41,9,47,47,32,114,101,97,100,32,116,104,101,32,115,121, 115,116,101,109,32,99,108,111,99,107,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,87,97,116, 99,104,40,99,111,110,115,116,32,105,110,116,32,104,44,32, 99,111,110,115,116,32,105,110,116,32,109,41,32,9,123,32, 97,115,109,32,123,32,48,120,50,50,44,32,104,44,32,109, 32,125,59,32,125,'\n','\n',32,32,35,105,102,32,95,95,82, 67,88,61,61,50,32,124,124,32,100,101,102,105,110,101,100, 40,95,95,83,87,65,78,41,'\n',9,47,47,32,114,101,113, 117,105,114,101,115,32,82,67,88,50,32,102,105,114,109,119, 97,114,101,32,110,101,119,101,114,32,116,104,97,110,32,102, 105,114,109,48,51,50,56,46,108,103,111,32,40,111,114,32, 83,119,97,110,32,102,105,114,109,119,97,114,101,41,'\n',9, 35,100,101,102,105,110,101,32,68,97,116,97,108,111,103,84, 121,112,101,40,110,41,9,64,64,40,48,120,50,54,50,53, 41,91,40,110,41,93,'\n',9,35,100,101,102,105,110,101,32, 68,97,116,97,108,111,103,86,97,108,117,101,40,110,41,9, 64,64,40,48,120,50,56,50,55,41,91,40,110,41,93,'\n', 9,35,100,101,102,105,110,101,32,68,97,116,97,108,111,103, 66,121,116,101,40,110,41,9,64,64,40,48,120,50,97,50, 57,41,91,40,110,41,93,'\n',32,32,35,101,110,100,105,102, '\n','\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,100, 101,102,105,110,101,100,40,95,95,83,67,79,85,84,41,'\n', 9,47,47,32,83,99,111,117,116,32,45,32,115,112,101,99, 105,97,108,32,102,117,110,99,116,105,111,110,115,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 83,99,111,117,116,82,117,108,101,115,40,99,111,110,115,116, 32,105,110,116,32,109,44,32,99,111,110,115,116,32,105,110, 116,32,116,44,32,99,111,110,115,116,32,105,110,116,32,108, 44,32,99,111,110,115,116,32,105,110,116,32,116,109,44,32, 99,111,110,115,116,32,105,110,116,32,102,120,41,'\n',9,9, 123,32,97,115,109,32,123,32,48,120,100,53,44,32,109,44, 32,116,44,32,108,44,32,116,109,44,32,102,120,32,125,59, 32,125,'\n','\n','\n',9,35,100,101,102,105,110,101,32,83,67, 79,85,84,95,77,79,68,69,95,83,84,65,78,68,65,76, 79,78,69,9,48,'\n',9,35,100,101,102,105,110,101,32,83, 67,79,85,84,95,77,79,68,69,95,80,79,87,69,82,32, 9,49,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,83,99,111,117,116,77,111,100,101,40,99, 111,110,115,116,32,105,110,116,32,115,41,9,9,123,32,97, 115,109,32,123,32,48,120,52,55,44,32,115,125,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,69,118,101,110,116,70,101,101,100,98,97,99,107, 40,99,111,110,115,116,32,105,110,116,32,38,120,41,9,123, 32,97,115,109,32,123,32,48,120,56,51,44,32,36,120,32, 58,32,95,95,65,83,77,95,83,82,67,95,66,65,83,73, 67,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35, 105,102,32,100,101,102,105,110,101,100,40,95,95,83,67,79, 85,84,41,32,124,124,32,95,95,82,67,88,61,61,50,32, 124,124,32,100,101,102,105,110,101,100,40,95,95,83,80,89, 41,32,124,124,32,100,101,102,105,110,101,100,40,95,95,83, 87,65,78,41,'\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,80,114,105,111,114,105,116,121,40, 99,111,110,115,116,32,105,110,116,32,112,41,9,123,32,97, 115,109,32,123,32,48,120,100,55,44,32,112,32,125,59,32, 125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,95, 95,82,67,88,61,61,50,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,80,89,41,32,124,124,32,100,101,102, 105,110,101,100,40,95,95,83,87,65,78,41,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,40, 99,111,110,115,116,32,105,110,116,32,38,100,115,116,44,32, 99,111,110,115,116,32,105,110,116,32,38,115,114,99,41,9, 123,32,97,115,109,32,123,32,48,120,48,53,44,32,36,100, 115,116,32,58,32,95,95,65,83,77,95,83,77,65,76,76, 95,86,65,76,85,69,44,32,36,115,114,99,32,125,59,32, 125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,95, 95,82,67,88,61,61,50,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,87,65,78,41,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,108,101,99,116, 80,114,111,103,114,97,109,40,99,111,110,115,116,32,105,110, 116,32,110,41,9,9,123,32,97,115,109,32,123,32,48,120, 57,49,44,32,110,32,125,59,32,125,'\n',35,101,110,100,105, 102,'\n','\n','\n',35,105,102,32,100,101,102,105,110,101,100,40, 95,95,83,67,79,85,84,41,32,124,124,32,95,95,82,67, 88,61,61,50,32,124,124,32,100,101,102,105,110,101,100,40, 95,95,83,80,89,41,32,124,124,32,100,101,102,105,110,101, 100,40,95,95,83,87,65,78,41,'\n',9,47,47,32,99,111, 110,115,116,97,110,116,115,32,102,111,114,32,97,99,113,117, 105,114,101,40,41,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,79,85,84,95,65,9,40,49,32, 60,60,32,48,41,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,79,85,84,95,66,9,40,49,32, 60,60,32,49,41,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,83,79,85,78,68,9,40,49,32, 60,60,32,50,41,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,79,85,84,95,67,9,40,49,32, 60,60,32,51,41,'\n',35,101,110,100,105,102,'\n','\n',35,105, 102,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, '\n',9,35,100,101,102,105,110,101,32,65,67,81,85,73,82, 69,95,76,69,68,9,40,49,32,60,60,32,52,41,'\n',35, 101,110,100,105,102,'\n','\n',35,105,102,32,95,95,82,67,88, 61,61,50,32,124,124,32,100,101,102,105,110,101,100,40,95, 95,83,87,65,78,41,'\n',9,47,47,32,109,111,114,101,32, 99,111,110,115,116,97,110,116,115,32,102,111,114,32,97,99, 113,117,114,105,101,40,41,32,45,32,82,67,88,50,32,111, 110,108,121,'\n',9,35,100,101,102,105,110,101,32,65,67,81, 85,73,82,69,95,85,83,69,82,95,49,9,40,49,32,60, 60,32,52,41,'\n',9,35,100,101,102,105,110,101,32,65,67, 81,85,73,82,69,95,85,83,69,82,95,50,9,40,49,32, 60,60,32,53,41,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,85,83,69,82,95,51,9,40,49, 32,60,60,32,54,41,'\n',9,35,100,101,102,105,110,101,32, 65,67,81,85,73,82,69,95,85,83,69,82,95,52,9,40, 49,32,60,60,32,55,41,'\n',35,101,110,100,105,102,'\n','\n', '\n','\n',47,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,'\n',32,42, 32,79,116,104,101,114,32,100,97,116,97,32,115,111,117,114, 99,101,115,'\n',32,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47, '\n','\n','\n',35,100,101,102,105,110,101,32,82,97,110,100,111, 109,40,110,41,9,9,64,40,48,120,52,48,48,48,48,32, 43,32,40,110,41,41,9,47,47,32,97,32,114,97,110,100, 111,109,32,110,117,109,98,101,114,'\n',35,105,102,32,95,95, 82,67,88,61,61,50,32,124,124,32,100,101,102,105,110,101, 100,40,95,95,83,80,89,41,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,87,65,78,41,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,82,97, 110,100,111,109,83,101,101,100,40,99,111,110,115,116,32,105, 110,116,32,38,118,41,9,123,32,83,101,116,40,82,97,110, 100,111,109,40,48,41,44,32,118,41,59,32,125,'\n',35,101, 110,100,105,102,'\n','\n','\n',35,105,102,100,101,102,32,95,95, 82,67,88,32,124,124,32,100,101,102,105,110,101,100,40,95, 95,83,87,65,78,41,'\n',9,47,47,32,82,67,88,32,115, 112,101,99,105,102,105,99,32,100,97,116,97,32,115,111,117, 114,99,101,115,'\n',9,35,100,101,102,105,110,101,32,80,114, 111,103,114,97,109,40,41,9,64,40,48,120,56,48,48,48, 48,41,9,47,47,32,99,117,114,114,101,110,116,108,121,32, 97,99,116,105,118,101,32,112,114,111,103,114,97,109,'\n',35, 101,110,100,105,102,'\n','\n','\n',35,105,102,100,101,102,32,95, 95,67,77,'\n',9,47,47,32,67,77,32,115,112,101,99,105, 102,105,99,32,100,97,116,97,32,115,111,117,114,99,101,115, '\n',9,35,100,101,102,105,110,101,32,65,71,67,40,41,9, 9,64,40,48,120,49,48,48,48,48,48,41,9,47,47,32, 65,117,116,111,109,97,116,105,99,32,71,97,105,110,32,67, 111,110,116,114,111,108,'\n',35,101,110,100,105,102,'\n','\n','\n', 35,105,102,32,100,101,102,105,110,101,100,40,95,95,83,67, 79,85,84,41,'\n',9,35,100,101,102,105,110,101,32,83,99, 111,117,116,82,117,108,101,115,40,110,41,9,64,40,48,120, 49,50,48,48,48,48,32,43,32,40,110,41,41,'\n',9,35, 100,101,102,105,110,101,32,84,105,109,101,114,76,105,109,105, 116,40,110,41,9,64,40,48,120,49,52,48,48,48,48,32, 43,32,40,110,41,41,'\n',9,35,100,101,102,105,110,101,32, 67,111,117,110,116,101,114,76,105,109,105,116,40,110,41,9, 64,40,48,120,49,54,48,48,48,48,32,43,32,40,110,41, 41,'\n',9,35,100,101,102,105,110,101,32,69,118,101,110,116, 70,101,101,100,98,97,99,107,40,41,9,64,40,48,120,49, 56,48,48,48,48,41,'\n',35,101,110,100,105,102,'\n','\n','\n', 35,105,102,32,95,95,82,67,88,61,61,50,32,124,124,32, 100,101,102,105,110,101,100,40,95,95,83,80,89,41,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,87,65,78, 41,'\n',9,35,100,101,102,105,110,101,32,66,97,116,116,101, 114,121,76,101,118,101,108,40,41,9,9,64,40,48,120,50, 50,48,48,48,48,41,'\n',9,35,100,101,102,105,110,101,32, 70,105,114,109,119,97,114,101,86,101,114,115,105,111,110,40, 41,9,64,40,48,120,50,51,48,48,48,48,41,'\n',9,35, 100,101,102,105,110,101,32,73,110,100,105,114,101,99,116,40, 110,41,9,9,64,40,48,120,50,52,48,48,48,48,32,43, 32,40,110,41,41,32,47,47,32,105,110,100,105,114,101,99, 116,32,118,97,114,105,97,98,108,101,32,114,101,103,105,115, 116,101,114,115,'\n','\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,73,110,100,105,114,101,99,116, 86,97,114,40,99,111,110,115,116,32,105,110,116,32,38,118, 44,32,99,111,110,115,116,32,105,110,116,32,38,110,41,'\n', 9,9,123,32,97,115,109,32,123,32,48,120,48,53,44,32, 48,120,50,52,44,32,36,118,32,58,32,48,120,51,48,48, 48,48,48,49,44,32,36,110,32,125,59,32,125,'\n',35,101, 110,100,105,102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,'\n',32,42,32,68,101,102,97,117,108,116,32,105, 110,105,116,105,97,108,105,122,97,116,105,111,110,'\n',32,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,47,'\n','\n',95,95,110,111, 108,105,115,116,32,118,111,105,100,32,95,105,110,105,116,40, 41,'\n',123,'\n',9,83,101,116,80,111,119,101,114,40,79,85, 84,95,65,32,43,32,79,85,84,95,66,32,43,32,79,85, 84,95,67,44,32,79,85,84,95,70,85,76,76,41,59,'\n', 9,70,119,100,40,79,85,84,95,65,32,43,32,79,85,84, 95,66,32,43,32,79,85,84,95,67,41,59,'\n',125,'\n','\n', '\n',47,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,'\n',32,42,32, 83,99,111,117,116,32,99,111,109,112,97,116,105,98,105,108, 105,116,121,32,65,80,73,'\n',32,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,47,'\n','\n',35,105,102,100,101,102,32,95,95,83, 67,79,85,84,95,67,79,77,80,65,84,'\n',9,47,42,'\n', 9,32,42,32,83,99,111,117,116,32,115,117,112,112,111,114, 116,32,119,97,115,32,105,110,105,116,105,97,108,108,121,32, 114,101,108,101,97,115,101,100,32,119,105,116,104,32,112,114, 101,108,105,109,105,110,97,114,121,32,65,80,73,115,32,116, 104,97,116,'\n',9,32,42,32,119,101,114,101,32,115,116,121, 108,101,100,32,97,102,116,101,114,32,116,104,101,32,76,65, 83,77,32,109,110,101,109,111,110,105,99,115,46,32,32,85, 110,102,111,114,116,117,110,97,116,101,108,121,44,32,116,104, 101,115,101,32,109,110,101,109,111,110,105,99,115,'\n',9,32, 42,32,108,101,100,32,116,111,32,115,111,109,101,32,114,97, 116,104,101,114,32,105,110,99,111,110,115,105,115,116,101,110, 116,32,65,80,73,115,46,32,32,73,110,32,111,114,100,101, 114,32,116,111,32,97,108,105,103,110,32,116,104,101,32,83, 99,111,117,116,'\n',9,32,42,32,65,80,73,32,119,105,116, 104,32,116,104,101,32,82,67,88,32,50,46,48,32,65,80, 73,32,97,32,110,117,109,98,101,114,32,111,102,32,99,97, 108,108,115,32,104,97,118,101,32,98,101,101,110,32,99,104, 97,110,103,101,100,46,32,32,84,104,101,'\n',9,32,42,32, 111,102,102,105,99,105,97,108,32,99,97,108,108,115,32,97, 112,112,101,97,114,32,105,110,32,116,104,101,32,118,97,114, 105,111,117,115,32,115,101,99,116,105,111,110,115,32,97,98, 111,118,101,46,32,32,84,104,101,32,115,101,99,116,105,111, 110,'\n',9,32,42,32,98,101,108,111,119,32,105,115,32,97, 32,116,101,109,112,111,114,97,114,121,32,104,97,99,107,32, 116,111,32,101,97,115,101,32,116,104,101,32,116,114,97,110, 115,105,116,105,111,110,32,98,101,116,119,101,101,110,32,116, 104,101,32,111,108,100,'\n',9,32,42,32,97,110,100,32,110, 101,119,32,83,99,111,117,116,32,65,80,73,115,46,32,32, 65,108,108,32,111,102,32,111,108,100,32,99,97,108,108,115, 32,116,104,97,116,32,119,101,114,101,32,100,114,111,112,112, 101,100,32,40,111,114,32,99,104,97,110,103,101,100,41,'\n', 9,32,42,32,105,110,32,116,104,101,32,110,101,119,32,65, 80,73,32,97,112,112,101,97,114,32,98,101,108,111,119,44, 32,98,117,116,32,119,105,116,104,32,97,32,112,114,101,99, 101,100,105,110,103,32,117,110,100,101,114,115,99,111,114,101, 46,32,32,70,111,114,'\n',9,32,42,32,101,120,97,109,112, 108,101,44,32,116,104,101,32,111,108,100,32,71,83,101,116, 79,117,116,112,117,116,40,41,32,99,97,108,108,32,110,111, 119,32,97,112,112,101,97,114,115,32,97,115,32,95,71,83, 101,116,79,117,116,112,117,116,40,41,46,'\n',9,32,42,32, 73,102,32,121,111,117,32,97,114,101,32,105,110,32,97,32, 104,117,114,114,121,32,116,111,32,103,101,116,32,121,111,117, 114,32,111,108,100,32,83,99,111,117,116,32,112,114,111,103, 114,97,109,32,119,111,114,107,105,110,103,44,32,121,111,117, '\n',9,32,42,32,99,97,110,32,106,117,115,116,32,112,114, 101,112,101,110,100,32,117,110,100,101,114,115,99,111,114,101, 115,32,116,111,32,116,104,101,32,118,97,114,105,111,117,115, 32,111,98,115,111,108,101,116,101,32,99,97,108,108,115,46, 32,32,72,111,119,101,118,101,114,44,'\n',9,32,42,32,97, 32,108,111,110,103,101,114,32,116,101,114,109,32,102,105,120, 32,105,115,32,116,111,32,117,115,101,32,116,104,101,32,110, 101,119,32,65,80,73,115,32,97,98,111,118,101,46,'\n',9, 32,42,47,'\n','\n','\n',9,47,47,32,103,108,111,98,97,108, 32,111,117,116,112,117,116,32,102,117,110,99,116,105,111,110, 115,'\n',9,118,111,105,100,32,95,71,83,101,116,79,117,116, 112,117,116,40,99,111,110,115,116,32,105,110,116,32,111,44, 32,99,111,110,115,116,32,105,110,116,32,109,41,9,123,32, 97,115,109,32,123,32,48,120,54,55,44,32,40,111,41,32, 43,32,40,109,41,32,125,59,32,125,'\n',9,118,111,105,100, 32,95,71,83,101,116,68,105,114,101,99,116,105,111,110,40, 99,111,110,115,116,32,105,110,116,32,111,44,32,99,111,110, 115,116,32,105,110,116,32,100,41,9,123,32,97,115,109,32, 123,32,48,120,55,55,44,32,40,111,41,32,43,32,40,100, 41,32,125,59,32,125,'\n',9,118,111,105,100,32,95,71,83, 101,116,80,111,119,101,114,40,99,111,110,115,116,32,105,110, 116,32,111,44,32,99,111,110,115,116,32,105,110,116,32,38, 112,41,9,123,32,97,115,109,32,123,32,48,120,97,51,44, 32,40,111,41,44,32,36,112,32,58,32,48,120,49,48,48, 48,48,49,53,125,59,32,125,'\n',9,118,111,105,100,32,95, 71,79,110,40,99,111,110,115,116,32,105,110,116,32,111,41, 9,123,32,95,71,83,101,116,79,117,116,112,117,116,40,111, 44,32,79,85,84,95,79,78,41,59,32,125,'\n',9,118,111, 105,100,32,95,71,79,102,102,40,99,111,110,115,116,32,105, 110,116,32,111,41,9,123,32,95,71,83,101,116,79,117,116, 112,117,116,40,111,44,32,79,85,84,95,79,70,70,41,59, 32,125,'\n',9,118,111,105,100,32,95,71,70,108,111,97,116, 40,99,111,110,115,116,32,105,110,116,32,111,41,32,123,32, 95,71,83,101,116,79,117,116,112,117,116,40,111,44,32,79, 85,84,95,70,76,79,65,84,41,59,32,125,'\n',9,118,111, 105,100,32,95,71,84,111,103,103,108,101,40,99,111,110,115, 116,32,105,110,116,32,111,41,32,123,32,95,71,83,101,116, 68,105,114,101,99,116,105,111,110,40,111,44,32,79,85,84, 95,84,79,71,71,76,69,41,59,32,125,'\n',9,118,111,105, 100,32,95,71,70,119,100,40,99,111,110,115,116,32,105,110, 116,32,111,41,9,123,32,95,71,83,101,116,68,105,114,101, 99,116,105,111,110,40,111,44,32,79,85,84,95,70,87,68, 41,59,32,125,'\n',9,118,111,105,100,32,95,71,82,101,118, 40,99,111,110,115,116,32,105,110,116,32,111,41,9,123,32, 95,71,83,101,116,68,105,114,101,99,116,105,111,110,40,111, 44,32,79,85,84,95,82,69,86,41,59,32,125,'\n',9,118, 111,105,100,32,95,71,79,110,70,119,100,40,99,111,110,115, 116,32,105,110,116,32,111,41,9,123,32,95,71,70,119,100, 40,111,41,59,32,71,79,110,40,111,41,59,32,125,'\n',9, 118,111,105,100,32,95,71,79,110,82,101,118,40,99,111,110, 115,116,32,105,110,116,32,111,41,9,123,32,95,71,82,101, 118,40,111,41,59,32,71,79,110,40,111,41,59,32,125,'\n', 9,118,111,105,100,32,95,71,79,110,70,111,114,40,99,111, 110,115,116,32,105,110,116,32,111,44,32,99,111,110,115,116, 32,105,110,116,32,38,116,41,9,123,32,71,79,110,40,111, 41,59,32,87,97,105,116,40,116,41,59,32,71,79,102,102, 40,111,41,59,32,125,'\n','\n','\n',9,118,111,105,100,32,95, 87,97,105,116,69,118,101,110,116,115,40,99,111,110,115,116, 32,105,110,116,32,38,109,97,115,107,41,32,123,32,97,115, 109,32,123,32,48,120,98,52,44,32,36,109,97,115,107,32, 58,32,95,95,65,83,77,95,83,82,67,95,69,88,84,44, 32,51,44,32,48,120,50,55,44,32,48,120,56,49,32,125, 59,32,125,32,47,47,32,117,115,101,32,109,111,110,105,116, 111,114,40,41,'\n','\n','\n',9,47,47,32,108,105,103,104,116, 32,115,101,110,115,111,114,'\n',9,118,111,105,100,32,95,76, 83,66,108,105,110,107,40,99,111,110,115,116,32,105,110,116, 32,38,120,41,9,123,32,97,115,109,32,123,32,48,120,101, 51,44,32,36,120,32,58,32,48,120,48,48,48,53,32,125, 59,32,125,9,47,47,32,117,115,101,32,83,101,116,83,101, 110,115,111,114,66,108,105,110,107,'\n',9,118,111,105,100,32, 95,76,83,67,97,108,40,41,9,9,9,9,123,32,97,115, 109,32,123,32,48,120,99,48,32,125,59,32,125,9,47,47, 32,117,115,101,32,67,97,108,105,98,114,97,116,101,83,101, 110,115,111,114,'\n',9,118,111,105,100,32,95,76,83,72,121, 115,116,40,99,111,110,115,116,32,105,110,116,32,38,120,41, 9,123,32,97,115,109,32,123,32,48,120,100,51,44,32,36, 120,32,58,32,48,120,48,48,48,53,32,125,59,32,125,9, 47,47,32,117,115,101,32,83,101,116,83,101,110,115,111,114, 72,121,115,116,'\n',9,118,111,105,100,32,95,76,83,76,111, 119,101,114,40,99,111,110,115,116,32,105,110,116,32,38,120, 41,9,123,32,97,115,109,32,123,32,48,120,99,51,44,32, 36,120,32,58,32,48,120,48,48,48,53,32,125,59,32,125, 9,47,47,32,117,115,101,32,83,101,116,83,101,110,115,111, 114,76,111,119,101,114,'\n',9,118,111,105,100,32,95,76,83, 85,112,112,101,114,40,99,111,110,115,116,32,105,110,116,32, 38,120,41,9,123,32,97,115,109,32,123,32,48,120,98,51, 44,32,36,120,32,58,32,48,120,48,48,48,53,32,125,59, 32,125,9,47,47,32,117,115,101,32,83,101,116,83,101,110, 115,111,114,85,112,112,101,114,'\n','\n','\n',9,47,47,32,111, 116,104,101,114,'\n',9,118,111,105,100,32,95,82,117,108,101, 115,40,99,111,110,115,116,32,105,110,116,32,109,44,32,99, 111,110,115,116,32,105,110,116,32,116,44,32,99,111,110,115, 116,32,105,110,116,32,108,44,32,99,111,110,115,116,32,105, 110,116,32,116,109,44,32,99,111,110,115,116,32,105,110,116, 32,102,120,41,'\n',9,9,123,32,97,115,109,32,123,32,48, 120,100,53,44,32,109,44,32,116,44,32,108,44,32,116,109, 44,32,102,120,32,125,59,32,125,32,47,47,32,115,101,101, 32,83,101,116,83,99,111,117,116,82,117,108,101,115,'\n',9, 118,111,105,100,32,95,83,99,111,117,116,40,99,111,110,115, 116,32,105,110,116,32,115,41,9,9,9,123,32,97,115,109, 32,123,32,48,120,52,55,44,32,115,125,59,32,125,32,47, 47,32,83,101,116,83,99,111,117,116,77,111,100,101,'\n',9, 118,111,105,100,32,95,83,101,116,70,101,101,100,98,97,99, 107,40,99,111,110,115,116,32,105,110,116,32,38,120,41,9, 123,32,97,115,109,32,123,32,48,120,56,51,44,32,36,120, 32,58,32,48,120,48,48,48,53,125,59,32,125,32,47,47, 32,83,101,116,69,118,101,110,116,70,101,101,100,98,97,99, 107,'\n','\n',9,118,111,105,100,32,95,83,111,117,110,100,40, 99,111,110,115,116,32,105,110,116,32,120,41,9,9,9,123, 32,97,115,109,32,123,32,48,120,53,55,44,32,120,32,125, 59,32,125,9,47,47,32,117,115,101,32,77,117,116,101,83, 111,117,110,100,44,32,85,110,109,117,116,101,83,111,117,110, 100,32,97,110,100,32,83,101,108,101,99,116,83,111,117,110, 100,115,'\n','\n','\n',9,118,111,105,100,32,95,86,76,76,40, 99,111,110,115,116,32,105,110,116,32,38,120,41,9,9,123, 32,97,115,109,32,123,32,48,120,101,50,44,32,36,120,32, 58,32,48,120,49,48,48,48,48,48,53,125,59,32,125,9, 47,47,32,117,115,101,32,83,101,110,100,86,76,76,'\n',9, 118,111,105,100,32,95,82,84,83,40,41,9,9,9,9,9, 123,32,97,115,109,32,123,32,48,120,102,54,32,125,59,32, 125,9,47,47,32,100,111,110,39,116,32,101,118,101,114,32, 110,101,101,100,32,116,104,105,115,'\n','\n','\n',9,47,47,32, 117,115,101,32,116,104,101,115,101,32,102,111,114,32,99,97, 108,108,105,110,103,32,115,117,98,114,111,117,116,105,110,101, 115,46,46,46,102,111,114,32,101,120,97,109,112,108,101,58, '\n',9,47,47,'\n',9,47,47,32,108,111,99,97,108,40,48, 41,32,61,32,49,59,'\n',9,47,47,32,67,97,108,108,40, 51,41,59,'\n',9,47,47,'\n',9,35,100,101,102,105,110,101, 32,108,111,99,97,108,40,110,41,9,9,9,40,64,40,40, 110,41,32,43,32,49,48,41,41,'\n',9,118,111,105,100,32, 67,97,108,108,40,99,111,110,115,116,32,105,110,116,32,110, 41,9,9,123,32,97,115,109,32,123,32,48,120,49,55,44, 32,110,32,125,59,32,125,'\n',35,101,110,100,105,102,32,47, 47,32,95,95,83,67,79,85,84,95,67,79,77,80,65,84, '\n','\n',35,105,102,32,100,101,102,105,110,101,100,40,95,95, 83,67,79,85,84,41,'\n','\n',35,101,110,100,105,102,'\n','\n', 47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,'\n',32,42,32,83, 112,121,98,111,116,45,115,112,101,99,105,102,105,99,32,65, 80,73,'\n',32,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,'\n', '\n',35,105,102,32,100,101,102,105,110,101,100,40,95,95,83, 80,89,41,'\n','\n',32,32,47,47,32,76,69,68,39,115,32, 109,97,121,32,98,101,32,115,101,116,47,99,104,101,99,107, 101,100,32,109,97,110,117,97,108,108,121,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,40,110,41,9,9,9,64, 40,48,120,49,54,48,48,48,48,32,43,32,40,110,41,41, 9,47,47,32,76,69,68,32,99,111,110,116,114,111,108,32, 114,101,103,105,115,116,101,114,115,'\n',32,32,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,76,69,68, 40,99,111,110,115,116,32,105,110,116,32,109,111,100,101,44, 32,99,111,110,115,116,32,105,110,116,32,38,118,41,32,9, 123,32,83,101,116,40,76,69,68,40,109,111,100,101,41,44, 32,118,41,59,32,125,'\n','\n',32,32,47,47,32,99,111,110, 115,116,97,110,116,115,32,102,111,114,32,116,104,101,32,109, 111,100,101,32,97,114,103,117,109,101,110,116,32,105,110,32, 83,101,116,76,69,68,40,41,'\n',32,32,35,100,101,102,105, 110,101,32,76,69,68,95,77,79,68,69,95,79,78,9,9, 9,48,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,77,79,68,69,95,66,76,73,78,75,9,9,49,'\n',32, 32,35,100,101,102,105,110,101,32,76,69,68,95,77,79,68, 69,95,68,85,82,65,84,73,79,78,9,9,50,'\n',32,32, 35,100,101,102,105,110,101,32,76,69,68,95,77,79,68,69, 95,83,67,65,76,69,9,9,51,'\n',32,32,35,100,101,102, 105,110,101,32,76,69,68,95,77,79,68,69,95,83,67,65, 76,69,95,66,76,73,78,75,9,9,52,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,83, 67,65,76,69,95,68,85,82,65,84,73,79,78,9,53,'\n', 32,32,35,100,101,102,105,110,101,32,76,69,68,95,77,79, 68,69,95,82,69,68,95,83,67,65,76,69,9,9,54,'\n', 32,32,35,100,101,102,105,110,101,32,76,69,68,95,77,79, 68,69,95,82,69,68,95,83,67,65,76,69,95,66,76,73, 78,75,9,55,'\n',32,32,35,100,101,102,105,110,101,32,76, 69,68,95,77,79,68,69,95,71,82,69,69,78,95,83,67, 65,76,69,9,9,56,'\n',32,32,35,100,101,102,105,110,101, 32,76,69,68,95,77,79,68,69,95,71,82,69,69,78,95, 83,67,65,76,69,95,66,76,73,78,75,9,57,'\n',32,32, 35,100,101,102,105,110,101,32,76,69,68,95,77,79,68,69, 95,89,69,76,76,79,87,9,9,49,48,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,89, 69,76,76,79,87,95,66,76,73,78,75,9,9,49,49,'\n', 32,32,35,100,101,102,105,110,101,32,76,69,68,95,77,79, 68,69,95,89,69,76,76,79,87,95,68,85,82,65,84,73, 79,78,9,49,50,'\n',32,32,35,100,101,102,105,110,101,32, 76,69,68,95,77,79,68,69,95,86,76,76,9,9,9,49, 51,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68,95, 77,79,68,69,95,86,76,76,95,66,76,73,78,75,9,9, 49,52,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,77,79,68,69,95,86,76,76,95,68,85,82,65,84,73, 79,78,9,9,49,53,'\n','\n',32,32,47,47,32,82,79,77, 32,97,110,105,109,97,116,105,111,110,115,32,40,102,111,114, 32,116,104,101,32,102,114,111,110,116,32,76,69,68,115,41, '\n',32,32,35,100,101,102,105,110,101,32,65,78,73,77,65, 84,73,79,78,95,83,67,65,78,9,9,48,'\n',32,32,35, 100,101,102,105,110,101,32,65,78,73,77,65,84,73,79,78, 95,83,80,65,82,75,76,69,9,9,49,'\n',32,32,35,100, 101,102,105,110,101,32,65,78,73,77,65,84,73,79,78,95, 70,76,65,83,72,9,9,50,'\n',32,32,35,100,101,102,105, 110,101,32,65,78,73,77,65,84,73,79,78,95,82,69,68, 95,84,79,95,71,82,69,69,78,9,51,'\n',32,32,35,100, 101,102,105,110,101,32,65,78,73,77,65,84,73,79,78,95, 71,82,69,69,78,95,84,79,95,82,69,68,9,52,'\n',32, 32,35,100,101,102,105,110,101,32,65,78,73,77,65,84,73, 79,78,95,80,79,73,78,84,95,70,79,82,87,65,82,68, 9,53,'\n',32,32,35,100,101,102,105,110,101,32,65,78,73, 77,65,84,73,79,78,95,65,76,65,82,77,9,9,54,'\n', 32,32,35,100,101,102,105,110,101,32,65,78,73,77,65,84, 73,79,78,95,84,72,73,78,75,73,78,71,9,9,55,'\n', '\n',32,32,47,47,32,109,97,99,114,111,32,102,111,114,32, 100,101,102,105,110,105,110,103,32,97,32,117,115,101,114,32, 97,110,105,109,97,116,105,111,110,58,'\n',32,32,47,47,9, 65,78,73,77,65,84,73,79,78,32,109,121,95,97,110,105, 109,97,116,105,111,110,32,123,32,49,44,32,49,48,44,32, 50,44,32,49,48,44,32,52,44,32,49,48,44,32,50,44, 32,49,48,44,32,50,53,53,44,32,50,53,53,32,125,59, '\n',32,32,47,47,'\n',32,32,35,100,101,102,105,110,101,32, 65,78,73,77,65,84,73,79,78,32,95,95,114,101,115,32, 51,'\n','\n',32,32,47,47,32,102,117,110,99,116,105,111,110, 32,116,111,32,115,116,97,114,116,32,97,32,103,105,118,101, 110,32,97,110,105,109,97,116,105,111,110,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,65, 110,105,109,97,116,105,111,110,40,99,111,110,115,116,32,105, 110,116,32,116,41,9,123,32,97,115,109,32,123,32,48,120, 99,55,44,32,116,32,125,59,32,125,'\n','\n',32,32,35,100, 101,102,105,110,101,32,65,110,105,109,97,116,101,76,69,68, 40,102,44,32,116,41,32,102,44,32,116,'\n',32,32,35,100, 101,102,105,110,101,32,82,101,112,101,97,116,65,110,105,109, 97,116,105,111,110,40,41,32,48,120,70,70,44,32,48,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 69,70,70,69,67,84,32,95,95,114,101,115,32,50,'\n','\n', 32,32,35,100,101,102,105,110,101,32,71,97,116,101,40,111, 44,32,112,41,32,48,120,54,50,44,32,112,44,32,111,'\n', 32,32,35,100,101,102,105,110,101,32,71,97,116,101,79,102, 102,40,41,32,48,120,55,48,'\n',32,32,35,100,101,102,105, 110,101,32,71,108,105,100,101,40,115,44,32,112,44,32,116, 41,32,48,120,52,53,44,32,116,44,32,115,32,38,32,48, 120,70,70,44,32,115,32,62,62,32,56,44,32,112,32,38, 32,48,120,70,70,44,32,112,32,62,62,32,56,'\n',32,32, 35,100,101,102,105,110,101,32,86,105,98,114,97,116,111,40, 115,44,32,112,44,32,116,41,32,48,120,53,53,44,32,116, 44,32,115,32,38,32,48,120,70,70,44,32,115,32,62,62, 32,56,44,32,112,32,38,32,48,120,70,70,44,32,112,32, 62,62,32,56,'\n',32,32,35,100,101,102,105,110,101,32,87, 97,105,116,69,102,102,101,99,116,40,116,41,32,48,120,50, 49,44,32,116,'\n',32,32,35,100,101,102,105,110,101,32,70, 105,120,101,100,87,97,105,116,69,102,102,101,99,116,40,116, 41,32,48,120,56,49,44,32,116,'\n',32,32,35,100,101,102, 105,110,101,32,84,111,110,101,40,102,44,32,116,41,32,48, 120,51,51,44,32,116,44,32,102,32,38,32,48,120,70,70, 44,32,102,32,62,62,32,56,'\n',32,32,35,100,101,102,105, 110,101,32,70,105,120,101,100,84,111,110,101,40,102,44,32, 116,41,32,48,120,57,51,44,32,116,44,32,102,32,38,32, 48,120,70,70,44,32,102,32,62,62,32,56,'\n',32,32,35, 100,101,102,105,110,101,32,82,101,112,101,97,116,69,102,102, 101,99,116,40,41,32,48,120,49,48,'\n','\n',32,32,35,100, 101,102,105,110,101,32,69,102,102,101,99,116,83,111,117,110, 100,40,41,9,64,40,48,120,51,53,48,48,48,48,41,32, 47,47,32,83,111,117,110,100,32,69,102,102,101,99,116,115, 32,99,111,110,116,114,111,108,32,114,101,103,105,115,116,101, 114,115,32,40,48,44,49,41,'\n',32,32,35,100,101,102,105, 110,101,32,69,102,102,101,99,116,84,105,109,101,40,41,9, 64,40,48,120,51,53,48,48,48,49,41,'\n','\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 69,102,102,101,99,116,83,111,117,110,100,40,99,111,110,115, 116,32,105,110,116,32,38,115,41,32,123,32,83,101,116,40, 69,102,102,101,99,116,83,111,117,110,100,40,41,44,32,115, 41,59,32,125,'\n',32,32,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,69,102,102,101,99,116,84,105, 109,101,40,99,111,110,115,116,32,105,110,116,32,38,116,41, 32,123,32,83,101,116,40,69,102,102,101,99,116,84,105,109, 101,40,41,44,32,116,41,59,32,125,'\n','\n',32,32,35,100, 101,102,105,110,101,32,84,65,82,71,69,84,95,78,79,78, 69,9,9,50,53,53,'\n','\n',32,32,35,100,101,102,105,110, 101,32,82,65,78,71,69,95,78,79,87,72,69,82,69,9, 9,48,'\n',32,32,35,100,101,102,105,110,101,32,82,65,78, 71,69,95,65,78,89,87,72,69,82,69,9,49,'\n',32,32, 35,100,101,102,105,110,101,32,82,65,78,71,69,95,84,72, 69,82,69,9,9,50,'\n',32,32,35,100,101,102,105,110,101, 32,82,65,78,71,69,95,72,69,82,69,9,9,51,'\n','\n', 32,32,35,100,101,102,105,110,101,32,68,73,82,69,67,84, 73,79,78,95,76,69,70,84,9,9,48,'\n',32,32,35,100, 101,102,105,110,101,32,68,73,82,69,67,84,73,79,78,95, 76,69,70,84,95,79,70,95,67,69,78,84,69,82,9,49, '\n',32,32,35,100,101,102,105,110,101,32,68,73,82,69,67, 84,73,79,78,95,67,69,78,84,69,82,9,9,50,'\n',32, 32,35,100,101,102,105,110,101,32,68,73,82,69,67,84,73, 79,78,95,82,73,71,72,84,95,79,70,95,67,69,78,84, 69,82,9,51,'\n',32,32,35,100,101,102,105,110,101,32,68, 73,82,69,67,84,73,79,78,95,82,73,71,72,84,9,9, 52,'\n','\n',32,32,35,100,101,102,105,110,101,32,65,83,80, 69,67,84,95,70,82,79,78,84,95,76,69,70,84,9,48, '\n',32,32,35,100,101,102,105,110,101,32,65,83,80,69,67, 84,95,70,82,79,78,84,9,9,49,'\n',32,32,35,100,101, 102,105,110,101,32,65,83,80,69,67,84,95,70,82,79,78, 84,95,82,73,71,72,84,9,50,'\n',32,32,35,100,101,102, 105,110,101,32,65,83,80,69,67,84,95,66,65,67,75,95, 82,73,71,72,84,9,51,'\n',32,32,35,100,101,102,105,110, 101,32,65,83,80,69,67,84,95,66,65,67,75,9,9,52, '\n',32,32,35,100,101,102,105,110,101,32,65,83,80,69,67, 84,95,66,65,67,75,95,76,69,70,84,9,53,'\n','\n',32, 32,35,100,101,102,105,110,101,32,83,80,89,95,84,65,82, 71,69,84,73,68,9,48,'\n',32,32,35,100,101,102,105,110, 101,32,83,80,89,95,78,79,84,69,9,49,'\n',32,32,35, 100,101,102,105,110,101,32,83,80,89,95,76,73,78,75,73, 68,9,50,'\n',32,32,35,100,101,102,105,110,101,32,83,80, 89,95,82,65,78,71,69,9,51,'\n',32,32,35,100,101,102, 105,110,101,32,83,80,89,95,68,73,82,69,67,84,73,79, 78,9,52,'\n',32,32,35,100,101,102,105,110,101,32,83,80, 89,95,65,83,80,69,67,84,9,53,'\n',32,32,35,100,101, 102,105,110,101,32,83,80,89,95,73,78,70,79,9,54,'\n', 32,32,35,100,101,102,105,110,101,32,83,80,89,95,83,72, 79,82,84,73,68,9,55,'\n','\n',32,32,35,100,101,102,105, 110,101,32,82,69,76,95,71,84,9,48,120,48,48,'\n',32, 32,35,100,101,102,105,110,101,32,82,69,76,95,76,84,9, 48,120,52,48,'\n',32,32,35,100,101,102,105,110,101,32,82, 69,76,95,69,81,9,48,120,56,48,'\n',32,32,35,100,101, 102,105,110,101,32,82,69,76,95,78,69,9,48,120,99,48, '\n','\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,70,105,110,100,87,111,114,108,100,40,105,110,116,32, 38,118,44,32,99,111,110,115,116,32,105,110,116,32,114,101, 108,115,114,99,44,32,99,111,110,115,116,32,105,110,116,32, 99,114,105,116,44,32,99,111,110,115,116,32,105,110,116,38, 32,116,104,114,101,115,104,41,'\n',9,123,32,97,115,109,32, 123,32,48,120,100,53,44,32,36,118,32,58,32,48,120,51, 48,48,48,48,48,49,44,32,48,120,50,97,32,43,32,114, 101,108,115,114,99,44,32,99,114,105,116,32,43,32,95,95, 116,121,112,101,40,116,104,114,101,115,104,41,44,32,36,116, 104,114,101,115,104,32,58,32,95,95,65,83,77,95,78,79, 95,84,89,80,69,32,125,59,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,67,108,101,97,114, 87,111,114,108,100,40,41,32,123,32,97,115,109,32,123,32, 48,120,51,54,32,125,59,32,125,'\n','\n',32,32,35,100,101, 102,105,110,101,32,84,97,114,103,101,116,40,110,41,9,64, 40,48,120,51,50,48,48,48,48,32,43,32,110,41,'\n','\n', 32,32,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,84,97,114,103,101,116,73,68,40,99,111,110,115, 116,32,105,110,116,32,38,118,41,32,123,32,83,101,116,40, 84,97,114,103,101,116,40,83,80,89,95,84,65,82,71,69, 84,73,68,41,44,32,118,41,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,84, 97,114,103,101,116,78,111,116,101,40,99,111,110,115,116,32, 105,110,116,32,38,118,41,32,123,32,83,101,116,40,84,97, 114,103,101,116,40,83,80,89,95,78,79,84,69,41,44,32, 118,41,59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101, 32,87,111,114,108,100,40,105,44,32,110,41,32,64,64,40, 48,120,51,50,50,97,43,40,105,41,41,91,40,110,41,93, '\n',32,32,35,100,101,102,105,110,101,32,87,111,114,108,100, 83,104,111,114,116,73,68,40,110,41,32,64,64,40,48,120, 51,50,50,97,43,83,80,89,95,83,72,79,82,84,73,68, 41,91,40,110,41,93,'\n',32,32,35,100,101,102,105,110,101, 32,87,111,114,108,100,76,105,110,107,73,68,40,110,41,32, 64,64,40,48,120,51,50,50,97,43,83,80,89,95,76,73, 78,75,73,68,41,91,40,110,41,93,'\n',32,32,35,100,101, 102,105,110,101,32,87,111,114,108,100,82,97,110,103,101,40, 110,41,32,64,64,40,48,120,51,50,50,97,43,83,80,89, 95,82,65,78,71,69,41,91,40,110,41,93,'\n',32,32,35, 100,101,102,105,110,101,32,87,111,114,108,100,68,105,114,101, 99,116,105,111,110,40,110,41,32,64,64,40,48,120,51,50, 50,97,43,83,80,89,95,68,73,82,69,67,84,73,79,78, 41,91,40,110,41,93,'\n',32,32,35,100,101,102,105,110,101, 32,87,111,114,108,100,65,115,112,101,99,116,40,110,41,32, 64,64,40,48,120,51,50,50,97,43,83,80,89,95,65,83, 80,69,67,84,41,91,40,110,41,93,'\n',32,32,35,100,101, 102,105,110,101,32,87,111,114,108,100,78,111,116,101,40,110, 41,32,64,64,40,48,120,51,50,50,97,43,83,80,89,95, 78,79,84,69,41,91,40,110,41,93,'\n','\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,71,101,116,87, 111,114,108,100,40,99,111,110,115,116,32,105,110,116,32,110, 44,32,105,110,116,32,38,116,44,32,105,110,116,32,38,118, 41,'\n',32,32,123,'\n',9,97,115,109,32,123,32,48,120,49, 52,44,32,36,118,32,58,32,95,95,65,83,77,95,78,79, 95,84,89,80,69,32,43,32,95,95,65,83,77,95,83,77, 65,76,76,95,86,65,76,85,69,44,32,48,120,50,97,32, 43,32,110,44,'\n',9,9,36,116,32,58,32,95,95,65,83, 77,95,78,79,95,84,89,80,69,32,43,32,95,95,65,83, 77,95,83,77,65,76,76,95,86,65,76,85,69,44,32,48, 120,48,48,32,125,59,'\n',32,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,71,101,116,87,111, 114,108,100,83,104,111,114,116,73,68,40,105,110,116,32,38, 116,44,32,105,110,116,32,38,118,41,9,123,32,71,101,116, 87,111,114,108,100,40,83,80,89,95,83,72,79,82,84,73, 68,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,71,101,116,87, 111,114,108,100,76,105,110,107,73,68,40,105,110,116,32,38, 116,44,32,105,110,116,32,38,118,41,9,123,32,71,101,116, 87,111,114,108,100,40,83,80,89,95,76,73,78,75,73,68, 44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,71,101,116,87,111, 114,108,100,82,97,110,103,101,40,105,110,116,32,38,116,44, 32,105,110,116,32,38,118,41,9,123,32,71,101,116,87,111, 114,108,100,40,83,80,89,95,82,65,78,71,69,44,32,116, 44,32,118,41,59,32,125,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,71,101,116,87,111,114,108,100, 68,105,114,101,99,116,105,111,110,40,105,110,116,32,38,116, 44,32,105,110,116,32,38,118,41,9,123,32,71,101,116,87, 111,114,108,100,40,83,80,89,95,68,73,82,69,67,84,73, 79,78,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,71,101,116, 87,111,114,108,100,65,115,112,101,99,116,40,105,110,116,32, 38,116,44,32,105,110,116,32,38,118,41,9,123,32,71,101, 116,87,111,114,108,100,40,83,80,89,95,65,83,80,69,67, 84,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,71,101,116,87, 111,114,108,100,78,111,116,101,40,105,110,116,32,38,116,44, 32,105,110,116,32,38,118,41,9,123,32,71,101,116,87,111, 114,108,100,40,83,80,89,95,78,79,84,69,44,32,116,44, 32,118,41,59,32,125,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,87,111,114,108,100,78, 111,116,101,40,105,110,116,32,38,116,44,32,99,111,110,115, 116,32,105,110,116,32,38,118,41,'\n',9,123,32,97,115,109, 32,123,32,48,120,48,53,44,32,48,120,50,98,44,32,36, 116,32,58,32,95,95,65,83,77,95,78,79,95,84,89,80, 69,32,43,32,95,95,65,83,77,95,83,77,65,76,76,95, 86,65,76,85,69,44,32,36,118,125,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,83,116,97,99,107,40,110, 41,9,64,40,48,120,49,50,48,48,48,48,32,43,32,40, 110,41,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,80,117,115,104,40,99,111,110,115,116,32,105, 110,116,32,38,118,41,9,123,32,97,115,109,32,123,32,48, 120,101,51,44,32,36,118,32,125,59,32,125,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,80,111,112, 40,99,111,110,115,116,32,105,110,116,32,110,41,9,123,32, 97,115,109,32,123,32,48,120,48,49,44,32,110,32,125,59, 32,125,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,83,116,97,99,107,40,99,111,110,115, 116,32,105,110,116,32,105,44,32,99,111,110,115,116,32,105, 110,116,32,38,118,41,9,123,32,83,101,116,40,83,116,97, 99,107,40,105,41,44,32,118,41,59,32,125,'\n','\n',32,32, 35,100,101,102,105,110,101,32,84,73,77,69,82,95,82,85, 78,78,73,78,71,9,49,'\n',32,32,35,100,101,102,105,110, 101,32,84,73,77,69,82,95,83,84,79,80,80,69,68,9, 48,'\n',32,32,35,100,101,102,105,110,101,32,84,105,109,101, 114,83,116,97,116,101,40,110,41,9,64,40,48,120,49,51, 48,48,48,48,32,43,32,40,110,41,41,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,84, 105,109,101,114,83,116,97,116,101,40,99,111,110,115,116,32, 105,110,116,32,110,44,32,99,111,110,115,116,32,105,110,116, 32,38,115,41,32,123,32,83,101,116,40,84,105,109,101,114, 83,116,97,116,101,40,110,41,44,32,115,41,59,32,125,'\n', '\n',32,32,35,100,101,102,105,110,101,32,67,117,114,114,101, 110,116,84,97,115,107,73,68,40,41,9,64,40,48,120,50, 48,48,48,48,48,41,'\n','\n',32,32,35,100,101,102,105,110, 101,32,80,105,110,103,67,111,110,116,114,111,108,40,110,41, 9,64,40,48,120,51,51,48,48,48,48,32,43,32,40,110, 41,41,32,47,47,32,53,49,'\n',32,32,35,100,101,102,105, 110,101,32,80,105,110,103,68,97,116,97,40,41,9,9,80, 105,110,103,67,111,110,116,114,111,108,40,48,41,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,80,105,110,103,68,97,116,97,40,99,111,110,115,116,32, 105,110,116,32,38,100,41,32,123,32,83,101,116,40,80,105, 110,103,68,97,116,97,40,41,44,32,100,41,59,32,125,'\n', '\n',32,32,35,100,101,102,105,110,101,32,80,105,110,103,73, 110,116,101,114,118,97,108,40,41,9,80,105,110,103,67,111, 110,116,114,111,108,40,49,41,'\n',32,32,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,80,105,110,103, 73,110,116,101,114,118,97,108,40,99,111,110,115,116,32,105, 110,116,32,38,105,41,9,123,32,83,101,116,40,80,105,110, 103,73,110,116,101,114,118,97,108,40,41,44,32,105,41,59, 32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,80,105, 110,103,73,68,40,41,9,80,105,110,103,67,111,110,116,114, 111,108,40,50,41,'\n','\n',32,32,35,100,101,102,105,110,101, 32,66,101,97,99,111,110,67,111,110,116,114,111,108,40,110, 41,9,64,40,48,120,51,52,48,48,48,48,32,43,32,40, 110,41,41,32,47,47,32,53,50,'\n','\n',32,32,35,100,101, 102,105,110,101,32,76,105,110,107,73,68,40,41,9,66,101, 97,99,111,110,67,111,110,116,114,111,108,40,48,41,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,76,105,110,107,73,68,40,99,111,110,115,116,32,105, 110,116,32,38,110,41,9,123,32,83,101,116,40,76,105,110, 107,73,68,40,41,44,32,110,41,59,32,125,'\n','\n',32,32, 35,100,101,102,105,110,101,32,82,67,95,67,72,65,78,78, 69,76,95,66,82,79,65,68,67,65,83,84,9,48,'\n',32, 32,35,100,101,102,105,110,101,32,82,67,95,67,72,65,78, 78,69,76,95,49,9,9,49,'\n',32,32,35,100,101,102,105, 110,101,32,82,67,95,67,72,65,78,78,69,76,95,50,9, 9,50,'\n',32,32,35,100,101,102,105,110,101,32,82,67,95, 67,72,65,78,78,69,76,95,51,9,9,51,'\n',32,32,35, 100,101,102,105,110,101,32,82,67,95,67,72,65,78,78,69, 76,95,68,73,83,65,66,76,69,68,9,52,'\n','\n',32,32, 35,100,101,102,105,110,101,32,82,67,82,120,67,104,97,110, 110,101,108,40,41,9,66,101,97,99,111,110,67,111,110,116, 114,111,108,40,49,41,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,82,67,82,120,67,104, 97,110,110,101,108,40,99,111,110,115,116,32,105,110,116,32, 38,99,41,9,123,32,83,101,116,40,82,67,82,120,67,104, 97,110,110,101,108,40,41,44,32,99,41,59,32,125,'\n','\n', 32,32,35,100,101,102,105,110,101,32,82,67,84,120,67,104, 97,110,110,101,108,40,41,9,66,101,97,99,111,110,67,111, 110,116,114,111,108,40,50,41,'\n',32,32,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,82,67,84,120, 67,104,97,110,110,101,108,40,99,111,110,115,116,32,105,110, 116,32,38,99,41,9,123,32,83,101,116,40,82,67,84,120, 67,104,97,110,110,101,108,40,41,44,32,99,41,59,32,125, '\n','\n',32,32,35,100,101,102,105,110,101,32,82,67,84,88, 77,79,68,69,95,83,73,78,71,76,69,95,83,72,79,84, 9,48,'\n',32,32,35,100,101,102,105,110,101,32,82,67,84, 88,77,79,68,69,95,67,79,78,84,73,78,85,79,85,83, 9,49,'\n','\n',32,32,35,100,101,102,105,110,101,32,82,67, 84,120,77,111,100,101,40,41,9,66,101,97,99,111,110,67, 111,110,116,114,111,108,40,51,41,'\n',32,32,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,82,67,84, 120,77,111,100,101,40,99,111,110,115,116,32,105,110,116,32, 38,109,41,9,123,32,83,101,116,40,82,67,84,120,77,111, 100,101,40,41,44,32,109,41,59,32,125,'\n','\n',32,32,35, 100,101,102,105,110,101,32,69,69,80,82,79,77,40,110,41, 9,64,64,40,48,120,49,52,51,54,41,91,40,110,41,93, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,69,69,80,82,79,77,40,99,111,110,115,116, 32,105,110,116,32,38,105,44,32,99,111,110,115,116,32,105, 110,116,32,38,100,41,32,123,32,83,101,116,40,69,69,80, 82,79,77,40,105,41,44,32,100,41,59,32,125,'\n','\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 116,97,114,116,84,97,115,107,40,99,111,110,115,116,32,105, 110,116,32,116,41,9,123,32,97,115,109,32,123,32,48,120, 55,49,44,32,116,125,59,32,125,'\n',32,32,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,116,111,112,84,97, 115,107,40,99,111,110,115,116,32,105,110,116,32,116,41,9, 123,32,97,115,109,32,123,32,48,120,56,49,44,32,116,125, 59,32,125,'\n','\n',47,47,32,69,69,80,82,79,77,32,105, 110,100,105,99,101,115,'\n',32,32,35,100,101,102,105,110,101, 32,69,69,80,82,79,77,95,77,79,84,79,82,67,79,78, 84,82,79,76,32,48,120,48,48,'\n',32,32,35,100,101,102, 105,110,101,32,69,69,80,82,79,77,95,83,80,69,67,73, 69,83,32,48,120,48,49,'\n',32,32,35,100,101,102,105,110, 101,32,69,69,80,82,79,77,95,76,79,78,71,73,68,32, 48,120,48,50,'\n',32,32,35,100,101,102,105,110,101,32,69, 69,80,82,79,77,95,85,83,69,82,76,69,86,69,76,32, 48,120,48,54,'\n',32,32,35,100,101,102,105,110,101,32,69, 69,80,82,79,77,95,68,69,70,65,85,76,84,80,73,78, 71,82,65,84,69,32,48,120,48,55,'\n',32,32,35,100,101, 102,105,110,101,32,69,69,80,82,79,77,95,82,85,78,83, 32,48,120,48,56,'\n',32,32,35,100,101,102,105,110,101,32, 69,69,80,82,79,77,95,87,73,78,83,32,48,120,48,97, '\n',32,32,35,100,101,102,105,110,101,32,69,69,80,82,79, 77,95,76,79,83,83,69,83,32,48,120,48,99,'\n',32,32, 35,100,101,102,105,110,101,32,69,69,80,82,79,77,95,80, 79,73,78,84,83,32,48,120,48,101,'\n',32,32,35,100,101, 102,105,110,101,32,69,69,80,82,79,77,95,80,76,65,89, 83,69,67,79,78,68,83,32,48,120,49,48,'\n',32,32,35, 100,101,102,105,110,101,32,69,69,80,82,79,77,95,84,79, 84,65,76,80,76,65,89,84,73,77,69,32,48,120,49,50, '\n',32,32,35,100,101,102,105,110,101,32,69,69,80,82,79, 77,95,77,65,88,66,79,84,83,32,48,120,49,54,'\n',32, 32,35,100,101,102,105,110,101,32,69,69,80,82,79,77,95, 77,73,83,83,73,79,78,73,68,32,48,120,49,55,'\n',32, 32,35,100,101,102,105,110,101,32,69,69,80,82,79,77,95, 77,73,83,83,73,79,78,83,80,76,65,89,69,68,32,48, 120,49,56,'\n',32,32,35,100,101,102,105,110,101,32,69,69, 80,82,79,77,95,77,73,83,83,73,79,78,80,79,73,78, 84,83,32,48,120,49,99,'\n',32,32,35,100,101,102,105,110, 101,32,69,69,80,82,79,77,95,72,73,71,72,83,67,79, 82,69,32,48,120,49,101,'\n',32,32,35,100,101,102,105,110, 101,32,69,69,80,82,79,77,95,82,79,66,79,84,78,65, 77,69,32,48,120,50,48,'\n',32,32,35,100,101,102,105,110, 101,32,69,69,80,82,79,77,95,66,73,82,84,72,68,65, 84,69,32,48,120,52,48,'\n',32,32,35,100,101,102,105,110, 101,32,69,69,80,82,79,77,95,66,79,84,68,65,84,65, 32,48,120,52,54,'\n',32,32,35,100,101,102,105,110,101,32, 69,69,80,82,79,77,95,83,84,65,84,85,83,32,48,120, 52,55,'\n',32,32,35,100,101,102,105,110,101,32,69,69,80, 82,79,77,95,70,73,82,83,84,84,79,75,69,78,32,48, 120,52,56,'\n',32,32,35,100,101,102,105,110,101,32,69,69, 80,82,79,77,95,76,65,83,84,84,79,75,69,78,32,48, 120,55,101,'\n',32,32,35,100,101,102,105,110,101,32,69,69, 80,82,79,77,95,77,65,88,84,79,75,69,78,83,32,50, 56,'\n',9,47,47,115,112,97,114,101,58,32,48,120,56,48, 32,45,32,48,120,102,102,'\n','\n',47,47,77,111,116,111,114, 67,111,110,116,114,111,108,32,40,101,101,112,114,111,109,91, 101,77,111,116,111,114,67,111,110,116,114,111,108,93,41,58, '\n',32,32,35,100,101,102,105,110,101,32,77,79,84,79,82, 67,79,78,84,82,79,76,95,78,79,82,77,65,76,83,80, 69,69,68,77,65,83,75,32,48,120,48,55,'\n',32,32,35, 100,101,102,105,110,101,32,77,79,84,79,82,67,79,78,84, 82,79,76,95,83,76,79,87,83,80,69,69,68,77,65,83, 75,32,48,120,51,56,'\n',32,32,35,100,101,102,105,110,101, 32,77,79,84,79,82,67,79,78,84,82,79,76,95,76,69, 70,84,68,73,82,32,48,120,52,48,'\n',32,32,35,100,101, 102,105,110,101,32,77,79,84,79,82,67,79,78,84,82,79, 76,95,82,73,71,72,84,68,73,82,32,48,120,56,48,'\n', '\n',47,47,83,112,101,99,105,101,115,32,40,101,101,112,114, 111,109,91,101,83,112,101,99,105,101,115,93,32,118,97,108, 117,101,115,41,'\n',32,32,35,100,101,102,105,110,101,32,83, 80,69,67,73,69,83,95,71,73,71,65,77,69,83,72,32, 49,'\n',32,32,35,100,101,102,105,110,101,32,83,80,69,67, 73,69,83,95,83,78,65,80,84,82,65,88,32,50,'\n',32, 32,35,100,101,102,105,110,101,32,83,80,69,67,73,69,83, 95,83,72,65,68,79,87,83,84,82,73,75,69,32,51,'\n', 32,32,35,100,101,102,105,110,101,32,83,80,69,67,73,69, 83,95,84,69,67,72,78,79,74,65,87,32,52,'\n','\n',47, 47,83,116,97,116,117,115,32,40,101,101,112,114,111,109,91, 101,83,116,97,116,117,115,93,32,118,97,108,117,101,115,41, '\n',32,32,35,100,101,102,105,110,101,32,83,84,65,84,85, 83,95,73,78,73,84,73,65,76,73,90,73,78,71,32,48, 120,48,49,'\n',32,32,35,100,101,102,105,110,101,32,83,84, 65,84,85,83,95,68,79,87,78,76,79,65,68,73,78,71, 32,48,120,48,50,'\n',32,32,35,100,101,102,105,110,101,32, 83,84,65,84,85,83,95,76,79,67,75,69,68,32,48,120, 48,52,'\n',9,47,47,98,105,116,115,32,51,45,55,32,115, 112,97,114,101,'\n','\n',47,47,66,97,116,116,101,114,121,32, 118,111,108,116,97,103,101,'\n',32,32,35,100,101,102,105,110, 101,32,66,65,84,84,69,82,89,95,77,65,88,32,52,54, 48,48,'\n',32,32,35,100,101,102,105,110,101,32,66,65,84, 84,69,82,89,95,76,79,87,32,51,52,48,48,'\n',32,32, 35,100,101,102,105,110,101,32,66,65,84,84,69,82,89,95, 77,73,78,32,50,55,48,48,'\n','\n',47,47,32,67,111,110, 116,114,111,108,108,101,114,32,98,117,116,116,111,110,115,'\n', 32,32,35,100,101,102,105,110,101,32,67,79,78,84,82,79, 76,76,69,82,95,66,85,84,84,79,78,49,9,48,120,48, 49,48,48,'\n',32,32,35,100,101,102,105,110,101,32,67,79, 78,84,82,79,76,76,69,82,95,66,85,84,84,79,78,50, 9,48,120,48,50,48,48,'\n',32,32,35,100,101,102,105,110, 101,32,67,79,78,84,82,79,76,76,69,82,95,66,85,84, 84,79,78,51,9,48,120,48,48,48,49,'\n',32,32,35,100, 101,102,105,110,101,32,67,79,78,84,82,79,76,76,69,82, 95,66,85,84,84,79,78,52,9,48,120,48,49,48,49,'\n', 32,32,35,100,101,102,105,110,101,32,67,79,78,84,82,79, 76,76,69,82,95,66,85,84,84,79,78,53,9,48,120,48, 50,48,49,'\n','\n',32,32,47,47,32,82,79,77,32,115,117, 98,114,111,117,116,105,110,101,115,'\n',32,32,47,47,32,105, 110,116,101,114,97,99,116,105,111,110,32,115,117,98,114,111, 117,116,105,110,101,115,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,110,100,83,112,121,98,111, 116,77,101,115,115,97,103,101,40,99,111,110,115,116,32,105, 110,116,32,38,110,73,110,100,101,120,44,32,99,111,110,115, 116,32,105,110,116,32,38,110,67,109,100,44,'\n',32,32,32, 32,99,111,110,115,116,32,105,110,116,32,38,110,72,105,66, 121,116,101,44,32,99,111,110,115,116,32,105,110,116,32,38, 110,76,111,66,121,116,101,41,'\n',32,32,123,'\n',9,97,115, 109,32,123,32,48,120,101,51,44,32,36,110,73,110,100,101, 120,32,125,59,'\n',9,97,115,109,32,123,32,48,120,101,51, 44,32,36,110,67,109,100,32,125,59,'\n',9,97,115,109,32, 123,32,48,120,101,51,44,32,36,110,72,105,66,121,116,101, 32,125,59,'\n',9,97,115,109,32,123,32,48,120,101,51,44, 32,36,110,76,111,66,121,116,101,32,125,59,'\n',9,97,115, 109,32,123,32,48,120,49,55,44,32,51,52,32,125,59,'\n', 9,97,115,109,32,123,32,48,120,48,49,44,32,52,32,125, 59,'\n',32,32,125,'\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,110,100,82,67,88,77,101,115, 115,97,103,101,40,99,111,110,115,116,32,105,110,116,32,38, 110,77,101,115,115,97,103,101,41,'\n',9,123,32,97,115,109, 32,123,32,48,120,101,51,44,32,36,110,77,101,115,115,97, 103,101,44,32,48,120,49,55,44,32,51,55,44,32,48,120, 48,49,44,32,49,32,125,59,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,110,100,65, 108,108,82,97,110,103,101,77,101,115,115,97,103,101,40,99, 111,110,115,116,32,105,110,116,32,38,110,77,101,115,115,97, 103,101,44,32,99,111,110,115,116,32,105,110,116,32,38,110, 68,97,116,97,41,'\n',9,123,32,97,115,109,32,123,32,48, 120,101,51,44,32,36,110,77,101,115,115,97,103,101,44,32, 48,120,101,51,44,32,36,110,68,97,116,97,44,32,48,120, 49,55,44,32,51,56,44,32,48,120,48,49,44,32,50,32, 125,59,32,125,'\n','\n',32,32,47,47,32,117,116,105,108,115, 32,115,117,98,114,111,117,116,105,110,101,115,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,68,105,115, 112,40,99,111,110,115,116,32,105,110,116,32,38,100,105,115, 112,108,97,121,41,'\n',9,123,32,97,115,109,32,123,32,48, 120,101,51,44,32,36,100,105,115,112,108,97,121,44,32,48, 120,49,55,44,32,52,50,44,32,48,120,48,49,44,32,49, 32,125,59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101, 32,77,79,86,69,95,66,65,83,73,67,9,9,48,120,48, 49,48,48,'\n',32,32,35,100,101,102,105,110,101,32,77,79, 86,69,95,82,65,78,68,79,77,9,9,48,120,48,50,48, 48,'\n',32,32,35,100,101,102,105,110,101,32,77,79,86,69, 95,70,65,78,67,89,9,9,48,120,48,51,48,48,'\n',32, 32,35,100,101,102,105,110,101,32,77,79,86,69,95,83,76, 79,87,68,79,87,78,9,9,48,120,48,52,48,48,'\n',32, 32,35,100,101,102,105,110,101,32,77,79,86,69,95,83,80, 69,69,68,85,80,9,9,48,120,48,53,48,48,'\n','\n',32, 32,35,100,101,102,105,110,101,32,77,79,86,69,95,77,65, 83,75,9,9,48,120,48,48,102,102,'\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,84,89,80,69,95,77, 65,83,75,9,48,120,102,102,48,48,'\n','\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,70,79,82,87,65,82,68,9,9,77,79,86,69,95,66, 65,83,73,67,32,43,32,49,'\n',32,32,35,100,101,102,105, 110,101,32,77,79,86,69,95,66,65,83,73,67,95,66,65, 67,75,87,65,82,68,9,9,77,79,86,69,95,66,65,83, 73,67,32,43,32,50,'\n',32,32,35,100,101,102,105,110,101, 32,77,79,86,69,95,66,65,83,73,67,95,83,80,73,78, 95,76,69,70,84,9,9,77,79,86,69,95,66,65,83,73, 67,32,43,32,51,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,66,65,83,73,67,95,83,80,73,78,95, 82,73,71,72,84,9,9,77,79,86,69,95,66,65,83,73, 67,32,43,32,52,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,66,65,83,73,67,95,84,85,82,78,95, 76,69,70,84,9,9,77,79,86,69,95,66,65,83,73,67, 32,43,32,53,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,66,65,83,73,67,95,84,85,82,78,95,82, 73,71,72,84,9,9,77,79,86,69,95,66,65,83,73,67, 32,43,32,54,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,66,65,83,73,67,95,65,86,79,73,68,95, 76,69,70,84,9,9,77,79,86,69,95,66,65,83,73,67, 32,43,32,55,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,66,65,83,73,67,95,65,86,79,73,68,95, 82,73,71,72,84,9,77,79,86,69,95,66,65,83,73,67, 32,43,32,56,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,66,65,83,73,67,95,82,69,83,84,9,9, 77,79,86,69,95,66,65,83,73,67,32,43,32,57,'\n',32, 32,35,100,101,102,105,110,101,32,77,79,86,69,95,66,65, 83,73,67,95,83,84,79,80,9,9,77,79,86,69,95,66, 65,83,73,67,32,43,32,49,48,'\n','\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,82,65,78,68,79,77, 95,70,79,82,87,65,82,68,9,9,77,79,86,69,95,82, 65,78,68,79,77,32,43,32,49,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,82,65,78,68,79,77,95, 66,65,67,75,87,65,82,68,9,9,77,79,86,69,95,82, 65,78,68,79,77,32,43,32,50,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,82,65,78,68,79,77,95, 83,80,73,78,95,76,69,70,84,9,9,77,79,86,69,95, 82,65,78,68,79,77,32,43,32,51,'\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,82,65,78,68,79,77, 95,83,80,73,78,95,82,73,71,72,84,9,77,79,86,69, 95,82,65,78,68,79,77,32,43,32,52,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,82,65,78,68,79, 77,95,84,85,82,78,95,76,69,70,84,9,9,77,79,86, 69,95,82,65,78,68,79,77,32,43,32,53,'\n',32,32,35, 100,101,102,105,110,101,32,77,79,86,69,95,82,65,78,68, 79,77,95,84,85,82,78,95,82,73,71,72,84,9,77,79, 86,69,95,82,65,78,68,79,77,32,43,32,54,'\n',32,32, 35,100,101,102,105,110,101,32,77,79,86,69,95,82,65,78, 68,79,77,95,82,69,83,84,9,9,77,79,86,69,95,82, 65,78,68,79,77,32,43,32,55,'\n','\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,70,65,78,67,89,95, 90,73,71,90,65,71,9,9,77,79,86,69,95,70,65,78, 67,89,32,43,32,49,'\n',32,32,35,100,101,102,105,110,101, 32,77,79,86,69,95,70,65,78,67,89,95,83,72,65,75, 69,9,9,77,79,86,69,95,70,65,78,67,89,32,43,32, 50,'\n',32,32,35,100,101,102,105,110,101,32,77,79,86,69, 95,70,65,78,67,89,95,83,67,65,78,9,9,77,79,86, 69,95,70,65,78,67,89,32,43,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,70,65,78,67,89, 95,83,84,69,80,9,9,77,79,86,69,95,70,65,78,67, 89,32,43,32,52,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,84,69,80,95, 66,65,67,75,9,9,77,79,86,69,95,70,65,78,67,89, 32,43,32,53,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,70,65,78,67,89,95,83,69,65,82,67,72, 9,9,77,79,86,69,95,70,65,78,67,89,32,43,32,54, '\n',32,32,35,100,101,102,105,110,101,32,77,79,86,69,95, 70,65,78,67,89,95,70,65,75,69,95,76,69,70,84,9, 9,77,79,86,69,95,70,65,78,67,89,32,43,32,55,'\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,70, 65,78,67,89,95,82,65,75,69,95,82,73,71,72,84,9, 9,77,79,86,69,95,70,65,78,67,89,32,43,32,56,'\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,70, 65,78,67,89,95,66,85,71,95,70,79,82,87,65,82,68, 9,77,79,86,69,95,70,65,78,67,89,32,43,32,57,'\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,70, 65,78,67,89,95,76,65,90,89,9,9,77,79,86,69,95, 70,65,78,67,89,32,43,32,49,48,'\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,70,65,78,67,89,95, 87,65,76,75,9,9,77,79,86,69,95,70,65,78,67,89, 32,43,32,49,49,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,87,65,76,75,95, 66,65,67,75,9,9,77,79,86,69,95,70,65,78,67,89, 32,43,32,49,50,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,68,65,78,67,69, 9,9,77,79,86,69,95,70,65,78,67,89,32,43,32,49, 51,'\n','\n',32,32,35,100,101,102,105,110,101,32,77,79,86, 69,95,83,76,79,87,68,79,87,78,95,70,79,82,87,65, 82,68,9,9,77,79,86,69,95,83,76,79,87,68,79,87, 78,32,43,32,49,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,83,76,79,87,68,79,87,78,95,66,65, 67,75,87,65,82,68,9,77,79,86,69,95,83,76,79,87, 68,79,87,78,32,43,32,50,'\n',32,32,35,100,101,102,105, 110,101,32,77,79,86,69,95,83,76,79,87,68,79,87,78, 95,83,80,73,78,95,76,69,70,84,9,77,79,86,69,95, 83,76,79,87,68,79,87,78,32,43,32,51,'\n',32,32,35, 100,101,102,105,110,101,32,77,79,86,69,95,83,76,79,87, 68,79,87,78,95,83,80,73,78,95,82,73,71,72,84,9, 77,79,86,69,95,83,76,79,87,68,79,87,78,32,43,32, 52,'\n','\n',32,32,35,100,101,102,105,110,101,32,77,79,86, 69,95,83,80,69,69,68,85,80,95,70,79,82,87,65,82, 68,9,9,77,79,86,69,95,83,80,69,69,68,85,80,32, 43,32,49,'\n',32,32,35,100,101,102,105,110,101,32,77,79, 86,69,95,83,80,69,69,68,85,80,95,66,65,67,75,87, 65,82,68,9,9,77,79,86,69,95,83,80,69,69,68,85, 80,32,43,32,50,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,83,80,69,69,68,85,80,95,83,80,73, 78,95,76,69,70,84,9,77,79,86,69,95,83,80,69,69, 68,85,80,32,43,32,51,'\n',32,32,35,100,101,102,105,110, 101,32,77,79,86,69,95,83,80,69,69,68,85,80,95,83, 80,73,78,95,82,73,71,72,84,9,77,79,86,69,95,83, 80,69,69,68,85,80,32,43,32,52,'\n','\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,66,97,115,105, 99,77,111,118,101,32,40,99,111,110,115,116,32,105,110,116, 32,38,109,111,118,101,44,32,99,111,110,115,116,32,105,110, 116,32,38,116,105,109,101,41,'\n',9,123,32,97,115,109,32, 123,32,48,120,101,51,44,32,36,109,111,118,101,44,32,48, 120,101,51,44,32,36,116,105,109,101,44,32,48,120,49,55, 44,32,52,51,44,32,48,120,48,49,44,32,50,32,125,59, 32,125,'\n','\n',32,32,47,47,32,110,83,111,117,110,100,32, 105,115,32,48,45,55,57,44,32,45,49,32,61,32,110,111, 32,115,111,117,110,100,'\n',32,32,47,47,32,110,68,105,115, 112,108,97,121,32,105,115,32,76,69,68,32,97,110,105,109, 97,116,105,111,110,32,40,48,45,49,53,41,32,116,111,32, 112,108,97,121,44,32,45,49,32,61,32,110,111,32,97,110, 105,109,97,116,105,111,110,'\n',32,32,47,47,32,110,77,111, 118,101,109,101,110,116,32,105,115,32,102,114,111,109,32,116, 104,101,32,42,77,111,118,101,32,114,111,117,116,105,110,101, 115,32,100,101,102,105,110,101,100,32,98,101,108,111,119,44, 32,45,49,32,61,32,110,111,32,109,111,118,101,'\n',32,32, 47,47,32,110,82,101,112,101,97,116,32,105,115,32,110,117, 109,98,101,114,32,111,102,32,116,105,109,101,115,32,116,111, 32,114,101,112,101,97,116,32,109,111,116,105,111,110,'\n',32, 32,47,47,32,110,116,105,109,101,32,105,115,32,105,110,32, 49,48,109,115,32,115,116,101,112,115,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,65,99,116,105,111, 110,32,40,99,111,110,115,116,32,105,110,116,32,38,110,83, 111,117,110,100,44,32,99,111,110,115,116,32,105,110,116,32, 38,110,68,105,115,112,108,97,121,44,'\n',32,32,32,32,99, 111,110,115,116,32,105,110,116,32,38,110,77,111,118,101,109, 101,110,116,44,32,99,111,110,115,116,32,105,110,116,32,38, 110,82,101,112,101,97,116,44,32,99,111,110,115,116,32,105, 110,116,32,38,110,84,105,109,101,41,'\n',32,32,123,'\n',9, 97,115,109,32,123,32,48,120,101,51,44,32,36,110,83,111, 117,110,100,32,125,59,'\n',9,97,115,109,32,123,32,48,120, 101,51,44,32,36,110,68,105,115,112,108,97,121,32,125,59, '\n',9,97,115,109,32,123,32,48,120,101,51,44,32,36,110, 77,111,118,101,109,101,110,116,32,125,59,'\n',9,97,115,109, 32,123,32,48,120,101,51,44,32,36,110,82,101,112,101,97, 116,32,125,59,'\n',9,97,115,109,32,123,32,48,120,101,51, 44,32,36,110,84,105,109,101,32,125,59,'\n',9,97,115,109, 32,123,32,48,120,49,55,44,32,52,52,32,125,59,'\n',9, 97,115,109,32,123,32,48,120,48,49,44,32,53,32,125,59, '\n',32,32,125,'\n','\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,82,97,110,100,111,109,77,111,118,101, 32,40,99,111,110,115,116,32,105,110,116,32,38,109,111,118, 101,44,32,99,111,110,115,116,32,105,110,116,32,38,116,105, 109,101,41,'\n',9,123,32,97,115,109,32,123,32,48,120,101, 51,44,32,36,109,111,118,101,44,32,48,120,101,51,44,32, 36,116,105,109,101,44,32,48,120,49,55,44,32,52,54,44, 32,48,120,48,49,44,32,50,32,125,59,32,125,'\n','\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,70, 97,110,99,121,77,111,118,101,32,40,99,111,110,115,116,32, 105,110,116,32,38,109,111,118,101,44,32,99,111,110,115,116, 32,105,110,116,32,38,116,105,109,101,41,'\n',9,123,32,97, 115,109,32,123,32,48,120,101,51,44,32,36,109,111,118,101, 44,32,48,120,101,51,44,32,36,116,105,109,101,44,32,48, 120,49,55,44,32,52,55,44,32,48,120,48,49,44,32,50, 32,125,59,32,125,'\n','\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,108,111,119,68,111,119,110,77, 111,118,101,32,40,99,111,110,115,116,32,105,110,116,32,38, 109,111,118,101,44,32,99,111,110,115,116,32,105,110,116,32, 38,116,105,109,101,41,'\n',9,123,32,97,115,109,32,123,32, 48,120,101,51,44,32,36,109,111,118,101,44,32,48,120,101, 51,44,32,36,116,105,109,101,44,32,48,120,49,55,44,32, 52,56,44,32,48,120,48,49,44,32,50,32,125,59,32,125, '\n','\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,112,101,101,100,85,112,77,111,118,101,32,40,99, 111,110,115,116,32,105,110,116,32,38,109,111,118,101,44,32, 99,111,110,115,116,32,105,110,116,32,38,116,105,109,101,41, '\n',9,123,32,97,115,109,32,123,32,48,120,101,51,44,32, 36,109,111,118,101,44,32,48,120,101,51,44,32,36,116,105, 109,101,44,32,48,120,49,55,44,32,52,57,44,32,48,120, 48,49,44,32,50,32,125,59,32,125,'\n','\n',32,32,47,47, 32,65,100,100,115,32,97,32,118,97,108,117,101,32,116,111, 32,97,32,50,32,98,121,116,101,32,108,111,99,97,116,105, 111,110,32,105,110,32,69,69,112,114,111,109,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,117,109, 50,77,101,109,32,40,99,111,110,115,116,32,105,110,116,32, 38,110,77,101,109,44,32,99,111,110,115,116,32,105,110,116, 32,38,110,86,97,108,117,101,41,'\n',9,123,32,97,115,109, 32,123,32,48,120,101,51,44,32,36,110,77,101,109,44,32, 48,120,101,51,44,32,36,110,86,97,108,117,101,44,32,48, 120,49,55,44,32,53,48,44,32,48,120,48,49,44,32,50, 32,125,59,32,125,'\n','\n',32,32,47,47,32,65,100,100,115, 32,97,32,118,97,108,117,101,32,116,111,32,97,32,52,32, 98,121,116,101,32,108,111,99,97,116,105,111,110,32,105,110, 32,69,69,112,114,111,109,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,117,109,52,77,101,109,32, 40,99,111,110,115,116,32,105,110,116,32,38,110,77,101,109, 44,32,99,111,110,115,116,32,105,110,116,32,38,110,86,97, 108,117,101,41,'\n',9,123,32,97,115,109,32,123,32,48,120, 101,51,44,32,36,110,77,101,109,44,32,48,120,101,51,44, 32,36,110,86,97,108,117,101,44,32,48,120,49,55,44,32, 53,49,44,32,48,120,48,49,44,32,50,32,125,59,32,125, '\n','\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,78,79,78,69,9,9,9,45,49,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,83,72,79,67, 75,69,68,9,9,9,54,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,70,73,82,69,95,76,65,83, 69,82,9,9,55,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,70,73,82,69,95,69,76,69,67,84, 82,79,78,69,84,9,9,56,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,70,73,82,69,95,83,80, 73,78,78,69,82,9,9,57,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,72,73,84,95,66,89,95, 76,65,83,69,82,9,9,49,48,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,72,73,84,95,66,89, 95,69,76,69,67,84,82,79,78,69,84,9,49,49,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,72, 73,84,95,66,89,95,83,80,73,78,78,69,82,9,9,49, 50,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,84,65,71,9,9,9,49,51,'\n',32,32,35,100,101, 102,105,110,101,32,83,79,85,78,68,95,67,82,65,83,72, 9,9,9,49,52,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,70,73,71,72,84,9,9,9,49,53, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,71,79,84,95,73,84,9,9,9,49,54,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,71,69,78, 69,82,65,76,95,65,76,69,82,84,9,9,49,55,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,79, 85,84,95,79,70,95,69,78,69,82,71,89,95,65,76,69, 82,84,9,49,56,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,76,79,87,95,69,78,69,82,71,89, 95,65,76,69,82,84,9,49,57,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,83,67,79,82,69,95, 65,76,69,82,84,9,9,50,48,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,84,73,77,69,95,65, 76,69,82,84,9,9,50,49,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,80,82,79,88,73,77,73, 84,89,95,65,76,69,82,84,9,9,50,50,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,68,65,78, 71,69,82,95,65,76,69,82,84,9,9,50,51,'\n',32,32, 35,100,101,102,105,110,101,32,83,79,85,78,68,95,66,79, 77,66,95,65,76,69,82,84,9,9,50,52,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,70,73,78, 65,76,95,67,79,85,78,84,68,79,87,78,9,9,50,53, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,84,73,67,75,95,84,79,67,75,9,9,50,54,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,71, 79,84,79,9,9,9,50,55,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,83,67,65,78,9,9,9, 50,56,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,80,79,73,78,84,95,84,79,9,9,50,57,'\n', 32,32,35,100,101,102,105,110,101,32,83,79,85,78,68,95, 65,67,84,73,86,65,84,69,95,83,72,73,69,76,68,83, 9,51,48,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,65,67,84,73,86,65,84,69,95,82,69,70, 76,69,67,84,9,51,49,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,65,67,84,73,86,65,84,69, 95,67,76,79,65,75,9,9,51,50,'\n',32,32,35,100,101, 102,105,110,101,32,83,79,85,78,68,95,65,67,84,73,86, 65,84,69,95,70,76,65,83,72,95,66,76,73,78,68,9, 51,51,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,77,65,71,78,69,84,9,9,9,51,52,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,81, 85,65,68,95,68,65,77,65,71,69,9,9,51,53,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,82, 69,80,85,76,83,69,9,9,9,51,54,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,84,85,82,66, 79,9,9,9,51,55,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,70,82,69,69,90,69,9,9,9, 51,56,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,83,76,79,87,9,9,9,51,57,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,82,69,86, 69,82,83,69,9,9,9,52,48,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,68,73,90,90,89,9, 9,9,52,49,'\n',32,32,35,100,101,102,105,110,101,32,83, 79,85,78,68,95,66,79,79,83,84,9,9,9,52,50,'\n', 32,32,35,100,101,102,105,110,101,32,83,79,85,78,68,95, 68,69,65,67,84,73,86,65,84,69,95,83,72,73,69,76, 68,83,9,52,51,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,68,69,65,67,84,73,86,65,84,69, 95,82,69,70,76,69,67,84,9,52,52,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,68,69,65,67, 84,73,86,65,84,69,95,67,76,79,65,75,9,52,53,'\n', 32,32,35,100,101,102,105,110,101,32,83,79,85,78,68,95, 82,69,70,76,69,67,84,9,9,9,52,54,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,69,88,80, 76,79,83,73,79,78,9,9,52,55,'\n',32,32,35,100,101, 102,105,110,101,32,83,79,85,78,68,95,66,73,71,95,69, 88,80,76,79,83,73,79,78,9,9,52,56,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,80,76,65, 67,69,95,66,79,77,66,9,9,52,57,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,72,73,84,95, 66,89,95,87,73,78,68,9,9,53,48,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,79,85,67,72, 9,9,9,53,49,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,71,69,73,71,69,82,9,9,9,53, 50,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,87,72,73,83,84,76,69,9,9,9,53,51,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,73, 77,95,73,84,9,9,9,53,52,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,72,69,76,80,9,9, 9,53,53,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,83,73,82,69,78,9,9,9,53,54,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,66, 85,82,78,84,9,9,9,53,55,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,71,82,73,78,68,69, 68,9,9,9,53,56,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,83,77,65,67,75,69,68,9,9, 9,53,57,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,84,82,73,76,76,95,85,80,9,9,54,48, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,84,82,73,76,76,95,68,79,87,78,9,9,54,49,'\n', 32,32,35,100,101,102,105,110,101,32,83,79,85,78,68,95, 89,69,76,76,9,9,9,54,50,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,87,72,73,83,80,69, 82,9,9,9,54,51,'\n','\n',32,32,35,100,101,102,105,110, 101,32,76,69,68,95,82,69,68,49,9,9,48,120,48,49, '\n',32,32,35,100,101,102,105,110,101,32,76,69,68,95,82, 69,68,50,9,9,48,120,48,50,'\n',32,32,35,100,101,102, 105,110,101,32,76,69,68,95,82,69,68,51,9,9,48,120, 48,52,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,71,82,69,69,78,49,9,9,48,120,48,56,'\n',32,32, 35,100,101,102,105,110,101,32,76,69,68,95,71,82,69,69, 78,50,9,9,48,120,49,48,'\n',32,32,35,100,101,102,105, 110,101,32,76,69,68,95,71,82,69,69,78,51,9,9,48, 120,50,48,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,89,69,76,76,79,87,9,9,48,120,52,48,'\n',32, 32,35,100,101,102,105,110,101,32,76,69,68,95,65,76,76, 95,82,69,68,9,9,76,69,68,95,82,69,68,49,32,43, 32,76,69,68,95,82,69,68,50,32,43,32,76,69,68,95, 82,69,68,51,'\n',32,32,35,100,101,102,105,110,101,32,76, 69,68,95,65,76,76,95,71,82,69,69,78,9,9,76,69, 68,95,71,82,69,69,78,49,32,43,32,76,69,68,95,71, 82,69,69,78,50,32,43,32,76,69,68,95,71,82,69,69, 78,51,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,65,76,76,95,82,69,68,95,71,82,69,69,78,9,76, 69,68,95,65,76,76,95,82,69,68,32,43,32,76,69,68, 95,65,76,76,95,71,82,69,69,78,'\n',32,32,35,100,101, 102,105,110,101,32,76,69,68,95,65,76,76,9,9,76,69, 68,95,65,76,76,95,82,69,68,95,71,82,69,69,78,32, 43,32,76,69,68,95,89,69,76,76,79,87,'\n','\n',35,101, 110,100,105,102,32,47,47,32,95,95,83,80,89,'\n','\n',47, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,'\n',32,42,32,83,119, 97,110,45,115,112,101,99,105,102,105,99,32,65,80,73,'\n', 32,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n',35,105, 102,32,100,101,102,105,110,101,100,40,95,95,83,87,65,78, 41,'\n','\n',47,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n',32, 42,32,77,111,116,111,114,115,'\n',32,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,47,'\n','\n',32,32,47,47,32,77,111,116,111, 114,'\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95, 65,9,48,'\n',32,32,35,100,101,102,105,110,101,32,77,84, 82,95,66,9,49,'\n',32,32,35,100,101,102,105,110,101,32, 77,84,82,95,67,9,50,'\n',32,32,35,100,101,102,105,110, 101,32,77,84,82,95,68,9,51,'\n',32,32,35,100,101,102, 105,110,101,32,77,84,82,95,69,9,52,'\n',32,32,35,100, 101,102,105,110,101,32,77,84,82,95,70,9,53,'\n','\n',32, 32,47,47,32,77,111,116,111,114,80,111,119,101,114,68,105, 114,101,99,116,105,111,110,'\n',32,32,35,100,101,102,105,110, 101,32,77,80,68,95,70,87,68,9,48,120,56,48,'\n',32, 32,35,100,101,102,105,110,101,32,77,80,68,95,82,69,86, 9,48,120,52,48,'\n',32,32,35,100,101,102,105,110,101,32, 77,80,68,95,70,76,79,65,84,9,48,120,67,48,'\n',32, 32,35,100,101,102,105,110,101,32,77,80,68,95,79,70,70, 9,48,120,48,48,'\n','\n',32,32,47,47,32,77,111,116,111, 114,83,116,97,116,101,'\n',32,32,35,100,101,102,105,110,101, 32,77,83,95,70,76,79,65,84,9,48,120,48,48,'\n',32, 32,35,100,101,102,105,110,101,32,77,83,95,66,82,65,75, 69,9,48,120,52,48,'\n',32,32,35,100,101,102,105,110,101, 32,77,83,95,70,87,68,9,48,120,56,56,'\n',32,32,35, 100,101,102,105,110,101,32,77,83,95,82,69,86,9,48,120, 56,48,'\n','\n',32,32,35,100,101,102,105,110,101,32,83,77, 79,84,79,82,95,70,87,68,9,48,120,48,56,'\n','\n',32, 32,35,100,101,102,105,110,101,32,77,84,82,95,70,87,68, 95,80,79,87,69,82,95,49,9,48,120,56,56,'\n',32,32, 35,100,101,102,105,110,101,32,77,84,82,95,70,87,68,95, 80,79,87,69,82,95,50,9,48,120,56,57,'\n',32,32,35, 100,101,102,105,110,101,32,77,84,82,95,70,87,68,95,80, 79,87,69,82,95,51,9,48,120,56,65,'\n',32,32,35,100, 101,102,105,110,101,32,77,84,82,95,70,87,68,95,80,79, 87,69,82,95,52,9,48,120,56,66,'\n',32,32,35,100,101, 102,105,110,101,32,77,84,82,95,70,87,68,95,80,79,87, 69,82,95,53,9,48,120,56,67,'\n',32,32,35,100,101,102, 105,110,101,32,77,84,82,95,70,87,68,95,80,79,87,69, 82,95,54,9,48,120,56,68,'\n',32,32,35,100,101,102,105, 110,101,32,77,84,82,95,70,87,68,95,80,79,87,69,82, 95,55,9,48,120,56,69,'\n',32,32,35,100,101,102,105,110, 101,32,77,84,82,95,70,87,68,95,80,79,87,69,82,95, 56,9,48,120,56,70,'\n','\n',32,32,35,100,101,102,105,110, 101,32,77,84,82,95,82,69,86,95,80,79,87,69,82,95, 49,9,48,120,56,48,'\n',32,32,35,100,101,102,105,110,101, 32,77,84,82,95,82,69,86,95,80,79,87,69,82,95,50, 9,48,120,56,49,'\n',32,32,35,100,101,102,105,110,101,32, 77,84,82,95,82,69,86,95,80,79,87,69,82,95,51,9, 48,120,56,50,'\n',32,32,35,100,101,102,105,110,101,32,77, 84,82,95,82,69,86,95,80,79,87,69,82,95,52,9,48, 120,56,51,'\n',32,32,35,100,101,102,105,110,101,32,77,84, 82,95,82,69,86,95,80,79,87,69,82,95,53,9,48,120, 56,52,'\n',32,32,35,100,101,102,105,110,101,32,77,84,82, 95,82,69,86,95,80,79,87,69,82,95,54,9,48,120,56, 53,'\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95, 82,69,86,95,80,79,87,69,82,95,55,9,48,120,56,54, '\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95,82, 69,86,95,80,79,87,69,82,95,56,9,48,120,56,55,'\n', '\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95,70, 76,79,65,84,95,80,79,87,69,82,95,49,9,48,120,48, 48,'\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95, 70,76,79,65,84,95,80,79,87,69,82,95,50,9,48,120, 48,49,'\n',32,32,35,100,101,102,105,110,101,32,77,84,82, 95,70,76,79,65,84,95,80,79,87,69,82,95,51,9,48, 120,48,50,'\n',32,32,35,100,101,102,105,110,101,32,77,84, 82,95,70,76,79,65,84,95,80,79,87,69,82,95,52,9, 48,120,48,51,'\n',32,32,35,100,101,102,105,110,101,32,77, 84,82,95,70,76,79,65,84,95,80,79,87,69,82,95,53, 9,48,120,48,52,'\n',32,32,35,100,101,102,105,110,101,32, 77,84,82,95,70,76,79,65,84,95,80,79,87,69,82,95, 54,9,48,120,48,53,'\n',32,32,35,100,101,102,105,110,101, 32,77,84,82,95,70,76,79,65,84,95,80,79,87,69,82, 95,55,9,48,120,48,54,'\n',32,32,35,100,101,102,105,110, 101,32,77,84,82,95,70,76,79,65,84,95,80,79,87,69, 82,95,56,9,48,120,48,55,'\n','\n',32,32,35,100,101,102, 105,110,101,32,77,84,82,95,66,82,65,75,69,95,80,79, 87,69,82,95,49,9,48,120,52,48,'\n',32,32,35,100,101, 102,105,110,101,32,77,84,82,95,66,82,65,75,69,95,80, 79,87,69,82,95,50,9,48,120,52,49,'\n',32,32,35,100, 101,102,105,110,101,32,77,84,82,95,66,82,65,75,69,95, 80,79,87,69,82,95,51,9,48,120,52,50,'\n',32,32,35, 100,101,102,105,110,101,32,77,84,82,95,66,82,65,75,69, 95,80,79,87,69,82,95,52,9,48,120,52,51,'\n',32,32, 35,100,101,102,105,110,101,32,77,84,82,95,66,82,65,75, 69,95,80,79,87,69,82,95,53,9,48,120,52,52,'\n',32, 32,35,100,101,102,105,110,101,32,77,84,82,95,66,82,65, 75,69,95,80,79,87,69,82,95,54,9,48,120,52,53,'\n', 32,32,35,100,101,102,105,110,101,32,77,84,82,95,66,82, 65,75,69,95,80,79,87,69,82,95,55,9,48,120,52,54, '\n',32,32,35,100,101,102,105,110,101,32,77,84,82,95,66, 82,65,75,69,95,80,79,87,69,82,95,56,9,48,120,52, 55,'\n','\n',32,32,35,100,101,102,105,110,101,32,77,111,116, 111,114,80,111,119,101,114,83,105,103,110,101,100,40,110,41, 9,64,40,48,120,48,53,48,48,48,48,32,43,32,40,110, 41,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,77,111,116,111,114,80,111,119,101,114, 83,105,103,110,101,100,40,99,111,110,115,116,32,105,110,116, 32,110,44,32,99,111,110,115,116,32,105,110,116,32,38,118, 41,32,123,32,83,101,116,40,77,111,116,111,114,80,111,119, 101,114,83,105,103,110,101,100,40,110,41,44,32,118,41,59, 32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,77,111, 116,111,114,66,114,97,107,101,80,111,119,101,114,40,110,41, 9,64,40,48,120,48,55,48,48,48,48,32,43,32,40,110, 41,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,77,111,116,111,114,66,114,97,107,101, 80,111,119,101,114,40,99,111,110,115,116,32,105,110,116,32, 110,44,32,99,111,110,115,116,32,105,110,116,32,38,118,41, 32,123,32,83,101,116,40,77,111,116,111,114,66,114,97,107, 101,80,111,119,101,114,40,110,41,44,32,118,41,59,32,125, '\n','\n',32,32,35,100,101,102,105,110,101,32,77,111,116,111, 114,80,111,119,101,114,56,40,110,41,9,64,40,48,120,50, 48,48,48,48,48,32,43,32,40,110,41,41,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 77,111,116,111,114,80,111,119,101,114,56,40,99,111,110,115, 116,32,105,110,116,32,110,44,32,99,111,110,115,116,32,105, 110,116,32,38,118,41,32,123,32,83,101,116,40,77,111,116, 111,114,80,111,119,101,114,56,40,110,41,44,32,118,41,59, 32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,77,111, 116,111,114,80,111,119,101,114,49,50,56,40,110,41,9,64, 40,48,120,49,48,48,48,48,48,32,43,32,40,110,41,41, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,77,111,116,111,114,80,111,119,101,114,49,50, 56,40,99,111,110,115,116,32,105,110,116,32,110,44,32,99, 111,110,115,116,32,105,110,116,32,38,118,41,32,123,32,83, 101,116,40,77,111,116,111,114,80,111,119,101,114,49,50,56, 40,110,41,44,32,118,41,59,32,125,'\n','\n',47,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,'\n',32,42,32,69,118,101,110,116, 32,115,111,117,114,99,101,115,'\n',32,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,47,'\n','\n',32,32,47,47,32,69,118,101,110, 116,83,101,110,115,111,114,84,121,112,101,'\n',32,32,35,100, 101,102,105,110,101,32,69,83,84,95,83,69,78,83,79,82, 95,49,9,9,48,'\n',32,32,35,100,101,102,105,110,101,32, 69,83,84,95,83,69,78,83,79,82,95,50,9,9,49,'\n', 32,32,35,100,101,102,105,110,101,32,69,83,84,95,83,69, 78,83,79,82,95,51,9,9,50,'\n',32,32,35,100,101,102, 105,110,101,32,69,83,84,95,84,73,77,69,82,95,49,9, 9,51,'\n',32,32,35,100,101,102,105,110,101,32,69,83,84, 95,84,73,77,69,82,95,50,9,9,52,'\n',32,32,35,100, 101,102,105,110,101,32,69,83,84,95,84,73,77,69,82,95, 51,9,9,53,'\n',32,32,35,100,101,102,105,110,101,32,69, 83,84,95,84,73,77,69,82,95,52,9,9,54,'\n',32,32, 35,100,101,102,105,110,101,32,69,83,84,95,76,65,83,84, 95,73,82,95,77,83,71,9,55,'\n',32,32,35,100,101,102, 105,110,101,32,69,83,84,95,67,79,85,78,84,69,82,95, 49,9,9,56,'\n',32,32,35,100,101,102,105,110,101,32,69, 83,84,95,67,79,85,78,84,69,82,95,50,9,9,57,'\n', 32,32,35,100,101,102,105,110,101,32,69,83,84,95,67,79, 85,78,84,69,82,95,51,9,9,49,48,'\n',32,32,35,100, 101,102,105,110,101,32,69,83,84,95,85,83,69,82,95,69, 86,69,78,84,95,48,9,49,49,'\n',32,32,35,100,101,102, 105,110,101,32,69,83,84,95,85,83,69,82,95,69,86,69, 78,84,95,49,9,49,50,'\n',32,32,35,100,101,102,105,110, 101,32,69,83,84,95,85,83,69,82,95,69,86,69,78,84, 95,50,9,49,51,'\n',32,32,35,100,101,102,105,110,101,32, 69,83,84,95,85,83,69,82,95,69,86,69,78,84,95,51, 9,49,52,'\n',32,32,35,100,101,102,105,110,101,32,69,83, 84,95,85,83,69,82,95,69,86,69,78,84,95,52,9,49, 53,'\n',32,32,35,100,101,102,105,110,101,32,69,83,84,95, 86,73,82,84,85,65,76,95,77,79,84,79,82,9,49,49, '\n',32,32,35,100,101,102,105,110,101,32,69,83,84,95,86, 73,82,84,85,65,76,95,83,69,78,83,79,82,9,49,50, '\n',32,32,35,100,101,102,105,110,101,32,69,83,84,95,87, 65,73,84,95,70,79,82,95,77,83,71,9,49,51,'\n',32, 32,35,100,101,102,105,110,101,32,69,83,84,95,73,78,70, 82,65,82,69,68,95,83,84,65,84,85,83,9,49,52,'\n', 32,32,35,100,101,102,105,110,101,32,69,83,84,95,83,69, 78,83,79,82,95,85,78,85,83,69,68,9,49,54,'\n','\n', 32,32,47,47,32,69,118,101,110,116,83,116,97,116,101,115, '\n',32,32,35,100,101,102,105,110,101,32,69,83,95,66,69, 76,79,87,95,76,79,87,69,82,9,48,'\n',32,32,35,100, 101,102,105,110,101,32,69,83,95,66,69,84,87,69,69,78, 9,9,49,'\n',32,32,35,100,101,102,105,110,101,32,69,83, 95,65,66,79,86,69,95,85,80,80,69,82,9,50,'\n',32, 32,35,100,101,102,105,110,101,32,69,83,95,85,78,68,69, 84,69,82,77,73,78,69,68,9,51,'\n','\n',32,32,35,100, 101,102,105,110,101,32,69,118,101,110,116,84,121,112,101,40, 110,41,9,9,64,40,48,120,49,50,48,48,48,48,32,43, 32,40,110,41,41,'\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,69,118,101,110,116,84,121, 112,101,40,99,111,110,115,116,32,105,110,116,32,110,44,32, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,123,32, 83,101,116,40,69,118,101,110,116,84,121,112,101,40,110,41, 44,32,118,41,59,32,125,'\n','\n',32,32,35,100,101,102,105, 110,101,32,69,118,101,110,116,83,114,99,40,110,41,9,9, 64,40,48,120,49,51,48,48,48,48,32,43,32,40,110,41, 41,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,69,118,101,110,116,83,114,99,40,99,111, 110,115,116,32,105,110,116,32,110,44,32,99,111,110,115,116, 32,105,110,116,32,38,118,41,32,123,32,83,101,116,40,69, 118,101,110,116,83,114,99,40,110,41,44,32,118,41,59,32, 125,'\n','\n',32,32,35,100,101,102,105,110,101,32,69,118,101, 110,116,67,111,117,110,116,115,40,110,41,9,64,40,48,120, 49,52,48,48,48,48,32,43,32,40,110,41,41,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,69,118,101,110,116,67,111,117,110,116,115,40,99,111,110, 115,116,32,105,110,116,32,110,44,32,99,111,110,115,116,32, 105,110,116,32,38,118,41,32,123,32,83,101,116,40,69,118, 101,110,116,67,111,117,110,116,115,40,110,41,44,32,118,41, 59,32,125,'\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,49,32,77,83,32,84,105,109,101,114,'\n',32, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,47,'\n','\n',32,32,35, 100,101,102,105,110,101,32,77,83,84,105,109,101,114,40,110, 41,9,9,64,40,48,120,49,54,48,48,48,48,32,43,32, 40,110,41,41,'\n',32,32,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,82,101,115,101,116,77,83,84,105,109,101, 114,40,99,111,110,115,116,32,105,110,116,32,110,41,32,123, 32,83,101,116,40,77,83,84,105,109,101,114,40,110,41,44, 32,48,41,59,32,125,'\n','\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,87,97,105,116,77,83,40,99, 111,110,115,116,32,105,110,116,32,38,118,41,9,123,32,97, 115,109,32,123,32,48,120,52,55,44,32,36,118,32,58,32, 95,95,65,83,77,95,83,82,67,95,69,88,84,125,59,32, 125,'\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n', 32,42,32,83,121,115,116,101,109,32,115,101,116,116,105,110, 103,115,'\n',32,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,47,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,121,115,116,101, 109,40,110,41,9,9,9,64,40,48,120,49,56,48,48,48, 48,32,43,32,40,110,41,41,'\n',32,32,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,83,121,115,116, 101,109,40,99,111,110,115,116,32,105,110,116,32,110,44,32, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,123,32, 83,101,116,40,83,121,115,116,101,109,40,110,41,44,32,118, 41,59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32, 83,89,83,95,66,65,84,84,69,82,89,95,76,69,86,69, 76,9,9,48,32,47,47,32,82,47,79,'\n',32,32,35,100, 101,102,105,110,101,32,73,109,109,101,100,105,97,116,101,66, 97,116,116,101,114,121,76,101,118,101,108,40,41,9,83,121, 115,116,101,109,40,83,89,83,95,66,65,84,84,69,82,89, 95,76,69,86,69,76,41,'\n','\n',32,32,35,100,101,102,105, 110,101,32,83,89,83,95,68,69,66,85,71,95,84,65,83, 75,95,77,79,68,69,9,9,49,32,47,47,32,82,47,79, '\n',32,32,35,100,101,102,105,110,101,32,68,101,98,117,103, 84,97,115,107,77,111,100,101,40,41,9,9,83,121,115,116, 101,109,40,83,89,83,95,68,69,66,85,71,95,84,65,83, 75,95,77,79,68,69,41,'\n','\n',32,32,35,100,101,102,105, 110,101,32,83,89,83,95,77,69,77,79,82,89,95,77,65, 80,95,65,68,68,82,69,83,83,9,50,32,47,47,32,82, 47,79,'\n',32,32,35,100,101,102,105,110,101,32,77,101,109, 111,114,121,77,97,112,65,100,100,114,101,115,115,40,41,9, 9,83,121,115,116,101,109,40,83,89,83,95,77,69,77,79, 82,89,95,77,65,80,95,65,68,68,82,69,83,83,41,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95,67, 85,82,82,69,78,84,95,84,65,83,75,9,9,51,32,47, 47,32,82,47,79,'\n',32,32,35,100,101,102,105,110,101,32, 67,117,114,114,101,110,116,84,97,115,107,40,41,9,9,9, 83,121,115,116,101,109,40,83,89,83,95,67,85,82,82,69, 78,84,95,84,65,83,75,41,'\n','\n',32,32,35,100,101,102, 105,110,101,32,83,89,83,95,83,69,82,73,65,76,95,76, 73,78,75,95,83,84,65,84,85,83,9,52,32,47,47,32, 82,47,79,'\n',32,32,35,100,101,102,105,110,101,32,83,101, 114,105,97,108,76,105,110,107,83,116,97,116,117,115,40,41, 9,9,83,121,115,116,101,109,40,83,89,83,95,83,69,82, 73,65,76,95,76,73,78,75,95,83,84,65,84,85,83,41, '\n','\n',9,35,100,101,102,105,110,101,32,83,76,83,95,87, 65,73,84,95,70,79,82,95,77,83,71,9,48,'\n',9,35, 100,101,102,105,110,101,32,83,76,83,95,82,69,67,69,73, 86,73,78,71,95,77,83,71,9,49,'\n',9,35,100,101,102, 105,110,101,32,83,76,83,95,84,82,65,78,83,77,73,84, 84,73,78,71,9,50,'\n',9,35,100,101,102,105,110,101,32, 83,76,83,95,85,78,75,78,79,87,78,9,9,51,'\n','\n', 32,32,35,100,101,102,105,110,101,32,83,89,83,95,79,80, 67,79,68,69,83,95,80,69,82,95,84,73,77,69,83,76, 73,67,69,9,53,32,47,47,32,82,47,87,32,40,49,48, 48,120,32,111,110,108,121,41,'\n',32,32,35,100,101,102,105, 110,101,32,79,112,99,111,100,101,115,80,101,114,84,105,109, 101,115,108,105,99,101,40,41,9,9,83,121,115,116,101,109, 40,83,89,83,95,79,80,67,79,68,69,83,95,80,69,82, 95,84,73,77,69,83,76,73,67,69,41,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,79, 112,99,111,100,101,115,80,101,114,84,105,109,101,115,108,105, 99,101,40,99,111,110,115,116,32,105,110,116,32,38,118,41, 32,123,32,83,101,116,40,79,112,99,111,100,101,115,80,101, 114,84,105,109,101,115,108,105,99,101,40,41,44,32,118,41, 59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,83, 89,83,95,77,79,84,79,82,95,84,82,65,78,83,73,84, 73,79,78,95,68,69,76,65,89,9,54,32,47,47,32,82, 47,87,'\n',32,32,35,100,101,102,105,110,101,32,77,111,116, 111,114,84,114,97,110,115,105,116,105,111,110,68,101,108,97, 121,40,41,9,83,121,115,116,101,109,40,83,89,83,95,77, 79,84,79,82,95,84,82,65,78,83,73,84,73,79,78,95, 68,69,76,65,89,41,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,77,111,116,111,114,84, 114,97,110,115,105,116,105,111,110,68,101,108,97,121,40,99, 111,110,115,116,32,105,110,116,32,38,118,41,32,123,32,83, 101,116,40,77,111,116,111,114,84,114,97,110,115,105,116,105, 111,110,68,101,108,97,121,40,41,44,32,118,41,59,32,125, '\n','\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95, 83,69,78,83,79,82,95,82,69,70,82,69,83,72,95,82, 65,84,69,9,55,32,47,47,32,82,47,87,'\n',32,32,35, 100,101,102,105,110,101,32,83,101,110,115,111,114,82,101,102, 114,101,115,104,82,97,116,101,40,41,9,9,83,121,115,116, 101,109,40,83,89,83,95,83,69,78,83,79,82,95,82,69, 70,82,69,83,72,95,82,65,84,69,41,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,110,115,111,114,82,101,102,114,101,115,104,82,97,116,101, 40,99,111,110,115,116,32,105,110,116,32,38,118,41,32,123, 32,83,101,116,40,83,101,110,115,111,114,82,101,102,114,101, 115,104,82,97,116,101,40,41,44,32,118,41,59,32,125,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95,69, 88,80,65,78,68,69,68,95,82,67,95,77,69,83,83,65, 71,69,83,9,56,32,47,47,32,82,47,87,'\n',32,32,35, 100,101,102,105,110,101,32,69,120,112,97,110,100,101,100,82, 101,109,111,116,101,77,101,115,115,97,103,101,115,40,41,9, 83,121,115,116,101,109,40,83,89,83,95,69,88,80,65,78, 68,69,68,95,82,67,95,77,69,83,83,65,71,69,83,41, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,69,120,112,97,110,100,101,100,82,101,109,111, 116,101,77,101,115,115,97,103,101,115,40,99,111,110,115,116, 32,105,110,116,32,38,118,41,32,123,32,83,101,116,40,69, 120,112,97,110,100,101,100,82,101,109,111,116,101,77,101,115, 115,97,103,101,115,40,41,44,32,118,41,59,32,125,'\n','\n', 32,32,35,100,101,102,105,110,101,32,83,89,83,95,76,67, 68,95,82,69,70,82,69,83,72,95,82,65,84,69,9,9, 57,32,47,47,32,82,47,87,32,40,49,48,48,109,115,32, 116,105,99,107,115,41,'\n',32,32,35,100,101,102,105,110,101, 32,76,67,68,82,101,102,114,101,115,104,82,97,116,101,40, 41,9,9,83,121,115,116,101,109,40,83,89,83,95,76,67, 68,95,82,69,70,82,69,83,72,95,82,65,84,69,41,'\n', 32,32,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,76,67,68,82,101,102,114,101,115,104,82,97,116, 101,40,99,111,110,115,116,32,105,110,116,32,38,118,41,32, 123,32,83,101,116,40,76,67,68,82,101,102,114,101,115,104, 82,97,116,101,40,41,44,32,118,41,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,83,89,83,95,78,79,95, 80,79,87,69,82,95,68,79,87,78,95,79,78,95,65,67, 9,49,48,32,47,47,32,82,47,87,32,40,116,114,117,101, 47,102,97,108,115,101,41,'\n',32,32,35,100,101,102,105,110, 101,32,78,111,80,111,119,101,114,68,111,119,110,79,110,65, 67,40,41,9,9,83,121,115,116,101,109,40,83,89,83,95, 78,79,95,80,79,87,69,82,95,68,79,87,78,95,79,78, 95,65,67,41,'\n',32,32,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,78,111,80,111,119,101,114,68, 111,119,110,79,110,65,67,40,99,111,110,115,116,32,105,110, 116,32,38,118,41,32,123,32,83,101,116,40,78,111,80,111, 119,101,114,68,111,119,110,79,110,65,67,40,41,44,32,118, 41,59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32, 83,89,83,95,68,69,70,65,85,76,84,95,84,65,83,75, 95,83,84,65,67,75,95,83,73,90,69,9,49,49,32,47, 47,32,82,47,87,'\n',32,32,35,100,101,102,105,110,101,32, 68,101,102,97,117,108,116,83,116,97,99,107,83,105,122,101, 40,41,9,9,83,121,115,116,101,109,40,83,89,83,95,68, 69,70,65,85,76,84,95,84,65,83,75,95,83,84,65,67, 75,95,83,73,90,69,41,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,68,101,102,97,117, 108,116,83,116,97,99,107,83,105,122,101,40,99,111,110,115, 116,32,105,110,116,32,38,118,41,32,123,32,83,101,116,40, 68,101,102,97,117,108,116,83,116,97,99,107,83,105,122,101, 40,41,44,32,118,41,59,32,125,'\n','\n',32,32,35,100,101, 102,105,110,101,32,83,89,83,95,84,65,83,75,95,65,67, 81,85,73,82,69,95,80,82,73,79,82,73,84,89,9,49, 50,32,47,47,32,82,47,87,'\n',32,32,35,100,101,102,105, 110,101,32,84,97,115,107,65,99,113,117,105,114,101,80,114, 105,111,114,105,116,121,40,41,9,9,83,121,115,116,101,109, 40,83,89,83,95,84,65,83,75,95,65,67,81,85,73,82, 69,95,80,82,73,79,82,73,84,89,41,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,84, 97,115,107,65,99,113,117,105,114,101,80,114,105,111,114,105, 116,121,40,99,111,110,115,116,32,105,110,116,32,38,118,41, 32,123,32,83,101,116,40,84,97,115,107,65,99,113,117,105, 114,101,80,114,105,111,114,105,116,121,40,41,44,32,118,41, 59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,83, 89,83,95,84,82,65,78,83,77,73,84,84,69,82,95,82, 65,78,71,69,9,9,49,51,32,47,47,32,82,47,87,32, 40,48,47,49,41,32,63,63,63,'\n',32,32,35,100,101,102, 105,110,101,32,84,114,97,110,115,109,105,116,116,101,114,82, 97,110,103,101,40,41,9,9,83,121,115,116,101,109,40,83, 89,83,95,84,82,65,78,83,77,73,84,84,69,82,95,82, 65,78,71,69,41,'\n','\n',32,32,35,100,101,102,105,110,101, 32,83,89,83,95,70,76,79,65,84,95,68,85,82,73,78, 71,95,73,78,65,67,84,73,86,69,95,80,87,77,9,49, 52,32,47,47,32,82,47,87,32,40,116,114,117,101,47,102, 97,108,115,101,41,'\n',32,32,35,100,101,102,105,110,101,32, 70,108,111,97,116,68,117,114,105,110,103,73,110,97,99,116, 105,118,101,80,87,77,40,41,9,83,121,115,116,101,109,40, 83,89,83,95,70,76,79,65,84,95,68,85,82,73,78,71, 95,73,78,65,67,84,73,86,69,95,80,87,77,41,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,70,108,111,97,116,68,117,114,105,110,103,73,110,97, 99,116,105,118,101,80,87,77,40,99,111,110,115,116,32,105, 110,116,32,38,118,41,32,123,32,83,101,116,40,70,108,111, 97,116,68,117,114,105,110,103,73,110,97,99,116,105,118,101, 80,87,77,40,41,44,32,118,41,59,32,125,'\n','\n',32,32, 35,100,101,102,105,110,101,32,83,89,83,95,82,79,84,95, 69,82,82,79,82,83,95,67,79,85,78,84,9,9,49,53, 32,47,47,32,82,47,87,'\n',32,32,35,100,101,102,105,110, 101,32,82,111,116,69,114,114,111,114,115,67,111,117,110,116, 40,41,9,9,83,121,115,116,101,109,40,83,89,83,95,82, 79,84,95,69,82,82,79,82,83,95,67,79,85,78,84,41, '\n','\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95, 82,79,84,95,68,69,66,79,85,78,67,69,68,95,71,76, 73,84,67,72,69,83,9,49,54,32,47,47,32,82,47,87, 32,100,101,98,117,103,'\n',32,32,35,100,101,102,105,110,101, 32,82,111,116,68,101,98,111,117,110,99,101,100,71,108,105, 116,99,104,101,115,40,41,9,83,121,115,116,101,109,40,83, 89,83,95,82,79,84,95,68,69,66,79,85,78,67,69,68, 95,71,76,73,84,67,72,69,83,41,'\n','\n',32,32,35,100, 101,102,105,110,101,32,83,89,83,95,80,82,69,65,77,66, 76,69,95,83,73,90,69,9,9,49,55,32,47,47,32,82, 47,87,32,40,48,46,46,51,41,'\n',32,32,35,100,101,102, 105,110,101,32,83,121,115,116,101,109,80,114,101,97,109,98, 108,101,83,105,122,101,40,41,9,9,83,121,115,116,101,109, 40,83,89,83,95,80,82,69,65,77,66,76,69,95,83,73, 90,69,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,121,115,116,101,109,80,114,101, 97,109,98,108,101,83,105,122,101,40,99,111,110,115,116,32, 105,110,116,32,38,118,41,32,123,32,83,101,116,40,83,121, 115,116,101,109,80,114,101,97,109,98,108,101,83,105,122,101, 40,41,44,32,118,41,59,32,125,'\n','\n',32,32,35,100,101, 102,105,110,101,32,83,89,83,95,85,78,83,79,76,73,67, 73,84,69,68,95,77,69,83,83,65,71,69,83,9,49,56, 32,47,47,32,82,47,87,32,40,116,114,117,101,47,102,97, 108,115,101,41,'\n',32,32,35,100,101,102,105,110,101,32,85, 110,115,111,108,105,99,105,116,101,100,77,101,115,115,97,103, 101,115,40,41,9,9,83,121,115,116,101,109,40,83,89,83, 95,85,78,83,79,76,73,67,73,84,69,68,95,77,69,83, 83,65,71,69,83,41,'\n','\n',32,32,35,100,101,102,105,110, 101,32,83,89,83,95,69,88,80,65,78,68,69,68,95,83, 85,66,82,79,85,84,73,78,69,83,9,49,57,32,47,47, 32,82,47,87,32,40,116,114,117,101,47,102,97,108,115,101, 41,'\n',32,32,35,100,101,102,105,110,101,32,69,120,112,97, 110,100,101,100,83,117,98,114,111,117,116,105,110,101,115,40, 41,9,9,83,121,115,116,101,109,40,83,89,83,95,69,88, 80,65,78,68,69,68,95,83,85,66,82,79,85,84,73,78, 69,83,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,69,120,112,97,110,100,101,100,83, 117,98,114,111,117,116,105,110,101,115,40,99,111,110,115,116, 32,105,110,116,32,38,118,41,32,123,32,83,101,116,40,69, 120,112,97,110,100,101,100,83,117,98,114,111,117,116,105,110, 101,115,40,41,44,32,118,41,59,32,125,'\n','\n',32,32,35, 100,101,102,105,110,101,32,83,89,83,95,80,79,87,69,82, 95,68,79,87,78,95,68,69,76,65,89,9,9,50,48,32, 47,47,32,82,47,87,'\n',32,32,35,100,101,102,105,110,101, 32,80,111,119,101,114,68,111,119,110,68,101,108,97,121,40, 41,9,9,83,121,115,116,101,109,40,83,89,83,95,80,79, 87,69,82,95,68,79,87,78,95,68,69,76,65,89,41,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95,87, 65,84,67,72,95,70,79,82,77,65,84,9,9,50,49,32, 47,47,32,82,47,87,'\n',32,32,35,100,101,102,105,110,101, 32,87,97,116,99,104,70,111,114,109,97,116,40,41,9,9, 9,83,121,115,116,101,109,40,83,89,83,95,87,65,84,67, 72,95,70,79,82,77,65,84,41,'\n',32,32,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,87,97,116, 99,104,70,111,114,109,97,116,40,99,111,110,115,116,32,105, 110,116,32,38,118,41,32,123,32,83,101,116,40,87,97,116, 99,104,70,111,114,109,97,116,40,41,44,32,118,41,59,32, 125,'\n',32,32,35,100,101,102,105,110,101,32,70,77,84,95, 72,72,77,77,9,48,'\n',32,32,35,100,101,102,105,110,101, 32,70,77,84,95,77,77,83,83,9,49,'\n',32,32,35,100, 101,102,105,110,101,32,70,77,84,95,77,83,83,84,69,78, 84,72,83,9,50,'\n','\n',32,32,35,100,101,102,105,110,101, 32,83,89,83,95,83,69,78,83,79,82,95,77,73,83,83, 69,68,95,67,79,78,86,69,82,83,73,79,78,83,9,50, 50,32,47,47,32,82,47,87,32,100,101,98,117,103,'\n',32, 32,35,100,101,102,105,110,101,32,77,105,115,115,101,100,83, 101,110,115,111,114,65,68,67,111,110,118,101,114,115,105,111, 110,115,40,41,9,83,121,115,116,101,109,40,83,89,83,95, 83,69,78,83,79,82,95,77,73,83,83,69,68,95,67,79, 78,86,69,82,83,73,79,78,83,41,'\n','\n',32,32,35,100, 101,102,105,110,101,32,83,89,83,95,73,71,78,79,82,69, 95,77,69,83,83,65,71,69,83,95,67,80,85,9,50,51, '\n',32,32,35,100,101,102,105,110,101,32,73,103,110,111,114, 101,77,101,115,115,97,103,101,115,67,80,85,40,41,9,9, 83,121,115,116,101,109,40,83,89,83,95,73,71,78,79,82, 69,95,77,69,83,83,65,71,69,83,95,67,80,85,41,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95,67, 79,77,77,95,69,82,82,79,82,83,95,84,73,77,69,79, 85,84,9,50,52,'\n',32,32,35,100,101,102,105,110,101,32, 67,111,109,109,69,114,114,111,114,115,84,105,109,101,111,117, 116,40,41,9,9,83,121,115,116,101,109,40,83,89,83,95, 67,79,77,77,95,69,82,82,79,82,83,95,84,73,77,69, 79,85,84,41,'\n','\n',32,32,35,100,101,102,105,110,101,32, 83,89,83,95,67,79,77,77,95,69,82,82,79,82,83,95, 80,65,82,73,84,89,9,50,53,'\n',32,32,35,100,101,102, 105,110,101,32,67,111,109,109,69,114,114,111,114,115,80,97, 114,105,116,121,40,41,9,9,83,121,115,116,101,109,40,83, 89,83,95,67,79,77,77,95,69,82,82,79,82,83,95,80, 65,82,73,84,89,41,'\n','\n',32,32,35,100,101,102,105,110, 101,32,83,89,83,95,67,79,77,77,95,69,82,82,79,82, 83,95,70,82,65,77,73,78,71,9,50,54,'\n',32,32,35, 100,101,102,105,110,101,32,67,111,109,109,69,114,114,111,114, 115,70,114,97,109,105,110,103,40,41,9,9,83,121,115,116, 101,109,40,83,89,83,95,67,79,77,77,95,69,82,82,79, 82,83,95,70,82,65,77,73,78,71,41,'\n','\n',32,32,35, 100,101,102,105,110,101,32,83,89,83,95,67,79,77,77,95, 69,82,82,79,82,83,95,79,86,69,82,82,85,78,9,50, 55,'\n',32,32,35,100,101,102,105,110,101,32,67,111,109,109, 69,114,114,111,114,115,79,118,101,114,114,117,110,40,41,9, 9,83,121,115,116,101,109,40,83,89,83,95,67,79,77,77, 95,69,82,82,79,82,83,95,79,86,69,82,82,85,78,41, '\n','\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95, 73,78,84,69,82,95,67,72,65,82,95,84,73,77,69,79, 85,84,9,50,56,32,47,47,32,82,47,87,'\n',32,32,35, 100,101,102,105,110,101,32,73,110,116,101,114,67,104,97,114, 84,105,109,101,111,117,116,40,41,9,9,83,121,115,116,101, 109,40,83,89,83,95,73,78,84,69,82,95,67,72,65,82, 95,84,73,77,69,79,85,84,41,'\n',32,32,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,73,110,116, 101,114,67,104,97,114,84,105,109,101,111,117,116,40,99,111, 110,115,116,32,105,110,116,32,38,118,41,32,123,32,83,101, 116,40,73,110,116,101,114,67,104,97,114,84,105,109,101,111, 117,116,40,41,44,32,118,41,59,32,125,'\n','\n',32,32,35, 100,101,102,105,110,101,32,83,89,83,95,84,65,83,75,95, 83,67,72,69,68,85,76,73,78,71,95,80,82,73,79,82, 73,84,89,9,50,57,32,47,47,32,82,47,87,'\n',32,32, 35,100,101,102,105,110,101,32,84,97,115,107,83,99,104,101, 100,117,108,105,110,103,80,114,105,111,114,105,116,121,40,41, 9,83,121,115,116,101,109,40,83,89,83,95,84,65,83,75, 95,83,67,72,69,68,85,76,73,78,71,95,80,82,73,79, 82,73,84,89,41,'\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,84,97,115,107,83,99,104, 101,100,117,108,105,110,103,80,114,105,111,114,105,116,121,40, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,123,32, 83,101,116,40,84,97,115,107,83,99,104,101,100,117,108,105, 110,103,80,114,105,111,114,105,116,121,40,41,44,32,118,41, 59,32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,83, 89,83,95,86,79,76,85,77,69,9,9,9,51,48,32,47, 47,32,82,47,87,'\n',32,32,35,100,101,102,105,110,101,32, 86,111,108,117,109,101,40,41,9,9,9,83,121,115,116,101, 109,40,83,89,83,95,86,79,76,85,77,69,41,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,86,111,108,117,109,101,40,99,111,110,115,116,32,105,110, 116,32,38,118,41,32,123,32,83,101,116,40,86,111,108,117, 109,101,40,41,44,32,118,41,59,32,125,'\n',32,32,35,100, 101,102,105,110,101,32,77,65,88,95,86,79,76,85,77,69, 9,49,54,'\n','\n',32,32,35,100,101,102,105,110,101,32,83, 89,83,95,83,79,85,78,68,95,80,76,65,89,73,78,71, 9,9,51,49,32,47,47,32,82,47,79,32,40,116,114,117, 101,47,102,97,108,115,101,41,'\n',32,32,35,100,101,102,105, 110,101,32,83,111,117,110,100,65,99,116,105,118,101,40,41, 9,9,9,83,121,115,116,101,109,40,83,89,83,95,83,79, 85,78,68,95,80,76,65,89,73,78,71,41,'\n','\n',32,32, 35,100,101,102,105,110,101,32,83,89,83,95,80,76,65,89, 95,83,79,85,78,68,83,9,9,51,50,32,47,47,32,82, 47,87,32,40,116,114,117,101,47,102,97,108,115,101,41,'\n', 32,32,35,100,101,102,105,110,101,32,80,108,97,121,83,111, 117,110,100,115,40,41,9,9,9,83,121,115,116,101,109,40, 83,89,83,95,80,76,65,89,95,83,79,85,78,68,83,41, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,80,108,97,121,83,111,117,110,100,115,40,99, 111,110,115,116,32,105,110,116,32,38,118,41,32,123,32,83, 101,116,40,80,108,97,121,83,111,117,110,100,115,40,41,44, 32,118,41,59,32,125,'\n','\n',32,32,35,100,101,102,105,110, 101,32,83,89,83,95,81,85,69,85,69,68,95,83,79,85, 78,68,95,67,79,85,78,84,9,51,51,32,47,47,32,82, 47,79,'\n',32,32,35,100,101,102,105,110,101,32,81,117,101, 117,101,100,83,111,117,110,100,67,111,117,110,116,40,41,9, 9,83,121,115,116,101,109,40,83,89,83,95,81,85,69,85, 69,68,95,83,79,85,78,68,95,67,79,85,78,84,41,'\n', '\n',32,32,35,100,101,102,105,110,101,32,83,89,83,95,83, 69,78,83,79,82,95,83,84,65,82,84,85,80,95,68,69, 76,65,89,9,51,52,'\n',32,32,35,100,101,102,105,110,101, 32,83,101,110,115,111,114,83,116,97,114,116,117,112,68,101, 108,97,121,40,41,9,9,83,121,115,116,101,109,40,83,89, 83,95,83,69,78,83,79,82,95,83,84,65,82,84,85,80, 95,68,69,76,65,89,41,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,83,101,110,115,111, 114,83,116,97,114,116,117,112,68,101,108,97,121,40,99,111, 110,115,116,32,105,110,116,32,38,118,41,32,123,32,83,101, 116,40,83,101,110,115,111,114,83,116,97,114,116,117,112,68, 101,108,97,121,40,41,44,32,118,41,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,83,89,83,95,83,69,78, 83,79,82,95,68,69,76,65,89,95,67,89,67,76,69,83, 9,51,53,'\n',32,32,35,100,101,102,105,110,101,32,83,101, 110,115,111,114,68,101,108,97,121,67,121,99,108,101,115,40, 41,9,9,83,121,115,116,101,109,40,83,89,83,95,83,69, 78,83,79,82,95,68,69,76,65,89,95,67,89,67,76,69, 83,41,'\n','\n',32,32,35,100,101,102,105,110,101,32,83,89, 83,95,83,69,78,83,79,82,95,82,69,70,82,69,83,72, 95,83,84,65,84,69,9,51,54,'\n',32,32,35,100,101,102, 105,110,101,32,83,101,110,115,111,114,82,101,102,114,101,115, 104,83,116,97,116,101,40,41,9,9,83,121,115,116,101,109, 40,83,89,83,95,83,69,78,83,79,82,95,82,69,70,82, 69,83,72,95,83,84,65,84,69,41,'\n','\n',32,32,35,100, 101,102,105,110,101,32,83,89,83,95,83,69,78,83,79,82, 95,83,67,65,78,95,67,79,85,78,84,9,9,51,55,'\n', 32,32,35,100,101,102,105,110,101,32,83,101,110,115,111,114, 83,99,97,110,67,111,117,110,116,40,41,9,9,83,121,115, 116,101,109,40,83,89,83,95,83,69,78,83,79,82,95,83, 67,65,78,95,67,79,85,78,84,41,'\n','\n',32,32,35,100, 101,102,105,110,101,32,83,89,83,95,68,65,84,65,76,79, 71,95,83,73,90,69,9,9,51,56,32,47,47,32,82,47, 87,'\n',32,32,35,100,101,102,105,110,101,32,68,97,116,97, 108,111,103,83,105,122,101,40,41,9,9,9,83,121,115,116, 101,109,40,83,89,83,95,68,65,84,65,76,79,71,95,83, 73,90,69,41,'\n','\n',32,32,47,47,32,73,110,102,114,97, 114,101,100,82,101,99,101,105,118,101,77,111,100,101,'\n',32, 32,35,100,101,102,105,110,101,32,73,82,77,95,65,67,67, 69,80,84,95,65,76,76,9,48,'\n',32,32,35,100,101,102, 105,110,101,32,73,82,77,95,65,67,67,69,80,84,95,85, 83,69,82,9,49,'\n',32,32,35,100,101,102,105,110,101,32, 73,82,77,95,68,73,83,67,65,82,68,9,9,50,'\n','\n', 47,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,'\n',32,42,32,71, 108,111,98,97,108,32,86,97,114,105,97,98,108,101,115,32, 38,32,73,110,100,105,114,101,99,116,32,73,110,116,114,105, 110,115,105,99,32,115,111,117,114,99,101,115,'\n',32,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,47,'\n','\n',32,32,35,100,101, 102,105,110,101,32,73,110,116,114,105,110,115,105,99,73,110, 100,71,108,111,98,97,108,40,110,41,9,64,40,48,120,48, 54,48,48,48,48,32,43,32,40,110,41,41,'\n',32,32,35, 100,101,102,105,110,101,32,71,108,111,98,97,108,86,97,114, 40,110,41,9,9,64,64,40,48,120,50,98,50,99,41,91, 40,110,41,93,'\n','\n',47,42,'\n',9,35,100,101,102,105,110, 101,32,115,114,99,73,110,100,101,120,101,100,71,108,111,98, 97,108,67,111,110,115,116,9,52,55,'\n',9,35,100,101,102, 105,110,101,32,115,114,99,83,116,97,99,107,86,97,114,9, 9,52,57,'\n',9,35,100,101,102,105,110,101,32,115,114,99, 67,111,110,115,116,97,110,116,86,97,114,9,9,53,48,'\n', 9,35,100,101,102,105,110,101,32,115,114,99,70,117,110,99, 116,105,111,110,82,101,116,86,97,108,87,111,114,100,9,53, 49,'\n',9,35,100,101,102,105,110,101,32,115,114,99,86,97, 114,66,121,116,101,9,9,53,52,'\n',9,35,100,101,102,105, 110,101,32,115,114,99,86,97,114,87,111,114,100,9,9,53, 53,'\n',9,35,100,101,102,105,110,101,32,115,114,99,84,97, 115,107,83,116,97,99,107,86,97,114,66,121,116,101,9,53, 55,'\n',9,35,100,101,102,105,110,101,32,115,114,99,84,97, 115,107,83,116,97,99,107,86,97,114,87,111,114,100,9,53, 56,'\n',9,35,100,101,102,105,110,101,32,115,114,99,84,97, 115,107,86,97,114,9,9,54,48,'\n',42,47,'\n','\n',32,32, 35,100,101,102,105,110,101,32,83,116,97,99,107,65,100,100, 114,101,115,115,40,110,41,9,64,40,48,120,51,100,48,48, 48,48,32,43,32,40,110,41,41,'\n',32,32,35,100,101,102, 105,110,101,32,83,116,97,99,107,83,105,122,101,40,110,41, 9,9,64,40,48,120,51,101,48,48,48,48,32,43,32,40, 110,41,41,'\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,78,101,119,32,111,112,99,111,100,101,115,'\n', 32,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n',32,32, 47,47,32,67,108,101,97,114,67,111,109,109,97,110,100,65, 99,116,105,111,110,'\n',32,32,35,100,101,102,105,110,101,32, 67,76,82,95,84,73,77,69,82,83,9,9,48,120,48,49, '\n',32,32,35,100,101,102,105,110,101,32,67,76,82,95,73, 78,80,85,84,83,9,9,48,120,48,50,'\n',32,32,35,100, 101,102,105,110,101,32,67,76,82,95,86,65,82,73,65,66, 76,69,83,9,9,48,120,48,52,'\n',32,32,35,100,101,102, 105,110,101,32,67,76,82,95,84,65,83,75,95,83,84,65, 67,75,9,48,120,48,56,'\n',32,32,35,100,101,102,105,110, 101,32,67,76,82,95,69,86,69,78,84,83,9,9,48,120, 49,48,'\n',32,32,35,100,101,102,105,110,101,32,67,76,82, 95,66,82,69,65,75,80,79,73,78,84,83,9,48,120,50, 48,'\n',32,32,35,100,101,102,105,110,101,32,67,76,82,95, 68,65,84,65,76,79,71,9,9,48,120,52,48,'\n','\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,67, 108,101,97,114,65,108,108,40,99,111,110,115,116,32,105,110, 116,32,38,110,67,109,100,70,108,97,103,115,41,'\n',32,32, 123,32,97,115,109,32,123,32,48,120,99,55,44,32,36,110, 67,109,100,70,108,97,103,115,32,58,32,40,95,95,65,83, 77,95,78,79,95,84,89,80,69,32,32,124,32,95,95,65, 83,77,95,83,77,65,76,76,95,86,65,76,85,69,41,32, 125,59,32,125,'\n','\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,66,105,116,83,101,116,40,99,111,110, 115,116,32,105,110,116,32,38,114,101,115,117,108,116,44,32, 99,111,110,115,116,32,105,110,116,32,38,111,112,101,114,97, 110,100,41,'\n',32,32,123,32,97,115,109,32,123,32,48,120, 55,101,44,32,36,114,101,115,117,108,116,32,58,32,95,95, 65,83,77,95,83,82,67,95,69,88,84,44,32,36,111,112, 101,114,97,110,100,32,58,32,95,95,65,83,77,95,83,82, 67,95,69,88,84,32,125,59,32,125,'\n','\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,66,105,116,67, 108,101,97,114,40,99,111,110,115,116,32,105,110,116,32,38, 114,101,115,117,108,116,44,32,99,111,110,115,116,32,105,110, 116,32,38,111,112,101,114,97,110,100,41,'\n',32,32,123,32, 97,115,109,32,123,32,48,120,55,102,44,32,36,114,101,115, 117,108,116,32,58,32,95,95,65,83,77,95,83,82,67,95, 69,88,84,44,32,36,111,112,101,114,97,110,100,32,58,32, 95,95,65,83,77,95,83,82,67,95,69,88,84,32,125,59, 32,125,'\n','\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,78,101,103,97,116,101,40,99,111,110,115,116, 32,105,110,116,32,38,114,101,115,117,108,116,44,32,99,111, 110,115,116,32,105,110,116,32,38,111,112,101,114,97,110,100, 41,'\n',32,32,123,32,97,115,109,32,123,32,48,120,57,98, 44,32,36,114,101,115,117,108,116,32,58,32,95,95,65,83, 77,95,83,82,67,95,69,88,84,44,32,36,111,112,101,114, 97,110,100,32,58,32,95,95,65,83,77,95,83,82,67,95, 69,88,84,32,125,59,32,125,'\n','\n',47,42,'\n',32,32,35, 100,101,102,105,110,101,32,111,112,87,97,105,116,84,105,109, 101,114,86,97,108,117,101,9,48,120,55,65,'\n',32,32,35, 100,101,102,105,110,101,32,111,112,83,101,116,77,111,116,111, 114,83,116,97,116,101,9,48,120,70,49,'\n',42,47,'\n','\n', 35,101,110,100,105,102,32,47,47,32,95,95,83,87,65,78, '\n',}; nqc-3.1.r6/compiler/RelExpr.cpp0000600000175000017500000000714210216067472014500 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "RelExpr.h" #include "Bytecode.h" /* #include "parser.h" #include "RCX_Constants.h" */ // these are VERY dependent on RCX_Constants static int sReversed[] = { RelExpr::kGreaterOrEqual, RelExpr::kLessOrEqual, RelExpr::kNotEqualTo, RelExpr::kEqualTo, RelExpr::kLessThan, RelExpr::kGreaterThan }; static int sInverted[] = { RelExpr::kGreaterThan, RelExpr::kLessThan, RelExpr::kEqualTo, RelExpr::kNotEqualTo, RelExpr::kLessOrEqual, RelExpr::kGreaterOrEqual }; static RCX_Relation sRCX_Codes[] = { kRCX_LessOrEqual, kRCX_GreaterOrEqual, kRCX_NotEqualTo, kRCX_EqualTo }; RelExpr::RelExpr (Expr *lhs, int relation, Expr *rhs) : NodeExpr(lhs, rhs), fRelation(relation) { } Expr* RelExpr::Clone(Mapping *b) const { return new RelExpr(Get(0)->Clone(b), fRelation, Get(1)->Clone(b)); } bool RelExpr::Evaluate(int &v) const { int v1, v2; bool b; if (!Get(0)->Evaluate(v1)) return false; if (!Get(1)->Evaluate(v2)) return false; switch(fRelation) { case kLessOrEqual: b = (v1 <= v2); break; case kGreaterOrEqual: b = (v1 >= v2); break; case kNotEqualTo: b = (v1 != v2); break; case kEqualTo: b = (v1 == v2); break; case kGreaterThan: b = (v1 > v2); break; case kLessThan: b = (v1 < v2); break; default: return false; } v = b ? 1 : 0; return true; } bool RelExpr::EmitBranch_(Bytecode &b, int label, bool condition) const { bool ok = true; int r = fRelation; RCX_Value ea1 = Get(0)->EmitConstrained(b, TEST_MASK); RCX_Value ea2 = Get(1)->EmitConstrained(b, TEST_MASK); // if value 2 is constant, swap with value 1 if (RCX_VALUE_TYPE(ea2) == kRCX_ConstantType) { RCX_Value t = ea1; ea1 = ea2; ea2 = t; r = sReversed[r]; } // invert if emitting false branch if (!condition) r = sInverted[r]; switch(r) { case kLessOrEqual: case kGreaterOrEqual: case kNotEqualTo: case kEqualTo: b.AddTest(ea1, sRCX_Codes[r], ea2, label); break; case kGreaterThan: case kLessThan: if (RCX_VALUE_TYPE(ea1) == kRCX_ConstantType) { RCX_Relation rel; short adjust; short limit; short c; if (r == kGreaterThan) { rel = kRCX_GreaterOrEqual; adjust = -1; limit = -32768; } else { rel = kRCX_LessOrEqual; adjust = 1; limit = 32767; } c = RCX_VALUE_DATA(ea1); // check for impossible range if (c == limit) { ok = false; break; } // test for adjusted range b.AddTest(RCX_VALUE(kRCX_ConstantType, c+adjust), rel, ea2, label); } else { int around = b.NewLabel(); b.AddTest(ea1, sRCX_Codes[sInverted[r]], ea2, around); b.AddJump(label); b.SetLabel(around); } break; } b.ReleaseTempEA(ea1); b.ReleaseTempEA(ea2); return ok; } nqc-3.1.r6/compiler/RelExpr.h0000600000175000017500000000271210216067464014144 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __RelExpr_h #define __RelExpr_h #include "NodeExpr.h" class RelExpr : public NodeExpr { public: enum { kLessOrEqual = 0, kGreaterOrEqual, kNotEqualTo, kEqualTo, kGreaterThan, kLessThan }; RelExpr(Expr *lhs, int relation, Expr *rhs); virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; // glue to emit values based on EmitBranch_() virtual RCX_Value EmitAny_(Bytecode &b) const { return EmitBoolAny(b); } virtual bool EmitTo_(Bytecode &b, int dst) const { return EmitBoolTo(b, dst); } virtual bool EmitBranch_(Bytecode &b, int label, bool condition) const; private: int fRelation; }; #endif nqc-3.1.r6/compiler/RepeatStmt.cpp0000600000175000017500000001154710216067460015210 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "RepeatStmt.h" #include "Bytecode.h" #include "RCX_Cmd.h" #include "RCX_Target.h" #include "Expr.h" #include "Error.h" #include "RCX_Constants.h" #define REPEAT_MASK (TYPEMASK(kRCX_VariableType) + \ TYPEMASK(kRCX_ConstantType) + \ TYPEMASK(kRCX_RandomType)) bool RepeatStmt::sRCXLoopInUse = false; RepeatStmt::RepeatStmt(Expr *c, Stmt *s) : ChainStmt(s) { fCount = c; } RepeatStmt::~RepeatStmt() { delete fCount; } void RepeatStmt::EmitActual(Bytecode &b) { RCX_TargetType tt = b.GetTarget()->fType; if (tt == kRCX_RCXTarget || tt == kRCX_CMTarget) { // see if loop is candidate for loop counter int n; bool bCountEval = fCount->Evaluate(n); if (bCountEval && n >= 0 && n < 256 && !sRCXLoopInUse) { // mark the loop counter in use, then emit code sRCXLoopInUse = true; EmitRCXLoop(b); // loop counter is now available for future use sRCXLoopInUse = false; } else { // use a temp variable rather than the loop counter EmitRCXVar(b); } } else if (tt == kRCX_SwanTarget) { // Swan can't use EmitDecJump because if uses global variables EmitRCXVar(b); } else { EmitDecJump(b); } } /* * EmitRCXLoop(Bytecode &b) - emit code using the RCX loop counter. * Since there is only one loop counter per task/sub, this cannot * be used for nested repeats */ void RepeatStmt::EmitRCXLoop(Bytecode &b) { /* set loop count cPos: check loop body jump -> cPos */ RCX_Cmd cmd; RCX_Value ea; int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); ea = fCount->EmitConstrained(b, REPEAT_MASK); cmd.MakeSetLoop(ea); b.Add(cmd); b.ReleaseTempEA(ea); b.SetLabel(cLabel); cmd.MakeCheckLoop(0); b.Add(cmd); b.AddFixup(Bytecode::kSimpleLongFixup, bLabel, 1, kRCX_SCheckLoopOp); GetBody()->Emit(b); b.AddJump(cLabel); b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } /* * EmitRCXVar(Bytecode &b) - emit using a temp variable and decrementing * it manually. */ void RepeatStmt::EmitRCXVar(Bytecode &b) { /* setvar to loop count cPos: dec var check var body jump -> cPos */ RCX_Cmd cmd; int var; int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); // allocate the loop variable var = EmitCountToTemp(b); // emit the decrement/check b.SetLabel(cLabel); b.AddTest(RCX_VALUE(kRCX_ConstantType, 0), kRCX_GreaterOrEqual, RCX_VALUE(kRCX_VariableType, var), bLabel); cmd.MakeVar(kRCX_SubVar, var, RCX_VALUE(kRCX_ConstantType, 1)); b.Add(cmd); // body and jump back to check GetBody()->Emit(b); b.AddJump(cLabel); // done with temp and loop context b.GetVarAllocator().Release(var); b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } /* * EmitDecJump(Bytecode &b) - emit using the decvjnl instruction */ void RepeatStmt::EmitDecJump(Bytecode &b) { /* setvar to loop count cPos: check var body jump -> cPos */ RCX_Cmd cmd; int var; int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); var = EmitCountToTemp(b); b.SetLabel(cLabel); cmd.Set(kRCX_DecVarJmpLTZeroOp, var, 0, 0); b.Add(cmd); b.AddFixup(Bytecode::kSignBitLongFixup, bLabel, 2, kRCX_SDecVarJmpLTZeroOp); GetBody()->Emit(b); b.AddJump(cLabel); b.GetVarAllocator().Release(var); b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } int RepeatStmt::EmitCountToTemp(Bytecode &b) { int var = b.GetTempVar(true); if (var == kIllegalVar) Error(kErr_NoMoreTemps).Raise(&fCount->GetLoc()); else fCount->EmitTo(b, var); return var; } Stmt* RepeatStmt::CloneActual(Mapping *b) const { return new RepeatStmt(fCount->Clone(b), GetBody()->Clone(b)); } void RepeatStmt::GetExprs(vector &v) const { v.push_back(fCount); } nqc-3.1.r6/compiler/RepeatStmt.h0000600000175000017500000000252610216067454014655 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __RepeatStmt_h #define __RepeatStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif class Expr; class RepeatStmt : public ChainStmt { public: RepeatStmt(Expr *c, Stmt *s); ~RepeatStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const; private: void EmitRCXLoop(Bytecode &b); void EmitRCXVar(Bytecode &b); void EmitDecJump(Bytecode &b); int EmitCountToTemp(Bytecode &b); Expr* fCount; // flag to indicate if rcx loop counter can be used static bool sRCXLoopInUse; }; #endif nqc-3.1.r6/compiler/Resource.cpp0000600000175000017500000000171210216067450014677 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Resource.h" #include "Expr.h" Resource::Resource() { } Resource::~Resource() { } void Resource::SetInfo(RCX_ChunkType type, Symbol *name) { fType = type; fName = name; } nqc-3.1.r6/compiler/Resource.h0000600000175000017500000000337710216067442014356 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Resource_h #define __Resource_h #ifndef __PTypes_h #include "PTypes.h" #endif #ifndef __PListS_h #include "PListS.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif #ifndef __RCX_Constants_h #include "RCX_Constants.h" #endif #ifndef __LocationNode_h #include "LocationNode.h" #endif #include using std::vector; class Symbol; class Expr; class Resource : public PLinkS, public AutoFree { public: Resource(); ~Resource(); void SetInfo(RCX_ChunkType type, Symbol *name); void SetNumber(int n) { fNumber = n; } int GetNumber() const { return fNumber; } Symbol* GetName() const { return fName; } RCX_ChunkType GetType() const { return fType; } void Add(int value) { fData.push_back((UByte)value); } int GetLength() const { return fData.size(); } const UByte* GetData() const { return &fData[0]; } private: RCX_ChunkType fType; Symbol* fName; int fNumber; vector fData; }; #endif nqc-3.1.r6/compiler/Scope.cpp0000600000175000017500000000330510216067434014163 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Scope.h" #include "Variable.h" Scope::Scope() { } Scope::~Scope() { } bool Scope::Define(const Symbol *name, int var, bool array, bool ptr, bool stack) { if (Contains(name)) return false; fBindings.push_back(ScopeData(name, var, array, ptr, stack)); return true; } int Scope::Lookup(const Symbol *name, bool &array, bool &ptr, bool &stack) { Scope *s; for(s=this; s; s=s->GetNext()) { int var = s->Lookup1(name, &array, &ptr, &stack); if (var != kIllegalVar) return var; } return kIllegalVar; } int Scope::Lookup1(const Symbol *name, bool *array, bool *ptr, bool *stack) { for(size_t i=0; i using std::vector; class Symbol; class Scope : public PLinkS, public AutoFree { public: Scope(); ~Scope(); bool Define(const Symbol *name, int var, bool array, bool ptr, bool stack); int Lookup(const Symbol *name, bool &array, bool &ptr, bool &stack); bool Contains(const Symbol *name) { return Lookup1(name)!= kIllegalVar; } private: struct ScopeData { ScopeData() : fName(0), fVar(kIllegalVar), fArray(0), fPtr(0), fStack(0) {} ScopeData(const Symbol *name, int var, bool a, bool ptr, bool stack) : fName(name), fVar(var), fArray(a), fPtr(ptr), fStack(stack) {} const Symbol * fName; int fVar; bool fArray; bool fPtr; bool fStack; }; int Lookup1(const Symbol *name, bool *array = 0, bool *ptr = 0, bool *stack = 0); vector fBindings; }; #endif nqc-3.1.r6/compiler/ScopeStmt.cpp0000600000175000017500000000261710216067426015041 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ScopeStmt.h" #include "VarTranslator.h" #include "Bytecode.h" ScopeStmt::ScopeStmt(Stmt *s) : ChainStmt(s) { } ScopeStmt::~ScopeStmt() { } void ScopeStmt::EmitActual(Bytecode &b) { GetBody()->EmitActual(b); // release vars in the reverse order they were allocated for(int i=fVariables.size()-1; i>=0; --i) b.GetVarAllocator().Release(fVariables[i]); } Stmt* ScopeStmt::CloneActual(Mapping *b) const { return new ScopeStmt(GetBody()->Clone(b)); } void ScopeStmt::RemapVar(int from, int to, int count) { VarTranslator vt(from, to); Apply(this, vt); while(count--) fVariables.push_back(to++); } nqc-3.1.r6/compiler/ScopeStmt.h0000600000175000017500000000222510216067422014475 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ScopeStmt_h #define __ScopeStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #include using std::vector; class ScopeStmt : public ChainStmt { public: ScopeStmt(Stmt *s); ~ScopeStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; void RemapVar(int from, int to, int count); private: vector fVariables; }; #endif nqc-3.1.r6/compiler/SensorExpr.cpp0000600000175000017500000000261610216067414015224 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "SensorExpr.h" #include "Bytecode.h" #include "Error.h" Expr* SensorExpr::Clone(Mapping *b) const { return new SensorExpr(Get(0)->Clone(b)); } RCX_Value SensorExpr::EmitAny_(Bytecode &) const { int v; if (!Evaluate(v)) return kIllegalEA; return RCX_VALUE(kRCX_ConstantType, v); } bool SensorExpr::Evaluate(int &v) const { RCX_Value ea; ea = Get(0)->GetStaticEA(); v = -1; switch(RCX_VALUE_TYPE(ea)) { case kRCX_ConstantType: case kRCX_InputValueType: v = RCX_VALUE_DATA(ea) & 0xff; return true; default: Error(kErr_ParamType, "sensor").Raise(&GetLoc()); return false; } } nqc-3.1.r6/compiler/SensorExpr.h0000600000175000017500000000266610216067406014677 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * This class is a kludge that is necessary to allow SENSOR_x to be used * interchangeably with the index of the sensor. In these cases, a valid * expression is either a constant or an EA of source 2. The SensorExpr() * class checks for these conditions and evaluates to the actual index of * the sensor. */ #ifndef __SensorExpr_h #define __SensorExpr_h #include "NodeExpr.h" class SensorExpr : public NodeExpr { public: SensorExpr(Expr *e) : NodeExpr(e) {} virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool PromiseConstant() const { return true; } virtual bool Evaluate(int &) const; }; #endif nqc-3.1.r6/compiler/ShiftExpr.cpp0000600000175000017500000000554410216067402015030 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ShiftExpr.h" #include "Bytecode.h" #include "RCX_Cmd.h" Expr* ShiftExpr::Clone(Mapping *b) const { return new ShiftExpr(Get(0)->Clone(b), Get(1)->Clone(b), fDirection); } bool ShiftExpr::Evaluate(int &value) const { int v1, v2; if (!Get(0)->Evaluate(v1)) return false; if (!Get(1)->Evaluate(v2)) return false; if (fDirection == kRight) value = v1 >> v2; else value = v1 << v2; return true; } RCX_Value ShiftExpr::EmitAny_(Bytecode &b) const { int dst; dst = GetTempVar(b); if (dst < 0) return kIllegalEA; if (!EmitTo_(b, dst)) return kIllegalEA; return RCX_VALUE(kRCX_VariableType, dst); } bool ShiftExpr::EmitTo_(Bytecode &b, int dst) const { int shiftCount; // Get(1) *should* be a constant, but we check anyway if (!Get(1)->Evaluate(shiftCount)) return false; // compute shift value if (shiftCount > 15) { // too big...just zero out dst b.AddMove(dst, RCX_VALUE(kRCX_ConstantType, 0)); return true; } else if (shiftCount < 0) { shiftCount = 0; } // factor is 2 ^ shiftCount int factor = 1 << shiftCount; // evaluate Get(0) into dst if (!Get(0)->EmitTo(b,dst)) return false; RCX_Cmd cmd; if (fDirection==kRight) { // divide by factor // branch if positive int posLabel = b.NewLabel(); b.AddTest(RCX_VALUE(kRCX_ConstantType, 0), kRCX_LessOrEqual, RCX_VALUE(kRCX_VariableType, dst), posLabel); // code for negative operand cmd.MakeVar( kRCX_AndVar, dst, RCX_VALUE(kRCX_ConstantType, 0x7fff)); b.Add(cmd); cmd.MakeVar( kRCX_DivVar, dst, RCX_VALUE(kRCX_ConstantType, factor)); b.Add(cmd); cmd.MakeVar( kRCX_OrVar, dst, RCX_VALUE(kRCX_ConstantType, 0x8000 >> shiftCount)); b.Add(cmd); int doneLabel = b.NewLabel(); b.AddJump(doneLabel); // code for positive operand b.SetLabel(posLabel); cmd.MakeVar( kRCX_DivVar, dst, RCX_VALUE(kRCX_ConstantType, factor)); b.Add(cmd); b.SetLabel(doneLabel); } else { // multiply by factor cmd.MakeVar(kRCX_MulVar, dst, RCX_VALUE(kRCX_ConstantType, factor)); b.Add(cmd); } return true; } nqc-3.1.r6/compiler/ShiftExpr.h0000600000175000017500000000235310216067376014502 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ShiftExpr_h #define __ShiftExpr_h #include "NodeExpr.h" class ShiftExpr : public NodeExpr { public: enum { kRight = 0, kLeft }; ShiftExpr(Expr *lhs, Expr *rhs, int direction) : NodeExpr(lhs, rhs), fDirection(direction) {}; virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; private: int fDirection; }; #endif nqc-3.1.r6/compiler/Stmt.cpp0000600000175000017500000000523410220003240014020 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "Stmt.h" #include "Bytecode.h" Stmt::Stmt() : fParent(0), fMustEmit(false) { fLoc.fIndex = kIllegalSrcIndex; } Stmt::~Stmt() { } bool Stmt::IsDescendantOf(const Stmt *ancestor) const { const Stmt *s = this; while(s) { if (s==ancestor) return true; s = s->GetParent(); } return false; } void Stmt::SetLocation(LocationNode *node) { fLoc = node->GetLoc(); delete node; } void Stmt::Emit(Bytecode &b) { // this is where to hook general-purpose emit code that // applies to all statements. For now, just add a source tag and // then call EmitActual() which is virtual and does all the work b.AddSourceTag(RCX_SourceTag::kNormal, fLoc); EmitActual(b); } Stmt *Stmt::Clone(Mapping *b) const { // this is where to hook general-purpose clone code that // applies to all statements. // for now, just copy location information after using // CloneActual (which is virtual) to make the actual clone Stmt *s = CloneActual(b); s->fLoc = fLoc; return s; } Stmt* LeafStmt::GetChildren() { return 0; } ChainStmt::~ChainStmt() { delete fBody; } Stmt* ChainStmt::GetChildren() { return fBody; } BinaryStmt::BinaryStmt(Stmt *s1, Stmt *s2) : fPrimary(s1), fSecondary(s2) { Adopt(s1); Adopt(s2); if (s2) { // this is a hack to get fPrimary and fSecondary linked together PListSS list; list.InsertHead(s2); list.InsertHead(s1); } } BinaryStmt::~BinaryStmt() { delete fPrimary; delete fSecondary; } Stmt *BinaryStmt::GetChildren() { return fPrimary; } #ifdef DEBUG #include #include using std::printf; using std::putchar; void DumpStmt(Stmt *s, int tab) { for(int i=0; iGetChildren(); c; c=c->GetNext()) { DumpStmt(c, tab + 2); } } #endif nqc-3.1.r6/compiler/Stmt.h0000600000175000017500000000676410216067346013524 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Stmt_h #define __Stmt_h #ifndef __PListS_h #include "PListS.h" #endif #ifndef __AutoFree_h #include "AutoFree.h" #endif #ifndef __LocationNode_h #include "LocationNode.h" #endif #include using std::vector; class Bytecode; class CheckState; class Mapping; class Expr; /* * Stmt is the abstract base class for all program statements */ class Stmt : public PLinkS, public AutoFree { public: Stmt(); virtual ~Stmt(); void SetLocation(LocationNode *node); const LexLocation& GetLoc() const { return fLoc; } Stmt* GetParent() const { return fParent; } bool IsDescendantOf(const Stmt* ancestor) const; virtual Stmt* GetChildren() = 0; // flag used to force statement to be emitted (not optimized out) bool GetMustEmit() const { return fMustEmit; } void SetMustEmit(bool b) { fMustEmit = b; } // overall emit which will call the virtual EmitActual void Emit(Bytecode &b); virtual void EmitActual(Bytecode &b) = 0; Stmt* Clone(Mapping *b) const; virtual Stmt* CloneActual(Mapping *b) const = 0; // append sub-expressions into vector and return number added virtual void GetExprs(vector & /* v */) const { } protected: void Adopt(Stmt *c) { if (c) c->fParent = this; } LexLocation fLoc; Stmt* fParent; bool fMustEmit; }; /* * LeafStmt is an abstract base class for statements that do not * contain any other statements as children. */ class LeafStmt : public Stmt { public: virtual Stmt* GetChildren(); }; /* * ChainStmt is an abstract base class for statements that contain * a single child. */ class ChainStmt : public Stmt { public: ChainStmt(Stmt *s=0) : fBody(s) { Adopt(s); } ~ChainStmt(); virtual Stmt* GetChildren(); Stmt* GetBody() { return fBody; } const Stmt* GetBody() const { return fBody; } protected: void SetBody(Stmt *s) { fBody=s; Adopt(s); } private: Stmt* fBody; }; /* * BinaryStmt is an abstract base class for statements that contain * one or two sub-statements (the second one is optional). */ class BinaryStmt : public Stmt { public: BinaryStmt(Stmt *s1, Stmt *s2=0); ~BinaryStmt(); virtual Stmt* GetChildren(); protected: Stmt* GetPrimary() { return fPrimary; } const Stmt* GetPrimary() const { return fPrimary; } Stmt* GetSecondary() { return fSecondary; } const Stmt* GetSecondary() const { return fSecondary; } private: Stmt* fPrimary; Stmt* fSecondary; }; template void Apply(Stmt *base, OP &op) { Stmt *s; if (!op(base)) return; for(s=base->GetChildren(); s; s=s->GetNext()) Apply(s, op); } #ifdef DEBUG void DumpStmt(Stmt *s, int tab=0); #endif #endif nqc-3.1.r6/compiler/SwitchStmt.cpp0000600000175000017500000000646410216067342015232 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "SwitchStmt.h" #include "Bytecode.h" #include "CaseStmt.h" #include "Error.h" class SwitchCaseEmitter { public: SwitchCaseEmitter(Bytecode &b, SwitchState &s) : fBytecode(b), fSwitchState(s) {}; bool operator()(Stmt *s); private: Bytecode& fBytecode; SwitchState& fSwitchState; }; SwitchStmt::SwitchStmt(Expr *c, Stmt *s) : ChainStmt(s) { fSelector = c; } SwitchStmt::~SwitchStmt() { delete fSelector; } void SwitchStmt::EmitActual(Bytecode &b) { /* * Code should look like this * * evalutate selector into variable * test case 1 * test case 2 * ... * test case N * jump to default * body case A * body case B * ... * body case M * * * Note that cases will be tested in the order they appear, * with the exception of the default case, which is never tested. * Code is emited for the body in the exact order it appears - * default case may be in the middle! */ RCX_Value selector; int defaultLabel = b.NewLabel(); // emit code to evaluate the selector selector = fSelector->EmitConstrained(b,TYPEMASK(kRCX_VariableType)); if (selector == Expr::kIllegalEA) return; // emit the code that tests cases (and in the process assign bytecode // labels to any LabelStmts SwitchState switchState(selector, defaultLabel); SwitchCaseEmitter emitter(b, switchState); Apply(GetBody(), emitter); // don't need the selector anymore b.ReleaseTempEA(selector); // we always jump to the default label after all cases b.AddJump(defaultLabel); // emit body - push partial loop context so 'break' will work int bLabel = b.PushFlow(Bytecode::kBreakFlow); GetBody()->Emit(b); // clean up by setting the break label position // and optionally the default label position b.SetLabel(bLabel); b.PopFlow(Bytecode::kBreakFlow); if (!switchState.ContainsCase(CaseStmt::kDefaultValue)) b.SetLabel(defaultLabel); } bool SwitchCaseEmitter::operator()(Stmt *s) { CaseStmt *ls; // don't walk into nested switches if (dynamic_cast(s)) return false; // emit labels ls = dynamic_cast(s); if (ls) ls->EmitSwitchCases(fBytecode, fSwitchState); return true; } Stmt* SwitchStmt::CloneActual(Mapping *b) const { return new SwitchStmt(fSelector->Clone(b), GetBody()->Clone(b)); } void SwitchStmt::GetExprs(vector &v) const { v.push_back(fSelector); } bool SwitchState::ContainsCase(int v) { size_t i; for(i=0; i using std::vector; class SwitchStmt : public ChainStmt { public: SwitchStmt(Expr *e, Stmt *s); ~SwitchStmt(); virtual void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const; private: Expr* fSelector; }; class SwitchState { public: SwitchState(RCX_Value selector, int defaultLabel) : fSelector(selector), fDefaultLabel(defaultLabel) {} bool ContainsCase(int v); void AddCase(int v) { fCases.push_back(v); } RCX_Value GetSelector() const { return fSelector; } int GetDefaultLabel() const { return fDefaultLabel; } private: RCX_Value fSelector; int fDefaultLabel; vector fCases; }; #endif nqc-3.1.r6/compiler/Symbol.cpp0000600000175000017500000000414710216067332014361 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #include #include "Symbol.h" #include "Macro.h" #include "Fragment.h" #include "Stmt.h" using std::printf; #define kHashSize 1023 SymbolTable * Symbol::sSymbolTable = 0; Symbol::Symbol(const char *name) { fKey = new char[strlen(name) + 1]; strcpy(fKey, name); fDefinition = 0; } Symbol::~Symbol() { Undefine(); delete [] fKey; } void Symbol::Define(Macro *d) { delete fDefinition; fDefinition = d; } void Symbol::Undefine() { delete fDefinition; fDefinition = 0; } Symbol *Symbol::Get(const char *name) { if (!sSymbolTable) sSymbolTable = new SymbolTable(); Symbol *s; s = sSymbolTable->Find(name); if (!s) { s = new Symbol(name); sSymbolTable->Add(s); } return s; } SymbolTable *Symbol::GetSymbolTable() { if (!sSymbolTable) sSymbolTable = new SymbolTable(); return sSymbolTable; } SymbolTable::SymbolTable() : PHashTable(kHashSize) { } void SymbolTable::Dump() { int i; Symbol *s; const Macro *d; for(i=0; iGetNext()) { printf("%s = ", s->GetKey()); d = s->GetDefinition(); if (d) { printf("macro [%d]\n", d->GetArgCount()); } else { printf("no def\n"); } } } SymbolTable::~SymbolTable() { } nqc-3.1.r6/compiler/Symbol.h0000600000175000017500000000272710216067326014033 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Symbol_h #define __Symbol_h #ifndef __PHashTable_h #include "PHashTable.h" #endif class Macro; class Fragment; class Stmt; class SymbolTable; class Symbol : public PHashable { public: Symbol(const char *name); ~Symbol(); bool IsDefined() const { return fDefinition ? true : false; } Macro* GetDefinition() { return fDefinition; } void Define(Macro *d); void Undefine(); static Symbol* Get(const char *name); static SymbolTable* GetSymbolTable(); private: Macro* fDefinition; static SymbolTable* sSymbolTable; }; class SymbolTable : public PHashTable { public: SymbolTable(); ~SymbolTable(); void Dump(); private: }; #endif nqc-3.1.r6/compiler/TaskIdExpr.cpp0000600000175000017500000000354110216067322015126 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "TaskIdExpr.h" #include "Error.h" #include "Stmt.h" Expr* TaskIdExpr::Clone(Mapping *) const { return new TaskIdExpr(GetLoc(), fTaskId); } RCX_Value TaskIdExpr::EmitAny_(Bytecode &) const { int v; if (!Evaluate(v)) return kIllegalEA; return RCX_VALUE(kRCX_ConstantType, v); } bool TaskIdExpr::Evaluate(int &v) const { if (fTaskId < 0) { // during the parse check phases, ids have not been // assigned, so the constant has not yet been // determined return false; } v = fTaskId; return true; } bool TaskIdExpr::Patcher::operator()(Stmt *s) { vector v; s->GetExprs(v); int n = v.size(); int i; for(i=0; i(e)) { te->fTaskId = fId; if (fId < 0) { // the error must be raised here rather than in Evaluate() // since Evaluate() is called prior to task ids being assigned Error(kErr_TaskIdUnknown).Raise(&te->GetLoc()); } } return true; } nqc-3.1.r6/compiler/TaskIdExpr.h0000600000175000017500000000252410216067316014576 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __TaskIdExpr_h #define __TaskIdExpr_h #include "Expr.h" #include "Fragment.h" class TaskIdExpr : public Expr { public: TaskIdExpr(const LexLocation &loc, int id=Fragment::kNoTaskID) : Expr(loc), fTaskId(id) {} virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool Evaluate(int &) const; class Patcher { public: Patcher(int id) { fId = id; } bool operator()(Stmt *s); bool operator()(Expr *e); private: int fId; }; friend class Patcher; private: int fTaskId; }; #endif nqc-3.1.r6/compiler/TaskStmt.cpp0000600000175000017500000000261210216067306014662 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "TaskStmt.h" #include "Bytecode.h" #include "Symbol.h" #include "Fragment.h" #include "Program.h" #include "Error.h" #include "RCX_Cmd.h" TaskStmt::TaskStmt(UByte opcode, Symbol *name, const LexLocation &loc) { fOpcode = opcode; fName = name; fLocation = loc; } void TaskStmt::EmitActual(Bytecode &b) { Fragment *f = gProgram->GetTask(fName); RCX_Cmd cmd; if (!f) { Error(kErr_UndefinedTask, fName->GetKey()).Raise(&fLocation); return; } cmd.Set(fOpcode, (UByte)f->GetNumber()); b.Add(cmd); } Stmt* TaskStmt::CloneActual(Mapping *) const { return new TaskStmt(fOpcode, fName, fLocation); } nqc-3.1.r6/compiler/TaskStmt.h0000600000175000017500000000225210216067302014323 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __TaskStmt_h #define __TaskStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __parser_h #include "parser.h" #endif class Symbol; class TaskStmt : public LeafStmt { public: TaskStmt(UByte opcode, Symbol *name, const LexLocation &loc); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; private: Symbol* fName; UByte fOpcode; LexLocation fLocation; }; #endif nqc-3.1.r6/compiler/TernaryExpr.cpp0000600000175000017500000000415510216067276015405 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "TernaryExpr.h" #include "Bytecode.h" #include "RCX_Cmd.h" Expr* TernaryExpr::Clone(Mapping *b) const { return new TernaryExpr(Get(0)->Clone(b), Get(1)->Clone(b), Get(2)->Clone(b)); } bool TernaryExpr::Evaluate(int &value) const { int test; const Expr *e; if (!Get(0)->Evaluate(test)) return false; e = test ? Get(1) : Get(2); if (!e->Evaluate(value)) return false; return true; } RCX_Value TernaryExpr::EmitAny_(Bytecode &b) const { int test; if (Get(0)->Evaluate(test)) { if (test) return Get(1)->EmitAny(b); else return Get(2)->EmitAny(b); } int dst = GetTempVar(b); if (dst < 0) return kIllegalEA; EmitConditionTo(b, dst); return RCX_VALUE(kRCX_VariableType, dst); } bool TernaryExpr::EmitTo_(Bytecode &b, int dst) const { int test; if (Get(0)->Evaluate(test)) { if (test) return Get(1)->EmitTo(b, dst); else return Get(2)->EmitTo(b, dst); } return EmitConditionTo(b, dst); } bool TernaryExpr::EmitConditionTo(Bytecode &b, int dst) const { int elseLabel = b.NewLabel(); int doneLabel = b.NewLabel(); if (!Get(0)->EmitBranch(b, elseLabel, false)) return false; if (!Get(1)->EmitTo(b, dst)) return false; b.AddJump(doneLabel); b.SetLabel(elseLabel); if (!Get(2)->EmitTo(b, dst)) return false; b.SetLabel(doneLabel); return true; } nqc-3.1.r6/compiler/TernaryExpr.h0000600000175000017500000000232710216067270015043 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __TernaryExpr_h #define __TernaryExpr_h #include "NodeExpr.h" class TernaryExpr : public NodeExpr { public: TernaryExpr(Expr *a, Expr *b, Expr *c) : NodeExpr(a, b, c) {} virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; private: virtual bool EmitConditionTo(Bytecode &b, int dst) const; }; #endif nqc-3.1.r6/compiler/Token.h0000600000175000017500000000167610216067260013645 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Token_h #define __Token_h #ifndef __parser_h #include "parser.h" #endif typedef YYSTYPE TokenVal; class Token { public: int fType; TokenVal fValue; }; #endif nqc-3.1.r6/compiler/TypeExpr.cpp0000600000175000017500000000211410216067232014663 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "TypeExpr.h" Expr* TypeExpr::Clone(Mapping *b) const { return new TypeExpr(Get(0)->Clone(b)); } RCX_Value TypeExpr::EmitAny_(Bytecode &) const { return kIllegalEA; } bool TypeExpr::Evaluate(int &value) const { int v; if (Get(0)->Evaluate(v)) value = 2; else value = 0; return true; } nqc-3.1.r6/compiler/TypeExpr.h0000600000175000017500000000302010216067226014330 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* This class is only partially implemented. Constant expressions always * evalutae correctly to type 2. All other expressions evaluate to type 0 * even if they are from some other non-constant source (sensor, random, etc) * * Fixing this would require either adding RTTI code, or preferably adding * another virtual method to the Expr hierarchy that returns the typecode of * the expression. */ #ifndef __TypeExpr_h #define __TypeExpr_h #include "NodeExpr.h" class TypeExpr : public NodeExpr { public: TypeExpr(Expr *e) : NodeExpr(e) {} virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool PromiseConstant() const { return true; } virtual bool Evaluate(int & value) const; }; #endif nqc-3.1.r6/compiler/UnaryExpr.cpp0000600000175000017500000000534510216067222015050 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "UnaryExpr.h" #include "parser.h" #include "Bytecode.h" #include "RCX_Cmd.h" #include "Program.h" static RCX_VarCode GetUnaryCode(int op); static RCX_VarCode GetUnaryCode(int op) { const RCX_Target *t = gProgram->GetTarget(); switch(op) { case ABS: return kRCX_AbsVar; case SIGN: return kRCX_SgnVar; case '~': if (t->fType == kRCX_SwanTarget) return kRCX_NotVar; else return kRCX_IllegalVar; default: return kRCX_IllegalVar; } } Expr* UnaryExpr::Clone(Mapping *b) const { return new UnaryExpr(fOp, Get(0)->Clone(b)); } bool UnaryExpr::Evaluate(int &value) const { if (!Get(0)->Evaluate(value)) return false; switch(fOp) { case '~': value = ~value; break; case ABS: if (value < 0) value = -value; break; case SIGN: if (value < 0) value = -1; else if (value > 0) value = 1; else value = 0; break; default: return false; } return true; } RCX_Value UnaryExpr::EmitAny_(Bytecode &b) const { RCX_Cmd cmd; RCX_Value ea; int dst; ea = Get(0)->EmitMath(b); if (ea == kIllegalEA) return ea; if (b.IsTempEA(ea)) { // operate in place dst = RCX_VALUE_DATA(ea); } else { // create a temp dst = GetTempVar(b); if (dst < 0) return kIllegalEA; } cmd.MakeVar(GetUnaryCode(fOp), dst, ea); b.Add(cmd); // return the ea return RCX_VALUE(kRCX_VariableType, dst); } bool UnaryExpr::EmitTo_(Bytecode &b, int dst) const { RCX_Value ea; RCX_Cmd cmd; ea = Get(0)->EmitMath(b); if (ea == kIllegalEA) return false; cmd.MakeVar(GetUnaryCode(fOp), dst, ea); b.Add(cmd); b.ReleaseTempEA(ea); return true; } bool UnaryExpr::EmitSide_(Bytecode &b) const { return Get(0)->EmitSide(b); } bool UnaryExpr::NeedsConstant(int op) { return GetUnaryCode(op) == kRCX_IllegalVar; } nqc-3.1.r6/compiler/UnaryExpr.h0000600000175000017500000000235410216067214014513 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __UnaryExpr_h #define __UnaryExpr_h #include "NodeExpr.h" class UnaryExpr : public NodeExpr { public: UnaryExpr(int op, Expr *e) : NodeExpr(e), fOp(op) {} virtual bool Evaluate(int &value) const; virtual Expr* Clone(Mapping *b) const; virtual RCX_Value EmitAny_(Bytecode &b) const; virtual bool EmitTo_(Bytecode &b, int dst) const; virtual bool EmitSide_(Bytecode &b) const; static bool NeedsConstant(int op); private: int fOp; }; #endif nqc-3.1.r6/compiler/ValueExpr.cpp0000600000175000017500000000217410216067006015023 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "ValueExpr.h" Expr* ValueExpr::Clone(Mapping *b) const { return new ValueExpr(Get(0)->Clone(b)); } RCX_Value ValueExpr::EmitAny_(Bytecode &) const { int v; if (!Get(0)->Evaluate(v)) return kIllegalEA; return (RCX_Value)v; } RCX_Value ValueExpr::GetStaticEA_() const { int v; if (!Get(0)->Evaluate(v)) return kIllegalEA; return v; } nqc-3.1.r6/compiler/ValueExpr.h0000600000175000017500000000225110216067000014456 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __ValueExpr_h #define __ValueExpr_h #include "NodeExpr.h" class ValueExpr : public NodeExpr { public: ValueExpr(Expr *e) : NodeExpr(e) {} virtual Expr* Clone(Mapping *b) const; virtual bool PromiseConstant() const { return false; } virtual bool PotentialLValue() const { return true; } virtual RCX_Value EmitAny_(Bytecode &b) const; virtual RCX_Value GetStaticEA_() const; }; #endif nqc-3.1.r6/compiler/VarAllocator.cpp0000600000175000017500000001270510216066774015515 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ /* * Allocation Strategy * * fMode Allocation * --------------------------- * kGlobalMode Low Global * * kTaskMode High Local * Low Global * * kSingleSubMode Low Local * Low Global * * kMultiSubMode Low Local * * * In general local variables are prefered to globals. The * only exception is for true global variables (kGlobalMode) * which are not allowed to use the local pool. * * In cases where a single task is known to be in execution * (kTaskMode or kSingleSubMode) allocation is allowed to * overflow from the local pool to the global pool. * * Vars allocated from the global pool may be re-used within the * same Begin()/End() session, but then become permanently * allocated after End(). In contrast, the local pool is refreshed * each time Begin() is called - in the case of tasks this is * justified by the fact that each task has its own local vars. * For subs, this is because the true variable allocation is * done within the calling task, and this is checked for conflicts * by CheckAvailable(). * * This strategy ensures that subs always use the bottom-most * local vars (overflow to globals in the case of a sub called * by only 1 task). Allocations for a task use up locals from * the high end, which means that the only time a call to a sub * will conflict with the presently allocated task vars is if * local space is exhausted. * */ #include "VarAllocator.h" #include "Variable.h" #ifdef DEBUG #include using std::printf; //#define DEBUG_VARS #endif VarAllocator::VarAllocator(int maxGlobals, int maxTaskVars) : fMode(kGlobalMode), fMaxVars(maxGlobals + maxTaskVars), fLocalStart(maxGlobals) { fStates = new VarState[fMaxVars]; for(int i=0; i= kUsed) return false; } } return true; } int VarAllocator::FindUnused(int start, int end, int count) { if (start < end) { // search [start, end) from bottom end -= count; for(int i=start; i<=end; ++i) if (CheckAvailable(i, count)) return i; } else { // search [end, start) from top for(int i=start-count; i>=end; --i) if (CheckAvailable(i, count)) return i; } return kIllegalVar; } bool VarAllocator::CheckAvailable(int first, int count) const { while(count--) { if (fStates[first++] >= kUsed) return false; } return true; } nqc-3.1.r6/compiler/VarAllocator.h0000600000175000017500000000333210216066672015153 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __VarAllocator_h #define __VarAllocator_h class VarAllocator { public: // allocation modes enum { kGlobalMode, kTaskMode, kSingleSubMode, kMultiSubMode }; VarAllocator(int maxGlobals, int maxTaskVars); ~VarAllocator(); bool Reserve(int v); // permenant reservation int Allocate(bool temp, bool canUseLocals, int count); void Release(int v); bool IsTemp(int v) const; void ReleaseTemp(int v); void Begin(int mode); int End(); bool CheckLocalMask(int localMask) const; private: enum VarState { // these states are available for variable allocation kFree = 0, kDirty, // states from here up are considered "used" kUsed, kTemp, kReserved }; bool IsLegal(int v) const { return (v >= 0 && v < fMaxVars); } int FindUnused(int start, int end, int count); bool CheckAvailable(int first, int count) const; int fMode; int fMaxVars; int fLocalStart; VarState* fStates; }; #endif nqc-3.1.r6/compiler/Variable.h0000600000175000017500000000220210216066704014276 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __Variable_h #define __Variable_h enum Variable { // error values kIllegalVar = -1, kPhysicalVarBase = 0, kVirtualVarBase = 0x8000, kVirtualConstantFlag = 0x4000, // for vars that are always constant kVirtualReadOnlyFlag = 0x2000, // for vars that are not lvalues kPointerFlag = 0x1000, // for pointers kVirtualVarMask = 0x0fff }; #endif nqc-3.1.r6/compiler/VarTranslator.cpp0000600000175000017500000000247410216066644015724 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "VarTranslator.h" #include "Expr.h" #include "Stmt.h" #include "AssignStmt.h" #include "AtomExpr.h" #include "IncDecExpr.h" bool VarTranslator::operator()(Stmt *s) { vector v; s->GetExprs(v); int n = v.size(); int i; for(i=0; i(s)) t->Translate(fFrom, fTo); return true; } bool VarTranslator::operator()(Expr *e) { if (Translatable *t = dynamic_cast(e)) t->Translate(fFrom, fTo); return true; } nqc-3.1.r6/compiler/VarTranslator.h0000600000175000017500000000216210216066662015363 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __VarTranslator_h #define __VarTranslator_h class Stmt; class Expr; class VarTranslator { public: VarTranslator(int from, int to) : fFrom(from), fTo(to) {} bool operator()(Stmt *s); bool operator()(Expr *e); private: int fFrom; int fTo; }; class Translatable { public: virtual void Translate(int from, int to) = 0; }; #endif nqc-3.1.r6/compiler/version.h0000600000175000017500000000215310456727706014257 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __version_h #define __version_h #define MAJOR_VERSION 3 #define MINOR_VERSION 1 #define RELEASE_STAGE "r" // 0=alpha, 2=release #define RELEASE_STAGE_INDEX 2 #define RELEASE_BUILD 6 #define STR_(x) #x #define STR(x) STR_(x) #define VERSION_STRING STR(MAJOR_VERSION) "." STR(MINOR_VERSION) " " RELEASE_STAGE STR(RELEASE_BUILD) "\0" #endif nqc-3.1.r6/compiler/WhileStmt.cpp0000600000175000017500000000424210216066762015036 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "WhileStmt.h" #include "Bytecode.h" WhileStmt::WhileStmt(Expr *e, Stmt *s) : ChainStmt(s) { fCondition = e; } WhileStmt::~WhileStmt() { delete fCondition; } void WhileStmt::EmitActual(Bytecode &b) { bool optimized = false; int startLabel; int value; int cLabel = b.PushFlow(Bytecode::kContinueFlow); int bLabel = b.PushFlow(Bytecode::kBreakFlow); if (fCondition->Evaluate(value)) { if (value) { /* cPos: body jump -> 1 */ b.SetLabel(cLabel); GetBody()->Emit(b); b.AddJump(cLabel); optimized = true; } else if (!GetBody()->GetMustEmit()) { // don't need to emit anything optimized = true; } } if (!optimized) { /* jump -> cPos startLabel: body cPos: test C -> startLabel */ int initialPosition = b.GetLength(); b.AddJump(cLabel); startLabel = b.NewLabel(); GetBody()->Emit(b); // if no body code has been emitted, then remove the // initial jump if (b.GetLabelPosition(startLabel) == b.GetLength()) { b.Truncate(initialPosition); b.SetLabel(startLabel); } b.SetLabel(cLabel); fCondition->EmitBranch(b, startLabel, true); } b.SetLabel(bLabel); b.PopFlow(Bytecode::kContinueFlow); b.PopFlow(Bytecode::kBreakFlow); } Stmt* WhileStmt::CloneActual(Mapping *b) const { return new WhileStmt(fCondition->Clone(b), GetBody()->Clone(b)); } nqc-3.1.r6/compiler/WhileStmt.h0000600000175000017500000000226110216066770014501 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __WhileStmt_h #define __WhileStmt_h #ifndef __Stmt_h #include "Stmt.h" #endif #ifndef __Expr_h #include "Expr.h" #endif class WhileStmt : public ChainStmt { public: WhileStmt(Expr *c, Stmt *s); ~WhileStmt(); void EmitActual(Bytecode &b); Stmt* CloneActual(Mapping *b) const; virtual void GetExprs(vector & v) const { v.push_back(fCondition); } private: Expr* fCondition; }; #endif nqc-3.1.r6/default/0000700000175000017500000000000010633241725012215 5ustar blpblpnqc-3.1.r6/default/lexer.cpp0000600000175000017500000016462010631575452014060 0ustar blpblp#line 2 "lexer.cpp" /* A lexical scanner generated by flex */ /* Scanner skeleton version: * $Header: c:\\winapps\\projects\\nqc/nqc/default/lexer.cpp,v 1.3 2007/06/06 18:21:29 jhansen Exp $ */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #include #if defined(__MWERKS__) && !__MACH__ && !YY_NEVER_INTERACTIVE #include #endif /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ #ifdef c_plusplus #ifndef __cplusplus #define __cplusplus #endif #endif #ifdef __cplusplus #include #include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef __TURBOC__ #pragma warn -rch #pragma warn -use #include #include #define YY_USE_CONST #define YY_USE_PROTOS #endif #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif #ifdef YY_USE_PROTOS #define YY_PROTO(proto) proto #else #define YY_PROTO(proto) () #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart( yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #define YY_BUF_SIZE 16384 typedef struct yy_buffer_state *YY_BUFFER_STATE; extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* The funky do-while in the following #define is used to turn the definition * int a single C statement (which needs a semi-colon terminator). This * avoids problems with code like: * * if ( condition_holds ) * yyless( 5 ); * else * do_something_else(); * * Prior to using the do-while the compiler would get upset at the * "else" because it interpreted the "if" statement as being all * done when it reached the ';' after the yyless() call. */ /* Return all but the first 'n' matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ *yy_cp = yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, yytext_ptr ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ typedef unsigned int yy_size_t; struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; static YY_BUFFER_STATE yy_current_buffer = 0; /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". */ #define YY_CURRENT_BUFFER yy_current_buffer /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 1; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart YY_PROTO(( FILE *input_file )); void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); void yy_load_buffer_state YY_PROTO(( void )); YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); static void *yy_flex_alloc YY_PROTO(( yy_size_t )); static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); static void yy_flex_free YY_PROTO(( void * )); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ yy_current_buffer->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (yy_current_buffer->yy_at_bol) typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state YY_PROTO(( void )); static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); static int yy_get_next_buffer YY_PROTO(( void )); static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ yytext_ptr = yy_bp; \ yyleng = (int) (yy_cp - yy_bp); \ yy_hold_char = *yy_cp; \ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; #define YY_NUM_RULES 89 #define YY_END_OF_BUFFER 90 static yyconst short int yy_accept[278] = { 0, 0, 0, 85, 85, 0, 0, 90, 83, 82, 3, 3, 2, 83, 83, 6, 83, 83, 83, 83, 83, 83, 80, 80, 83, 83, 83, 83, 78, 83, 83, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 83, 85, 87, 86, 20, 19, 19, 20, 20, 20, 20, 20, 20, 82, 6, 66, 0, 81, 6, 5, 63, 69, 57, 55, 71, 0, 53, 72, 54, 84, 1, 56, 80, 0, 75, 67, 65, 68, 76, 77, 78, 4, 64, 78, 78, 78, 78, 78, 78, 78, 78, 24, 78, 78, 78, 78, 21, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 78, 58, 70, 85, 86, 86, 88, 0, 0, 0, 0, 11, 0, 0, 0, 0, 60, 1, 79, 62, 61, 78, 78, 78, 78, 78, 51, 78, 46, 78, 78, 78, 78, 78, 78, 78, 25, 78, 37, 78, 78, 78, 78, 78, 78, 48, 78, 78, 78, 78, 78, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 78, 78, 78, 78, 78, 78, 31, 78, 78, 78, 78, 22, 78, 36, 78, 78, 78, 52, 78, 49, 78, 47, 73, 38, 78, 0, 13, 12, 0, 0, 0, 0, 0, 0, 0, 0, 78, 78, 45, 78, 78, 78, 78, 27, 35, 39, 78, 78, 74, 78, 78, 78, 50, 78, 23, 0, 14, 17, 9, 0, 0, 0, 15, 0, 78, 78, 78, 78, 41, 78, 78, 78, 78, 26, 29, 30, 8, 10, 0, 16, 0, 78, 78, 78, 78, 34, 78, 32, 33, 7, 18, 78, 44, 40, 43, 28, 78, 78, 42, 0 } ; static yyconst int yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 2, 6, 7, 8, 1, 9, 10, 1, 1, 1, 11, 12, 1, 13, 1, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 1, 17, 18, 19, 1, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 22, 22, 1, 24, 1, 25, 26, 1, 27, 28, 29, 30, 31, 32, 33, 34, 35, 22, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 23, 49, 22, 1, 50, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst int yy_meta[51] = { 0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 4, 4, 1, 1, 1, 1, 4, 5, 5, 1, 1, 5, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 1 } ; static yyconst short int yy_base[286] = { 0, 0, 0, 48, 50, 59, 105, 330, 331, 56, 331, 331, 331, 311, 321, 58, 309, 47, 308, 55, 56, 61, 55, 40, 59, 307, 62, 304, 0, 79, 305, 296, 57, 278, 57, 56, 283, 64, 279, 56, 278, 286, 67, 71, 276, 281, 74, 0, 331, 92, 331, 331, 331, 283, 79, 78, 270, 273, 284, 91, 117, 331, 303, 331, 307, 331, 331, 331, 331, 331, 331, 290, 331, 331, 331, 331, 0, 331, 105, 0, 289, 331, 331, 331, 288, 331, 0, 331, 331, 98, 261, 262, 265, 271, 82, 262, 268, 0, 255, 261, 254, 251, 0, 250, 255, 87, 260, 104, 264, 256, 246, 243, 253, 252, 331, 268, 0, 119, 134, 331, 253, 103, 254, 240, 119, 253, 254, 250, 236, 331, 0, 0, 331, 331, 231, 237, 245, 244, 107, 0, 228, 0, 246, 241, 242, 110, 243, 238, 224, 0, 227, 0, 231, 234, 218, 224, 219, 220, 0, 215, 223, 227, 227, 219, 331, 220, 222, 222, 217, 211, 219, 219, 211, 214, 215, 206, 213, 206, 198, 202, 196, 198, 203, 201, 0, 202, 190, 199, 187, 0, 201, 0, 186, 203, 186, 0, 183, 0, 198, 0, 0, 0, 195, 186, 331, 331, 192, 180, 190, 190, 174, 181, 186, 182, 177, 180, 0, 170, 177, 181, 168, 0, 0, 0, 171, 172, 0, 168, 162, 167, 0, 171, 0, 173, 331, 331, 331, 171, 172, 174, 331, 161, 154, 154, 157, 161, 0, 164, 148, 148, 149, 0, 0, 0, 331, 331, 160, 331, 154, 156, 133, 134, 127, 0, 121, 0, 0, 331, 331, 106, 0, 0, 0, 0, 96, 94, 0, 331, 158, 163, 168, 170, 175, 180, 185, 107 } ; static yyconst short int yy_def[286] = { 0, 277, 1, 278, 278, 279, 279, 277, 277, 277, 277, 277, 277, 277, 280, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 282, 277, 283, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 280, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 284, 277, 277, 285, 277, 277, 277, 277, 277, 277, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 282, 283, 283, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 284, 285, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 277, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 277, 277, 281, 281, 281, 281, 281, 281, 281, 281, 0, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yyconst short int yy_nxt[382] = { 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 28, 39, 28, 28, 40, 28, 28, 28, 28, 41, 42, 43, 28, 44, 45, 28, 46, 48, 48, 48, 48, 78, 78, 67, 59, 49, 64, 49, 51, 52, 60, 68, 65, 70, 71, 73, 78, 78, 75, 72, 74, 76, 80, 81, 79, 77, 83, 84, 87, 87, 94, 90, 91, 96, 102, 53, 54, 99, 114, 59, 55, 103, 97, 95, 110, 60, 56, 92, 106, 118, 100, 57, 119, 58, 51, 52, 124, 131, 107, 108, 111, 109, 121, 125, 122, 64, 78, 78, 123, 276, 115, 65, 143, 144, 153, 134, 277, 156, 154, 277, 180, 53, 54, 135, 166, 275, 55, 136, 137, 138, 157, 118, 56, 167, 119, 170, 274, 57, 273, 58, 186, 187, 181, 272, 171, 47, 47, 47, 47, 47, 50, 50, 50, 50, 50, 62, 62, 62, 62, 62, 86, 86, 116, 271, 270, 116, 116, 117, 269, 117, 117, 117, 130, 268, 130, 130, 130, 267, 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, 185, 184, 183, 182, 179, 178, 177, 176, 175, 174, 173, 172, 169, 168, 165, 164, 163, 162, 161, 160, 159, 158, 155, 152, 151, 150, 149, 148, 147, 146, 145, 142, 141, 140, 139, 133, 132, 129, 64, 63, 128, 127, 126, 120, 113, 112, 105, 104, 101, 98, 93, 89, 88, 85, 82, 69, 66, 63, 61, 277, 7, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yyconst short int yy_chk[382] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 23, 23, 17, 9, 3, 15, 4, 5, 5, 9, 17, 15, 19, 19, 20, 22, 22, 21, 19, 20, 21, 24, 24, 22, 21, 26, 26, 29, 29, 34, 32, 32, 35, 39, 5, 5, 37, 46, 59, 5, 39, 35, 34, 43, 59, 5, 32, 42, 49, 37, 5, 49, 5, 6, 6, 55, 285, 42, 42, 43, 42, 54, 55, 54, 60, 78, 78, 54, 275, 46, 60, 94, 94, 105, 89, 117, 107, 105, 117, 138, 6, 6, 89, 121, 274, 6, 89, 89, 89, 107, 118, 6, 121, 118, 124, 269, 6, 264, 6, 145, 145, 138, 262, 124, 278, 278, 278, 278, 278, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 281, 281, 282, 261, 260, 282, 282, 283, 259, 283, 283, 283, 284, 258, 284, 284, 284, 256, 250, 249, 248, 247, 245, 244, 243, 242, 241, 239, 238, 237, 233, 231, 229, 228, 227, 225, 224, 220, 219, 218, 217, 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, 203, 202, 198, 196, 194, 193, 192, 190, 188, 187, 186, 185, 183, 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, 165, 163, 162, 161, 160, 159, 157, 156, 155, 154, 153, 152, 150, 148, 147, 146, 144, 143, 142, 140, 137, 136, 135, 134, 128, 127, 126, 125, 123, 122, 120, 115, 113, 112, 111, 110, 109, 108, 106, 104, 103, 101, 100, 99, 98, 96, 95, 93, 92, 91, 90, 84, 80, 71, 64, 62, 58, 57, 56, 53, 45, 44, 41, 40, 38, 36, 33, 31, 30, 27, 25, 18, 16, 14, 13, 7, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "lex.l" #define INITIAL 0 #line 2 "lex.l" /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. */ #include #include #include "Symbol.h" #include "RCX_Constants.h" #include "JumpStmt.h" #include "Buffer.h" #include "parser.h" #include "Compiler.h" #include "Error.h" #include "Bytecode.h" #define kMaxFileDepth 16 #define kMaxFileCount 255 typedef struct InputFile { struct InputFile *fNext; int fSourceIndex; YY_BUFFER_STATE fBufferState; long fSavedOffset; const char* fDataPtr; int fDataRemain; } InputFile; static int sFileDepth = 0; static InputFile *sCurrentInputFile = 0; static int sSourceIndex = 0; static long sOffset = 0; static int sReturnWhitespace = 0; static int sInsideDirective = 0; static int sInsideProse = 0; static int FillBuffer(char *ptr, int max); #define YY_DECL int yylex(YYSTYPE &yylval) #define YY_USER_ACTION { sOffset += yyleng; } #define YY_INPUT(buf,res,max) (res = FillBuffer(buf, max)) #define Return(tok, val) do { yylval.fInt = val; return tok; } while(0) // this is a hack so that isatty() and fileno() aren't required for the Win32/macintosh builds #if defined(WIN32) || defined(macintosh) #define YY_NEVER_INTERACTIVE 1 #endif #define COMMENT 1 #define PREPROC 2 #line 610 "lexer.cpp" /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap YY_PROTO(( void )); #else extern int yywrap YY_PROTO(( void )); #endif #endif #ifndef YY_NO_UNPUT static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif #ifndef yytext_ptr static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen YY_PROTO(( yyconst char * )); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput YY_PROTO(( void )); #else static int input YY_PROTO(( void )); #endif #endif #if YY_STACK_USED static int yy_start_stack_ptr = 0; static int yy_start_stack_depth = 0; static int *yy_start_stack = 0; #ifndef YY_NO_PUSH_STATE static void yy_push_state YY_PROTO(( int new_state )); #endif #ifndef YY_NO_POP_STATE static void yy_pop_state YY_PROTO(( void )); #endif #ifndef YY_NO_TOP_STATE static int yy_top_state YY_PROTO(( void )); #endif #else #define YY_NO_PUSH_STATE 1 #define YY_NO_POP_STATE 1 #define YY_NO_TOP_STATE 1 #endif #ifdef YY_MALLOC_DECL YY_MALLOC_DECL #else #if __STDC__ #ifndef __cplusplus #include #endif #else /* Just try to get by without declaring the routines. This will fail * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) * or sizeof(void*) != sizeof(int). */ #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( yy_current_buffer->yy_is_interactive ) \ { \ int c = '*', n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL int yylex YY_PROTO(( void )) #endif /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 79 "lex.l" #line 765 "lexer.cpp" if ( yy_init ) { yy_init = 0; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! yy_start ) yy_start = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = yy_c_buf_p; /* Support of yytext. */ *yy_cp = yy_hold_char; /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = yy_start; yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 331 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = yy_hold_char; yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; goto yy_find_action; case 1: YY_RULE_SETUP #line 82 "lex.l" ; YY_BREAK case 2: YY_RULE_SETUP #line 83 "lex.l" ; // hack for DOS EOF characters YY_BREAK case 3: YY_RULE_SETUP #line 85 "lex.l" { if (sInsideDirective) { sInsideDirective = 0; return NL; } } YY_BREAK case 4: YY_RULE_SETUP #line 86 "lex.l" { } YY_BREAK case 5: YY_RULE_SETUP #line 89 "lex.l" { return PP_GLOM; } YY_BREAK case 6: YY_RULE_SETUP #line 90 "lex.l" { if (sInsideDirective) return '#'; else { BEGIN(PREPROC); sInsideDirective = 1; } } YY_BREAK case 7: YY_RULE_SETUP #line 91 "lex.l" { BEGIN(INITIAL); return PP_INCLUDE; } YY_BREAK case 8: YY_RULE_SETUP #line 92 "lex.l" { BEGIN(INITIAL); return PP_DEFINE; } YY_BREAK case 9: YY_RULE_SETUP #line 93 "lex.l" { BEGIN(INITIAL); Return(PP_IFDEF, true); } YY_BREAK case 10: YY_RULE_SETUP #line 94 "lex.l" { BEGIN(INITIAL); Return(PP_IFDEF, false); } YY_BREAK case 11: YY_RULE_SETUP #line 95 "lex.l" { BEGIN(INITIAL); return PP_IF; } YY_BREAK case 12: YY_RULE_SETUP #line 96 "lex.l" { BEGIN(INITIAL); return PP_ELSE; } YY_BREAK case 13: YY_RULE_SETUP #line 97 "lex.l" { BEGIN(INITIAL); return PP_ELIF; } YY_BREAK case 14: YY_RULE_SETUP #line 98 "lex.l" { BEGIN(INITIAL); return PP_ENDIF; } YY_BREAK case 15: YY_RULE_SETUP #line 99 "lex.l" { BEGIN(INITIAL); return PP_UNDEF; } YY_BREAK case 16: YY_RULE_SETUP #line 100 "lex.l" { BEGIN(INITIAL); return PP_PRAGMA; } YY_BREAK case 17: YY_RULE_SETUP #line 101 "lex.l" { BEGIN(INITIAL); return PP_ERROR; } YY_BREAK case 18: YY_RULE_SETUP #line 102 "lex.l" { BEGIN(INITIAL); return PP_WARNING; } YY_BREAK case 19: YY_RULE_SETUP #line 103 "lex.l" { BEGIN(INITIAL); yyless(yyleng-1); return PP_UNKNOWN; } YY_BREAK case 20: YY_RULE_SETUP #line 104 "lex.l" { BEGIN(INITIAL); return PP_UNKNOWN; } YY_BREAK case 21: YY_RULE_SETUP #line 106 "lex.l" { return IF; } YY_BREAK case 22: YY_RULE_SETUP #line 107 "lex.l" { return ELSE; } YY_BREAK case 23: YY_RULE_SETUP #line 108 "lex.l" { return WHILE; } YY_BREAK case 24: YY_RULE_SETUP #line 109 "lex.l" { return DO; } YY_BREAK case 25: YY_RULE_SETUP #line 110 "lex.l" { return FOR; } YY_BREAK case 26: YY_RULE_SETUP #line 111 "lex.l" { return REPEAT; } YY_BREAK case 27: YY_RULE_SETUP #line 112 "lex.l" { yylval.fInt = Bytecode::kBreakFlow; return JUMP; } YY_BREAK case 28: YY_RULE_SETUP #line 113 "lex.l" { yylval.fInt = Bytecode::kContinueFlow; return JUMP; } YY_BREAK case 29: YY_RULE_SETUP #line 114 "lex.l" { yylval.fInt = Bytecode::kReturnFlow; return JUMP; } YY_BREAK case 30: YY_RULE_SETUP #line 115 "lex.l" { return SWITCH; } YY_BREAK case 31: YY_RULE_SETUP #line 116 "lex.l" { return CASE; } YY_BREAK case 32: YY_RULE_SETUP #line 117 "lex.l" { return DEFAULT; } YY_BREAK case 33: YY_RULE_SETUP #line 118 "lex.l" { return MONITOR; } YY_BREAK case 34: YY_RULE_SETUP #line 119 "lex.l" { return ACQUIRE; } YY_BREAK case 35: YY_RULE_SETUP #line 120 "lex.l" { return CATCH; } YY_BREAK case 36: YY_RULE_SETUP #line 121 "lex.l" { return GOTO; } YY_BREAK case 37: YY_RULE_SETUP #line 123 "lex.l" { return INT; } YY_BREAK case 38: YY_RULE_SETUP #line 124 "lex.l" { return T_VOID; } YY_BREAK case 39: YY_RULE_SETUP #line 125 "lex.l" { return T_CONST; } YY_BREAK case 40: YY_RULE_SETUP #line 126 "lex.l" { return SENSOR; } YY_BREAK case 41: YY_RULE_SETUP #line 127 "lex.l" { return TYPE; } YY_BREAK case 42: YY_RULE_SETUP #line 128 "lex.l" { return EVENT_SRC; } YY_BREAK case 43: YY_RULE_SETUP #line 129 "lex.l" { return TASKID; } YY_BREAK case 44: YY_RULE_SETUP #line 130 "lex.l" { return NOLIST; } YY_BREAK case 45: YY_RULE_SETUP #line 131 "lex.l" { return RES; } YY_BREAK case 46: YY_RULE_SETUP #line 132 "lex.l" { return ASM; } YY_BREAK case 47: YY_RULE_SETUP #line 133 "lex.l" { return TASK; } YY_BREAK case 48: YY_RULE_SETUP #line 134 "lex.l" { return SUB; } YY_BREAK case 49: YY_RULE_SETUP #line 135 "lex.l" { Return( TASKOP, kRCX_StopTaskOp); } YY_BREAK case 50: YY_RULE_SETUP #line 136 "lex.l" { Return( TASKOP, kRCX_StartTaskOp); } YY_BREAK case 51: YY_RULE_SETUP #line 137 "lex.l" { return ABS; } YY_BREAK case 52: YY_RULE_SETUP #line 138 "lex.l" { return SIGN; } YY_BREAK case 53: YY_RULE_SETUP #line 140 "lex.l" { Return( ASSIGN, kRCX_AddVar); } YY_BREAK case 54: YY_RULE_SETUP #line 141 "lex.l" { Return( ASSIGN, kRCX_SubVar); } YY_BREAK case 55: YY_RULE_SETUP #line 142 "lex.l" { Return( ASSIGN, kRCX_MulVar); } YY_BREAK case 56: YY_RULE_SETUP #line 143 "lex.l" { Return( ASSIGN, kRCX_DivVar); } YY_BREAK case 57: YY_RULE_SETUP #line 144 "lex.l" { Return( ASSIGN, kRCX_AndVar); } YY_BREAK case 58: YY_RULE_SETUP #line 145 "lex.l" { Return( ASSIGN, kRCX_OrVar); } YY_BREAK case 59: YY_RULE_SETUP #line 146 "lex.l" { Return( ASSIGN, kRCX_AbsVar); } YY_BREAK case 60: YY_RULE_SETUP #line 147 "lex.l" { Return( ASSIGN, kRCX_SgnVar); } YY_BREAK case 61: YY_RULE_SETUP #line 149 "lex.l" { Return( ASSIGN2, RIGHT); } YY_BREAK case 62: YY_RULE_SETUP #line 150 "lex.l" { Return( ASSIGN2, LEFT); } YY_BREAK case 63: YY_RULE_SETUP #line 151 "lex.l" { Return( ASSIGN2, '%'); } YY_BREAK case 64: YY_RULE_SETUP #line 152 "lex.l" { Return( ASSIGN2, '^'); } YY_BREAK case 65: YY_RULE_SETUP #line 154 "lex.l" { return REL_EQ; } YY_BREAK case 66: YY_RULE_SETUP #line 155 "lex.l" { return REL_NE; } YY_BREAK case 67: YY_RULE_SETUP #line 156 "lex.l" { return REL_LE; } YY_BREAK case 68: YY_RULE_SETUP #line 157 "lex.l" { return REL_GE; } YY_BREAK case 69: YY_RULE_SETUP #line 159 "lex.l" { return AND; } YY_BREAK case 70: YY_RULE_SETUP #line 160 "lex.l" { return OR; } YY_BREAK case 71: YY_RULE_SETUP #line 162 "lex.l" { Return( INCDEC, 1); } YY_BREAK case 72: YY_RULE_SETUP #line 163 "lex.l" { Return( INCDEC, 0); } YY_BREAK case 73: YY_RULE_SETUP #line 165 "lex.l" { return CTRUE; } YY_BREAK case 74: YY_RULE_SETUP #line 166 "lex.l" { return CFALSE; } YY_BREAK case 75: YY_RULE_SETUP #line 168 "lex.l" { return LEFT; } YY_BREAK case 76: YY_RULE_SETUP #line 169 "lex.l" { return RIGHT; } YY_BREAK case 77: YY_RULE_SETUP #line 171 "lex.l" { return INDIRECT; } YY_BREAK case 78: YY_RULE_SETUP #line 173 "lex.l" { yylval.fSymbol = Symbol::Get(yytext); return ID; } YY_BREAK case 79: YY_RULE_SETUP #line 174 "lex.l" { char*ptr; yylval.fInt = strtol(yytext, &ptr, 0); return NUMBER; } YY_BREAK case 80: YY_RULE_SETUP #line 175 "lex.l" { yylval.fInt = (int)atof(yytext); return NUMBER; } YY_BREAK case 81: YY_RULE_SETUP #line 177 "lex.l" { yytext[yyleng-1]=0; yylval.fString = yytext+1; return STRING; } YY_BREAK case 82: YY_RULE_SETUP #line 179 "lex.l" { if (sReturnWhitespace) return WS; } YY_BREAK case 83: YY_RULE_SETUP #line 182 "lex.l" { return yytext[0]; } YY_BREAK case 84: YY_RULE_SETUP #line 184 "lex.l" BEGIN(COMMENT); YY_BREAK case 85: YY_RULE_SETUP #line 185 "lex.l" /* eat anything that's not a '*' */ YY_BREAK case 86: YY_RULE_SETUP #line 186 "lex.l" /* eat up '*'s not followed by '/'s */ YY_BREAK case 87: YY_RULE_SETUP #line 187 "lex.l" /* eat up newlines */ YY_BREAK case 88: YY_RULE_SETUP #line 188 "lex.l" BEGIN(INITIAL); YY_BREAK case 89: YY_RULE_SETUP #line 191 "lex.l" ECHO; YY_BREAK #line 1293 "lexer.cpp" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(PREPROC): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between yy_current_buffer and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = yy_c_buf_p; goto yy_find_action; } } else switch ( yy_get_next_buffer() ) { case EOB_ACT_END_OF_FILE: { yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: yy_c_buf_p = &yy_current_buffer->yy_ch_buf[yy_n_chars]; yy_current_state = yy_get_previous_state(); yy_cp = yy_c_buf_p; yy_bp = yytext_ptr + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer() { register char *dest = yy_current_buffer->yy_ch_buf; register char *source = yytext_ptr; register int number_to_move, i; int ret_val; if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ yy_current_buffer->yy_n_chars = yy_n_chars = 0; else { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); #else /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = yy_current_buffer; int yy_c_buf_p_offset = (int) (yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; } if ( yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; yy_n_chars += number_to_move; yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state() { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ #ifdef YY_USE_PROTOS static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) #else static yy_state_type yy_try_NUL_trans( yy_current_state ) yy_state_type yy_current_state; #endif { register int yy_is_jam; register char *yy_cp = yy_c_buf_p; register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 278 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 277); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #ifdef YY_USE_PROTOS static void yyunput( int c, register char *yy_bp ) #else static void yyunput( c, yy_bp ) int c; register char *yy_bp; #endif { register char *yy_cp = yy_c_buf_p; /* undo effects of setting up yytext */ *yy_cp = yy_hold_char; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = yy_n_chars + 2; register char *dest = &yy_current_buffer->yy_ch_buf[ yy_current_buffer->yy_buf_size + 2]; register char *source = &yy_current_buffer->yy_ch_buf[number_to_move]; while ( source > yy_current_buffer->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); yy_current_buffer->yy_n_chars = yy_n_chars = yy_current_buffer->yy_buf_size; if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; yytext_ptr = yy_bp; yy_hold_char = *yy_cp; yy_c_buf_p = yy_cp; } #endif /* ifndef YY_NO_UNPUT */ #ifdef __cplusplus static int yyinput() #else static int input() #endif { int c; *yy_c_buf_p = yy_hold_char; if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) /* This was really a NUL. */ *yy_c_buf_p = '\0'; else { /* need more input */ int offset = yy_c_buf_p - yytext_ptr; ++yy_c_buf_p; switch ( yy_get_next_buffer() ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart( yyin ); /* fall through */ case EOB_ACT_END_OF_FILE: { if ( yywrap() ) return EOF; if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: yy_c_buf_p = yytext_ptr + offset; break; } } } c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ *yy_c_buf_p = '\0'; /* preserve yytext */ yy_hold_char = *++yy_c_buf_p; return c; } #ifdef YY_USE_PROTOS void yyrestart( FILE *input_file ) #else void yyrestart( input_file ) FILE *input_file; #endif { if ( ! yy_current_buffer ) yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); yy_init_buffer( yy_current_buffer, input_file ); yy_load_buffer_state(); } #ifdef YY_USE_PROTOS void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) #else void yy_switch_to_buffer( new_buffer ) YY_BUFFER_STATE new_buffer; #endif { if ( yy_current_buffer == new_buffer ) return; if ( yy_current_buffer ) { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; } yy_current_buffer = new_buffer; yy_load_buffer_state(); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ yy_did_buffer_switch_on_eof = 1; } #ifdef YY_USE_PROTOS void yy_load_buffer_state( void ) #else void yy_load_buffer_state() #endif { yy_n_chars = yy_current_buffer->yy_n_chars; yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; yyin = yy_current_buffer->yy_input_file; yy_hold_char = *yy_c_buf_p; } #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) #else YY_BUFFER_STATE yy_create_buffer( file, size ) FILE *file; int size; #endif { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer( b, file ); return b; } #ifdef YY_USE_PROTOS void yy_delete_buffer( YY_BUFFER_STATE b ) #else void yy_delete_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; if ( b == yy_current_buffer ) yy_current_buffer = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yy_flex_free( (void *) b->yy_ch_buf ); yy_flex_free( (void *) b ); } #ifndef YY_ALWAYS_INTERACTIVE #ifndef YY_NEVER_INTERACTIVE extern int isatty YY_PROTO(( int )); #endif #endif #ifdef YY_USE_PROTOS void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) #else void yy_init_buffer( b, file ) YY_BUFFER_STATE b; FILE *file; #endif { yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; #if YY_ALWAYS_INTERACTIVE b->yy_is_interactive = 1; #else #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; #endif #endif } #ifdef YY_USE_PROTOS void yy_flush_buffer( YY_BUFFER_STATE b ) #else void yy_flush_buffer( b ) YY_BUFFER_STATE b; #endif { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == yy_current_buffer ) yy_load_buffer_state(); } #ifndef YY_NO_SCAN_BUFFER #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) #else YY_BUFFER_STATE yy_scan_buffer( base, size ) char *base; yy_size_t size; #endif { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer( b ); return b; } #endif #ifndef YY_NO_SCAN_STRING #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) #else YY_BUFFER_STATE yy_scan_string( yy_str ) yyconst char *yy_str; #endif { int len; for ( len = 0; yy_str[len]; ++len ) ; return yy_scan_bytes( yy_str, len ); } #endif #ifndef YY_NO_SCAN_BYTES #ifdef YY_USE_PROTOS YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) #else YY_BUFFER_STATE yy_scan_bytes( bytes, len ) yyconst char *bytes; int len; #endif { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; buf = (char *) yy_flex_alloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < len; ++i ) buf[i] = bytes[i]; buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer( buf, n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #endif #ifndef YY_NO_PUSH_STATE #ifdef YY_USE_PROTOS static void yy_push_state( int new_state ) #else static void yy_push_state( new_state ) int new_state; #endif { if ( yy_start_stack_ptr >= yy_start_stack_depth ) { yy_size_t new_size; yy_start_stack_depth += YY_START_STACK_INCR; new_size = yy_start_stack_depth * sizeof( int ); if ( ! yy_start_stack ) yy_start_stack = (int *) yy_flex_alloc( new_size ); else yy_start_stack = (int *) yy_flex_realloc( (void *) yy_start_stack, new_size ); if ( ! yy_start_stack ) YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); } yy_start_stack[yy_start_stack_ptr++] = YY_START; BEGIN(new_state); } #endif #ifndef YY_NO_POP_STATE static void yy_pop_state() { if ( --yy_start_stack_ptr < 0 ) YY_FATAL_ERROR( "start-condition stack underflow" ); BEGIN(yy_start_stack[yy_start_stack_ptr]); } #endif #ifndef YY_NO_TOP_STATE static int yy_top_state() { return yy_start_stack[yy_start_stack_ptr - 1]; } #endif #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif #ifdef YY_USE_PROTOS static void yy_fatal_error( yyconst char msg[] ) #else static void yy_fatal_error( msg ) char msg[]; #endif { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ yytext[yyleng] = yy_hold_char; \ yy_c_buf_p = yytext + n; \ yy_hold_char = *yy_c_buf_p; \ *yy_c_buf_p = '\0'; \ yyleng = n; \ } \ while ( 0 ) /* Internal utility routines. */ #ifndef yytext_ptr #ifdef YY_USE_PROTOS static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) #else static void yy_flex_strncpy( s1, s2, n ) char *s1; yyconst char *s2; int n; #endif { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN #ifdef YY_USE_PROTOS static int yy_flex_strlen( yyconst char *s ) #else static int yy_flex_strlen( s ) yyconst char *s; #endif { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif #ifdef YY_USE_PROTOS static void *yy_flex_alloc( yy_size_t size ) #else static void *yy_flex_alloc( size ) yy_size_t size; #endif { return (void *) malloc( size ); } #ifdef YY_USE_PROTOS static void *yy_flex_realloc( void *ptr, yy_size_t size ) #else static void *yy_flex_realloc( ptr, size ) void *ptr; yy_size_t size; #endif { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } #ifdef YY_USE_PROTOS static void yy_flex_free( void *ptr ) #else static void yy_flex_free( ptr ) void *ptr; #endif { free( ptr ); } #if YY_MAIN int main() { yylex(); return 0; } #endif #line 191 "lex.l" void LexCurrentLocation(LexLocation &loc) { loc.fLength = yyleng; loc.fIndex = sSourceIndex; loc.fOffset = sOffset - yyleng; } void LexReturnWhitespace(int mode) { sReturnWhitespace = mode; } int LexFindAndPushFile(const char *name) { Buffer *b = Compiler::Get()->CreateBuffer(name); if (!b) { Error(kErr_FileOpen, name).RaiseLex(); return 0; } return LexPush(b); } int LexPush(Buffer *b) { InputFile *inputFile; int index; index = Compiler::Get()->AddBuffer(b); // make sure max file depth and file count haven't been exceeded if (sFileDepth == kMaxFileDepth || index > kMaxFileCount) return 0; // save line number and buffer in previous file if (sCurrentInputFile) { sCurrentInputFile->fSavedOffset = sOffset; sCurrentInputFile->fBufferState = YY_CURRENT_BUFFER; } inputFile = (InputFile *)malloc(sizeof(InputFile)); inputFile->fBufferState = yy_create_buffer(0, YY_BUF_SIZE); inputFile->fDataPtr = b->GetData(); inputFile->fDataRemain = b->GetLength(); inputFile->fSourceIndex = index; // link into list inputFile->fNext = sCurrentInputFile; sCurrentInputFile = inputFile; sFileDepth++; // switch to new buffer sOffset = 0; sSourceIndex = index; yy_switch_to_buffer(inputFile->fBufferState); return 1; } int yywrap() { InputFile *inputFile; // check for unterminated comments if (YY_START == COMMENT) { Error(kErr_UnterminatedComment).RaiseLex(); BEGIN(INITIAL); } // if no input files, just return if (sCurrentInputFile == 0) return 1; // pop an input file off the list inputFile = sCurrentInputFile; sCurrentInputFile = inputFile->fNext; sFileDepth--; // cleanup the input file yy_delete_buffer(YY_CURRENT_BUFFER); free(inputFile); // if no more files, just return 1 if (!sCurrentInputFile) return 1; // switch to next file yy_switch_to_buffer(sCurrentInputFile->fBufferState); sOffset = sCurrentInputFile->fSavedOffset; sSourceIndex = sCurrentInputFile->fSourceIndex; // tell yylex() to continue return 0; } void LexReset() { while(yywrap() == 0) ; } int FillBuffer(char *buf, int max_size) { int result; // if no files are pending, return 0 (EOF) if (!sCurrentInputFile) return 0; int n = sCurrentInputFile->fDataRemain; if (n > max_size) n = max_size; memcpy(buf, sCurrentInputFile->fDataPtr, n); sCurrentInputFile->fDataPtr += n; sCurrentInputFile->fDataRemain -= n; result = n; return result; } nqc-3.1.r6/default/parse.cpp0000600000175000017500000022747110012505734014044 0ustar blpblp /* A Bison parser, made from parse.y with Bison version GNU Bison version 1.24 */ #define YYBISON 1 /* Identify Bison output. */ #define OR 258 #define AND 259 #define REL_EQ 260 #define REL_NE 261 #define REL_LE 262 #define REL_GE 263 #define LEFT 264 #define RIGHT 265 #define UMINUS 266 #define INDIRECT 267 #define INCDEC 268 #define ABS 269 #define SIGN 270 #define TYPE 271 #define EVENT_SRC 272 #define LOWER_THAN_ELSE 273 #define ELSE 274 #define LOWER_THAN_EXPR_SHIFT 275 #define ID 276 #define NUMBER 277 #define ASSIGN 278 #define ASSIGN2 279 #define TASKOP 280 #define JUMP 281 #define TASK 282 #define SUB 283 #define STRING 284 #define PP_DEFINE 285 #define PP_INCLUDE 286 #define NL 287 #define WS 288 #define PP_ARG 289 #define PP_UNKNOWN 290 #define PP_IFDEF 291 #define PP_IF 292 #define PP_ELSE 293 #define PP_ELIF 294 #define PP_ENDIF 295 #define PP_UNDEF 296 #define PP_PRAGMA 297 #define PP_GLOM 298 #define PP_ERROR 299 #define PP_WARNING 300 #define IF 301 #define WHILE 302 #define DO 303 #define FOR 304 #define REPEAT 305 #define SWITCH 306 #define CASE 307 #define DEFAULT 308 #define MONITOR 309 #define CATCH 310 #define ACQUIRE 311 #define GOTO 312 #define ASM 313 #define INT 314 #define T_VOID 315 #define T_CONST 316 #define SENSOR 317 #define TASKID 318 #define NOLIST 319 #define RES 320 #define CTRUE 321 #define CFALSE 322 #line 1 "parse.y" /* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. */ #line 19 "parse.y" // prevent redefinition of YYSTYPE in parser.h #define __PARSE_TAB_H // these classes must be defined prior to YYSTYPE #include "Fragment.h" #include "Resource.h" #include "BlockStmt.h" #include "Symbol.h" #include "Expr.h" #include "FunctionDef.h" #include "CallStmt.h" #include "AsmStmt.h" #include "CaseStmt.h" #include "DeclareStmt.h" #include "Fragment.h" #if __MWERKS__ #include #endif class Clause; class LocationNode; #line 45 "parse.y" typedef union { int fInt; bool fBool; Resource* fResource; Fragment* fFragment; Stmt* fStmt; BlockStmt* fBlock; Symbol* fSymbol; char* fString; Expr* fExpr; FunctionDef* fFunction; CallStmt* fCall; AsmStmt* fAsmStmt; Field* fField; CaseStmt* fCaseStmt; DeclareStmt* fDeclareStmt; LocationNode* fLocation; } YYSTYPE; #line 65 "parse.y" #include #include "IfStmt.h" #include "WhileStmt.h" #include "AsmStmt.h" #include "DoStmt.h" #include "RepeatStmt.h" #include "AssignStmt.h" #include "TaskStmt.h" #include "JumpStmt.h" #include "SwitchStmt.h" #include "ExprStmt.h" #include "RCX_Constants.h" #include "PreProc.h" #include "parser.h" #include "Program.h" #include "parse_util.h" #include "Program.h" #include "IncDecExpr.h" #include "AtomExpr.h" #include "TypeExpr.h" #include "Error.h" #include "MonitorStmt.h" #include "EventSrcExpr.h" #include "SensorExpr.h" #include "AssignMathStmt.h" #include "ForStmt.h" #include "RelExpr.h" #include "NegateExpr.h" #include "LogicalExpr.h" #include "TernaryExpr.h" #include "LabelStmt.h" #include "GotoStmt.h" #include "AddrOfExpr.h" #include "DerefExpr.h" #define yylex() (gPreProc->Get(yylval)) static LexLocation sSavedLoc; #line 155 "parse.y" static void yyerror(const char *msg); #ifndef YYLTYPE typedef struct yyltype { int timestamp; int first_line; int first_column; int last_line; int last_column; char *text; } yyltype; #define YYLTYPE yyltype #endif #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 326 #define YYFLAG -32768 #define YYNTBASE 93 #define YYTRANSLATE(x) ((unsigned)(x) <= 322 ? yytranslate[x] : 131) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 26, 2, 2, 92, 22, 9, 2, 86, 35, 20, 19, 87, 18, 2, 21, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 83, 12, 88, 13, 4, 91, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 89, 2, 90, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 84, 7, 85, 24, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 5, 6, 10, 11, 14, 15, 16, 17, 23, 25, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 2, 5, 6, 10, 14, 18, 25, 28, 35, 37, 38, 44, 53, 59, 64, 67, 69, 71, 72, 77, 80, 82, 85, 88, 92, 94, 97, 101, 105, 107, 109, 113, 116, 122, 126, 127, 132, 135, 136, 138, 140, 143, 148, 151, 153, 156, 163, 172, 179, 186, 193, 202, 211, 220, 231, 236, 242, 246, 251, 258, 262, 265, 267, 271, 275, 279, 281, 282, 284, 285, 287, 288, 291, 292, 295, 302, 305, 310, 314, 316, 317, 321, 323, 326, 330, 334, 338, 342, 346, 350, 354, 358, 362, 366, 370, 374, 378, 382, 386, 390, 393, 396, 399, 403, 407, 410, 413, 418, 423, 427, 430, 436, 439, 442, 445, 450, 455, 460, 463, 471, 477, 481, 488, 492, 493, 494, 498, 500, 501, 503, 506, 511, 518, 522, 524, 525 }; static const short yyrhs[] = { 94, 0, 94, 95, 0, 0, 74, 104, 83, 0, 125, 98, 125, 0, 125, 99, 125, 0, 125, 96, 84, 109, 85, 125, 0, 128, 83, 0, 97, 75, 36, 86, 101, 35, 0, 79, 0, 0, 42, 36, 86, 35, 107, 0, 43, 36, 86, 100, 35, 84, 109, 85, 0, 43, 36, 86, 35, 107, 0, 100, 87, 103, 36, 0, 103, 36, 0, 102, 0, 75, 0, 0, 102, 87, 103, 36, 0, 103, 36, 0, 74, 0, 76, 74, 0, 74, 9, 0, 76, 74, 9, 0, 77, 0, 74, 20, 0, 76, 74, 20, 0, 104, 87, 105, 0, 105, 0, 106, 0, 106, 88, 123, 0, 36, 125, 0, 36, 125, 89, 123, 90, 0, 20, 36, 125, 0, 0, 84, 108, 109, 85, 0, 109, 110, 0, 0, 83, 0, 107, 0, 120, 110, 0, 125, 36, 3, 110, 0, 1, 83, 0, 111, 0, 112, 125, 0, 62, 86, 123, 35, 125, 110, 0, 63, 125, 110, 62, 86, 123, 35, 83, 0, 65, 86, 123, 35, 125, 110, 0, 66, 86, 123, 35, 125, 110, 0, 61, 86, 123, 35, 125, 110, 0, 61, 86, 123, 35, 125, 110, 33, 110, 0, 69, 125, 86, 123, 35, 125, 107, 117, 0, 71, 125, 86, 123, 35, 125, 107, 116, 0, 64, 86, 114, 83, 115, 83, 114, 35, 125, 110, 0, 72, 36, 124, 83, 0, 73, 84, 126, 85, 83, 0, 124, 41, 83, 0, 40, 124, 36, 83, 0, 125, 36, 86, 121, 35, 83, 0, 74, 104, 83, 0, 113, 83, 0, 123, 0, 123, 38, 123, 0, 123, 39, 123, 0, 123, 88, 123, 0, 113, 0, 0, 123, 0, 0, 119, 0, 0, 117, 118, 0, 0, 70, 107, 0, 70, 125, 86, 123, 35, 107, 0, 70, 107, 0, 124, 67, 123, 3, 0, 124, 68, 3, 0, 122, 0, 0, 122, 87, 123, 0, 123, 0, 37, 124, 0, 123, 19, 123, 0, 123, 18, 123, 0, 123, 20, 123, 0, 123, 21, 123, 0, 123, 9, 123, 0, 123, 7, 123, 0, 123, 22, 123, 0, 123, 16, 123, 0, 123, 17, 123, 0, 123, 8, 123, 0, 123, 10, 123, 0, 123, 14, 123, 0, 123, 15, 123, 0, 123, 11, 123, 0, 123, 12, 123, 0, 123, 13, 123, 0, 81, 124, 0, 82, 124, 0, 26, 123, 0, 123, 6, 123, 0, 123, 5, 123, 0, 18, 123, 0, 24, 123, 0, 28, 86, 123, 35, 0, 29, 86, 123, 35, 0, 86, 123, 35, 0, 125, 36, 0, 125, 36, 89, 123, 90, 0, 91, 123, 0, 123, 27, 0, 27, 123, 0, 77, 86, 123, 35, 0, 30, 86, 123, 35, 0, 31, 86, 123, 35, 0, 125, 78, 0, 25, 86, 123, 35, 89, 123, 90, 0, 123, 4, 123, 3, 123, 0, 125, 9, 36, 0, 125, 9, 36, 89, 123, 90, 0, 125, 20, 36, 0, 0, 0, 126, 87, 127, 0, 127, 0, 0, 123, 0, 92, 123, 0, 92, 123, 3, 123, 0, 80, 123, 36, 84, 129, 85, 0, 129, 87, 130, 0, 130, 0, 0, 123, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 163, 167, 168, 171, 172, 173, 174, 175, 179, 182, 183, 186, 193, 194, 197, 198, 201, 202, 203, 206, 207, 210, 211, 212, 213, 214, 215, 216, 220, 221, 224, 225, 228, 229, 230, 233, 233, 236, 237, 241, 242, 243, 244, 245, 246, 247, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 265, 266, 267, 268, 269, 270, 274, 275, 276, 277, 281, 282, 285, 286, 290, 291, 295, 296, 299, 300, 304, 307, 308, 311, 312, 315, 316, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 342, 343, 345, 346, 348, 349, 350, 351, 353, 354, 356, 357, 358, 359, 360, 361, 362, 363, 364, 367, 370, 373, 374, 375, 379, 380, 381, 385, 388, 389, 390, 393 }; static const char * const yytname[] = { "$","error","$undefined.","':'","'?'", "OR","AND","'|'","'^'","'&'","REL_EQ","REL_NE","'<'","'>'","REL_LE","REL_GE", "LEFT","RIGHT","'-'","'+'","'*'","'/'","'%'","UMINUS","'~'","INDIRECT","'!'", "INCDEC","ABS","SIGN","TYPE","EVENT_SRC","LOWER_THAN_ELSE","ELSE","LOWER_THAN_EXPR_SHIFT", "')'","ID","NUMBER","ASSIGN","ASSIGN2","TASKOP","JUMP","TASK","SUB","STRING", "PP_DEFINE","PP_INCLUDE","NL","WS","PP_ARG","PP_UNKNOWN","PP_IFDEF","PP_IF", "PP_ELSE","PP_ELIF","PP_ENDIF","PP_UNDEF","PP_PRAGMA","PP_GLOM","PP_ERROR","PP_WARNING", "IF","WHILE","DO","FOR","REPEAT","SWITCH","CASE","DEFAULT","MONITOR","CATCH", "ACQUIRE","GOTO","ASM","INT","T_VOID","T_CONST","SENSOR","TASKID","NOLIST","RES", "CTRUE","CFALSE","';'","'{'","'}'","'('","','","'='","'['","']'","'@'","'$'", "S","unit_list","unit","function_head","nolist_opt","fragment","subfragment", "sarg_list","args","arg_list","arg_type","var_list","var_item","var_decl","block", "@1","stmt_list","stmt","control_stmt","misc_stmt","expr_stmt","opt_expr_stmt", "opt_expr","opt_handler","handler_list","evt_handler","handler","case","params", "param_list","expr","saveloc","loc","asm_list","asm_item","resource","res_data", "res_byte","" }; #endif static const short yyr1[] = { 0, 93, 94, 94, 95, 95, 95, 95, 95, 96, 97, 97, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 103, 103, 103, 103, 103, 104, 104, 105, 105, 106, 106, 106, 108, 107, 109, 109, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 120, 120, 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 125, 126, 126, 126, 127, 127, 127, 128, 129, 129, 129, 130 }; static const short yyr2[] = { 0, 1, 2, 0, 3, 3, 3, 6, 2, 6, 1, 0, 5, 8, 5, 4, 2, 1, 1, 0, 4, 2, 1, 2, 2, 3, 1, 2, 3, 3, 1, 1, 3, 2, 5, 3, 0, 4, 2, 0, 1, 1, 2, 4, 2, 1, 2, 6, 8, 6, 6, 6, 8, 8, 8, 10, 4, 5, 3, 4, 6, 3, 2, 1, 3, 3, 3, 1, 0, 1, 0, 1, 0, 2, 0, 2, 6, 2, 4, 3, 1, 0, 3, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 3, 3, 2, 2, 4, 4, 3, 2, 5, 2, 2, 2, 4, 4, 4, 2, 7, 5, 3, 6, 3, 0, 0, 3, 1, 0, 1, 2, 4, 6, 3, 1, 0, 1 }; static const short yydefact[] = { 3, 126, 0, 126, 2, 11, 0, 0, 126, 0, 30, 31, 126, 126, 0, 126, 126, 0, 0, 0, 0, 125, 0, 125, 125, 126, 126, 0, 0, 0, 0, 10, 0, 0, 126, 126, 8, 126, 33, 4, 0, 126, 106, 107, 126, 103, 115, 126, 126, 126, 126, 84, 126, 101, 102, 0, 113, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 114, 0, 0, 0, 111, 119, 0, 0, 39, 0, 5, 6, 35, 126, 29, 32, 0, 0, 0, 0, 0, 0, 110, 0, 105, 104, 90, 94, 89, 95, 98, 99, 100, 96, 97, 92, 93, 86, 85, 87, 88, 91, 126, 122, 124, 126, 0, 0, 0, 0, 0, 0, 108, 109, 117, 118, 116, 126, 137, 0, 135, 126, 0, 0, 0, 22, 0, 26, 0, 0, 0, 125, 0, 0, 126, 0, 0, 0, 126, 126, 0, 0, 0, 40, 36, 126, 41, 38, 45, 126, 0, 0, 63, 0, 0, 19, 34, 126, 121, 133, 126, 0, 112, 12, 14, 24, 27, 23, 0, 0, 16, 44, 0, 126, 126, 0, 126, 126, 126, 0, 0, 125, 126, 0, 39, 7, 46, 62, 42, 126, 126, 126, 0, 126, 0, 111, 18, 0, 17, 0, 0, 134, 123, 25, 28, 39, 0, 0, 0, 0, 0, 67, 0, 0, 0, 126, 126, 0, 126, 130, 0, 128, 61, 0, 64, 65, 66, 58, 0, 79, 0, 126, 9, 0, 21, 120, 0, 15, 59, 126, 126, 0, 126, 126, 126, 0, 0, 56, 131, 0, 126, 37, 78, 43, 0, 80, 83, 0, 13, 0, 0, 126, 0, 69, 0, 0, 126, 126, 126, 57, 127, 0, 126, 20, 51, 47, 0, 126, 49, 50, 0, 0, 132, 60, 82, 0, 0, 0, 74, 72, 52, 48, 126, 53, 0, 54, 71, 0, 126, 73, 77, 55, 75, 0, 126, 0, 0, 76, 0, 0, 0 }; static const short yydefgoto[] = { 324, 1, 4, 32, 33, 34, 35, 144, 213, 214, 145, 9, 10, 11, 162, 200, 124, 163, 164, 165, 166, 228, 278, 311, 309, 315, 312, 167, 270, 271, 168, 169, 28, 236, 237, 6, 135, 136 }; static const short yypact[] = {-32768, 8, 12, 910,-32768, -28, -66, -2,-32768, -63,-32768, -55, 910, 910, -36, 910, 910, -11, 6, 10, 30, -32768, 31,-32768,-32768, 910, 910, 998, 7, 48, 89, -32768, 23, 47,-32768,-32768,-32768,-32768, 44,-32768, 12, 910, 126, 126, 910, 126, 126, 910, 910, 910, 910, -32768, 910,-32768,-32768, 1031, 126, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910, 910,-32768, 70, 119, 121, 72, -32768, 74, 76,-32768, 127,-32768,-32768,-32768, 910,-32768, 1586, 1063, 1095, 1127, 1159, 1191, 1223,-32768, 1512, 129, 205, 1630, 466, 543, 619, 619, 82, 82, 82, 82, 92, 92, 9, 9, 126, 126, 126, 770, 80,-32768, 910, 136, 0, 355, 88, 282, 93,-32768,-32768,-32768, -32768,-32768, 910, 1586, -4,-32768, 910, 677, 96, 96, 19, 107,-32768, -14, 147, 102,-32768, 103, 106,-32768, 108, 110, 111,-32768,-32768, 152, 109, 12,-32768,-32768, -32768,-32768,-32768,-32768,-32768, 115, 589, 765, 11, 17, 91,-32768, 910, 1610,-32768, 910, 701,-32768,-32768,-32768, -32768,-32768, 71, 116, 101,-32768,-32768, 163, 910, 910, 589, 800, 910, 910, 122, 123,-32768, 242, 41,-32768, -32768,-32768,-32768,-32768, 910, 910, 910, 118, 910, 202, 4,-32768, 172, 124, 194, 725,-32768,-32768,-32768,-32768, -32768, 197, 151, 1255, 1287, 173,-32768, 154, 1319, 1351, 910, 910, 155, 910, 1586, 21,-32768,-32768, 433, 1586, 1586, 1586,-32768, 1537,-32768, 589, 841,-32768, 101,-32768, -32768, 511,-32768,-32768,-32768,-32768, 153, 869,-32768,-32768, 1383, 1415,-32768, 1562, 159, 731,-32768,-32768,-32768, 208, 158, 1586, 210,-32768, 589, 589, 910, 165, 1586, 589, 589,-32768,-32768, 910,-32768,-32768, 166, 910,-32768, 217, -32768, 1447, 884,-32768,-32768, 96, 96, 1586,-32768, 1586, 589, 169, 219,-32768, 186,-32768,-32768,-32768, 187, 96, -32768,-32768, 589, 96,-32768,-32768,-32768,-32768, 175, 910, 1479, 96,-32768, 258, 259,-32768 }; static const short yypgoto[] = {-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -160, 104, 224,-32768, -138,-32768, -181, -149,-32768,-32768, -188, -17,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -3, -18, 86,-32768, -1,-32768,-32768, 99 }; #define YYLAST 1657 static const short yytable[] = { 27, 179, 180, 51, 227, 53, 54, 246, -1, 42, 43, 215, 45, 46, 29, 30, 78, 36, 204, 239, 39, 184, 55, 56, 40, 222, 78, 79, 181, 73, 74, 75, 7, 41, 37, 140, 76, 79, 91, 182, 252, 92, 226, 80, 93, 94, 95, 96, 8, 97, 44, 31, 208, 211, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 185, 141, 47, 142, 143, 209, 210, 219, 175, 2, 176, 82, 81, 126, 5, 3, 273, 247, 220, 48, 121, 38, 81, 49, 269, 69, 70, 71, 72, 73, 74, 75, 227, 265, 84, 266, 76, 71, 72, 73, 74, 75, 134, 50, 52, 138, 76, 86, 87, 85, 88, 238, 83, 290, 291, 40, 188, 174, 294, 295, 89, 177, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 306, 76, 118, 119, 76, 120, 304, 305, 122, 121, 123, 125, 317, 141, 212, 142, 143, 137, 216, 139, 316, 134, 171, 141, 318, 142, 143, 233, 160, 183, 173, 186, 323, 187, 224, 225, 197, 189, 229, 230, 190, 198, 192, 235, 193, 194, 203, 223, 221, 243, 240, 241, 242, 245, 244, 248, 231, 232, 170, 249, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 261, 262, 250, 264, 76, 253, 254, 257, 191, 258, 263, 277, 195, 196, 285, 287, 272, 288, 289, 201, 293, 299, 301, 202, 307, 170, 308, 279, 310, 314, 325, 326, 12, 320, 199, 235, 90, 286, 13, 14, 15, 16, 17, 18, 19, 20, 292, 217, 303, 170, 0, 21, 0, 298, 0, 0, 0, 300, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 321, 0, 22, 0, 0, 0, 23, 24, 170, 0, -129, 25, -129, 0, 0, 170, 26, 234, 0, 0, 0, 170, 0, 0, 275, 276, 0, 0, 280, 281, 0, 0, 0, 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, 0, 170, 170, 0, -126, 0, 170, 170, 296, 297, 0, 0, 172, 12, 0, -126, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 170, 0, 0, 0, -126, 21, 0, 313, 147, -125, 0, 0, 170, 319, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, 149, 150, 151, 152, 153, -125, -125, 154, 0, 155, 156, 157, 158, 0, 0, 22, -126, 146, 0, 23, 24, 159, 160, 161, 25, -126, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -126, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -126, 21, 0, 0, 147, -125, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 148, 149, 150, 151, 152, 153, -125, -125, 154, 0, 155, 156, 157, 158, 0, 0, 22, -126, 146, 0, 23, 24, 159, 160, 267, 25, -126, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -126, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -126, 21, 0, 0, 147, -125, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 148, 149, 150, 151, 152, 153, -125, -125, 154, 0, 155, 156, 157, 158, 0, 0, 22, -126, 146, 0, 23, 24, 159, 160, 274, 25, -126, 0, 0, 0, 26, 0, 0, 0, 0, 12, 0, -126, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, -126, 21, 0, 0, 147, -125, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 148, 149, 150, 151, 152, 153, -125, -125, 154, 0, 155, 156, 157, 158, 0, 0, 22, -126, 0, 0, 23, 24, 159, 160, 0, 25, 0, 0, 0, 0, 26, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 12, 0, 0, 76, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 178, 21, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 12, 0, 0, 218, 76, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 205, 206, 0, 0, 21, 22, 0, 0, 0, 23, 24, 0, 251, 0, 25, 12, 0, 0, 0, 26, 234, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 23, 24, 207, 0, -136, 25, -136, 0, 12, 0, 26, 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, -81, 22, 21, 0, 0, 23, 24, -68, 0, 0, 25, 12, 0, 0, 0, 26, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 12, 0, 0, 0, 21, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 22, -68, 0, 21, 23, 24, 0, 0, 0, 25, 12, 0, 0, 0, 26, 0, 13, 14, 15, 16, 17, 18, 19, 20, 0, 0, 0, 0, 22, 21, 0, 0, 23, 24, -70, 0, 0, 25, 0, 0, 0, 0, 26, 22, 0, 0, 0, 23, 24, 0, 0, 0, 25, 0, 0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 23, 24, 0, 0, 0, 25, 0, 0, 0, 0, 26, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 0, 77, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 98, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 127, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 128, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 129, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 130, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 131, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 132, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 255, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 256, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 259, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 260, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 282, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 283, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 302, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 0, 0, 0, 0, 0, 0, 0, 322, 133, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 268, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 284, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76,-32768, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 76 }; static const short yycheck[] = { 3, 139, 140, 21, 192, 23, 24, 3, 0, 12, 13, 171, 15, 16, 42, 43, 9, 83, 167, 200, 83, 35, 25, 26, 87, 185, 9, 20, 9, 20, 21, 22, 20, 88, 36, 35, 27, 20, 41, 20, 221, 44, 191, 36, 47, 48, 49, 50, 36, 52, 86, 79, 41, 36, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 87, 74, 86, 76, 77, 67, 68, 9, 85, 74, 87, 36, 78, 89, 1, 80, 249, 86, 20, 86, 89, 8, 78, 86, 246, 16, 17, 18, 19, 20, 21, 22, 293, 85, 84, 87, 27, 18, 19, 20, 21, 22, 118, 86, 86, 121, 27, 34, 35, 75, 37, 83, 36, 275, 276, 87, 147, 133, 280, 281, 89, 137, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 301, 27, 84, 36, 27, 36, 296, 297, 86, 89, 86, 36, 313, 74, 75, 76, 77, 89, 173, 35, 310, 176, 86, 74, 314, 76, 77, 197, 84, 74, 89, 36, 322, 83, 189, 190, 36, 86, 193, 194, 86, 84, 86, 198, 86, 86, 83, 36, 84, 83, 205, 206, 207, 3, 209, 35, 86, 86, 124, 87, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 231, 232, 36, 234, 27, 36, 83, 62, 150, 83, 83, 86, 154, 155, 83, 35, 247, 87, 36, 161, 83, 83, 33, 165, 83, 167, 35, 258, 70, 70, 0, 0, 18, 86, 158, 266, 40, 266, 24, 25, 26, 27, 28, 29, 30, 31, 277, 176, 293, 191, -1, 37, -1, 284, -1, -1, -1, 288, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 320, -1, 77, -1, -1, -1, 81, 82, 239, -1, 85, 86, 87, -1, -1, 246, 91, 92, -1, -1, -1, 252, -1, -1, 255, 256, -1, -1, 259, 260, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, -1, -1, -1, -1, 275, 276, -1, 9, -1, 280, 281, 282, 283, -1, -1, 90, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, 301, -1, -1, -1, 36, 37, -1, 308, 40, 41, -1, -1, 313, 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, 1, -1, 81, 82, 83, 84, 85, 86, 9, -1, -1, -1, 91, -1, -1, -1, -1, 18, -1, 20, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 36, 37, -1, -1, 40, 41, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, -1, 71, 72, 73, 74, -1, -1, 77, 78, -1, -1, 81, 82, 83, 84, -1, 86, -1, -1, -1, -1, 91, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, 18, -1, -1, 27, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 90, 37, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 18, -1, -1, 90, 27, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, 38, 39, -1, -1, 37, 77, -1, -1, -1, 81, 82, -1, 90, -1, 86, 18, -1, -1, -1, 91, 92, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, -1, 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, 81, 82, 88, -1, 85, 86, 87, -1, 18, -1, 91, -1, -1, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, 35, 77, 37, -1, -1, 81, 82, 83, -1, -1, 86, 18, -1, -1, -1, 91, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, 18, -1, -1, -1, 37, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, 77, 35, -1, 37, 81, 82, -1, -1, -1, 86, 18, -1, -1, -1, 91, -1, 24, 25, 26, 27, 28, 29, 30, 31, -1, -1, -1, -1, 77, 37, -1, -1, 81, 82, 83, -1, -1, 86, -1, -1, -1, -1, 91, 77, -1, -1, -1, 81, 82, -1, -1, -1, 86, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 77, -1, -1, -1, 81, 82, -1, -1, -1, 86, -1, -1, -1, -1, 91, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, -1, 36, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, -1, -1, -1, -1, -1, -1, -1, 35, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "bison.simple" /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ #ifndef alloca #include #endif /* alloca not defined. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY -2 #define YYEOF 0 #define YYACCEPT return(0) #define YYABORT return(1) #define YYERROR goto yyerrlab1 /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { yychar = (token), yylval = (value); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else #define YYLEX yylex(&yylval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, YYLEX_PARAM) #else #define YYLEX yylex(&yylval) #endif #endif /* not YYLSP_NEEDED */ #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ int yyparse (void); #endif #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (from, to, count) char *from; char *to; int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (char *from, char *to, int count) { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 192 "bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; #else #define YYPARSE_PARAM #define YYPARSE_PARAM_DECL #endif int yyparse(YYPARSE_PARAM) YYPARSE_PARAM_DECL { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* Give user a chance to reallocate the stack */ /* Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 163 "parse.y" { yyval.fInt = 0; ; break;} case 4: #line 171 "parse.y" { gProgram->AddGlobalDecls(yyvsp[-1].fBlock); ; break;} case 5: #line 172 "parse.y" { yyvsp[-1].fFragment->SetLocations(yyvsp[-2].fLocation, yyvsp[0].fLocation); ; break;} case 6: #line 173 "parse.y" { yyvsp[-1].fFragment->SetLocations(yyvsp[-2].fLocation, yyvsp[0].fLocation); ; break;} case 7: #line 174 "parse.y" { EndFunction(yyvsp[-4].fFunction, yyvsp[-2].fBlock, yyvsp[-5].fLocation, yyvsp[0].fLocation); ; break;} case 8: #line 175 "parse.y" { gProgram->AddResource(yyvsp[-1].fResource); ; break;} case 9: #line 179 "parse.y" { yyval.fFunction = BeginFunction(yyvsp[-1].fFunction, yyvsp[-3].fSymbol, yyvsp[-5].fBool); ; break;} case 10: #line 182 "parse.y" { yyval.fBool = 0; ; break;} case 11: #line 183 "parse.y" { yyval.fBool = 1; ; break;} case 12: #line 186 "parse.y" { yyval.fFragment = new Fragment(true, yyvsp[-3].fSymbol, yyvsp[0].fStmt); ; break;} case 13: #line 193 "parse.y" { yyval.fFragment = CreateSubroutine(yyvsp[-4].fFragment, yyvsp[-6].fSymbol, yyvsp[-1].fBlock); ; break;} case 14: #line 194 "parse.y" { yyval.fFragment = new Fragment(false, yyvsp[-3].fSymbol, yyvsp[0].fStmt); ; break;} case 15: #line 197 "parse.y" { yyval.fFragment = yyvsp[-3].fFragment; DefineSubArg(yyval.fFragment, yyvsp[0].fSymbol, yyvsp[-1].fInt); ; break;} case 16: #line 198 "parse.y" { yyval.fFragment = new Fragment(false); DefineSubArg(yyval.fFragment,yyvsp[0].fSymbol,yyvsp[-1].fInt); ; break;} case 18: #line 202 "parse.y" { yyval.fFunction = new FunctionDef(); ; break;} case 19: #line 203 "parse.y" { yyval.fFunction = new FunctionDef(); ; break;} case 20: #line 206 "parse.y" { yyval.fFunction = yyvsp[-3].fFunction; DefineArg(yyval.fFunction, yyvsp[0].fSymbol, yyvsp[-1].fInt); ; break;} case 21: #line 207 "parse.y" { yyval.fFunction = new FunctionDef(); DefineArg(yyval.fFunction,yyvsp[0].fSymbol,yyvsp[-1].fInt); ; break;} case 22: #line 210 "parse.y" { yyval.fInt = FunctionDef::kIntegerArg; ; break;} case 23: #line 211 "parse.y" { yyval.fInt = FunctionDef::kConstantArg; ; break;} case 24: #line 212 "parse.y" { yyval.fInt = FunctionDef::kReferenceArg; ; break;} case 25: #line 213 "parse.y" { yyval.fInt = FunctionDef::kConstRefArg; ; break;} case 26: #line 214 "parse.y" { yyval.fInt = FunctionDef::kSensorArg; ; break;} case 27: #line 215 "parse.y" { yyval.fInt = FunctionDef::kPointerArg; ; break;} case 28: #line 216 "parse.y" { yyval.fInt = FunctionDef::kConstPtrArg; ; break;} case 29: #line 220 "parse.y" { yyvsp[-2].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-2].fBlock; ; break;} case 30: #line 221 "parse.y" { yyval.fBlock = new BlockStmt(); yyval.fBlock->Add(yyvsp[0].fStmt); ; break;} case 31: #line 224 "parse.y" { yyval.fStmt = yyvsp[0].fDeclareStmt; ; break;} case 32: #line 225 "parse.y" { yyval.fStmt = yyvsp[-2].fDeclareStmt; yyvsp[-2].fDeclareStmt->SetInitialValue(yyvsp[0].fExpr); ; break;} case 33: #line 228 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-1].fSymbol, yyvsp[0].fLocation, 0, false, false); ; break;} case 34: #line 229 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-4].fSymbol, yyvsp[-3].fLocation, yyvsp[-1].fExpr, false, false); ; break;} case 35: #line 230 "parse.y" { yyval.fDeclareStmt = MakeDeclareStmt(yyvsp[-1].fSymbol, yyvsp[0].fLocation, 0, true, false); ; break;} case 36: #line 233 "parse.y" { BeginScope(); ; break;} case 37: #line 233 "parse.y" { yyval.fStmt = EndScope(yyvsp[-1].fBlock); ; break;} case 38: #line 236 "parse.y" { yyvsp[-1].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-1].fBlock; ; break;} case 39: #line 237 "parse.y" { yyval.fBlock = new BlockStmt(); ; break;} case 40: #line 241 "parse.y" { yyval.fStmt = new BlockStmt(); ; break;} case 42: #line 243 "parse.y" { yyval.fStmt = yyvsp[-1].fCaseStmt; yyvsp[-1].fCaseStmt->SetStmt(yyvsp[0].fStmt); ; break;} case 43: #line 244 "parse.y" { yyval.fStmt = new LabelStmt(yyvsp[-2].fSymbol, yyvsp[-3].fLocation->GetLoc(), yyvsp[0].fStmt); delete yyvsp[-3].fLocation; ; break;} case 44: #line 245 "parse.y" { yyerrok; yyval.fStmt = new BlockStmt(); ; break;} case 46: #line 247 "parse.y" { yyvsp[-1].fStmt->SetLocation(yyvsp[0].fLocation); ; break;} case 47: #line 252 "parse.y" { yyval.fStmt = new WhileStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 48: #line 253 "parse.y" { yyval.fStmt = new DoStmt(yyvsp[-2].fExpr, yyvsp[-5].fStmt); yyval.fStmt->SetLocation(yyvsp[-6].fLocation); ; break;} case 49: #line 254 "parse.y" { yyval.fStmt = new RepeatStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 50: #line 255 "parse.y" { yyval.fStmt = new SwitchStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 51: #line 256 "parse.y" { yyval.fStmt = new IfStmt(yyvsp[-3].fExpr, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 52: #line 257 "parse.y" { yyval.fStmt = new IfStmt(yyvsp[-5].fExpr, yyvsp[-2].fStmt, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-3].fLocation); ; break;} case 53: #line 258 "parse.y" { yyval.fStmt = new MonitorStmt(yyvsp[-4].fExpr, yyvsp[-1].fStmt, yyvsp[0].fBlock, yyvsp[-6].fLocation->GetLoc()); delete yyvsp[-6].fLocation; yyval.fStmt->SetLocation(yyvsp[-2].fLocation); ; break;} case 54: #line 259 "parse.y" { yyval.fStmt = MakeAcquireStmt(yyvsp[-4].fExpr, yyvsp[-1].fStmt, yyvsp[0].fStmt, yyvsp[-6].fLocation); yyval.fStmt->SetLocation(yyvsp[-2].fLocation); ; break;} case 55: #line 260 "parse.y" { yyval.fStmt = new ForStmt(yyvsp[-7].fStmt, yyvsp[-5].fExpr, yyvsp[-3].fStmt, yyvsp[0].fStmt); yyval.fStmt->SetLocation(yyvsp[-1].fLocation); ; break;} case 56: #line 261 "parse.y" { yyval.fStmt = new GotoStmt(yyvsp[-2].fSymbol, sSavedLoc); ; break;} case 57: #line 265 "parse.y" { yyval.fStmt = yyvsp[-2].fAsmStmt; ; break;} case 58: #line 266 "parse.y" { yyval.fStmt = new JumpStmt(yyvsp[-1].fInt, sSavedLoc); ; break;} case 59: #line 267 "parse.y" { yyval.fStmt = new TaskStmt((UByte)yyvsp[-3].fInt, yyvsp[-1].fSymbol, sSavedLoc); ; break;} case 60: #line 268 "parse.y" { yyval.fStmt = yyvsp[-2].fCall; yyvsp[-2].fCall->SetName(yyvsp[-4].fSymbol); yyvsp[-2].fCall->SetLocation(yyvsp[-5].fLocation->GetLoc()); delete yyvsp[-5].fLocation; ; break;} case 61: #line 269 "parse.y" { yyval.fStmt = yyvsp[-1].fBlock; ; break;} case 63: #line 274 "parse.y" { yyval.fStmt = new ExprStmt(yyvsp[0].fExpr); ; break;} case 64: #line 275 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = MakeAssignStmt(yyvsp[-2].fExpr, yyvsp[-1].fInt, yyvsp[0].fExpr); ; break;} case 65: #line 276 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = MakeAssign2Stmt(yyvsp[-2].fExpr, yyvsp[-1].fInt, yyvsp[0].fExpr); ; break;} case 66: #line 277 "parse.y" { CheckLValue(yyvsp[-2].fExpr); yyval.fStmt = new AssignStmt(yyvsp[-2].fExpr, yyvsp[0].fExpr); ; break;} case 68: #line 282 "parse.y" { yyval.fStmt = 0; ; break;} case 70: #line 286 "parse.y" { yyval.fExpr = 0; ; break;} case 72: #line 291 "parse.y" { yyval.fStmt = 0; ; break;} case 73: #line 295 "parse.y" { yyvsp[-1].fBlock->Add(yyvsp[0].fStmt); yyval.fBlock = yyvsp[-1].fBlock; ; break;} case 74: #line 296 "parse.y" { yyval.fBlock = new BlockStmt(); ; break;} case 75: #line 299 "parse.y" { yyval.fStmt = yyvsp[0].fStmt; ; break;} case 76: #line 300 "parse.y" { yyval.fStmt = MakeCatchStmt(yyvsp[-2].fExpr, yyvsp[0].fStmt, yyvsp[-4].fLocation); ; break;} case 77: #line 304 "parse.y" { yyval.fStmt = yyvsp[0].fStmt; ; break;} case 78: #line 307 "parse.y" { yyval.fCaseStmt = MakeCaseStmt(yyvsp[-1].fExpr, sSavedLoc); ; break;} case 79: #line 308 "parse.y" { yyval.fCaseStmt = new CaseStmt(CaseStmt::kDefaultValue, sSavedLoc); ; break;} case 81: #line 312 "parse.y" { yyval.fCall = new CallStmt(); ; break;} case 82: #line 315 "parse.y" { yyval.fCall = yyvsp[-2].fCall; yyval.fCall->AddParam(yyvsp[0].fExpr); ; break;} case 83: #line 316 "parse.y" { yyval.fCall = new CallStmt(); yyval.fCall->AddParam(yyvsp[0].fExpr); ; break;} case 84: #line 319 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, yyvsp[-1].fInt, sSavedLoc); ; break;} case 85: #line 320 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '+', yyvsp[0].fExpr); ; break;} case 86: #line 321 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '-', yyvsp[0].fExpr); ; break;} case 87: #line 322 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '*', yyvsp[0].fExpr); ; break;} case 88: #line 323 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '/', yyvsp[0].fExpr); ; break;} case 89: #line 324 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '&', yyvsp[0].fExpr); ; break;} case 90: #line 325 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '|', yyvsp[0].fExpr); ; break;} case 91: #line 326 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '%', yyvsp[0].fExpr); ; break;} case 92: #line 327 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, LEFT, yyvsp[0].fExpr); ; break;} case 93: #line 328 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, RIGHT, yyvsp[0].fExpr); ; break;} case 94: #line 329 "parse.y" { yyval.fExpr = MakeBinaryExpr(yyvsp[-2].fExpr, '^', yyvsp[0].fExpr); ; break;} case 95: #line 330 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kEqualTo, yyvsp[0].fExpr); ; break;} case 96: #line 331 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kLessOrEqual, yyvsp[0].fExpr); ; break;} case 97: #line 332 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kGreaterOrEqual, yyvsp[0].fExpr); ; break;} case 98: #line 333 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kNotEqualTo, yyvsp[0].fExpr); ; break;} case 99: #line 334 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kLessThan, yyvsp[0].fExpr); ; break;} case 100: #line 335 "parse.y" { yyval.fExpr = new RelExpr(yyvsp[-2].fExpr, RelExpr::kGreaterThan, yyvsp[0].fExpr); ; break;} case 101: #line 336 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, 1, sSavedLoc); ; break;} case 102: #line 337 "parse.y" { yyval.fExpr = new AtomExpr(kRCX_ConstantType, 0, sSavedLoc); ; break;} case 103: #line 338 "parse.y" { yyval.fExpr = new NegateExpr(yyvsp[0].fExpr); ; break;} case 104: #line 339 "parse.y" { yyval.fExpr = new LogicalExpr(yyvsp[-2].fExpr, LogicalExpr::kLogicalAnd, yyvsp[0].fExpr); ; break;} case 105: #line 340 "parse.y" { yyval.fExpr = new LogicalExpr(yyvsp[-2].fExpr, LogicalExpr::kLogicalOr, yyvsp[0].fExpr); ; break;} case 106: #line 342 "parse.y" { yyval.fExpr = MakeBinaryExpr(new AtomExpr(kRCX_ConstantType, 0, yyvsp[0].fExpr->GetLoc()), '-', yyvsp[0].fExpr); ; break;} case 107: #line 343 "parse.y" { yyval.fExpr = MakeUnaryExpr('~', yyvsp[0].fExpr); ; break;} case 108: #line 345 "parse.y" { yyval.fExpr = MakeUnaryExpr(ABS, yyvsp[-1].fExpr); ; break;} case 109: #line 346 "parse.y" { yyval.fExpr = MakeUnaryExpr(SIGN, yyvsp[-1].fExpr); ; break;} case 110: #line 348 "parse.y" { yyval.fExpr = yyvsp[-1].fExpr; ; break;} case 111: #line 349 "parse.y" { yyval.fExpr = MakeVarExpr(yyvsp[0].fSymbol, yyvsp[-1].fLocation); ; break;} case 112: #line 350 "parse.y" { yyval.fExpr = MakeArrayExpr(yyvsp[-3].fSymbol, yyvsp[-4].fLocation, yyvsp[-1].fExpr); ; break;} case 113: #line 351 "parse.y" { yyval.fExpr = MakeValueExpr(yyvsp[0].fExpr); ; break;} case 114: #line 353 "parse.y" { yyval.fExpr = MakeIncDecExpr(yyvsp[-1].fExpr, yyvsp[0].fInt, false, yyvsp[-1].fExpr->GetLoc()); ; break;} case 115: #line 354 "parse.y" { yyval.fExpr = MakeIncDecExpr(yyvsp[0].fExpr, yyvsp[-1].fInt, true, yyvsp[0].fExpr->GetLoc()); ; break;} case 116: #line 356 "parse.y" { yyval.fExpr = new SensorExpr(yyvsp[-1].fExpr); ; break;} case 117: #line 357 "parse.y" { yyval.fExpr = new TypeExpr(yyvsp[-1].fExpr); ; break;} case 118: #line 358 "parse.y" { yyval.fExpr = new EventSrcExpr(yyvsp[-1].fExpr, gProgram->GetTarget()->fType); ; break;} case 119: #line 359 "parse.y" { yyval.fExpr = MakeTaskIdExpr(yyvsp[-1].fLocation); ; break;} case 120: #line 360 "parse.y" { yyval.fExpr = MakeIndirectExpr(yyvsp[-4].fExpr, yyvsp[-1].fExpr); ; break;} case 121: #line 361 "parse.y" { yyval.fExpr = new TernaryExpr(yyvsp[-4].fExpr, yyvsp[-2].fExpr, yyvsp[0].fExpr); ; break;} case 122: #line 362 "parse.y" { yyval.fExpr = MakeAddrOfExpr(yyvsp[0].fSymbol, yyvsp[-2].fLocation, (Expr *)0); ; break;} case 123: #line 363 "parse.y" { yyval.fExpr = MakeAddrOfExpr(yyvsp[-3].fSymbol, yyvsp[-5].fLocation, yyvsp[-1].fExpr); ; break;} case 124: #line 364 "parse.y" { yyval.fExpr = MakeDerefExpr(yyvsp[0].fSymbol, yyvsp[-2].fLocation); ; break;} case 125: #line 367 "parse.y" { LexCurrentLocation(sSavedLoc); ; break;} case 126: #line 370 "parse.y" { yyval.fLocation = new LocationNode(); ; break;} case 127: #line 373 "parse.y" { yyval.fAsmStmt = yyvsp[-2].fAsmStmt; yyvsp[-2].fAsmStmt->Add(yyvsp[0].fField); ; break;} case 128: #line 374 "parse.y" { yyval.fAsmStmt = new AsmStmt(); yyval.fAsmStmt->Add(yyvsp[0].fField); ; break;} case 129: #line 375 "parse.y" { yyval.fAsmStmt = new AsmStmt(); ; break;} case 130: #line 379 "parse.y" { yyval.fField = MakeConstField(yyvsp[0].fExpr); ; break;} case 131: #line 380 "parse.y" { yyval.fField = new EAField(yyvsp[0].fExpr); ; break;} case 132: #line 381 "parse.y" { yyval.fField = new EAField(yyvsp[-2].fExpr, GetConstantValue(yyvsp[0].fExpr)); ; break;} case 133: #line 385 "parse.y" { yyval.fResource=yyvsp[-1].fResource; yyvsp[-1].fResource->SetInfo((RCX_ChunkType)GetConstantValue(yyvsp[-4].fExpr), yyvsp[-3].fSymbol); ; break;} case 134: #line 388 "parse.y" { yyval.fResource = yyvsp[-2].fResource; yyvsp[-2].fResource->Add(yyvsp[0].fInt); ; break;} case 135: #line 389 "parse.y" { yyval.fResource = new Resource(); yyval.fResource->Add(yyvsp[0].fInt); ; break;} case 136: #line 390 "parse.y" { yyval.fResource = new Resource(); ; break;} case 137: #line 393 "parse.y" { yyval.fInt = GetConstantValue(yyvsp[0].fExpr); ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 487 "bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* Now "shift" the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; } #line 397 "parse.y" void yyerror(const char *msg) { Error(kErr_Parser, msg).RaiseLex(); } nqc-3.1.r6/default/parse.tab.h0000600000175000017500000001101507754147214014255 0ustar blpblp/* A Bison parser, made by GNU Bison 1.875. */ /* Skeleton parser for Yacc-like parsing with Bison, Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { OR = 258, AND = 259, REL_NE = 260, REL_EQ = 261, REL_GE = 262, REL_LE = 263, RIGHT = 264, LEFT = 265, INDIRECT = 266, UMINUS = 267, INCDEC = 268, EVENT_SRC = 269, TYPE = 270, SIGN = 271, ABS = 272, LOWER_THAN_ELSE = 273, ELSE = 274, LOWER_THAN_EXPR_SHIFT = 275, ID = 276, NUMBER = 277, ASSIGN = 278, ASSIGN2 = 279, TASKOP = 280, JUMP = 281, TASK = 282, SUB = 283, STRING = 284, PP_DEFINE = 285, PP_INCLUDE = 286, NL = 287, WS = 288, PP_ARG = 289, PP_UNKNOWN = 290, PP_IFDEF = 291, PP_IF = 292, PP_ELSE = 293, PP_ELIF = 294, PP_ENDIF = 295, PP_UNDEF = 296, PP_PRAGMA = 297, PP_GLOM = 298, PP_ERROR = 299, PP_WARNING = 300, IF = 301, WHILE = 302, DO = 303, FOR = 304, REPEAT = 305, SWITCH = 306, CASE = 307, DEFAULT = 308, MONITOR = 309, CATCH = 310, ACQUIRE = 311, GOTO = 312, ASM = 313, INT = 314, T_VOID = 315, T_CONST = 316, SENSOR = 317, TASKID = 318, NOLIST = 319, RES = 320, CTRUE = 321, CFALSE = 322 }; #endif #define OR 258 #define AND 259 #define REL_NE 260 #define REL_EQ 261 #define REL_GE 262 #define REL_LE 263 #define RIGHT 264 #define LEFT 265 #define INDIRECT 266 #define UMINUS 267 #define INCDEC 268 #define EVENT_SRC 269 #define TYPE 270 #define SIGN 271 #define ABS 272 #define LOWER_THAN_ELSE 273 #define ELSE 274 #define LOWER_THAN_EXPR_SHIFT 275 #define ID 276 #define NUMBER 277 #define ASSIGN 278 #define ASSIGN2 279 #define TASKOP 280 #define JUMP 281 #define TASK 282 #define SUB 283 #define STRING 284 #define PP_DEFINE 285 #define PP_INCLUDE 286 #define NL 287 #define WS 288 #define PP_ARG 289 #define PP_UNKNOWN 290 #define PP_IFDEF 291 #define PP_IF 292 #define PP_ELSE 293 #define PP_ELIF 294 #define PP_ENDIF 295 #define PP_UNDEF 296 #define PP_PRAGMA 297 #define PP_GLOM 298 #define PP_ERROR 299 #define PP_WARNING 300 #define IF 301 #define WHILE 302 #define DO 303 #define FOR 304 #define REPEAT 305 #define SWITCH 306 #define CASE 307 #define DEFAULT 308 #define MONITOR 309 #define CATCH 310 #define ACQUIRE 311 #define GOTO 312 #define ASM 313 #define INT 314 #define T_VOID 315 #define T_CONST 316 #define SENSOR 317 #define TASKID 318 #define NOLIST 319 #define RES 320 #define CTRUE 321 #define CFALSE 322 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #line 41 "parse.y" typedef union YYSTYPE { int fInt; bool fBool; Resource* fResource; Fragment* fFragment; Stmt* fStmt; BlockStmt* fBlock; Symbol* fSymbol; char* fString; Expr* fExpr; FunctionDef* fFunction; CallStmt* fCall; AsmStmt* fAsmStmt; Field* fField; CaseStmt* fCaseStmt; DeclareStmt* fDeclareStmt; LocationNode* fLocation; } YYSTYPE; /* Line 1248 of yacc.c. */ #line 189 "y.tab.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE yylval; nqc-3.1.r6/default/rcx1_nqh.h0000600000175000017500000005357307760663074014144 0ustar blpblpstatic const char rcx1_nqh[]={ 47,42,'\n',32,42,32,114,99,120,46,110,113,104,32,45,32, 118,101,114,115,105,111,110,32,50,46,48,'\n',32,42,32,67, 111,112,121,114,105,103,104,116,32,40,67,41,32,49,57,57, 56,44,49,57,57,57,32,68,97,118,101,32,66,97,117,109, '\n',32,42,'\n',32,42,32,67,121,98,101,114,77,97,115,116, 101,114,32,100,101,102,105,110,105,116,105,111,110,115,32,98, 121,32,76,97,117,114,101,110,116,105,110,111,32,77,97,114, 116,105,110,115,'\n',32,42,'\n',32,42,32,84,104,105,115,32, 102,105,108,101,32,105,115,32,112,97,114,116,32,111,102,32, 110,113,99,44,32,116,104,101,32,78,111,116,32,81,117,105, 116,101,32,67,32,99,111,109,112,105,108,101,114,32,102,111, 114,32,116,104,101,32,82,67,88,'\n',32,42,'\n',32,42,32, 84,104,101,32,99,111,110,116,101,110,116,115,32,111,102,32, 116,104,105,115,32,102,105,108,101,32,97,114,101,32,115,117, 98,106,101,99,116,32,116,111,32,116,104,101,32,77,111,122, 105,108,108,97,32,80,117,98,108,105,99,32,76,105,99,101, 110,115,101,'\n',32,42,32,86,101,114,115,105,111,110,32,49, 46,48,32,40,116,104,101,32,34,76,105,99,101,110,115,101, 34,41,59,32,121,111,117,32,109,97,121,32,110,111,116,32, 117,115,101,32,116,104,105,115,32,102,105,108,101,32,101,120, 99,101,112,116,32,105,110,'\n',32,42,32,99,111,109,112,108, 105,97,110,99,101,32,119,105,116,104,32,116,104,101,32,76, 105,99,101,110,115,101,46,32,89,111,117,32,109,97,121,32, 111,98,116,97,105,110,32,97,32,99,111,112,121,32,111,102, 32,116,104,101,32,76,105,99,101,110,115,101,32,97,116,'\n', 32,42,32,104,116,116,112,58,47,47,119,119,119,46,109,111, 122,105,108,108,97,46,111,114,103,47,77,80,76,47,'\n',32, 42,'\n',32,42,32,83,111,102,116,119,97,114,101,32,100,105, 115,116,114,105,98,117,116,101,100,32,117,110,100,101,114,32, 116,104,101,32,76,105,99,101,110,115,101,32,105,115,32,100, 105,115,116,114,105,98,117,116,101,100,32,111,110,32,97,110, 32,34,65,83,32,73,83,34,'\n',32,42,32,98,97,115,105, 115,44,32,87,73,84,72,79,85,84,32,87,65,82,82,65, 78,84,89,32,79,70,32,65,78,89,32,75,73,78,68,44, 32,101,105,116,104,101,114,32,101,120,112,114,101,115,115,32, 111,114,32,105,109,112,108,105,101,100,46,32,83,101,101,32, 116,104,101,'\n',32,42,32,76,105,99,101,110,115,101,32,102, 111,114,32,116,104,101,32,115,112,101,99,105,102,105,99,32, 108,97,110,103,117,97,103,101,32,103,111,118,101,114,110,105, 110,103,32,114,105,103,104,116,115,32,97,110,100,32,108,105, 109,105,116,97,116,105,111,110,115,'\n',32,42,32,117,110,100, 101,114,32,116,104,101,32,76,105,99,101,110,115,101,46,'\n', 32,42,'\n',32,42,32,84,104,101,32,73,110,105,116,105,97, 108,32,68,101,118,101,108,111,112,101,114,32,111,102,32,116, 104,105,115,32,99,111,100,101,32,105,115,32,68,97,118,105, 100,32,66,97,117,109,46,'\n',32,42,32,80,111,114,116,105, 111,110,115,32,99,114,101,97,116,101,100,32,98,121,32,68, 97,118,105,100,32,66,97,117,109,32,97,114,101,32,67,111, 112,121,114,105,103,104,116,32,40,67,41,32,49,57,57,56, 32,68,97,118,105,100,32,66,97,117,109,46,'\n',32,42,32, 65,108,108,32,82,105,103,104,116,115,32,82,101,115,101,114, 118,101,100,46,'\n',32,42,47,'\n',32,'\n',47,42,'\n',32,42, 32,32,84,104,105,115,32,102,105,108,101,32,100,101,102,105, 110,101,115,32,118,97,114,105,111,117,115,32,115,121,115,116, 101,109,32,99,111,110,115,116,97,110,116,115,32,97,110,100, 32,109,97,99,114,111,115,32,116,111,32,98,101,32,117,115, 101,100,'\n',32,42,32,32,119,105,116,104,32,116,104,101,32, 82,67,88,46,32,32,77,111,115,116,32,111,102,32,116,104, 101,32,114,101,97,108,32,102,117,110,99,116,105,111,110,97, 108,105,116,121,32,111,102,32,116,104,101,32,82,67,88,32, 105,115,'\n',32,42,32,32,100,101,102,105,110,101,100,32,104, 101,114,101,32,114,97,116,104,101,114,32,116,104,97,110,32, 119,105,116,104,105,110,32,110,113,99,99,32,105,116,115,101, 108,102,46,'\n',32,42,'\n',32,42,47,'\n','\n','\n',47,47,32, 116,104,105,115,32,105,115,32,97,32,99,111,112,121,32,111, 102,32,116,104,101,32,78,81,67,32,49,46,51,32,114,99, 120,46,110,113,104,32,102,105,108,101,'\n','\n',47,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,'\n',32,42,32,105,110,112,117,116, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n',47, 47,32,99,111,110,115,116,97,110,116,115,32,102,111,114,32, 115,101,108,101,99,116,105,110,103,32,115,101,110,115,111,114, 115,'\n',35,100,101,102,105,110,101,32,73,78,95,49,9,73, 110,112,117,116,40,48,41,'\n',35,100,101,102,105,110,101,32, 73,78,95,50,9,73,110,112,117,116,40,49,41,'\n',35,100, 101,102,105,110,101,32,73,78,95,51,9,73,110,112,117,116, 40,50,41,'\n','\n',35,105,102,100,101,102,32,95,95,67,77, '\n',47,47,32,97,108,116,101,114,110,97,116,105,118,101,32, 110,97,109,101,115,32,102,111,114,32,105,110,112,117,116,32, 115,101,110,115,111,114,115,'\n',35,100,101,102,105,110,101,32, 73,78,95,76,32,73,78,95,49,32,47,47,32,76,101,102, 116,32,115,101,110,115,111,114,'\n',35,100,101,102,105,110,101, 32,73,78,95,77,32,73,78,95,50,32,47,47,32,77,105, 100,100,108,101,32,115,101,110,115,111,114,'\n',35,100,101,102, 105,110,101,32,73,78,95,82,32,73,78,95,51,32,47,47, 32,82,105,103,104,116,32,115,101,110,115,111,114,'\n',35,101, 110,100,105,102,'\n','\n',47,47,32,109,111,100,101,115,32,102, 111,114,32,83,101,110,115,111,114,77,111,100,101,40,41,32, 97,110,100,32,73,78,95,67,70,71,40,41,'\n',35,100,101, 102,105,110,101,32,83,77,79,68,69,95,82,65,87,9,9, 48,120,48,48,'\n',35,100,101,102,105,110,101,32,83,77,79, 68,69,95,66,79,79,76,9,9,48,120,50,48,'\n',35,100, 101,102,105,110,101,32,83,77,79,68,69,95,69,68,71,69, 9,9,48,120,52,48,'\n',35,100,101,102,105,110,101,32,83, 77,79,68,69,95,80,85,76,83,69,9,9,48,120,54,48, '\n',35,100,101,102,105,110,101,32,83,77,79,68,69,95,80, 69,82,67,69,78,84,9,48,120,56,48,'\n',35,105,102,100, 101,102,32,95,95,82,67,88,'\n',35,100,101,102,105,110,101, 32,83,77,79,68,69,95,67,69,76,83,73,85,83,9,48, 120,97,48,'\n',35,100,101,102,105,110,101,32,83,77,79,68, 69,95,70,65,72,82,69,78,72,69,73,84,32,48,120,99, 48,'\n',35,100,101,102,105,110,101,32,83,77,79,68,69,95, 65,78,71,76,69,9,9,48,120,101,48,'\n',35,101,110,100, 105,102,'\n','\n',35,100,101,102,105,110,101,32,83,101,110,115, 111,114,77,111,100,101,40,115,101,110,115,111,114,44,32,109, 111,100,101,41,9,97,115,109,32,123,32,48,120,52,50,44, 32,36,115,101,110,115,111,114,32,58,32,48,120,48,51,48, 48,48,50,48,48,44,32,40,109,111,100,101,41,32,125,'\n', '\n',35,105,102,100,101,102,32,95,95,82,67,88,'\n',47,47, 32,116,121,112,101,115,32,102,111,114,32,83,101,110,115,111, 114,84,121,112,101,40,41,32,97,110,100,32,73,78,95,67, 70,71,40,41,'\n',35,100,101,102,105,110,101,32,83,84,89, 80,69,95,83,87,73,84,67,72,9,49,'\n',35,100,101,102, 105,110,101,32,83,84,89,80,69,95,84,69,77,80,9,9, 50,'\n',35,100,101,102,105,110,101,32,83,84,89,80,69,95, 76,73,71,72,84,9,9,51,'\n',35,100,101,102,105,110,101, 32,83,84,89,80,69,95,65,78,71,76,69,9,9,52,'\n', '\n',47,47,32,105,110,112,117,116,32,99,111,110,102,105,103, 117,114,97,116,105,111,110,115,32,45,32,117,115,101,100,32, 105,110,32,99,97,108,108,115,32,116,111,32,83,101,110,115, 111,114,40,41,'\n',35,100,101,102,105,110,101,32,73,78,95, 67,70,71,40,116,121,112,101,44,109,111,100,101,41,9,40, 40,40,116,121,112,101,41,60,60,56,41,32,43,32,40,109, 111,100,101,41,41,'\n',35,100,101,102,105,110,101,32,73,78, 95,83,87,73,84,67,72,9,73,78,95,67,70,71,40,83, 84,89,80,69,95,83,87,73,84,67,72,44,32,83,77,79, 68,69,95,66,79,79,76,41,'\n',35,100,101,102,105,110,101, 9,73,78,95,80,85,76,83,69,9,73,78,95,67,70,71, 40,83,84,89,80,69,95,83,87,73,84,67,72,44,32,83, 77,79,68,69,95,80,85,76,83,69,41,'\n',35,100,101,102, 105,110,101,32,73,78,95,69,68,71,69,9,9,73,78,95, 67,70,71,40,83,84,89,80,69,95,83,87,73,84,67,72, 44,32,83,77,79,68,69,95,69,68,71,69,41,'\n',35,100, 101,102,105,110,101,32,73,78,95,76,73,71,72,84,9,73, 78,95,67,70,71,40,83,84,89,80,69,95,76,73,71,72, 84,44,32,32,83,77,79,68,69,95,80,69,82,67,69,78, 84,41,'\n',35,100,101,102,105,110,101,32,73,78,95,65,78, 71,76,69,9,73,78,95,67,70,71,40,83,84,89,80,69, 95,65,78,71,76,69,44,32,32,83,77,79,68,69,95,65, 78,71,76,69,41,'\n','\n',47,47,32,115,101,116,32,97,32, 115,101,110,115,111,114,39,115,32,116,121,112,101,'\n',35,100, 101,102,105,110,101,32,83,101,110,115,111,114,84,121,112,101, 40,115,101,110,115,111,114,44,32,116,121,112,101,41,9,97, 115,109,32,123,32,48,120,51,50,44,32,36,115,101,110,115, 111,114,32,58,32,48,120,48,51,48,48,48,50,48,48,44, 32,40,116,121,112,101,41,32,125,'\n','\n',47,47,32,115,101, 116,32,97,32,115,101,110,115,111,114,39,115,32,116,121,112, 101,32,97,110,100,32,109,111,100,101,32,117,115,105,110,103, 32,97,32,99,111,110,102,105,103,32,45,32,101,46,103,46, 32,83,101,110,115,111,114,40,73,78,95,49,44,32,73,78, 95,76,73,71,72,84,41,59,'\n',35,100,101,102,105,110,101, 32,83,101,110,115,111,114,40,115,101,110,115,111,114,44,32, 116,109,41,9,100,111,32,123,32,83,101,110,115,111,114,84, 121,112,101,40,115,101,110,115,111,114,44,32,116,109,62,62, 56,41,59,32,92,'\n',9,9,9,9,9,9,9,9,9,32, 83,101,110,115,111,114,77,111,100,101,40,115,101,110,115,111, 114,44,32,116,109,41,59,32,125,32,119,104,105,108,101,32, 40,102,97,108,115,101,41,32,'\n','\n',35,101,110,100,105,102, '\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n', 32,42,32,111,117,112,117,116,'\n',32,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,47,'\n','\n',47,47,32,99,111,110,115,116,97, 110,116,115,32,102,111,114,32,115,101,108,101,99,116,105,110, 103,32,111,117,116,112,117,116,115,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,65,9,40,49,32,60,60,32,48,41, '\n',35,100,101,102,105,110,101,32,79,85,84,95,66,9,40, 49,32,60,60,32,49,41,'\n',35,100,101,102,105,110,101,32, 79,85,84,95,67,9,40,49,32,60,60,32,50,41,'\n','\n', 47,47,32,111,117,116,112,117,116,32,109,111,100,101,115,'\n', 35,100,101,102,105,110,101,32,79,85,84,95,70,76,79,65, 84,9,48,'\n',35,100,101,102,105,110,101,32,79,85,84,95, 79,70,70,9,9,48,120,52,48,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,79,78,9,9,48,120,56,48,'\n','\n', 47,47,32,111,117,116,112,117,116,32,100,105,114,101,99,116, 105,111,110,115,'\n',35,100,101,102,105,110,101,32,79,85,84, 95,82,69,86,9,9,48,'\n',35,100,101,102,105,110,101,32, 79,85,84,95,70,76,73,80,9,48,120,52,48,'\n',35,100, 101,102,105,110,101,32,79,85,84,95,70,87,68,9,9,48, 120,56,48,'\n','\n',47,47,32,115,112,101,101,100,115,'\n',35, 100,101,102,105,110,101,32,79,85,84,95,76,79,87,9,9, 49,'\n',35,100,101,102,105,110,101,32,79,85,84,95,72,65, 76,70,9,52,'\n',35,100,101,102,105,110,101,32,79,85,84, 95,70,85,76,76,9,55,'\n','\n',47,47,32,111,117,116,112, 117,116,32,102,117,110,99,116,105,111,110,115,'\n',35,100,101, 102,105,110,101,32,79,117,116,112,117,116,77,111,100,101,40, 111,44,32,109,41,9,97,115,109,32,123,32,48,120,50,49, 44,32,40,111,41,32,43,32,40,109,41,32,125,'\n',35,100, 101,102,105,110,101,32,79,117,116,112,117,116,68,105,114,40, 111,44,32,100,41,9,9,97,115,109,32,123,32,48,120,101, 49,44,32,40,111,41,32,43,32,40,100,41,32,125,'\n',35, 100,101,102,105,110,101,32,79,117,116,112,117,116,80,111,119, 101,114,40,111,44,32,112,41,9,97,115,109,9,123,32,48, 120,49,51,44,32,40,111,41,44,32,36,112,32,58,32,48, 120,49,48,48,48,48,49,53,125,'\n','\n',35,100,101,102,105, 110,101,32,70,119,100,40,111,44,32,112,41,9,100,111,32, 123,32,9,79,117,116,112,117,116,68,105,114,40,111,44,79, 85,84,95,70,87,68,41,59,32,92,'\n',9,9,9,9,9, 9,9,79,117,116,112,117,116,77,111,100,101,40,111,44,79, 85,84,95,79,78,41,59,32,92,'\n',9,9,9,9,9,9, 9,79,117,116,112,117,116,80,111,119,101,114,40,111,44,112, 41,59,32,125,32,119,104,105,108,101,40,102,97,108,115,101, 41,'\n',9,9,9,9,9,9,9,'\n',35,100,101,102,105,110, 101,32,82,101,118,40,111,44,32,112,41,9,100,111,32,123, 9,79,117,116,112,117,116,68,105,114,40,111,44,79,85,84, 95,82,69,86,41,59,32,92,'\n',9,9,9,9,9,9,9, 79,117,116,112,117,116,77,111,100,101,40,111,44,79,85,84, 95,79,78,41,59,32,92,'\n',9,9,9,9,9,9,9,79, 117,116,112,117,116,80,111,119,101,114,40,111,44,112,41,59, 32,125,32,119,104,105,108,101,40,102,97,108,115,101,41,'\n', 9,9,9,9,9,9,9,'\n',35,100,101,102,105,110,101,32, 79,102,102,40,111,41,9,9,9,9,79,117,116,112,117,116, 77,111,100,101,40,111,44,32,79,85,84,95,79,70,70,41, '\n',35,100,101,102,105,110,101,32,70,108,111,97,116,40,111, 41,9,9,9,79,117,116,112,117,116,77,111,100,101,40,111, 44,32,79,85,84,95,70,76,79,65,84,41,'\n',35,100,101, 102,105,110,101,32,84,111,103,103,108,101,40,111,41,9,9, 9,79,117,116,112,117,116,68,105,114,40,40,111,41,44,32, 79,85,84,95,70,76,73,80,41,'\n','\n','\n',47,47,32,67, 121,98,101,114,77,97,115,116,101,114,32,115,112,101,99,105, 102,105,99,32,115,116,117,102,102,'\n',35,105,102,100,101,102, 32,95,95,67,77,'\n',47,47,32,97,108,116,101,114,110,97, 116,101,32,110,97,109,101,115,32,102,111,114,32,109,111,116, 111,114,115,'\n',35,100,101,102,105,110,101,32,79,85,84,95, 76,32,79,85,84,95,65,32,47,47,32,76,101,102,116,32, 109,111,116,111,114,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,82,32,79,85,84,95,66,32,47,47,32,82,105,103, 104,116,32,109,111,116,111,114,'\n',35,100,101,102,105,110,101, 32,79,85,84,95,88,32,79,85,84,95,67,32,47,47,32, 69,120,116,101,114,110,97,108,32,109,111,116,111,114,'\n','\n', 35,100,101,102,105,110,101,32,68,114,105,118,101,40,109,48, 44,32,109,49,41,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,97,115,109,32,123,32, 48,120,52,49,44,32,68,73,82,83,80,69,69,68,40,109, 48,41,32,124,32,68,73,82,83,80,69,69,68,40,109,49, 41,60,60,52,32,125,'\n',35,100,101,102,105,110,101,32,79, 110,87,97,105,116,40,109,44,32,110,44,32,116,41,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,97,115,109,32,123,32,48,120,99,50,44,32,40,109,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 41,44,32,116,32,125,'\n',35,100,101,102,105,110,101,32,79, 110,87,97,105,116,68,105,102,102,101,114,101,110,116,40,109, 44,32,110,48,44,32,110,49,44,32,110,50,44,32,116,41, 32,97,115,109,32,123,32,48,120,53,51,44,32,40,109,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 48,41,44,32,68,73,82,83,80,69,69,68,40,110,49,41, 60,60,52,32,124,32,68,73,82,83,80,69,69,68,40,110, 50,41,44,32,116,32,125,'\n','\n',47,47,32,65,117,120,46, 32,102,117,110,99,116,105,111,110,58,32,84,114,97,110,115, 102,111,114,109,115,32,97,32,110,117,109,98,101,114,32,98, 101,116,119,101,101,110,32,45,55,32,97,110,100,32,55,32, 116,111,32,97,32,52,32,98,105,116,32,115,101,113,117,101, 110,99,101,58,32,'\n',47,47,32,66,105,116,115,58,32,49, 46,46,51,32,45,32,83,112,101,101,100,58,32,48,32,116, 111,32,55,'\n',47,47,32,66,105,116,32,58,32,52,32,32, 32,32,45,32,68,105,114,101,99,116,105,111,110,58,32,49, 32,105,102,32,118,62,61,48,44,32,48,32,105,102,32,118, 60,48,'\n',35,100,101,102,105,110,101,32,68,73,82,83,80, 69,69,68,40,118,41,9,9,40,40,118,41,38,56,94,56, 124,40,40,118,41,42,40,40,40,118,41,62,62,51,41,42, 50,94,49,41,41,38,55,41,'\n','\n','\n',35,101,110,100,105, 102,'\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,100,97,116,97,32,115,111,117,114,99,101,115, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n',32,'\n', 35,100,101,102,105,110,101,32,84,105,109,101,114,40,110,41, 9,9,64,40,48,120,49,48,48,48,48,32,43,32,40,110, 41,41,'\n',35,100,101,102,105,110,101,32,82,97,110,100,111, 109,40,110,41,9,9,64,40,48,120,52,48,48,48,48,32, 43,32,40,110,41,41,'\n',35,100,101,102,105,110,101,32,73, 110,112,117,116,40,110,41,9,9,64,40,48,120,57,48,48, 48,48,32,43,32,40,110,41,41,'\n',35,100,101,102,105,110, 101,32,73,110,112,117,116,84,121,112,101,40,110,41,9,64, 40,48,120,97,48,48,48,48,32,43,32,40,110,41,41,'\n', 35,100,101,102,105,110,101,32,73,110,112,117,116,77,111,100, 101,40,110,41,9,64,40,48,120,98,48,48,48,48,32,43, 32,40,110,41,41,'\n','\n',35,105,102,100,101,102,32,95,95, 82,67,88,'\n',47,47,32,82,67,88,32,115,112,101,99,105, 102,105,99,32,100,97,116,97,32,115,111,117,114,99,101,115, '\n',35,100,101,102,105,110,101,32,80,114,111,103,114,97,109, 40,41,32,32,32,9,64,40,48,120,56,41,'\n',35,100,101, 102,105,110,101,32,73,110,112,117,116,82,97,119,40,110,41, 9,9,64,40,48,120,99,48,48,48,48,32,43,32,40,110, 41,41,'\n',35,100,101,102,105,110,101,32,73,110,112,117,116, 66,111,111,108,40,110,41,9,64,40,48,120,100,48,48,48, 48,32,43,32,40,110,41,41,'\n',35,100,101,102,105,110,101, 32,87,97,116,99,104,40,41,9,9,9,64,40,48,120,101, 48,48,48,48,41,'\n',35,100,101,102,105,110,101,32,77,101, 115,115,97,103,101,40,41,9,9,64,40,48,120,102,48,48, 48,48,41,'\n',35,101,110,100,105,102,'\n','\n',35,105,102,100, 101,102,32,95,95,67,77,'\n',47,47,32,67,77,32,115,112, 101,99,105,102,105,99,32,100,97,116,97,32,115,111,117,114, 99,101,115,'\n',35,100,101,102,105,110,101,32,84,97,99,104, 111,67,111,117,110,116,40,110,41,32,32,32,32,32,32,32, 32,32,32,64,40,48,120,53,48,48,48,48,32,43,32,40, 110,41,45,49,41,32,47,47,32,85,115,101,32,79,85,84, 95,120,32,97,115,32,112,97,114,97,109,101,116,101,114,'\n', 35,100,101,102,105,110,101,32,84,97,99,104,111,83,112,101, 101,100,40,110,41,32,32,32,32,32,32,32,32,32,32,64, 40,48,120,54,48,48,48,48,32,43,32,40,110,41,45,49, 41,32,47,47,32,85,115,101,32,79,85,84,95,120,32,97, 115,32,112,97,114,97,109,101,116,101,114,'\n',35,100,101,102, 105,110,101,32,69,120,116,101,114,110,97,108,77,111,116,111, 114,82,117,110,110,105,110,103,40,41,32,64,40,48,120,55, 48,48,48,50,41,32,32,32,32,32,32,32,32,32,47,47, 32,82,101,102,101,114,101,100,32,105,110,32,116,104,101,32, 83,68,75,32,97,115,32,77,111,116,111,114,67,117,114,114, 101,110,116,40,50,41,46,32,78,111,110,32,122,101,114,111, 32,105,102,32,101,120,116,101,114,110,97,108,32,109,111,116, 111,114,32,114,117,110,110,105,110,103,46,'\n',35,100,101,102, 105,110,101,32,65,71,67,40,41,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,64,40,48,120,49, 48,48,48,48,48,41,32,32,32,32,32,32,32,32,47,47, 32,65,117,116,111,109,97,116,105,99,32,71,97,105,110,32, 67,111,110,116,114,111,108,'\n',35,101,110,100,105,102,'\n','\n', '\n',47,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,'\n',32,42,32, 109,105,115,99,101,108,108,97,110,101,111,117,115,'\n',32,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,47,'\n','\n',47,47,32,119, 97,105,116,32,102,111,114,32,97,32,99,111,110,100,105,116, 105,111,110,32,116,111,32,98,101,99,111,109,101,32,116,114, 117,101,'\n',35,100,101,102,105,110,101,32,119,97,105,116,40, 99,41,9,9,119,104,105,108,101,40,33,40,99,41,41,'\n', '\n',47,47,32,112,108,97,121,105,110,103,32,115,111,117,110, 100,115,32,97,110,100,32,110,111,116,101,115,'\n',35,100,101, 102,105,110,101,32,80,108,97,121,83,111,117,110,100,40,120, 41,9,9,97,115,109,32,123,32,48,120,53,49,44,32,120, 32,125,'\n',35,100,101,102,105,110,101,32,80,108,97,121,78, 111,116,101,40,102,44,32,100,41,9,9,97,115,109,32,123, 32,48,120,50,51,44,32,40,102,41,44,32,40,102,41,62, 62,56,44,32,40,100,41,32,125,'\n','\n',47,47,32,115,108, 101,101,112,32,102,111,114,32,118,32,116,105,99,107,115,32, 40,49,48,109,115,32,112,101,114,32,116,105,99,107,41,'\n', 35,100,101,102,105,110,101,32,83,108,101,101,112,40,118,41, 9,97,115,109,32,123,32,48,120,52,51,44,32,36,118,32, 58,32,48,120,48,48,49,53,125,'\n','\n','\n',35,100,101,102, 105,110,101,32,67,108,101,97,114,84,105,109,101,114,40,110, 41,9,97,115,109,32,123,32,48,120,97,49,44,32,110,32, 125,'\n',35,100,101,102,105,110,101,32,67,108,101,97,114,83, 101,110,115,111,114,40,115,101,110,115,111,114,41,9,97,115, 109,9,123,32,48,120,100,49,44,32,36,115,101,110,115,111, 114,32,58,32,48,120,48,51,48,48,48,50,48,48,32,125, '\n','\n',35,100,101,102,105,110,101,32,83,116,111,112,65,108, 108,84,97,115,107,115,40,41,9,97,115,109,32,123,32,48, 120,53,48,32,125,'\n','\n',35,105,102,100,101,102,32,95,95, 82,67,88,'\n',47,47,32,115,101,116,32,116,104,101,32,100, 105,115,112,108,97,121,32,109,111,100,101,'\n',35,100,101,102, 105,110,101,32,68,105,115,112,108,97,121,40,118,41,9,97, 115,109,32,123,32,48,120,51,51,44,32,36,118,32,58,32, 48,120,48,48,48,53,125,'\n','\n',47,47,32,73,82,32,109, 101,115,115,97,103,101,32,115,117,112,112,111,114,116,'\n',35, 100,101,102,105,110,101,32,83,101,110,100,77,101,115,115,97, 103,101,40,118,41,9,97,115,109,32,123,32,48,120,98,50, 44,32,36,118,32,58,32,48,120,49,48,48,48,48,48,53, 32,125,'\n',35,100,101,102,105,110,101,32,67,108,101,97,114, 77,101,115,115,97,103,101,40,41,9,97,115,109,32,123,32, 48,120,57,48,32,125,'\n','\n',47,47,32,68,97,116,97,32, 108,111,103,103,105,110,103,'\n',35,100,101,102,105,110,101,32, 83,101,116,68,97,116,97,108,111,103,40,115,105,122,101,41, 9,97,115,109,9,123,32,48,120,53,50,44,32,40,115,105, 122,101,41,44,32,40,115,105,122,101,41,62,62,56,32,125, '\n',35,100,101,102,105,110,101,32,68,97,116,97,108,111,103, 40,118,41,9,9,9,97,115,109,32,123,32,48,120,54,50, 44,32,36,118,32,58,32,48,120,49,48,48,52,50,48,51, 125,'\n',35,100,101,102,105,110,101,32,85,112,108,111,97,100, 68,97,116,97,108,111,103,40,115,44,32,110,41,9,97,115, 109,32,123,32,48,120,97,52,44,32,40,115,41,44,32,40, 115,41,62,62,56,44,32,40,110,41,44,32,40,110,41,62, 62,56,32,125,'\n','\n',47,47,32,115,101,116,32,116,104,101, 32,115,121,115,116,101,109,32,99,108,111,99,107,'\n',35,100, 101,102,105,110,101,32,83,101,116,87,97,116,99,104,40,104, 44,32,109,41,32,32,9,97,115,109,32,123,32,48,120,50, 50,44,32,40,104,41,44,32,40,109,41,32,125,'\n','\n',47, 47,32,115,117,112,112,111,114,116,32,102,111,114,32,99,111, 110,116,114,111,108,108,105,110,103,32,116,104,101,32,73,82, 77,111,100,101,'\n',35,100,101,102,105,110,101,32,73,82,95, 76,79,32,48,'\n',35,100,101,102,105,110,101,32,73,82,95, 72,73,32,49,'\n',35,100,101,102,105,110,101,32,73,82,77, 111,100,101,40,109,41,32,32,32,32,32,32,97,115,109,32, 123,32,48,120,51,49,44,32,109,32,125,'\n',35,101,110,100, 105,102,'\n','\n',35,105,102,100,101,102,32,95,95,67,77,'\n', 35,100,101,102,105,110,101,32,67,108,101,97,114,84,97,99, 104,111,67,111,117,110,116,101,114,40,109,41,32,97,115,109, 32,123,32,48,120,49,49,44,32,40,109,41,32,125,'\n',35, 101,110,100,105,102,'\n','\n',35,112,114,97,103,109,97,32,110, 111,105,110,105,116,'\n',}; nqc-3.1.r6/default/rcx2_nqh.h0000600000175000017500000041064707777523660014150 0ustar blpblpstatic const char rcx2_nqh[]={ 47,42,'\n',32,42,32,114,99,120,46,110,113,104,32,45,32, 118,101,114,115,105,111,110,32,50,46,54,97,49,'\n',32,42, 32,67,111,112,121,114,105,103,104,116,32,40,67,41,32,49, 57,57,56,45,50,48,48,51,32,68,97,118,101,32,66,97, 117,109,44,32,74,111,104,110,32,72,97,110,115,101,110,'\n', 32,42,'\n',32,42,32,67,121,98,101,114,77,97,115,116,101, 114,32,100,101,102,105,110,105,116,105,111,110,115,32,98,121, 32,76,97,117,114,101,110,116,105,110,111,32,77,97,114,116, 105,110,115,'\n',32,42,32,83,112,121,98,111,116,32,100,101, 102,105,110,105,116,105,111,110,115,32,40,105,110,32,112,97, 114,116,41,32,98,121,32,74,111,104,110,32,72,97,110,115, 101,110,'\n',32,42,'\n',32,42,32,84,104,105,115,32,102,105, 108,101,32,105,115,32,112,97,114,116,32,111,102,32,110,113, 99,44,32,116,104,101,32,78,111,116,32,81,117,105,116,101, 32,67,32,99,111,109,112,105,108,101,114,32,102,111,114,32, 116,104,101,32,82,67,88,'\n',32,42,'\n',32,42,32,84,104, 101,32,99,111,110,116,101,110,116,115,32,111,102,32,116,104, 105,115,32,102,105,108,101,32,97,114,101,32,115,117,98,106, 101,99,116,32,116,111,32,116,104,101,32,77,111,122,105,108, 108,97,32,80,117,98,108,105,99,32,76,105,99,101,110,115, 101,'\n',32,42,32,86,101,114,115,105,111,110,32,49,46,48, 32,40,116,104,101,32,34,76,105,99,101,110,115,101,34,41, 59,32,121,111,117,32,109,97,121,32,110,111,116,32,117,115, 101,32,116,104,105,115,32,102,105,108,101,32,101,120,99,101, 112,116,32,105,110,'\n',32,42,32,99,111,109,112,108,105,97, 110,99,101,32,119,105,116,104,32,116,104,101,32,76,105,99, 101,110,115,101,46,32,89,111,117,32,109,97,121,32,111,98, 116,97,105,110,32,97,32,99,111,112,121,32,111,102,32,116, 104,101,32,76,105,99,101,110,115,101,32,97,116,'\n',32,42, 32,104,116,116,112,58,47,47,119,119,119,46,109,111,122,105, 108,108,97,46,111,114,103,47,77,80,76,47,'\n',32,42,'\n', 32,42,32,83,111,102,116,119,97,114,101,32,100,105,115,116, 114,105,98,117,116,101,100,32,117,110,100,101,114,32,116,104, 101,32,76,105,99,101,110,115,101,32,105,115,32,100,105,115, 116,114,105,98,117,116,101,100,32,111,110,32,97,110,32,34, 65,83,32,73,83,34,'\n',32,42,32,98,97,115,105,115,44, 32,87,73,84,72,79,85,84,32,87,65,82,82,65,78,84, 89,32,79,70,32,65,78,89,32,75,73,78,68,44,32,101, 105,116,104,101,114,32,101,120,112,114,101,115,115,32,111,114, 32,105,109,112,108,105,101,100,46,32,83,101,101,32,116,104, 101,'\n',32,42,32,76,105,99,101,110,115,101,32,102,111,114, 32,116,104,101,32,115,112,101,99,105,102,105,99,32,108,97, 110,103,117,97,103,101,32,103,111,118,101,114,110,105,110,103, 32,114,105,103,104,116,115,32,97,110,100,32,108,105,109,105, 116,97,116,105,111,110,115,'\n',32,42,32,117,110,100,101,114, 32,116,104,101,32,76,105,99,101,110,115,101,46,'\n',32,42, '\n',32,42,32,84,104,101,32,73,110,105,116,105,97,108,32, 68,101,118,101,108,111,112,101,114,32,111,102,32,116,104,105, 115,32,99,111,100,101,32,105,115,32,68,97,118,105,100,32, 66,97,117,109,46,'\n',32,42,32,80,111,114,116,105,111,110, 115,32,99,114,101,97,116,101,100,32,98,121,32,68,97,118, 105,100,32,66,97,117,109,32,97,114,101,32,67,111,112,121, 114,105,103,104,116,32,40,67,41,32,49,57,57,56,32,68, 97,118,105,100,32,66,97,117,109,46,'\n',32,42,32,80,111, 114,116,105,111,110,115,32,99,114,101,97,116,101,100,32,98, 121,32,74,111,104,110,32,72,97,110,115,101,110,32,97,114, 101,32,67,111,112,121,114,105,103,104,116,32,40,67,41,32, 50,48,48,51,32,74,111,104,110,32,72,97,110,115,101,110, 46,'\n',32,42,32,65,108,108,32,82,105,103,104,116,115,32, 82,101,115,101,114,118,101,100,46,'\n',32,42,47,'\n',32,'\n', 47,42,'\n',32,42,32,32,84,104,105,115,32,102,105,108,101, 32,100,101,102,105,110,101,115,32,118,97,114,105,111,117,115, 32,115,121,115,116,101,109,32,99,111,110,115,116,97,110,116, 115,32,97,110,100,32,109,97,99,114,111,115,32,116,111,32, 98,101,32,117,115,101,100,'\n',32,42,32,32,119,105,116,104, 32,116,104,101,32,82,67,88,46,32,32,77,111,115,116,32, 111,102,32,116,104,101,32,114,101,97,108,32,102,117,110,99, 116,105,111,110,97,108,105,116,121,32,111,102,32,116,104,101, 32,82,67,88,32,105,115,'\n',32,42,32,32,100,101,102,105, 110,101,100,32,104,101,114,101,32,114,97,116,104,101,114,32, 116,104,97,110,32,119,105,116,104,105,110,32,110,113,99,99, 32,105,116,115,101,108,102,46,'\n',32,42,'\n',32,42,47,'\n', '\n','\n','\n','\n',47,47,32,105,110,116,101,114,110,97,108,32, 99,111,110,115,116,97,110,116,115,32,102,111,114,32,97,115, 109,32,115,116,97,116,101,109,101,110,116,115,'\n',35,100,101, 102,105,110,101,9,95,95,65,83,77,95,83,77,65,76,76, 95,86,65,76,85,69,9,48,120,48,49,48,48,48,48,48, 48,'\n',35,100,101,102,105,110,101,32,95,95,65,83,77,95, 78,79,95,84,89,80,69,9,9,48,120,48,50,48,48,48, 48,48,48,'\n',35,100,101,102,105,110,101,32,95,95,65,83, 77,95,78,79,95,76,79,67,65,76,9,9,48,120,48,52, 48,48,48,48,48,48,'\n','\n','\n',47,47,32,99,111,109,109, 111,110,108,121,32,117,115,101,100,32,114,101,115,116,114,105, 99,116,111,114,115,'\n',35,105,102,32,95,95,82,67,88,61, 61,50,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,80,89,41,'\n',9,47,47,32,110,111,32,114,101,115,116, 114,105,99,116,105,111,110,'\n',9,35,100,101,102,105,110,101, 32,95,95,65,83,77,95,83,82,67,95,66,65,83,73,67, 9,48,'\n',9,35,100,101,102,105,110,101,32,95,95,65,83, 77,95,83,82,67,95,69,88,84,9,48,'\n',35,101,108,115, 101,'\n',9,35,100,101,102,105,110,101,9,95,95,65,83,77, 95,83,82,67,95,66,65,83,73,67,9,48,120,48,48,48, 48,48,53,9,47,47,32,99,111,110,115,116,97,110,116,32, 111,114,32,118,97,114,105,97,98,108,101,'\n',9,35,100,101, 102,105,110,101,32,95,95,65,83,77,95,83,82,67,95,69, 88,84,9,48,120,48,48,48,48,49,53,9,47,47,32,99, 111,110,115,116,97,110,116,44,32,118,97,114,105,97,98,108, 101,44,32,111,114,32,114,97,110,100,111,109,'\n',35,101,110, 100,105,102,'\n','\n','\n','\n','\n',47,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,'\n',32,42,32,115,101,110,115,111,114,115,'\n',32, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,47,'\n','\n','\n',47,47, 32,114,101,97,100,105,110,103,32,97,32,115,101,110,115,111, 114,39,115,32,118,97,108,117,101,32,97,110,100,32,116,121, 112,101,'\n',35,100,101,102,105,110,101,32,83,101,110,115,111, 114,86,97,108,117,101,40,110,41,9,9,64,40,48,120,57, 48,48,48,48,32,43,32,40,95,95,115,101,110,115,111,114, 40,110,41,41,41,'\n','\n','\n',35,105,102,110,100,101,102,32, 95,95,83,80,89,'\n',35,100,101,102,105,110,101,32,83,101, 110,115,111,114,84,121,112,101,40,110,41,9,9,64,40,48, 120,97,48,48,48,48,32,43,32,40,95,95,115,101,110,115, 111,114,40,110,41,41,41,'\n',35,101,110,100,105,102,'\n','\n', '\n',47,47,32,99,111,110,115,116,97,110,116,115,32,102,111, 114,32,115,101,108,101,99,116,105,110,103,32,115,101,110,115, 111,114,115,32,45,32,97,108,115,111,32,97,32,115,104,111, 114,116,104,97,110,100,32,116,111,32,114,101,97,100,32,116, 104,101,32,115,101,110,115,111,114,39,115,32,118,97,108,117, 101,'\n',35,100,101,102,105,110,101,32,83,69,78,83,79,82, 95,49,9,83,101,110,115,111,114,86,97,108,117,101,40,48, 41,'\n',35,100,101,102,105,110,101,32,83,69,78,83,79,82, 95,50,9,83,101,110,115,111,114,86,97,108,117,101,40,49, 41,'\n',35,100,101,102,105,110,101,32,83,69,78,83,79,82, 95,51,9,83,101,110,115,111,114,86,97,108,117,101,40,50, 41,'\n','\n','\n',95,95,110,111,108,105,115,116,32,118,111,105, 100,32,67,108,101,97,114,83,101,110,115,111,114,40,95,95, 115,101,110,115,111,114,32,115,101,110,115,111,114,41,32,123, 32,97,115,109,32,123,32,48,120,100,49,44,32,36,115,101, 110,115,111,114,32,58,32,48,120,48,51,48,48,48,50,48, 48,125,59,32,125,'\n','\n','\n',35,105,102,100,101,102,32,95, 95,67,77,'\n',9,47,47,32,67,77,32,104,97,115,32,97, 108,116,101,114,110,97,116,105,118,101,32,110,97,109,101,115, 32,102,111,114,32,115,101,110,115,111,114,115,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,76,32,83, 69,78,83,79,82,95,49,32,47,47,32,76,101,102,116,32, 115,101,110,115,111,114,'\n',9,35,100,101,102,105,110,101,32, 83,69,78,83,79,82,95,77,32,83,69,78,83,79,82,95, 50,32,47,47,32,77,105,100,100,108,101,32,115,101,110,115, 111,114,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,82,32,83,69,78,83,79,82,95,51,32,47,47, 32,82,105,103,104,116,32,115,101,110,115,111,114,'\n',35,101, 110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102,105,110, 101,100,40,95,95,82,67,88,41,32,124,124,32,100,101,102, 105,110,101,100,40,95,95,67,77,41,'\n',9,47,47,32,82, 67,88,32,97,110,100,32,67,77,32,115,117,112,112,111,114, 116,32,115,101,110,115,111,114,32,109,111,100,101,115,'\n',9, 35,100,101,102,105,110,101,32,83,69,78,83,79,82,95,77, 79,68,69,95,82,65,87,9,9,9,48,120,48,48,'\n',9, 35,100,101,102,105,110,101,32,83,69,78,83,79,82,95,77, 79,68,69,95,66,79,79,76,9,9,48,120,50,48,'\n',9, 35,100,101,102,105,110,101,32,83,69,78,83,79,82,95,77, 79,68,69,95,69,68,71,69,9,9,48,120,52,48,'\n',9, 35,100,101,102,105,110,101,32,83,69,78,83,79,82,95,77, 79,68,69,95,80,85,76,83,69,9,9,48,120,54,48,'\n', 9,35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 77,79,68,69,95,80,69,82,67,69,78,84,9,9,48,120, 56,48,'\n',9,35,105,102,100,101,102,32,95,95,82,67,88, '\n',9,9,47,47,32,82,67,88,32,104,97,115,32,115,111, 109,101,32,101,120,116,114,97,32,109,111,100,101,115,'\n',9, 9,35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 77,79,68,69,95,67,69,76,83,73,85,83,9,9,48,120, 97,48,'\n',9,9,35,100,101,102,105,110,101,32,83,69,78, 83,79,82,95,77,79,68,69,95,70,65,72,82,69,78,72, 69,73,84,9,48,120,99,48,'\n',9,9,35,100,101,102,105, 110,101,32,83,69,78,83,79,82,95,77,79,68,69,95,82, 79,84,65,84,73,79,78,9,48,120,101,48,'\n',9,35,101, 110,100,105,102,32,47,47,32,95,95,82,67,88,'\n','\n','\n', 9,35,100,101,102,105,110,101,32,83,101,110,115,111,114,77, 111,100,101,40,110,41,9,9,64,40,48,120,98,48,48,48, 48,32,43,32,40,95,95,115,101,110,115,111,114,40,110,41, 41,41,9,47,47,32,114,101,97,100,32,116,104,101,32,115, 101,110,115,111,114,32,109,111,100,101,'\n','\n','\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,110,115,111,114,77,111,100,101,40,95,95,115,101,110,115, 111,114,32,115,101,110,115,111,114,44,32,99,111,110,115,116, 32,105,110,116,32,109,111,100,101,41,32,32,123,32,97,115, 109,32,123,32,48,120,52,50,44,32,36,115,101,110,115,111, 114,32,58,32,48,120,48,51,48,48,48,50,48,48,44,32, 109,111,100,101,32,125,59,32,125,'\n',35,101,110,100,105,102, 32,47,47,32,100,101,102,105,110,101,100,40,95,95,82,67, 88,41,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 67,77,41,'\n','\n','\n',35,105,102,32,100,101,102,105,110,101, 100,40,95,95,83,80,89,41,'\n',9,47,47,32,83,80,89, 32,100,111,101,115,110,39,116,32,115,104,105,102,116,32,116, 104,101,32,109,111,100,101,32,111,118,101,114,32,53,32,98, 105,116,115,32,105,110,32,83,101,110,115,111,114,77,111,100, 101,40,41,44,'\n',9,47,47,32,115,111,32,99,111,110,115, 116,97,110,116,115,32,97,114,101,32,100,105,102,102,101,114, 101,110,116,32,102,114,111,109,32,82,67,88,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,77,79,68, 69,95,82,65,87,9,9,9,48,120,48,48,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,77,79,68, 69,95,66,79,79,76,9,9,48,120,48,49,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,77,79,68, 69,95,80,69,82,67,69,78,84,9,9,48,120,48,52,'\n', 9,35,100,101,102,105,110,101,32,83,101,110,115,111,114,77, 111,100,101,40,110,41,9,9,64,40,48,120,98,48,48,48, 48,32,43,32,40,95,95,115,101,110,115,111,114,40,110,41, 41,41,9,47,47,32,114,101,97,100,32,116,104,101,32,115, 101,110,115,111,114,32,109,111,100,101,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,83,101,116,83,101,110, 115,111,114,77,111,100,101,40,95,95,115,101,110,115,111,114, 32,115,101,110,115,111,114,44,32,99,111,110,115,116,32,105, 110,116,32,109,111,100,101,41,32,32,123,32,97,115,109,32, 123,32,48,120,52,50,44,32,36,115,101,110,115,111,114,32, 58,32,48,120,48,51,48,48,48,50,48,48,44,32,109,111, 100,101,32,60,60,32,53,32,125,59,32,125,'\n',35,101,110, 100,105,102,'\n','\n','\n','\n','\n','\n','\n',35,105,102,100,101,102, 32,95,95,82,67,88,'\n',9,47,47,32,82,67,88,32,115, 117,112,112,111,114,116,115,32,115,101,110,115,111,114,32,116, 121,112,101,115,'\n',9,'\n',9,47,47,32,116,121,112,101,115, 32,102,111,114,32,83,101,116,83,101,110,115,111,114,84,121, 112,101,40,41,'\n',9,35,100,101,102,105,110,101,32,83,69, 78,83,79,82,95,84,89,80,69,95,78,79,78,69,9,9, 48,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83,79, 82,95,84,89,80,69,95,84,79,85,67,72,9,9,49,'\n', 9,35,100,101,102,105,110,101,32,83,69,78,83,79,82,95, 84,89,80,69,95,84,69,77,80,69,82,65,84,85,82,69, 9,50,'\n',9,35,100,101,102,105,110,101,32,83,69,78,83, 79,82,95,84,89,80,69,95,76,73,71,72,84,9,9,51, '\n',9,35,100,101,102,105,110,101,32,83,69,78,83,79,82, 95,84,89,80,69,95,82,79,84,65,84,73,79,78,9,52, '\n','\n','\n',9,47,47,32,116,121,112,101,47,109,111,100,101, 32,99,111,109,98,105,110,97,116,105,111,110,115,32,102,111, 114,32,83,101,116,83,101,110,115,111,114,40,41,'\n',9,35, 100,101,102,105,110,101,32,95,83,69,78,83,79,82,95,67, 70,71,40,116,121,112,101,44,109,111,100,101,41,9,40,40, 40,116,121,112,101,41,60,60,56,41,32,43,32,40,109,111, 100,101,41,41,'\n',9,35,100,101,102,105,110,101,32,83,69, 78,83,79,82,95,84,79,85,67,72,9,9,95,83,69,78, 83,79,82,95,67,70,71,40,83,69,78,83,79,82,95,84, 89,80,69,95,84,79,85,67,72,44,32,83,69,78,83,79, 82,95,77,79,68,69,95,66,79,79,76,41,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,76,73,71, 72,84,9,9,95,83,69,78,83,79,82,95,67,70,71,40, 83,69,78,83,79,82,95,84,89,80,69,95,76,73,71,72, 84,44,32,83,69,78,83,79,82,95,77,79,68,69,95,80, 69,82,67,69,78,84,41,'\n',9,35,100,101,102,105,110,101, 32,83,69,78,83,79,82,95,82,79,84,65,84,73,79,78, 9,9,95,83,69,78,83,79,82,95,67,70,71,40,83,69, 78,83,79,82,95,84,89,80,69,95,82,79,84,65,84,73, 79,78,44,32,83,69,78,83,79,82,95,77,79,68,69,95, 82,79,84,65,84,73,79,78,41,'\n',9,35,100,101,102,105, 110,101,32,83,69,78,83,79,82,95,67,69,76,83,73,85, 83,9,9,95,83,69,78,83,79,82,95,67,70,71,40,83, 69,78,83,79,82,95,84,89,80,69,95,84,69,77,80,69, 82,65,84,85,82,69,44,32,83,69,78,83,79,82,95,77, 79,68,69,95,67,69,76,83,73,85,83,41,'\n',9,35,100, 101,102,105,110,101,32,83,69,78,83,79,82,95,70,65,72, 82,69,78,72,69,73,84,9,95,83,69,78,83,79,82,95, 67,70,71,40,83,69,78,83,79,82,95,84,89,80,69,95, 84,69,77,80,69,82,65,84,85,82,69,44,32,83,69,78, 83,79,82,95,77,79,68,69,95,70,65,72,82,69,78,72, 69,73,84,41,'\n',9,35,100,101,102,105,110,101,9,83,69, 78,83,79,82,95,80,85,76,83,69,9,9,95,83,69,78, 83,79,82,95,67,70,71,40,83,69,78,83,79,82,95,84, 89,80,69,95,84,79,85,67,72,44,32,83,69,78,83,79, 82,95,77,79,68,69,95,80,85,76,83,69,41,'\n',9,35, 100,101,102,105,110,101,32,83,69,78,83,79,82,95,69,68, 71,69,9,9,9,95,83,69,78,83,79,82,95,67,70,71, 40,83,69,78,83,79,82,95,84,89,80,69,95,84,79,85, 67,72,44,32,83,69,78,83,79,82,95,77,79,68,69,95, 69,68,71,69,41,'\n','\n','\n',9,35,100,101,102,105,110,101, 32,83,101,110,115,111,114,86,97,108,117,101,66,111,111,108, 40,110,41,9,64,40,48,120,100,48,48,48,48,32,43,32, 40,95,95,115,101,110,115,111,114,40,110,41,41,41,9,47, 47,32,114,101,97,100,32,116,104,101,32,98,111,111,108,101, 97,110,32,118,97,108,117,101,32,111,102,32,97,32,115,101, 110,115,111,114,'\n','\n','\n',9,47,47,32,115,101,116,32,97, 32,115,101,110,115,111,114,39,115,32,116,121,112,101,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,83,101,110,115,111,114,84,121,112,101,40,95,95,115,101, 110,115,111,114,32,115,101,110,115,111,114,44,32,99,111,110, 115,116,32,105,110,116,32,116,121,112,101,41,9,32,123,32, 97,115,109,32,123,32,48,120,51,50,44,32,36,115,101,110, 115,111,114,32,58,32,48,120,48,51,48,48,48,50,48,48, 44,32,40,116,121,112,101,41,32,125,59,32,125,'\n','\n','\n', 9,47,47,32,115,101,116,32,97,32,115,101,110,115,111,114, 39,115,32,116,121,112,101,32,97,110,100,32,109,111,100,101, 32,117,115,105,110,103,32,97,32,99,111,110,102,105,103,32, 45,32,101,46,103,46,32,83,101,116,83,101,110,115,111,114, 40,83,69,78,83,79,82,95,49,44,32,83,69,78,83,79, 82,95,76,73,71,72,84,41,59,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,83,101,110,115, 111,114,40,95,95,115,101,110,115,111,114,32,115,101,110,115, 111,114,44,32,99,111,110,115,116,32,105,110,116,32,116,109, 41,9,123,32,83,101,116,83,101,110,115,111,114,84,121,112, 101,40,115,101,110,115,111,114,44,32,116,109,62,62,56,41, 59,32,83,101,116,83,101,110,115,111,114,77,111,100,101,40, 115,101,110,115,111,114,44,32,116,109,41,59,32,125,32,'\n', 35,101,110,100,105,102,'\n','\n','\n',35,105,102,100,101,102,32, 95,95,83,67,79,85,84,'\n',9,47,47,32,83,99,111,117, 116,32,104,97,115,32,115,111,109,101,32,115,112,101,99,105, 97,108,32,114,111,117,116,105,110,101,115,32,116,111,32,99, 111,110,102,105,103,117,114,101,32,116,104,101,32,108,105,103, 104,116,32,115,101,110,115,111,114,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,67,97,108,105,98,114,97, 116,101,83,101,110,115,111,114,40,41,9,9,9,9,123,32, 97,115,109,32,123,32,48,120,99,48,32,125,59,32,125,'\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,83,101,110,115,111,114,67,108,105,99,107,84,105,109, 101,40,99,111,110,115,116,32,105,110,116,32,38,120,41,9, 123,32,97,115,109,32,123,32,48,120,101,51,44,32,36,120, 32,58,32,95,95,65,83,77,95,83,82,67,95,66,65,83, 73,67,32,125,59,32,125,'\n',9,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,83,101,110,115,111,114, 72,121,115,116,101,114,101,115,105,115,40,99,111,110,115,116, 32,105,110,116,32,38,120,41,9,123,32,97,115,109,32,123, 32,48,120,100,51,44,32,36,120,32,58,32,95,95,65,83, 77,95,83,82,67,95,66,65,83,73,67,32,125,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,83,101,110,115,111,114,76,111,119,101,114,76,105, 109,105,116,40,99,111,110,115,116,32,105,110,116,32,38,120, 41,9,123,32,97,115,109,32,123,32,48,120,99,51,44,32, 36,120,32,58,32,95,95,65,83,77,95,83,82,67,95,66, 65,83,73,67,32,125,59,32,125,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,83,101,110,115, 111,114,85,112,112,101,114,76,105,109,105,116,40,99,111,110, 115,116,32,105,110,116,32,38,120,41,9,123,32,97,115,109, 32,123,32,48,120,98,51,44,32,36,120,32,58,32,95,95, 65,83,77,95,83,82,67,95,66,65,83,73,67,32,125,59, 32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32, 100,101,102,105,110,101,100,40,95,95,82,67,88,41,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,67,79,85, 84,41,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,80,89,41,'\n',9,47,47,32,82,67,88,32,97,110,100, 32,83,99,111,117,116,32,115,117,112,112,111,114,116,32,114, 101,97,100,105,110,103,32,116,104,101,32,114,97,119,32,118, 97,108,117,101,'\n',9,35,100,101,102,105,110,101,32,83,101, 110,115,111,114,86,97,108,117,101,82,97,119,40,110,41,9, 64,40,48,120,99,48,48,48,48,32,43,32,40,95,95,115, 101,110,115,111,114,40,110,41,41,41,'\n',35,101,110,100,105, 102,'\n','\n','\n','\n','\n','\n','\n',47,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,'\n',32,42,32,111,117,112,117,116,'\n',32,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,47,'\n','\n','\n',47,47,32,99, 111,110,115,116,97,110,116,115,32,102,111,114,32,115,101,108, 101,99,116,105,110,103,32,111,117,116,112,117,116,115,'\n',35, 100,101,102,105,110,101,32,79,85,84,95,65,9,40,49,32, 60,60,32,48,41,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,66,9,40,49,32,60,60,32,49,41,'\n',35,100,101, 102,105,110,101,32,79,85,84,95,67,9,40,49,32,60,60, 32,50,41,'\n','\n','\n',47,47,32,111,117,116,112,117,116,32, 109,111,100,101,115,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,70,76,79,65,84,9,48,'\n',35,100,101,102,105,110, 101,32,79,85,84,95,79,70,70,9,9,48,120,52,48,'\n', 35,100,101,102,105,110,101,32,79,85,84,95,79,78,9,9, 48,120,56,48,'\n','\n','\n',47,47,32,111,117,116,112,117,116, 32,100,105,114,101,99,116,105,111,110,115,'\n',35,100,101,102, 105,110,101,32,79,85,84,95,82,69,86,9,9,48,'\n',35, 100,101,102,105,110,101,32,79,85,84,95,84,79,71,71,76, 69,9,48,120,52,48,'\n',35,100,101,102,105,110,101,32,79, 85,84,95,70,87,68,9,9,48,120,56,48,'\n','\n','\n',47, 47,32,111,117,116,112,117,116,32,112,111,119,101,114,32,108, 101,118,101,108,115,'\n',35,100,101,102,105,110,101,32,79,85, 84,95,76,79,87,9,9,48,'\n',35,100,101,102,105,110,101, 32,79,85,84,95,72,65,76,70,9,51,'\n',35,100,101,102, 105,110,101,32,79,85,84,95,70,85,76,76,9,55,'\n','\n', '\n',47,47,32,111,117,116,112,117,116,32,102,117,110,99,116, 105,111,110,115,'\n',95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,79,117,116,112,117,116,40,99,111,110, 115,116,32,105,110,116,32,111,44,32,99,111,110,115,116,32, 105,110,116,32,109,41,9,123,32,97,115,109,32,123,32,48, 120,50,49,44,32,40,111,41,32,43,32,40,109,41,32,125, 59,32,125,'\n',95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,68,105,114,101,99,116,105,111,110,40,99, 111,110,115,116,32,105,110,116,32,111,44,32,99,111,110,115, 116,32,105,110,116,32,100,41,9,123,32,97,115,109,32,123, 32,48,120,101,49,44,32,40,111,41,32,43,32,40,100,41, 32,125,59,32,125,'\n',95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,80,111,119,101,114,40,99,111,110, 115,116,32,105,110,116,32,111,44,32,99,111,110,115,116,32, 105,110,116,32,38,112,41,9,123,32,97,115,109,32,123,32, 48,120,49,51,44,32,40,111,41,44,32,36,112,32,58,32, 95,95,65,83,77,95,83,77,65,76,76,95,86,65,76,85, 69,32,43,32,95,95,65,83,77,95,83,82,67,95,69,88, 84,125,59,32,125,'\n','\n','\n',95,95,110,111,108,105,115,116, 32,118,111,105,100,32,79,110,40,99,111,110,115,116,32,105, 110,116,32,111,41,9,123,32,83,101,116,79,117,116,112,117, 116,40,111,44,32,79,85,84,95,79,78,41,59,32,125,'\n', 95,95,110,111,108,105,115,116,32,118,111,105,100,32,79,102, 102,40,99,111,110,115,116,32,105,110,116,32,111,41,9,123, 32,83,101,116,79,117,116,112,117,116,40,111,44,32,79,85, 84,95,79,70,70,41,59,32,125,'\n',95,95,110,111,108,105, 115,116,32,118,111,105,100,32,70,108,111,97,116,40,99,111, 110,115,116,32,105,110,116,32,111,41,32,123,32,83,101,116, 79,117,116,112,117,116,40,111,44,32,79,85,84,95,70,76, 79,65,84,41,59,32,125,'\n',95,95,110,111,108,105,115,116, 32,118,111,105,100,32,84,111,103,103,108,101,40,99,111,110, 115,116,32,105,110,116,32,111,41,32,123,32,83,101,116,68, 105,114,101,99,116,105,111,110,40,111,44,32,79,85,84,95, 84,79,71,71,76,69,41,59,32,125,'\n',95,95,110,111,108, 105,115,116,32,118,111,105,100,32,70,119,100,40,99,111,110, 115,116,32,105,110,116,32,111,41,9,123,32,83,101,116,68, 105,114,101,99,116,105,111,110,40,111,44,32,79,85,84,95, 70,87,68,41,59,32,125,'\n',95,95,110,111,108,105,115,116, 32,118,111,105,100,32,82,101,118,40,99,111,110,115,116,32, 105,110,116,32,111,41,9,123,32,83,101,116,68,105,114,101, 99,116,105,111,110,40,111,44,32,79,85,84,95,82,69,86, 41,59,32,125,'\n',95,95,110,111,108,105,115,116,32,118,111, 105,100,32,79,110,70,119,100,40,99,111,110,115,116,32,105, 110,116,32,111,41,9,123,32,70,119,100,40,111,41,59,32, 79,110,40,111,41,59,32,125,'\n',95,95,110,111,108,105,115, 116,32,118,111,105,100,32,79,110,82,101,118,40,99,111,110, 115,116,32,105,110,116,32,111,41,9,123,32,82,101,118,40, 111,41,59,32,79,110,40,111,41,59,32,125,'\n',95,95,110, 111,108,105,115,116,32,118,111,105,100,32,79,110,70,111,114, 40,99,111,110,115,116,32,105,110,116,32,111,44,32,99,111, 110,115,116,32,105,110,116,32,38,116,41,9,123,32,79,110, 40,111,41,59,32,87,97,105,116,40,116,41,59,32,79,102, 102,40,111,41,59,32,125,'\n','\n','\n',35,100,101,102,105,110, 101,32,79,117,116,112,117,116,83,116,97,116,117,115,40,110, 41,9,9,64,40,48,120,48,51,48,48,48,48,32,43,32, 40,110,41,41,9,47,47,32,114,101,97,100,32,116,104,101, 32,111,117,116,112,117,116,32,115,116,97,116,117,115,'\n','\n', '\n',35,105,102,100,101,102,32,95,95,67,77,'\n',9,47,47, 32,67,121,98,101,114,77,97,115,116,101,114,32,115,112,101, 99,105,102,105,99,32,115,116,117,102,102,'\n',9,47,47,32, 97,108,116,101,114,110,97,116,101,32,110,97,109,101,115,32, 102,111,114,32,109,111,116,111,114,115,'\n',9,35,100,101,102, 105,110,101,32,79,85,84,95,76,32,79,85,84,95,65,32, 47,47,32,76,101,102,116,32,109,111,116,111,114,'\n',9,35, 100,101,102,105,110,101,32,79,85,84,95,82,32,79,85,84, 95,66,32,47,47,32,82,105,103,104,116,32,109,111,116,111, 114,'\n',9,35,100,101,102,105,110,101,32,79,85,84,95,88, 32,79,85,84,95,67,32,47,47,32,69,120,116,101,114,110, 97,108,32,109,111,116,111,114,'\n','\n','\n',9,35,100,101,102, 105,110,101,32,68,114,105,118,101,40,109,48,44,32,109,49, 41,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,97,115,109,32,123,32,48,120,52,49, 44,32,68,73,82,83,80,69,69,68,40,109,48,41,32,124, 32,68,73,82,83,80,69,69,68,40,109,49,41,60,60,52, 32,125,'\n',9,35,100,101,102,105,110,101,32,79,110,87,97, 105,116,40,109,44,32,110,44,32,116,41,32,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,115, 109,32,123,32,48,120,99,50,44,32,40,109,41,60,60,52, 32,124,32,68,73,82,83,80,69,69,68,40,110,41,44,32, 116,32,125,'\n',9,35,100,101,102,105,110,101,32,79,110,87, 97,105,116,68,105,102,102,101,114,101,110,116,40,109,44,32, 110,48,44,32,110,49,44,32,110,50,44,32,116,41,32,97, 115,109,32,123,32,48,120,53,51,44,32,40,109,41,60,60, 52,32,124,32,68,73,82,83,80,69,69,68,40,110,48,41, 44,32,68,73,82,83,80,69,69,68,40,110,49,41,60,60, 52,32,124,32,68,73,82,83,80,69,69,68,40,110,50,41, 44,32,116,32,125,'\n','\n','\n',9,47,47,32,65,117,120,46, 32,102,117,110,99,116,105,111,110,58,32,84,114,97,110,115, 102,111,114,109,115,32,97,32,110,117,109,98,101,114,32,98, 101,116,119,101,101,110,32,45,55,32,97,110,100,32,55,32, 116,111,32,97,32,52,32,98,105,116,32,115,101,113,117,101, 110,99,101,58,32,'\n',9,47,47,32,66,105,116,115,58,32, 49,46,46,51,32,45,32,83,112,101,101,100,58,32,48,32, 116,111,32,55,'\n',9,47,47,32,66,105,116,32,58,32,52, 32,32,32,32,45,32,68,105,114,101,99,116,105,111,110,58, 32,49,32,105,102,32,118,62,61,48,44,32,48,32,105,102, 32,118,60,48,'\n',9,35,100,101,102,105,110,101,32,68,73, 82,83,80,69,69,68,40,118,41,9,9,40,40,118,41,38, 56,94,56,124,40,40,118,41,42,40,40,40,118,41,62,62, 51,41,42,50,94,49,41,41,38,55,41,'\n','\n','\n',9,47, 47,32,114,101,97,100,105,110,103,32,116,104,101,32,116,97, 99,104,111,44,32,101,116,99,46,'\n',9,35,100,101,102,105, 110,101,32,84,97,99,104,111,67,111,117,110,116,40,110,41, 32,32,32,32,32,32,32,32,32,32,64,40,48,120,53,48, 48,48,48,32,43,32,40,110,41,45,49,41,32,47,47,32, 85,115,101,32,79,85,84,95,120,32,97,115,32,112,97,114, 97,109,101,116,101,114,'\n',9,35,100,101,102,105,110,101,32, 84,97,99,104,111,83,112,101,101,100,40,110,41,32,32,32, 32,32,32,32,32,32,32,64,40,48,120,54,48,48,48,48, 32,43,32,40,110,41,45,49,41,32,47,47,32,85,115,101, 32,79,85,84,95,120,32,97,115,32,112,97,114,97,109,101, 116,101,114,'\n',9,35,100,101,102,105,110,101,32,69,120,116, 101,114,110,97,108,77,111,116,111,114,82,117,110,110,105,110, 103,40,41,32,64,40,48,120,55,48,48,48,50,41,32,32, 32,32,32,32,32,32,32,47,47,32,82,101,102,101,114,101, 100,32,105,110,32,116,104,101,32,83,68,75,32,97,115,32, 77,111,116,111,114,67,117,114,114,101,110,116,40,50,41,46, 32,78,111,110,32,122,101,114,111,32,105,102,32,101,120,116, 101,114,110,97,108,32,109,111,116,111,114,32,114,117,110,110, 105,110,103,46,'\n','\n','\n',9,35,100,101,102,105,110,101,32, 67,108,101,97,114,84,97,99,104,111,67,111,117,110,116,101, 114,40,109,41,32,97,115,109,32,123,32,48,120,49,49,44, 32,40,109,41,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n', '\n','\n',35,105,102,32,100,101,102,105,110,101,100,40,95,95, 83,67,79,85,84,41,32,124,124,32,95,95,82,67,88,61, 61,50,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,80,89,41,'\n',9,47,47,32,83,99,111,117,116,32,97, 110,100,32,82,67,88,50,32,104,97,118,101,32,103,108,111, 98,97,108,32,118,101,114,115,105,111,110,115,32,111,102,32, 111,117,116,112,117,116,32,99,111,110,116,114,111,108,32,'\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,71,108,111,98,97,108,79,117,116,112,117,116,40,99, 111,110,115,116,32,105,110,116,32,111,44,32,99,111,110,115, 116,32,105,110,116,32,109,41,9,123,32,97,115,109,32,123, 32,48,120,54,55,44,32,40,111,41,32,43,32,40,109,41, 32,125,59,32,125,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,71,108,111,98,97,108,68,105, 114,101,99,116,105,111,110,40,99,111,110,115,116,32,105,110, 116,32,111,44,32,99,111,110,115,116,32,105,110,116,32,100, 41,9,123,32,97,115,109,32,123,32,48,120,55,55,44,32, 40,111,41,32,43,32,40,100,41,32,125,59,32,125,'\n',9, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,77,97,120,80,111,119,101,114,40,99,111,110,115,116,32, 105,110,116,32,111,44,32,99,111,110,115,116,32,105,110,116, 32,38,112,41,9,123,32,97,115,109,32,123,32,48,120,97, 51,44,32,40,111,41,44,32,36,112,32,58,32,95,95,65, 83,77,95,83,77,65,76,76,95,86,65,76,85,69,32,43, 32,95,95,65,83,77,95,83,82,67,95,69,88,84,125,59, 32,125,'\n','\n','\n',9,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,69,110,97,98,108,101,79,117,116,112,117,116, 40,99,111,110,115,116,32,105,110,116,32,111,41,32,123,32, 83,101,116,71,108,111,98,97,108,79,117,116,112,117,116,40, 111,44,32,79,85,84,95,79,78,41,59,32,125,'\n',9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,68,105,115, 97,98,108,101,79,117,116,112,117,116,40,99,111,110,115,116, 32,105,110,116,32,111,41,32,123,32,83,101,116,71,108,111, 98,97,108,79,117,116,112,117,116,40,111,44,32,79,85,84, 95,79,70,70,41,59,32,125,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,73,110,118,101,114,116,79,117, 116,112,117,116,40,99,111,110,115,116,32,105,110,116,32,111, 41,32,123,32,83,101,116,71,108,111,98,97,108,68,105,114, 101,99,116,105,111,110,40,111,44,32,79,85,84,95,82,69, 86,41,59,32,125,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,79,98,118,101,114,116,79,117,116,112,117, 116,40,99,111,110,115,116,32,105,110,116,32,111,41,32,123, 32,83,101,116,71,108,111,98,97,108,68,105,114,101,99,116, 105,111,110,40,111,44,32,79,85,84,95,70,87,68,41,59, 32,125,'\n','\n','\n',9,35,100,101,102,105,110,101,32,71,108, 111,98,97,108,79,117,116,112,117,116,83,116,97,116,117,115, 40,110,41,9,9,64,40,48,120,49,49,48,48,48,48,32, 43,32,40,110,41,41,9,47,47,32,114,101,97,100,32,116, 104,101,32,103,108,111,98,97,108,32,115,116,97,116,117,115, '\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,100,101, 102,105,110,101,100,40,95,95,83,67,79,85,84,41,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, '\n',9,47,47,32,83,99,111,117,116,32,104,97,115,32,97, 32,108,105,103,104,116,'\n',9,35,100,101,102,105,110,101,32, 76,73,71,72,84,95,79,78,9,48,120,56,48,'\n',9,35, 100,101,102,105,110,101,32,76,73,71,72,84,95,79,70,70, 9,48,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,76,105,103,104,116,40,99,111,110,115,116, 32,105,110,116,32,120,41,9,123,32,97,115,109,32,123,32, 48,120,56,55,44,32,120,32,125,59,32,125,'\n',35,101,110, 100,105,102,'\n','\n','\n','\n','\n',47,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,'\n',32,42,32,115,111,117,110,100,'\n',32,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,47,'\n',32,'\n',47,47,32,115, 111,117,110,100,115,32,45,32,102,111,114,32,80,108,97,121, 83,111,117,110,100,40,41,'\n',35,100,101,102,105,110,101,32, 83,79,85,78,68,95,67,76,73,67,75,9,9,9,48,'\n', 35,100,101,102,105,110,101,32,83,79,85,78,68,95,68,79, 85,66,76,69,95,66,69,69,80,9,49,'\n',35,100,101,102, 105,110,101,32,83,79,85,78,68,95,68,79,87,78,9,9, 9,50,'\n',35,100,101,102,105,110,101,32,83,79,85,78,68, 95,85,80,9,9,9,51,'\n',35,100,101,102,105,110,101,32, 83,79,85,78,68,95,76,79,87,95,66,69,69,80,9,9, 52,'\n',35,100,101,102,105,110,101,32,83,79,85,78,68,95, 70,65,83,84,95,85,80,9,9,53,'\n','\n','\n',47,47,32, 112,108,97,121,105,110,103,32,97,32,115,121,115,116,101,109, 32,115,111,117,110,100,'\n',35,105,102,32,100,101,102,105,110, 101,100,40,95,95,83,80,89,41,'\n',9,47,47,32,83,112, 121,32,99,97,110,32,112,108,97,121,32,118,97,114,105,97, 98,108,101,32,111,114,32,99,111,110,115,116,97,110,116,32, 115,111,117,110,100,115,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,80,108,97,121,83,111,117,110,100,40, 99,111,110,115,116,32,105,110,116,32,38,120,41,'\n',9,123, '\n',9,9,105,102,32,40,95,95,116,121,112,101,40,120,41, 61,61,50,41,'\n',9,9,9,97,115,109,32,123,32,48,120, 53,49,44,32,36,120,32,58,32,48,120,51,48,48,48,48, 48,52,32,125,59,'\n',9,9,101,108,115,101,'\n',9,9,9, 97,115,109,32,123,32,48,120,101,55,44,32,36,120,32,58, 32,48,120,51,48,48,48,48,48,49,32,125,59,'\n',9,125, '\n',35,101,108,115,101,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,80,108,97,121,83,111,117,110,100,40, 99,111,110,115,116,32,105,110,116,32,120,41,9,9,9,9, 9,123,9,97,115,109,32,123,32,48,120,53,49,44,32,120, 32,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n','\n', '\n',47,47,32,112,108,97,121,105,110,103,32,97,32,110,111, 116,101,'\n',35,105,102,32,100,101,102,105,110,101,100,40,95, 95,83,67,79,85,84,41,32,124,124,32,95,95,82,67,88, 61,61,50,32,124,124,32,100,101,102,105,110,101,100,40,95, 95,83,80,89,41,'\n',9,47,47,32,82,67,88,50,32,97, 110,100,32,83,99,111,117,116,32,99,97,110,32,112,108,97, 121,32,118,97,114,105,97,98,108,101,32,111,114,32,99,111, 110,115,116,97,110,116,32,102,114,101,113,117,101,110,99,121, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 80,108,97,121,84,111,110,101,40,99,111,110,115,116,32,105, 110,116,32,38,110,111,116,101,44,32,99,111,110,115,116,32, 105,110,116,32,100,117,114,41,'\n',9,123,'\n',9,9,105,102, 32,40,95,95,116,121,112,101,40,110,111,116,101,41,61,61, 50,41,'\n',9,9,9,97,115,109,32,123,32,48,120,50,51, 44,32,36,110,111,116,101,32,58,32,48,120,50,48,48,48, 48,48,52,44,32,100,117,114,32,125,59,'\n',9,9,101,108, 115,101,'\n',9,9,9,97,115,109,32,123,32,48,120,48,50, 44,32,36,110,111,116,101,32,58,32,48,120,51,48,48,48, 48,48,49,44,32,100,117,114,125,59,'\n',9,125,'\n',35,101, 108,115,101,'\n',9,47,47,32,82,67,88,49,32,97,110,100, 32,67,77,32,110,101,101,100,32,99,111,110,115,116,97,110, 116,32,102,114,101,113,117,101,110,99,121,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,80,108,97,121,84, 111,110,101,40,99,111,110,115,116,32,105,110,116,32,102,44, 32,99,111,110,115,116,32,105,110,116,32,100,41,9,9,123, 9,97,115,109,32,123,32,48,120,50,51,44,32,40,102,41, 44,32,40,102,41,62,62,56,44,32,40,100,41,32,125,59, 32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32, 95,95,82,67,88,61,61,50,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,80,89,41,'\n',9,47,47,32,82, 67,88,50,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,77,117,116,101,83,111,117,110,100,40,41,9,123, 32,97,115,109,32,123,32,48,120,100,48,32,125,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 85,110,109,117,116,101,83,111,117,110,100,40,41,32,9,123, 32,97,115,109,32,123,32,48,120,101,48,32,125,59,32,125, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 67,108,101,97,114,83,111,117,110,100,40,41,32,9,123,32, 97,115,109,32,123,32,48,120,56,48,32,125,59,32,125,'\n', 35,101,108,105,102,32,100,101,102,105,110,101,100,40,95,95, 83,67,79,85,84,41,'\n',9,47,47,32,83,67,79,85,84, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 77,117,116,101,83,111,117,110,100,40,41,9,123,32,97,115, 109,32,123,32,48,120,53,55,44,32,48,120,56,48,32,125, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,85,110,109,117,116,101,83,111,117,110,100,40,41, 9,123,32,97,115,109,32,123,32,48,120,53,55,44,32,48, 120,99,48,32,125,59,32,125,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,108,101,99,116,83,111, 117,110,100,115,40,99,111,110,115,116,32,105,110,116,32,103, 114,111,117,112,41,9,123,32,97,115,109,32,123,32,48,120, 53,55,44,32,103,114,111,117,112,32,125,59,32,125,'\n',35, 101,110,100,105,102,'\n','\n','\n','\n','\n',47,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,'\n',32,42,32,68,105,115,112,108,97,121, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n','\n', 35,105,102,100,101,102,32,95,95,82,67,88,'\n',9,47,47, 32,115,101,116,32,116,104,101,32,100,105,115,112,108,97,121, 32,109,111,100,101,'\n',9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,108,101,99,116,68,105,115,112,108, 97,121,40,99,111,110,115,116,32,105,110,116,32,38,118,41, 32,123,32,97,115,109,32,123,32,48,120,51,51,44,32,36, 118,32,58,32,95,95,65,83,77,95,83,82,67,95,66,65, 83,73,67,125,59,32,125,'\n','\n','\n',9,47,47,32,100,105, 115,112,108,97,121,32,109,111,100,101,115,32,45,32,102,111, 114,32,83,101,108,101,99,116,68,105,115,112,108,97,121,'\n', 9,35,100,101,102,105,110,101,32,68,73,83,80,76,65,89, 95,87,65,84,67,72,9,9,48,'\n',9,35,100,101,102,105, 110,101,32,68,73,83,80,76,65,89,95,83,69,78,83,79, 82,95,49,9,49,'\n',9,35,100,101,102,105,110,101,32,68, 73,83,80,76,65,89,95,83,69,78,83,79,82,95,50,9, 50,'\n',9,35,100,101,102,105,110,101,32,68,73,83,80,76, 65,89,95,83,69,78,83,79,82,95,51,9,51,'\n',9,35, 100,101,102,105,110,101,32,68,73,83,80,76,65,89,95,79, 85,84,95,65,9,9,52,'\n',9,35,100,101,102,105,110,101, 32,68,73,83,80,76,65,89,95,79,85,84,95,66,9,9, 53,'\n',9,35,100,101,102,105,110,101,32,68,73,83,80,76, 65,89,95,79,85,84,95,67,9,9,54,'\n',9,'\n',9,35, 105,102,32,95,95,82,67,88,61,61,50,'\n',9,9,35,100, 101,102,105,110,101,32,68,73,83,80,76,65,89,95,85,83, 69,82,9,55,'\n',9,9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,116,85,115,101,114,68,105,115,112, 108,97,121,40,99,111,110,115,116,32,105,110,116,32,38,118, 44,32,99,111,110,115,116,32,105,110,116,32,112,114,101,99, 41,32,123,32,97,115,109,32,123,32,48,120,101,53,44,32, 48,44,32,112,114,101,99,44,32,36,118,32,58,32,95,95, 65,83,77,95,78,79,95,76,79,67,65,76,32,125,59,32, 125,'\n',9,35,101,110,100,105,102,'\n',35,101,110,100,105,102, '\n','\n','\n','\n','\n','\n','\n',47,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,'\n',32,42,32,99,111,109,109,117,110,105,99,97,116, 105,111,110,'\n',32,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,47, '\n','\n','\n',35,105,102,32,100,101,102,105,110,101,100,40,95, 95,83,80,89,41,'\n',9,35,100,101,102,105,110,101,32,86, 76,76,40,41,9,9,9,64,40,48,120,102,48,48,48,48, 41,9,47,47,32,114,101,97,100,32,116,104,101,32,109,101, 115,115,97,103,101,32,98,117,102,102,101,114,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,110,100, 86,76,76,40,99,111,110,115,116,32,105,110,116,32,38,120, 41,9,9,123,32,97,115,109,32,123,32,48,120,101,50,44, 32,36,120,32,58,32,95,95,65,83,77,95,83,77,65,76, 76,95,86,65,76,85,69,32,43,32,95,95,65,83,77,95, 83,82,67,95,66,65,83,73,67,125,59,32,125,'\n',35,101, 110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102,105,110, 101,100,40,95,95,82,67,88,41,32,124,124,32,100,101,102, 105,110,101,100,40,95,95,83,67,79,85,84,41,'\n',9,47, 47,32,83,99,111,117,116,32,97,110,100,32,82,67,88,32, 104,97,118,101,32,73,82,32,109,101,115,115,97,103,101,32, 99,97,112,97,98,105,108,105,116,121,'\n',9,35,100,101,102, 105,110,101,32,77,101,115,115,97,103,101,40,41,9,9,9, 64,40,48,120,102,48,48,48,48,41,9,47,47,32,114,101, 97,100,32,116,104,101,32,109,101,115,115,97,103,101,32,98, 117,102,102,101,114,'\n',9,'\n',9,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,110,100,77,101,115,115,97, 103,101,40,99,111,110,115,116,32,105,110,116,32,38,118,41, 9,123,32,97,115,109,32,123,32,48,120,98,50,44,32,36, 118,32,58,32,95,95,65,83,77,95,83,77,65,76,76,95, 86,65,76,85,69,32,43,32,95,95,65,83,77,95,83,82, 67,95,66,65,83,73,67,125,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,67,108,101,97,114, 77,101,115,115,97,103,101,40,41,9,9,9,9,123,32,97, 115,109,32,123,32,48,120,57,48,32,125,59,32,125,'\n',35, 101,110,100,105,102,'\n','\n','\n',35,105,102,100,101,102,32,95, 95,83,67,79,85,84,'\n',9,47,47,32,83,99,111,117,116, 32,99,97,110,32,115,101,110,100,32,86,76,76,32,99,111, 109,109,97,110,100,115,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,110,100,86,76,76,40,99,111, 110,115,116,32,105,110,116,32,38,120,41,9,9,123,32,97, 115,109,32,123,32,48,120,101,50,44,32,36,120,32,58,32, 95,95,65,83,77,95,83,77,65,76,76,95,86,65,76,85, 69,32,43,32,95,95,65,83,77,95,83,82,67,95,66,65, 83,73,67,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n', '\n',35,105,102,32,95,95,82,67,88,61,61,50,32,124,124, 32,100,101,102,105,110,101,100,40,95,95,83,80,89,41,'\n', 32,32,35,105,102,32,95,95,82,67,88,61,61,50,'\n',32, 32,9,47,47,32,115,101,114,105,97,108,32,99,111,109,109, 117,110,105,99,97,116,105,111,110,32,115,111,117,114,99,101, 115,'\n',32,32,9,35,100,101,102,105,110,101,32,83,101,114, 105,97,108,80,97,99,107,101,116,40,41,9,64,40,48,120, 50,49,48,48,49,48,41,'\n',32,32,9,35,100,101,102,105, 110,101,32,83,101,114,105,97,108,67,111,109,109,40,41,9, 64,40,48,120,50,49,48,48,49,49,41,'\n',32,32,9,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 83,101,114,105,97,108,80,97,99,107,101,116,40,99,111,110, 115,116,32,105,110,116,32,38,118,41,9,9,123,32,83,101, 116,40,83,101,114,105,97,108,80,97,99,107,101,116,40,41, 44,32,118,41,59,32,125,'\n',32,32,9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,83,101,114,105, 97,108,67,111,109,109,40,99,111,110,115,116,32,105,110,116, 32,38,118,41,9,9,123,32,83,101,116,40,83,101,114,105, 97,108,67,111,109,109,40,41,44,32,118,41,59,32,125,'\n', '\n',32,32,9,47,47,32,118,97,108,117,101,115,32,102,111, 114,32,83,101,114,80,97,99,107,101,116,'\n',32,32,9,35, 100,101,102,105,110,101,32,83,69,82,73,65,76,95,80,65, 67,75,69,84,95,68,69,70,65,85,76,84,9,48,9,47, 47,32,114,97,119,32,115,101,114,105,97,108,44,32,110,111, 32,99,104,101,99,107,115,117,109,44,32,110,111,32,112,114, 101,97,109,98,108,101,'\n',32,32,9,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,80,65,67,75,69,84,95, 80,82,69,65,77,66,76,69,9,49,'\n',32,32,9,35,100, 101,102,105,110,101,32,83,69,82,73,65,76,95,80,65,67, 75,69,84,95,78,69,71,65,84,69,68,9,50,9,47,47, 32,105,110,99,108,117,100,101,115,32,99,104,101,99,107,115, 117,109,'\n',32,32,9,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,80,65,67,75,69,84,95,67,72,69,67, 75,83,85,77,9,52,9,47,47,32,117,115,101,32,116,104, 105,115,32,102,111,114,32,99,104,101,99,107,115,117,109,32, 119,47,111,32,110,101,103,97,116,101,100,'\n',32,32,9,35, 100,101,102,105,110,101,32,83,69,82,73,65,76,95,80,65, 67,75,69,84,95,82,67,88,9,9,40,83,69,82,73,65, 76,95,80,65,67,75,69,84,95,80,82,69,65,77,66,76, 69,32,43,32,83,69,82,73,65,76,95,80,65,67,75,69, 84,95,78,69,71,65,84,69,68,41,'\n','\n',32,32,9,47, 47,32,118,97,108,117,101,115,32,102,111,114,32,83,101,114, 67,111,109,109,'\n',32,32,9,35,100,101,102,105,110,101,32, 83,69,82,73,65,76,95,67,79,77,77,95,68,69,70,65, 85,76,84,9,9,48,'\n',32,32,9,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,67,79,77,77,95,52,56, 48,48,9,9,49,9,47,47,32,100,101,102,97,117,108,116, 32,105,115,32,50,52,48,48,32,98,97,117,100,'\n',32,32, 9,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 67,79,77,77,95,55,54,75,72,90,9,9,50,9,47,47, 32,100,101,102,97,117,108,116,32,105,115,32,51,56,107,72, 122,'\n',32,32,9,35,100,101,102,105,110,101,32,83,69,82, 73,65,76,95,67,79,77,77,95,68,85,84,89,50,53,9, 9,52,9,47,47,32,100,101,102,97,117,108,116,32,105,115, 32,53,48,37,32,100,117,116,121,32,99,121,99,108,101,'\n', '\n',32,32,9,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,73,110,116,101,114,110,97,108,77,101,115,115,97,103, 101,40,99,111,110,115,116,32,105,110,116,32,109,41,9,123, 32,97,115,109,32,123,32,48,120,102,55,44,32,109,32,125, 59,32,125,'\n',9,'\n',32,32,35,101,110,100,105,102,'\n','\n', 9,35,100,101,102,105,110,101,32,83,101,114,105,97,108,68, 97,116,97,40,110,41,9,64,40,48,120,50,49,48,48,48, 48,32,43,32,40,110,41,41,32,47,47,32,100,97,116,97, 32,102,111,114,32,83,101,110,100,83,101,114,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,114,105,97,108,68,97,116,97,40,99,111,110,115,116,32, 105,110,116,32,110,44,32,99,111,110,115,116,32,105,110,116, 32,38,118,41,9,123,32,83,101,116,40,83,101,114,105,97, 108,68,97,116,97,40,110,41,44,32,118,41,59,32,125,'\n', '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,110,100,83,101,114,105,97,108,40,99,111,110,115,116, 32,105,110,116,32,102,105,114,115,116,44,32,99,111,110,115, 116,32,105,110,116,32,99,111,117,110,116,41,9,123,32,97, 115,109,32,123,32,48,120,99,50,44,32,102,105,114,115,116, 44,32,99,111,117,110,116,32,125,59,32,125,'\n','\n',32,32, 35,105,102,32,100,101,102,105,110,101,100,40,95,95,83,80, 89,41,'\n','\n',32,32,32,32,35,100,101,102,105,110,101,32, 83,69,82,73,65,76,95,84,89,80,69,32,48,120,49,48, '\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69,82, 73,65,76,95,84,89,80,69,95,83,80,89,66,79,84,32, 48,'\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,84,89,80,69,95,82,67,88,32,49,'\n', 32,32,32,32,35,100,101,102,105,110,101,32,83,69,82,73, 65,76,95,84,89,80,69,95,82,67,32,50,'\n',32,32,32, 32,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 84,89,80,69,95,85,83,69,82,32,51,'\n',32,32,32,32, 35,100,101,102,105,110,101,32,83,101,114,105,97,108,84,121, 112,101,40,41,32,64,40,48,120,50,49,48,48,49,48,41, '\n',32,32,32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,83,101,114,105,97,108,84,121,112,101, 40,99,111,110,115,116,32,105,110,116,32,38,116,41,32,123, 32,83,101,116,40,83,101,114,105,97,108,84,121,112,101,40, 41,44,32,116,41,59,32,125,'\n','\n',32,32,32,32,35,100, 101,102,105,110,101,32,83,69,82,73,65,76,95,66,65,85, 68,32,48,120,49,49,'\n',32,32,32,32,35,100,101,102,105, 110,101,32,83,69,82,73,65,76,95,66,65,85,68,95,50, 52,48,48,32,48,'\n',32,32,32,32,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,66,65,85,68,95,52,56, 48,48,32,49,'\n',32,32,32,32,35,100,101,102,105,110,101, 32,83,69,82,73,65,76,95,66,65,85,68,95,57,54,48, 48,32,50,'\n',32,32,32,32,35,100,101,102,105,110,101,32, 83,101,114,105,97,108,66,97,117,100,40,41,32,64,40,48, 120,50,49,48,48,49,49,41,'\n',32,32,32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,83,101, 114,105,97,108,66,97,117,100,40,99,111,110,115,116,32,105, 110,116,32,38,98,41,32,123,32,83,101,116,40,83,101,114, 105,97,108,66,97,117,100,40,41,44,32,98,41,59,32,125, '\n','\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,67,72,65,78,78,69,76,32,48,120,49, 50,'\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,67,72,65,78,78,69,76,95,73,82,32, 48,'\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,67,72,65,78,78,69,76,95,80,67,32, 49,'\n',32,32,32,32,35,100,101,102,105,110,101,32,83,101, 114,105,97,108,67,104,97,110,110,101,108,40,41,32,64,40, 48,120,50,49,48,48,49,50,41,'\n',32,32,32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,114,105,97,108,67,104,97,110,110,101,108,40,99,111,110, 115,116,32,105,110,116,32,38,99,41,32,123,32,83,101,116, 40,83,101,114,105,97,108,67,104,97,110,110,101,108,40,41, 44,32,99,41,59,32,125,'\n','\n',32,32,32,32,35,100,101, 102,105,110,101,32,83,69,82,73,65,76,95,80,82,69,65, 77,66,76,69,95,80,79,83,32,48,120,49,51,'\n',32,32, 32,32,35,100,101,102,105,110,101,32,83,101,114,105,97,108, 80,114,101,97,109,98,108,101,80,111,115,40,41,32,64,40, 48,120,50,49,48,48,49,51,41,'\n',32,32,32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,83, 101,114,105,97,108,80,114,101,97,109,98,108,101,80,111,115, 40,99,111,110,115,116,32,105,110,116,32,38,112,41,32,123, 32,83,101,116,40,83,101,114,105,97,108,80,114,101,97,109, 98,108,101,80,111,115,40,41,44,32,112,41,59,32,125,'\n', '\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69,82, 73,65,76,95,80,82,69,65,77,66,76,69,95,76,69,78, 32,48,120,49,52,'\n',32,32,32,32,35,100,101,102,105,110, 101,32,83,101,114,105,97,108,80,114,101,97,109,98,108,101, 76,101,110,40,41,32,64,40,48,120,50,49,48,48,49,52, 41,'\n',32,32,32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,101,114,105,97,108,80,114,101, 97,109,98,108,101,76,101,110,40,99,111,110,115,116,32,105, 110,116,32,38,108,41,32,123,32,83,101,116,40,83,101,114, 105,97,108,80,114,101,97,109,98,108,101,76,101,110,40,41, 44,32,108,41,59,32,125,'\n','\n',32,32,32,32,35,100,101, 102,105,110,101,32,83,69,82,73,65,76,95,67,72,69,67, 75,83,85,77,32,48,120,49,53,'\n',32,32,32,32,35,100, 101,102,105,110,101,32,83,69,82,73,65,76,95,67,72,69, 67,75,83,85,77,95,78,79,78,69,32,48,'\n',32,32,32, 32,35,100,101,102,105,110,101,32,83,69,82,73,65,76,95, 67,72,69,67,75,83,85,77,95,83,85,77,32,48,120,48, 52,'\n',32,32,32,32,35,100,101,102,105,110,101,32,83,69, 82,73,65,76,95,67,72,69,67,75,83,85,77,95,90,69, 82,79,95,83,85,77,32,48,120,48,56,'\n',32,32,32,32, 35,100,101,102,105,110,101,32,83,101,114,105,97,108,67,104, 101,99,107,115,117,109,40,41,32,64,40,48,120,50,49,48, 48,49,53,41,'\n',32,32,32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,83,101,114,105,97,108, 67,104,101,99,107,115,117,109,40,99,111,110,115,116,32,105, 110,116,32,38,110,41,32,123,32,83,101,116,40,83,101,114, 105,97,108,67,104,101,99,107,115,117,109,40,41,44,32,110, 41,59,32,125,'\n','\n',32,32,32,32,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,66,73,80,72,65,83,69, 32,48,120,49,54,'\n',32,32,32,32,35,100,101,102,105,110, 101,32,83,69,82,73,65,76,95,66,73,80,72,65,83,69, 95,79,70,70,32,48,'\n',32,32,32,32,35,100,101,102,105, 110,101,32,83,69,82,73,65,76,95,66,73,80,72,65,83, 69,95,79,78,32,48,120,102,102,'\n',32,32,32,32,35,100, 101,102,105,110,101,32,83,101,114,105,97,108,66,105,80,104, 97,115,101,40,41,32,64,40,48,120,50,49,48,48,49,54, 41,'\n',32,32,32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,101,114,105,97,108,66,105,80, 104,97,115,101,40,99,111,110,115,116,32,105,110,116,32,38, 110,41,32,123,32,83,101,116,40,83,101,114,105,97,108,66, 105,80,104,97,115,101,40,41,44,32,110,41,59,32,125,'\n', '\n',32,32,32,32,35,100,101,102,105,110,101,32,77,83,71, 95,78,79,78,69,32,48,'\n',32,32,32,32,35,100,101,102, 105,110,101,32,77,83,71,95,73,82,32,49,'\n',32,32,32, 32,35,100,101,102,105,110,101,32,77,83,71,95,80,67,32, 50,'\n',32,32,32,32,35,100,101,102,105,110,101,32,82,120, 77,101,115,115,97,103,101,76,111,99,107,40,41,32,64,40, 48,120,50,49,48,48,49,55,41,'\n',32,32,32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,82, 120,77,101,115,115,97,103,101,76,111,99,107,40,99,111,110, 115,116,32,105,110,116,32,38,108,41,32,123,32,83,101,116, 40,82,120,77,101,115,115,97,103,101,76,111,99,107,40,41, 44,32,108,41,59,32,125,'\n','\n',32,32,32,32,35,100,101, 102,105,110,101,32,82,120,77,101,115,115,97,103,101,73,110, 100,101,120,40,41,32,64,40,48,120,50,49,48,48,49,56, 41,'\n',32,32,32,32,35,100,101,102,105,110,101,32,82,120, 77,101,115,115,97,103,101,67,104,97,110,110,101,108,40,41, 32,64,40,48,120,50,49,48,48,49,57,41,32,47,47,32, 114,101,116,117,114,110,115,32,77,83,71,95,73,82,32,111, 114,32,77,83,71,95,80,67,'\n',32,32,32,32,35,100,101, 102,105,110,101,32,82,120,77,101,115,115,97,103,101,73,68, 40,99,41,32,64,40,48,120,50,49,48,48,49,57,32,43, 32,40,99,41,41,32,47,47,32,99,32,61,61,32,77,83, 71,95,73,82,32,111,114,32,77,83,71,95,80,67,'\n','\n', 32,32,32,32,35,100,101,102,105,110,101,32,77,83,71,95, 73,78,68,69,88,32,48,'\n',32,32,32,32,35,100,101,102, 105,110,101,32,77,83,71,95,67,79,77,77,65,78,68,32, 49,'\n',32,32,32,32,35,100,101,102,105,110,101,32,77,83, 71,95,72,73,95,66,89,84,69,32,50,'\n',32,32,32,32, 35,100,101,102,105,110,101,32,77,83,71,95,76,79,95,66, 89,84,69,32,51,'\n',32,32,32,32,35,100,101,102,105,110, 101,32,67,79,77,77,65,78,68,95,67,79,78,84,82,79, 76,76,69,82,32,48,120,52,48,'\n',32,32,32,32,35,100, 101,102,105,110,101,32,73,78,68,69,88,95,76,73,78,75, 67,65,83,84,32,48,120,52,48,'\n',32,32,32,32,35,100, 101,102,105,110,101,32,73,78,68,69,88,95,66,82,79,65, 68,67,65,83,84,32,48,120,56,48,'\n',32,32,32,32,35, 100,101,102,105,110,101,32,73,78,68,69,88,95,73,78,86, 65,76,73,68,32,48,120,50,48,'\n',32,32,32,32,35,100, 101,102,105,110,101,32,82,120,77,101,115,115,97,103,101,40, 99,44,32,110,41,32,64,40,48,120,50,49,48,48,49,56, 32,43,32,40,99,42,52,41,32,43,32,40,110,41,41,32, 47,47,32,99,32,61,61,32,77,83,71,95,73,82,32,111, 114,32,77,83,71,95,80,67,59,32,52,32,98,121,116,101, 115,'\n','\n',32,32,35,101,110,100,105,102,'\n',9,'\n',35,101, 110,100,105,102,'\n','\n','\n','\n','\n',47,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,'\n',32,42,32,84,105,109,101,114,115,'\n',32, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,47,'\n','\n','\n',35,100, 101,102,105,110,101,32,84,105,109,101,114,40,110,41,9,9, 9,64,40,48,120,49,48,48,48,48,32,43,32,40,110,41, 41,9,47,47,32,114,101,97,100,32,97,32,116,105,109,101, 114,39,115,32,118,97,108,117,101,'\n','\n','\n',95,95,110,111, 108,105,115,116,32,118,111,105,100,32,67,108,101,97,114,84, 105,109,101,114,40,99,111,110,115,116,32,105,110,116,32,110, 41,32,123,9,97,115,109,32,123,32,48,120,97,49,44,32, 110,32,125,59,32,125,'\n','\n','\n',35,105,102,100,101,102,32, 95,95,83,67,79,85,84,'\n',9,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,84,105,109,101,114,76, 105,109,105,116,40,99,111,110,115,116,32,105,110,116,32,110, 44,32,99,111,110,115,116,32,105,110,116,32,38,120,41,9, 123,32,97,115,109,32,123,32,48,120,99,52,44,32,110,44, 32,36,120,32,58,32,95,95,65,83,77,95,83,82,67,95, 69,88,84,32,125,59,32,125,'\n',35,101,110,100,105,102,'\n', '\n','\n',35,105,102,32,95,95,82,67,88,61,61,50,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,84,105,109,101,114,40,99,111,110,115,116,32,105, 110,116,32,110,44,32,99,111,110,115,116,32,105,110,116,32, 38,118,41,9,32,123,32,83,101,116,40,84,105,109,101,114, 40,110,41,44,32,118,41,59,32,125,'\n',9,35,100,101,102, 105,110,101,32,70,97,115,116,84,105,109,101,114,40,110,41, 9,64,40,48,120,49,97,48,48,48,48,32,43,32,40,110, 41,41,'\n',35,101,110,100,105,102,'\n','\n','\n','\n','\n',47,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,'\n',32,42,32,67,111,117, 110,116,101,114,115,'\n',32,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,47,'\n','\n','\n',35,105,102,32,100,101,102,105,110,101,100, 40,95,95,83,67,79,85,84,41,32,124,124,32,95,95,82, 67,88,61,61,50,32,124,124,32,100,101,102,105,110,101,100, 40,95,95,83,80,89,41,'\n',9,47,47,32,83,99,111,117, 116,32,97,110,100,32,82,67,88,50,32,104,97,118,101,32, 99,111,117,110,116,101,114,32,115,117,112,112,111,114,116,'\n', 9,35,100,101,102,105,110,101,32,67,111,117,110,116,101,114, 40,110,41,9,9,9,64,40,48,120,49,53,48,48,48,48, 32,43,32,40,110,41,41,9,47,47,32,114,101,97,100,32, 97,32,99,111,117,110,116,101,114,'\n','\n','\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,73,110,99,67,111, 117,110,116,101,114,40,99,111,110,115,116,32,105,110,116,32, 99,41,32,123,32,97,115,109,32,123,32,48,120,57,55,44, 32,99,32,125,59,32,125,'\n',9,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,68,101,99,67,111,117,110,116,101, 114,40,99,111,110,115,116,32,105,110,116,32,99,41,32,123, 32,97,115,109,32,123,32,48,120,65,55,44,32,99,32,125, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,67,108,101,97,114,67,111,117,110,116,101,114,40, 99,111,110,115,116,32,105,110,116,32,99,41,32,123,32,97, 115,109,32,123,32,48,120,98,55,44,32,99,125,59,32,125, '\n',9,'\n',9,35,105,102,100,101,102,32,95,95,83,67,79, 85,84,'\n',9,9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,67,111,117,110,116,101,114,76,105,109, 105,116,40,99,111,110,115,116,32,105,110,116,32,99,44,32, 99,111,110,115,116,32,105,110,116,32,38,108,41,32,123,32, 97,115,109,32,123,32,48,120,100,52,44,32,32,99,44,32, 36,108,32,58,32,95,95,65,83,77,95,83,82,67,95,69, 88,84,32,125,59,32,125,'\n',9,35,101,110,100,105,102,'\n', 35,101,110,100,105,102,'\n','\n','\n','\n','\n',47,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,'\n',32,42,32,69,118,101,110,116,115, '\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n','\n', 35,105,102,32,100,101,102,105,110,101,100,40,95,95,83,67, 79,85,84,41,32,124,124,32,95,95,82,67,88,61,61,50, 32,124,124,32,100,101,102,105,110,101,100,40,95,95,83,80, 89,41,'\n',9,47,47,32,83,99,111,117,116,32,97,110,100, 32,82,67,88,50,32,104,97,118,101,32,98,97,115,105,99, 32,101,118,101,110,116,32,115,117,112,112,111,114,116,'\n',9, 35,100,101,102,105,110,101,32,65,99,116,105,118,101,69,118, 101,110,116,115,40,110,41,9,64,40,48,120,49,55,48,48, 48,48,32,43,32,40,110,41,41,'\n',9,35,100,101,102,105, 110,101,32,69,86,69,78,84,95,77,65,83,75,40,101,41, 9,40,49,32,60,60,32,40,101,41,41,'\n','\n','\n',9,35, 105,102,32,100,101,102,105,110,101,100,40,95,95,83,67,79, 85,84,41,'\n',9,9,47,47,32,111,110,108,121,32,99,111, 110,115,116,97,110,116,32,109,97,115,107,115,32,97,108,108, 111,119,101,100,'\n',9,9,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,69,118,101,110,116,40,99,111,110,115,116, 32,105,110,116,32,101,41,9,9,9,123,32,97,115,109,32, 123,32,48,120,48,51,44,32,50,44,32,101,44,32,101,62, 62,56,32,125,59,32,125,'\n',9,35,101,108,115,101,'\n',9, 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,69, 118,101,110,116,40,99,111,110,115,116,32,105,110,116,32,38, 101,41,9,9,123,32,97,115,109,32,123,32,48,120,48,51, 44,32,36,101,32,125,59,32,125,'\n',9,35,101,110,100,105, 102,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,95, 95,82,67,88,61,61,50,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,80,89,41,'\n',9,35,105,102,32,95, 95,82,67,88,61,61,50,'\n',9,9,35,100,101,102,105,110, 101,32,67,117,114,114,101,110,116,69,118,101,110,116,115,40, 41,32,65,99,116,105,118,101,69,118,101,110,116,115,40,49, 48,41,'\n',9,35,101,108,115,101,'\n',9,9,35,100,101,102, 105,110,101,32,67,117,114,114,101,110,116,69,118,101,110,116, 115,40,41,32,65,99,116,105,118,101,69,118,101,110,116,115, 40,49,54,41,'\n',9,35,101,110,100,105,102,9,'\n','\n','\n', 9,35,100,101,102,105,110,101,32,69,86,69,78,84,95,84, 89,80,69,95,80,82,69,83,83,69,68,9,48,'\n',9,35, 100,101,102,105,110,101,32,69,86,69,78,84,95,84,89,80, 69,95,82,69,76,69,65,83,69,68,32,49,'\n',9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,84,89,80,69, 95,76,79,87,9,9,56,'\n',9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,84,89,80,69,95,78,79,82,77, 65,76,9,57,'\n',9,35,100,101,102,105,110,101,32,69,86, 69,78,84,95,84,89,80,69,95,72,73,71,72,9,9,49, 48,'\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84, 95,84,89,80,69,95,67,76,73,67,75,9,49,49,'\n','\n', '\n',9,35,105,102,100,101,102,32,95,95,83,80,89,'\n',9, 9,47,47,32,116,104,101,115,101,32,97,108,108,32,99,111, 114,114,101,115,112,111,110,100,32,116,111,32,117,115,105,110, 103,32,86,76,76,40,41,32,97,115,32,116,104,101,32,115, 111,117,114,99,101,'\n',9,9,35,100,101,102,105,110,101,32, 69,86,69,78,84,95,84,89,80,69,95,69,78,84,82,89, 95,70,79,85,78,68,32,52,'\n',9,9,35,100,101,102,105, 110,101,32,69,86,69,78,84,95,84,89,80,69,95,77,83, 71,95,68,73,83,67,65,82,68,32,54,'\n',9,9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,84,89,80,69, 95,77,83,71,95,82,69,67,69,73,86,69,68,32,49,51, '\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78,84, 95,84,89,80,69,95,86,76,76,95,77,83,71,95,82,69, 67,69,73,86,69,68,32,49,52,'\n',9,9,35,100,101,102, 105,110,101,32,69,86,69,78,84,95,84,89,80,69,95,69, 78,84,82,89,95,67,72,65,78,71,69,68,32,49,53,'\n', 9,35,101,108,115,101,'\n',9,9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,84,89,80,69,95,80,85,76,83, 69,9,50,'\n',9,9,35,100,101,102,105,110,101,32,69,86, 69,78,84,95,84,89,80,69,95,69,68,71,69,9,9,51, '\n',9,9,35,100,101,102,105,110,101,32,69,86,69,78,84, 95,84,89,80,69,95,70,65,83,84,67,72,65,78,71,69, 9,55,'\n',9,9,35,100,101,102,105,110,101,32,69,86,69, 78,84,95,84,89,80,69,95,68,79,85,66,76,69,67,76, 73,67,75,9,49,50,'\n',9,9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,84,89,80,69,95,77,69,83,83, 65,71,69,9,49,52,'\n',9,35,101,110,100,105,102,'\n',9, '\n','\n','\n',9,35,100,101,102,105,110,101,32,83,101,116,69, 118,101,110,116,40,101,44,115,44,116,41,9,95,95,83,101, 116,69,118,101,110,116,40,101,44,95,95,101,118,101,110,116, 95,115,114,99,40,115,41,44,116,41,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,95,95,83,101,116,69, 118,101,110,116,40,99,111,110,115,116,32,105,110,116,32,101, 118,116,44,32,99,111,110,115,116,32,105,110,116,32,115,114, 99,44,32,99,111,110,115,116,32,105,110,116,32,116,121,112, 101,41,'\n',9,9,123,32,97,115,109,32,123,32,48,120,57, 51,44,32,101,118,116,44,32,115,114,99,44,32,116,121,112, 101,125,59,32,125,'\n','\n','\n',9,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,67,108,101,97,114,69,118,101,110, 116,40,99,111,110,115,116,32,105,110,116,32,101,118,116,41, 9,123,32,97,115,109,32,123,32,48,120,57,51,44,32,101, 118,116,44,32,48,44,32,49,54,32,125,59,32,125,9,'\n', 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,67, 108,101,97,114,65,108,108,69,118,101,110,116,115,40,41,9, 123,32,97,115,109,32,123,32,48,120,48,54,32,125,59,32, 125,'\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,67,97,108,105,98,114,97,116,101,69,118,101,110,116,40, 99,111,110,115,116,32,105,110,116,32,101,118,116,44,32,99, 111,110,115,116,32,105,110,116,32,108,111,119,44,32,99,111, 110,115,116,32,105,110,116,32,104,105,44,32,99,111,110,115, 116,32,105,110,116,32,104,121,115,116,41,'\n',9,9,123,32, 97,115,109,32,123,32,48,120,48,52,44,32,101,118,116,44, 32,104,105,44,32,108,111,119,44,32,104,121,115,116,32,125, 59,32,125,'\n','\n','\n',9,35,100,101,102,105,110,101,32,69, 118,101,110,116,83,116,97,116,101,40,110,41,9,64,40,48, 120,49,57,48,48,48,48,32,43,32,40,110,41,41,'\n',9, 35,100,101,102,105,110,101,32,85,112,112,101,114,76,105,109, 105,116,40,110,41,9,64,40,48,120,49,99,48,48,48,48, 32,43,32,40,110,41,41,'\n',9,35,100,101,102,105,110,101, 32,76,111,119,101,114,76,105,109,105,116,40,110,41,9,64, 40,48,120,49,100,48,48,48,48,32,43,32,40,110,41,41, '\n',9,35,100,101,102,105,110,101,32,72,121,115,116,101,114, 101,115,105,115,40,110,41,9,64,40,48,120,49,101,48,48, 48,48,32,43,32,40,110,41,41,'\n',9,35,100,101,102,105, 110,101,32,67,108,105,99,107,84,105,109,101,40,110,41,9, 64,40,48,120,49,102,48,48,48,48,32,43,32,40,110,41, 41,'\n','\n','\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,85,112,112,101,114,76,105,109,105,116, 40,99,111,110,115,116,32,105,110,116,32,101,118,116,44,32, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,9,123, 32,83,101,116,40,85,112,112,101,114,76,105,109,105,116,40, 101,118,116,41,44,32,118,41,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,76,111, 119,101,114,76,105,109,105,116,40,99,111,110,115,116,32,105, 110,116,32,101,118,116,44,32,99,111,110,115,116,32,105,110, 116,32,38,118,41,32,9,123,32,83,101,116,40,76,111,119, 101,114,76,105,109,105,116,40,101,118,116,41,44,32,118,41, 59,32,125,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,72,121,115,116,101,114,101,115,105,115, 40,99,111,110,115,116,32,105,110,116,32,101,118,116,44,32, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,9,123, 32,83,101,116,40,72,121,115,116,101,114,101,115,105,115,40, 101,118,116,41,44,32,118,41,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,116,67,108, 105,99,107,84,105,109,101,40,99,111,110,115,116,32,105,110, 116,32,101,118,116,44,32,99,111,110,115,116,32,105,110,116, 32,38,118,41,32,9,9,123,32,83,101,116,40,67,108,105, 99,107,84,105,109,101,40,101,118,116,41,44,32,118,41,59, 32,125,'\n','\n','\n',9,35,105,102,32,95,95,82,67,88,61, 61,50,'\n',9,9,35,100,101,102,105,110,101,32,67,108,105, 99,107,67,111,117,110,116,101,114,40,110,41,9,64,40,48, 120,49,98,48,48,48,48,32,43,32,40,110,41,41,'\n',9, 9,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,67,108,105,99,107,67,111,117,110,116,101,114,40,99, 111,110,115,116,32,105,110,116,32,101,118,116,44,32,99,111, 110,115,116,32,105,110,116,32,38,118,41,32,9,123,32,83, 101,116,40,67,108,105,99,107,67,111,117,110,116,101,114,40, 101,118,116,41,44,32,118,41,59,32,125,'\n',9,35,101,110, 100,105,102,9,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105, 102,32,95,95,83,67,79,85,84,'\n',9,47,47,32,101,118, 101,110,116,32,99,111,100,101,115,'\n',9,35,100,101,102,105, 110,101,32,69,86,69,78,84,95,49,95,80,82,69,83,83, 69,68,9,9,40,49,32,60,60,32,48,41,'\n',9,35,100, 101,102,105,110,101,32,69,86,69,78,84,95,49,95,82,69, 76,69,65,83,69,68,9,40,49,32,60,60,32,49,41,'\n', 9,35,100,101,102,105,110,101,32,69,86,69,78,84,95,50, 95,80,82,69,83,83,69,68,9,9,40,49,32,60,60,32, 50,41,'\n',9,35,100,101,102,105,110,101,32,69,86,69,78, 84,95,50,95,82,69,76,69,65,83,69,68,9,40,49,32, 60,60,32,51,41,'\n',9,35,100,101,102,105,110,101,32,69, 86,69,78,84,95,76,73,71,72,84,95,72,73,71,72,9, 40,49,32,60,60,32,52,41,'\n',9,35,100,101,102,105,110, 101,32,69,86,69,78,84,95,76,73,71,72,84,95,78,79, 82,77,65,76,9,40,49,32,60,60,32,53,41,'\n',9,35, 100,101,102,105,110,101,32,69,86,69,78,84,95,76,73,71, 72,84,95,76,79,87,9,9,40,49,32,60,60,32,54,41, '\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84,95, 76,73,71,72,84,95,67,76,73,67,75,9,40,49,32,60, 60,32,55,41,'\n',9,35,100,101,102,105,110,101,32,69,86, 69,78,84,95,76,73,71,72,84,95,68,79,85,66,76,69, 67,76,73,67,75,9,40,49,32,60,60,32,56,41,'\n',9, 35,100,101,102,105,110,101,32,69,86,69,78,84,95,67,79, 85,78,84,69,82,95,48,9,9,40,49,32,60,60,32,57, 41,'\n',9,35,100,101,102,105,110,101,32,69,86,69,78,84, 95,67,79,85,78,84,69,82,95,49,9,9,40,49,32,60, 60,32,49,48,41,'\n',9,35,100,101,102,105,110,101,32,69, 86,69,78,84,95,84,73,77,69,82,95,48,9,9,40,49, 32,60,60,32,49,49,41,'\n',9,35,100,101,102,105,110,101, 32,69,86,69,78,84,95,84,73,77,69,82,95,49,9,9, 40,49,32,60,60,32,49,50,41,'\n',9,35,100,101,102,105, 110,101,32,69,86,69,78,84,95,84,73,77,69,82,95,50, 9,9,40,49,32,60,60,32,49,51,41,'\n',9,35,100,101, 102,105,110,101,32,69,86,69,78,84,95,77,69,83,83,65, 71,69,9,9,40,49,32,60,60,32,49,52,41,'\n',35,101, 110,100,105,102,'\n','\n','\n','\n','\n','\n','\n',47,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,'\n',32,42,32,71,101,110,101,114,97, 108,'\n',32,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,47,'\n','\n', '\n',47,47,32,119,97,105,116,32,102,111,114,32,97,32,99, 111,110,100,105,116,105,111,110,32,116,111,32,98,101,99,111, 109,101,32,116,114,117,101,'\n',35,100,101,102,105,110,101,32, 117,110,116,105,108,40,99,41,9,9,119,104,105,108,101,40, 33,40,99,41,41,'\n','\n','\n',47,47,32,115,108,101,101,112, 32,102,111,114,32,118,32,116,105,99,107,115,32,40,49,48, 109,115,32,112,101,114,32,116,105,99,107,41,'\n',95,95,110, 111,108,105,115,116,32,118,111,105,100,32,87,97,105,116,40, 99,111,110,115,116,32,105,110,116,32,38,118,41,9,123,32, 97,115,109,32,123,32,48,120,52,51,44,32,36,118,32,58, 32,95,95,65,83,77,95,83,82,67,95,69,88,84,125,59, 32,125,'\n','\n','\n',95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,116,111,112,65,108,108,84,97,115,107,115,40, 41,9,123,32,97,115,109,32,123,32,48,120,53,48,32,125, 59,32,125,'\n',95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,83,108,101,101,112,84,105,109,101,40,99, 111,110,115,116,32,105,110,116,32,116,41,9,123,32,97,115, 109,32,123,32,48,120,98,49,44,32,116,32,125,59,32,125, '\n',95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 108,101,101,112,78,111,119,40,41,32,123,32,97,115,109,32, 123,32,48,120,54,48,32,125,59,32,125,'\n','\n','\n','\n','\n', 35,105,102,32,100,101,102,105,110,101,100,40,95,95,82,67, 88,41,32,124,124,32,100,101,102,105,110,101,100,40,95,95, 83,67,79,85,84,41,'\n',9,47,47,32,83,99,111,117,116, 32,97,110,100,32,82,67,88,'\n',9,35,100,101,102,105,110, 101,32,84,88,95,80,79,87,69,82,95,76,79,9,48,'\n', 9,35,100,101,102,105,110,101,32,84,88,95,80,79,87,69, 82,95,72,73,9,49,'\n',9,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,84,120,80,111,119,101,114, 40,99,111,110,115,116,32,105,110,116,32,112,41,9,123,32, 97,115,109,32,123,32,48,120,51,49,44,32,112,32,125,59, 32,125,'\n',35,101,110,100,105,102,32,47,47,32,100,101,102, 105,110,101,100,40,95,95,82,67,88,41,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,67,79,85,84,41,'\n', '\n','\n','\n','\n',35,105,102,32,100,101,102,105,110,101,100,40, 95,95,82,67,88,41,'\n',9,47,47,32,82,67,88,32,111, 110,108,121,46,46,46,'\n',9,'\n',9,47,47,32,68,97,116, 97,32,108,111,103,103,105,110,103,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,67,114,101,97,116,101,68, 97,116,97,108,111,103,40,99,111,110,115,116,32,105,110,116, 32,115,105,122,101,41,32,123,32,97,115,109,32,123,32,48, 120,53,50,44,32,40,115,105,122,101,41,44,32,40,115,105, 122,101,41,62,62,56,32,125,59,32,125,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,65,100,100,84,111, 68,97,116,97,108,111,103,40,99,111,110,115,116,32,105,110, 116,32,38,118,41,9,123,32,97,115,109,32,123,32,48,120, 54,50,44,32,36,118,32,58,32,95,95,65,83,77,95,78, 79,95,76,79,67,65,76,32,43,32,95,95,65,83,77,95, 83,77,65,76,76,95,86,65,76,85,69,32,43,32,48,120, 48,48,52,50,48,51,125,59,32,125,'\n',9,95,95,110,111, 108,105,115,116,32,118,111,105,100,32,85,112,108,111,97,100, 68,97,116,97,108,111,103,40,99,111,110,115,116,32,105,110, 116,32,115,44,32,99,111,110,115,116,32,105,110,116,32,110, 41,32,123,32,97,115,109,32,123,32,48,120,97,52,44,32, 40,115,41,44,32,40,115,41,62,62,56,44,32,40,110,41, 44,32,40,110,41,62,62,56,32,125,59,32,125,'\n','\n','\n', 9,47,47,32,116,104,101,32,115,121,115,116,101,109,32,99, 108,111,99,107,'\n',9,35,100,101,102,105,110,101,32,87,97, 116,99,104,40,41,9,9,9,9,64,40,48,120,101,48,48, 48,48,41,9,47,47,32,114,101,97,100,32,116,104,101,32, 115,121,115,116,101,109,32,99,108,111,99,107,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,87, 97,116,99,104,40,99,111,110,115,116,32,105,110,116,32,104, 44,32,99,111,110,115,116,32,105,110,116,32,109,41,32,9, 123,32,97,115,109,32,123,32,48,120,50,50,44,32,104,44, 32,109,32,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n', '\n',35,105,102,32,100,101,102,105,110,101,100,40,95,95,83, 67,79,85,84,41,'\n',9,47,47,32,83,99,111,117,116,32, 45,32,115,112,101,99,105,97,108,32,102,117,110,99,116,105, 111,110,115,'\n',9,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,101,116,83,99,111,117,116,82,117,108,101,115, 40,99,111,110,115,116,32,105,110,116,32,109,44,32,99,111, 110,115,116,32,105,110,116,32,116,44,32,99,111,110,115,116, 32,105,110,116,32,108,44,32,99,111,110,115,116,32,105,110, 116,32,116,109,44,32,99,111,110,115,116,32,105,110,116,32, 102,120,41,'\n',9,9,123,32,97,115,109,32,123,32,48,120, 100,53,44,32,109,44,32,116,44,32,108,44,32,116,109,44, 32,102,120,32,125,59,32,125,'\n','\n','\n',9,35,100,101,102, 105,110,101,32,83,67,79,85,84,95,77,79,68,69,95,83, 84,65,78,68,65,76,79,78,69,9,48,'\n',9,35,100,101, 102,105,110,101,32,83,67,79,85,84,95,77,79,68,69,95, 80,79,87,69,82,32,9,9,49,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,83,99,111,117, 116,77,111,100,101,40,99,111,110,115,116,32,105,110,116,32, 115,41,9,9,9,123,32,97,115,109,32,123,32,48,120,52, 55,44,32,115,125,59,32,125,'\n',9,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,69,118,101,110,116, 70,101,101,100,98,97,99,107,40,99,111,110,115,116,32,105, 110,116,32,38,120,41,9,123,32,97,115,109,32,123,32,48, 120,56,51,44,32,36,120,32,58,32,95,95,65,83,77,95, 83,82,67,95,66,65,83,73,67,125,59,32,125,'\n',35,101, 110,100,105,102,'\n','\n','\n',35,105,102,32,100,101,102,105,110, 101,100,40,95,95,83,67,79,85,84,41,32,124,124,32,95, 95,82,67,88,61,61,50,32,124,124,32,100,101,102,105,110, 101,100,40,95,95,83,80,89,41,'\n',9,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,80,114,105,111, 114,105,116,121,40,99,111,110,115,116,32,105,110,116,32,112, 41,9,123,32,97,115,109,32,123,32,48,120,100,55,44,32, 112,32,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n', '\n','\n',35,105,102,32,95,95,82,67,88,61,61,50,32,124, 124,32,100,101,102,105,110,101,100,40,95,95,83,80,89,41, '\n',9,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,40,99,111,110,115,116,32,105,110,116,32,38,100, 115,116,44,32,99,111,110,115,116,32,105,110,116,32,38,115, 114,99,41,9,123,32,97,115,109,32,123,32,48,120,48,53, 44,32,36,100,115,116,32,58,32,95,95,65,83,77,95,83, 77,65,76,76,95,86,65,76,85,69,44,32,36,115,114,99, 32,125,59,32,125,'\n',35,101,110,100,105,102,'\n','\n','\n',35, 105,102,32,95,95,82,67,88,61,61,50,'\n',9,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,83,101,108,101,99, 116,80,114,111,103,114,97,109,40,99,111,110,115,116,32,105, 110,116,32,110,41,9,9,9,9,123,32,97,115,109,32,123, 32,48,120,57,49,44,32,110,32,125,59,32,125,'\n',35,101, 110,100,105,102,'\n','\n','\n','\n','\n',35,105,102,32,100,101,102, 105,110,101,100,40,95,95,83,67,79,85,84,41,32,124,124, 32,95,95,82,67,88,61,61,50,32,124,124,32,100,101,102, 105,110,101,100,40,95,95,83,80,89,41,'\n',9,47,47,32, 99,111,110,115,116,97,110,116,115,32,102,111,114,32,97,99, 113,117,105,114,101,40,41,'\n',9,35,100,101,102,105,110,101, 32,65,67,81,85,73,82,69,95,79,85,84,95,65,9,40, 49,32,60,60,32,48,41,'\n',9,35,100,101,102,105,110,101, 32,65,67,81,85,73,82,69,95,79,85,84,95,66,9,40, 49,32,60,60,32,49,41,'\n',9,35,100,101,102,105,110,101, 32,65,67,81,85,73,82,69,95,83,79,85,78,68,9,40, 49,32,60,60,32,50,41,'\n',9,35,100,101,102,105,110,101, 32,65,67,81,85,73,82,69,95,79,85,84,95,67,9,40, 49,32,60,60,32,51,41,'\n',35,101,110,100,105,102,'\n','\n', '\n',35,105,102,32,100,101,102,105,110,101,100,40,95,95,83, 80,89,41,'\n',9,35,100,101,102,105,110,101,32,65,67,81, 85,73,82,69,95,76,69,68,9,9,40,49,32,60,60,32, 52,41,'\n',35,101,110,100,105,102,'\n',9,'\n',35,105,102,32, 95,95,82,67,88,61,61,50,'\n',9,47,47,32,109,111,114, 101,32,99,111,110,115,116,97,110,116,115,32,102,111,114,32, 97,99,113,117,114,105,101,40,41,32,45,32,82,67,88,50, 32,111,110,108,121,'\n',9,35,100,101,102,105,110,101,32,65, 67,81,85,73,82,69,95,85,83,69,82,95,49,9,40,49, 32,60,60,32,52,41,'\n',9,35,100,101,102,105,110,101,32, 65,67,81,85,73,82,69,95,85,83,69,82,95,50,9,40, 49,32,60,60,32,53,41,'\n',9,35,100,101,102,105,110,101, 32,65,67,81,85,73,82,69,95,85,83,69,82,95,51,9, 40,49,32,60,60,32,54,41,'\n',9,35,100,101,102,105,110, 101,32,65,67,81,85,73,82,69,95,85,83,69,82,95,52, 9,40,49,32,60,60,32,55,41,'\n',35,101,110,100,105,102, '\n','\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, '\n',32,42,32,79,116,104,101,114,32,100,97,116,97,32,115, 111,117,114,99,101,115,'\n',32,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,47,'\n','\n','\n',35,100,101,102,105,110,101,32,82,97, 110,100,111,109,40,110,41,9,9,9,64,40,48,120,52,48, 48,48,48,32,43,32,40,110,41,41,9,47,47,32,97,32, 114,97,110,100,111,109,32,110,117,109,98,101,114,'\n',35,105, 102,32,95,95,82,67,88,61,61,50,32,124,124,32,100,101, 102,105,110,101,100,40,95,95,83,80,89,41,'\n',9,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,82, 97,110,100,111,109,83,101,101,100,40,99,111,110,115,116,32, 105,110,116,32,38,118,41,9,123,32,83,101,116,40,82,97, 110,100,111,109,40,48,41,44,32,118,41,59,32,125,'\n',35, 101,110,100,105,102,'\n','\n','\n','\n','\n',35,105,102,100,101,102, 32,95,95,82,67,88,'\n',9,47,47,32,82,67,88,32,115, 112,101,99,105,102,105,99,32,100,97,116,97,32,115,111,117, 114,99,101,115,'\n',9,35,100,101,102,105,110,101,32,80,114, 111,103,114,97,109,40,41,32,32,32,9,9,64,40,48,120, 56,48,48,48,48,41,9,47,47,32,99,117,114,114,101,110, 116,108,121,32,97,99,116,105,118,101,32,112,114,111,103,114, 97,109,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,100, 101,102,32,95,95,67,77,'\n',9,47,47,32,67,77,32,115, 112,101,99,105,102,105,99,32,100,97,116,97,32,115,111,117, 114,99,101,115,'\n',9,35,100,101,102,105,110,101,32,65,71, 67,40,41,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,32,32,32,64,40,48,120,49,48,48,48,48,48,41, 32,32,32,32,32,32,32,32,47,47,32,65,117,116,111,109, 97,116,105,99,32,71,97,105,110,32,67,111,110,116,114,111, 108,'\n',35,101,110,100,105,102,'\n','\n','\n',35,105,102,32,100, 101,102,105,110,101,100,40,95,95,83,67,79,85,84,41,'\n', 9,35,100,101,102,105,110,101,32,83,99,111,117,116,82,117, 108,101,115,40,110,41,9,64,40,48,120,49,50,48,48,48, 48,32,43,32,40,110,41,41,'\n',9,35,100,101,102,105,110, 101,32,84,105,109,101,114,76,105,109,105,116,40,110,41,9, 64,40,48,120,49,52,48,48,48,48,32,43,32,40,110,41, 41,'\n',9,35,100,101,102,105,110,101,32,67,111,117,110,116, 101,114,76,105,109,105,116,40,110,41,9,64,40,48,120,49, 54,48,48,48,48,32,43,32,40,110,41,41,'\n',9,35,100, 101,102,105,110,101,32,69,118,101,110,116,70,101,101,100,98, 97,99,107,40,41,9,64,40,48,120,49,56,48,48,48,48, 41,'\n',35,101,110,100,105,102,'\n','\n','\n','\n','\n','\n','\n',35, 105,102,32,95,95,82,67,88,61,61,50,32,124,124,32,100, 101,102,105,110,101,100,40,95,95,83,80,89,41,'\n',9,35, 100,101,102,105,110,101,32,66,97,116,116,101,114,121,76,101, 118,101,108,40,41,9,64,40,48,120,50,50,48,48,48,48, 41,'\n',9,35,100,101,102,105,110,101,32,70,105,114,109,119, 97,114,101,86,101,114,115,105,111,110,40,41,9,64,40,48, 120,50,51,48,48,48,48,41,'\n',35,101,110,100,105,102,'\n', '\n','\n','\n','\n',47,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,'\n', 32,42,32,68,101,102,97,117,108,116,32,105,110,105,116,105, 97,108,105,122,97,116,105,111,110,'\n',32,42,42,42,42,42, 42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42, 42,42,42,42,42,47,'\n','\n','\n',95,95,110,111,108,105,115, 116,32,118,111,105,100,32,95,105,110,105,116,40,41,'\n',123, '\n',9,83,101,116,80,111,119,101,114,40,79,85,84,95,65, 32,43,32,79,85,84,95,66,32,43,32,79,85,84,95,67, 44,32,79,85,84,95,70,85,76,76,41,59,'\n',9,70,119, 100,40,79,85,84,95,65,32,43,32,79,85,84,95,66,32, 43,32,79,85,84,95,67,41,59,'\n',125,'\n','\n','\n','\n','\n', '\n','\n',35,105,102,100,101,102,32,95,95,83,67,79,85,84, 95,67,79,77,80,65,84,'\n',9,47,42,'\n',9,32,42,32, 83,99,111,117,116,32,115,117,112,112,111,114,116,32,119,97, 115,32,105,110,105,116,105,97,108,108,121,32,114,101,108,101, 97,115,101,100,32,119,105,116,104,32,112,114,101,108,105,109, 105,110,97,114,121,32,65,80,73,115,32,116,104,97,116,32, '\n',9,32,42,32,119,101,114,101,32,115,116,121,108,101,100, 32,97,102,116,101,114,32,116,104,101,32,76,65,83,77,32, 109,110,101,109,111,110,105,99,115,46,32,32,85,110,102,111, 114,116,117,110,97,116,101,108,121,44,32,116,104,101,115,101, 32,109,110,101,109,111,110,105,99,115,'\n',9,32,42,32,108, 101,100,32,116,111,32,115,111,109,101,32,114,97,116,104,101, 114,32,105,110,99,111,110,115,105,115,116,101,110,116,32,65, 80,73,115,46,32,32,73,110,32,111,114,100,101,114,32,116, 111,32,97,108,105,103,110,32,116,104,101,32,83,99,111,117, 116,'\n',9,32,42,32,65,80,73,32,119,105,116,104,32,116, 104,101,32,82,67,88,32,50,46,48,32,65,80,73,32,97, 32,110,117,109,98,101,114,32,111,102,32,99,97,108,108,115, 32,104,97,118,101,32,98,101,101,110,32,99,104,97,110,103, 101,100,46,32,32,84,104,101,'\n',9,32,42,32,111,102,102, 105,99,105,97,108,32,99,97,108,108,115,32,97,112,112,101, 97,114,32,105,110,32,116,104,101,32,118,97,114,105,111,117, 115,32,115,101,99,116,105,111,110,115,32,97,98,111,118,101, 46,32,32,84,104,101,32,115,101,99,116,105,111,110,'\n',9, 32,42,32,98,101,108,111,119,32,105,115,32,97,32,116,101, 109,112,111,114,97,114,121,32,104,97,99,107,32,116,111,32, 101,97,115,101,32,116,104,101,32,116,114,97,110,115,105,116, 105,111,110,32,98,101,116,119,101,101,110,32,116,104,101,32, 111,108,100,'\n',9,32,42,32,97,110,100,32,110,101,119,32, 83,99,111,117,116,32,65,80,73,115,46,32,32,65,108,108, 32,111,102,32,111,108,100,32,99,97,108,108,115,32,116,104, 97,116,32,119,101,114,101,32,100,114,111,112,112,101,100,32, 40,111,114,32,99,104,97,110,103,101,100,41,'\n',9,32,42, 32,105,110,32,116,104,101,32,110,101,119,32,65,80,73,32, 97,112,112,101,97,114,32,98,101,108,111,119,44,32,98,117, 116,32,119,105,116,104,32,97,32,112,114,101,99,101,100,105, 110,103,32,117,110,100,101,114,115,99,111,114,101,46,32,32, 70,111,114,'\n',9,32,42,32,101,120,97,109,112,108,101,44, 32,116,104,101,32,111,108,100,32,71,83,101,116,79,117,116, 112,117,116,40,41,32,99,97,108,108,32,110,111,119,32,97, 112,112,101,97,114,115,32,97,115,32,95,71,83,101,116,79, 117,116,112,117,116,40,41,46,'\n',9,32,42,32,73,102,32, 121,111,117,32,97,114,101,32,105,110,32,97,32,104,117,114, 114,121,32,116,111,32,103,101,116,32,121,111,117,114,32,111, 108,100,32,83,99,111,117,116,32,112,114,111,103,114,97,109, 32,119,111,114,107,105,110,103,44,32,121,111,117,'\n',9,32, 42,32,99,97,110,32,106,117,115,116,32,112,114,101,112,101, 110,100,32,117,110,100,101,114,115,99,111,114,101,115,32,116, 111,32,116,104,101,32,118,97,114,105,111,117,115,32,111,98, 115,111,108,101,116,101,32,99,97,108,108,115,46,32,32,72, 111,119,101,118,101,114,44,'\n',9,32,42,32,97,32,108,111, 110,103,101,114,32,116,101,114,109,32,102,105,120,32,105,115, 32,116,111,32,117,115,101,32,116,104,101,32,110,101,119,32, 65,80,73,115,32,97,98,111,118,101,46,32,'\n',9,32,42, 47,'\n','\n','\n',9,47,47,32,103,108,111,98,97,108,32,111, 117,116,112,117,116,32,102,117,110,99,116,105,111,110,115,'\n', 9,118,111,105,100,32,95,71,83,101,116,79,117,116,112,117, 116,40,99,111,110,115,116,32,105,110,116,32,111,44,32,99, 111,110,115,116,32,105,110,116,32,109,41,9,123,32,97,115, 109,32,123,32,48,120,54,55,44,32,40,111,41,32,43,32, 40,109,41,32,125,59,32,125,'\n',9,118,111,105,100,32,95, 71,83,101,116,68,105,114,101,99,116,105,111,110,40,99,111, 110,115,116,32,105,110,116,32,111,44,32,99,111,110,115,116, 32,105,110,116,32,100,41,9,123,32,97,115,109,32,123,32, 48,120,55,55,44,32,40,111,41,32,43,32,40,100,41,32, 125,59,32,125,'\n',9,118,111,105,100,32,95,71,83,101,116, 80,111,119,101,114,40,99,111,110,115,116,32,105,110,116,32, 111,44,32,99,111,110,115,116,32,105,110,116,32,38,112,41, 9,123,32,97,115,109,32,123,32,48,120,97,51,44,32,40, 111,41,44,32,36,112,32,58,32,48,120,49,48,48,48,48, 49,53,125,59,32,125,'\n',9,118,111,105,100,32,95,71,79, 110,40,99,111,110,115,116,32,105,110,116,32,111,41,9,123, 32,95,71,83,101,116,79,117,116,112,117,116,40,111,44,32, 79,85,84,95,79,78,41,59,32,125,'\n',9,118,111,105,100, 32,95,71,79,102,102,40,99,111,110,115,116,32,105,110,116, 32,111,41,9,123,32,95,71,83,101,116,79,117,116,112,117, 116,40,111,44,32,79,85,84,95,79,70,70,41,59,32,125, '\n',9,118,111,105,100,32,95,71,70,108,111,97,116,40,99, 111,110,115,116,32,105,110,116,32,111,41,32,123,32,95,71, 83,101,116,79,117,116,112,117,116,40,111,44,32,79,85,84, 95,70,76,79,65,84,41,59,32,125,'\n',9,118,111,105,100, 32,95,71,84,111,103,103,108,101,40,99,111,110,115,116,32, 105,110,116,32,111,41,32,123,32,95,71,83,101,116,68,105, 114,101,99,116,105,111,110,40,111,44,32,79,85,84,95,84, 79,71,71,76,69,41,59,32,125,'\n',9,118,111,105,100,32, 95,71,70,119,100,40,99,111,110,115,116,32,105,110,116,32, 111,41,9,123,32,95,71,83,101,116,68,105,114,101,99,116, 105,111,110,40,111,44,32,79,85,84,95,70,87,68,41,59, 32,125,'\n',9,118,111,105,100,32,95,71,82,101,118,40,99, 111,110,115,116,32,105,110,116,32,111,41,9,123,32,95,71, 83,101,116,68,105,114,101,99,116,105,111,110,40,111,44,32, 79,85,84,95,82,69,86,41,59,32,125,'\n',9,118,111,105, 100,32,95,71,79,110,70,119,100,40,99,111,110,115,116,32, 105,110,116,32,111,41,9,123,32,95,71,70,119,100,40,111, 41,59,32,71,79,110,40,111,41,59,32,125,'\n',9,118,111, 105,100,32,95,71,79,110,82,101,118,40,99,111,110,115,116, 32,105,110,116,32,111,41,9,123,32,95,71,82,101,118,40, 111,41,59,32,71,79,110,40,111,41,59,32,125,'\n',9,118, 111,105,100,32,95,71,79,110,70,111,114,40,99,111,110,115, 116,32,105,110,116,32,111,44,32,99,111,110,115,116,32,105, 110,116,32,38,116,41,9,123,32,71,79,110,40,111,41,59, 32,87,97,105,116,40,116,41,59,32,71,79,102,102,40,111, 41,59,32,125,'\n','\n','\n',9,118,111,105,100,32,95,87,97, 105,116,69,118,101,110,116,115,40,99,111,110,115,116,32,105, 110,116,32,38,109,97,115,107,41,32,123,32,97,115,109,32, 123,32,48,120,98,52,44,32,36,109,97,115,107,32,58,32, 95,95,65,83,77,95,83,82,67,95,69,88,84,44,32,51, 44,32,48,120,50,55,44,32,48,120,56,49,32,125,59,32, 125,32,47,47,32,117,115,101,32,109,111,110,105,116,111,114, 40,41,'\n','\n','\n','\n','\n',9,47,47,32,108,105,103,104,116, 32,115,101,110,115,111,114,'\n',9,118,111,105,100,32,95,76, 83,66,108,105,110,107,40,99,111,110,115,116,32,105,110,116, 32,38,120,41,9,123,32,97,115,109,32,123,32,48,120,101, 51,44,32,36,120,32,58,32,48,120,48,48,48,53,32,125, 59,32,125,9,47,47,32,117,115,101,32,83,101,116,83,101, 110,115,111,114,66,108,105,110,107,'\n',9,118,111,105,100,32, 95,76,83,67,97,108,40,41,9,9,9,9,123,32,97,115, 109,32,123,32,48,120,99,48,32,125,59,32,125,9,47,47, 32,117,115,101,32,67,97,108,105,98,114,97,116,101,83,101, 110,115,111,114,'\n',9,118,111,105,100,32,95,76,83,72,121, 115,116,40,99,111,110,115,116,32,105,110,116,32,38,120,41, 9,123,32,97,115,109,32,123,32,48,120,100,51,44,32,36, 120,32,58,32,48,120,48,48,48,53,32,125,59,32,125,9, 47,47,32,117,115,101,32,83,101,116,83,101,110,115,111,114, 72,121,115,116,'\n',9,118,111,105,100,32,95,76,83,76,111, 119,101,114,40,99,111,110,115,116,32,105,110,116,32,38,120, 41,9,123,32,97,115,109,32,123,32,48,120,99,51,44,32, 36,120,32,58,32,48,120,48,48,48,53,32,125,59,32,125, 9,47,47,32,117,115,101,32,83,101,116,83,101,110,115,111, 114,76,111,119,101,114,'\n',9,118,111,105,100,32,95,76,83, 85,112,112,101,114,40,99,111,110,115,116,32,105,110,116,32, 38,120,41,9,123,32,97,115,109,32,123,32,48,120,98,51, 44,32,36,120,32,58,32,48,120,48,48,48,53,32,125,59, 32,125,9,47,47,32,117,115,101,32,83,101,116,83,101,110, 115,111,114,85,112,112,101,114,'\n','\n','\n',9,47,47,32,111, 116,104,101,114,'\n',9,118,111,105,100,32,95,82,117,108,101, 115,40,99,111,110,115,116,32,105,110,116,32,109,44,32,99, 111,110,115,116,32,105,110,116,32,116,44,32,99,111,110,115, 116,32,105,110,116,32,108,44,32,99,111,110,115,116,32,105, 110,116,32,116,109,44,32,99,111,110,115,116,32,105,110,116, 32,102,120,41,'\n',9,9,123,32,97,115,109,32,123,32,48, 120,100,53,44,32,109,44,32,116,44,32,108,44,32,116,109, 44,32,102,120,32,125,59,32,125,32,47,47,32,115,101,101, 32,83,101,116,83,99,111,117,116,82,117,108,101,115,'\n',9, 118,111,105,100,32,95,83,99,111,117,116,40,99,111,110,115, 116,32,105,110,116,32,115,41,9,9,9,123,32,97,115,109, 32,123,32,48,120,52,55,44,32,115,125,59,32,125,32,47, 47,32,83,101,116,83,99,111,117,116,77,111,100,101,'\n',9, 118,111,105,100,32,95,83,101,116,70,101,101,100,98,97,99, 107,40,99,111,110,115,116,32,105,110,116,32,38,120,41,9, 123,32,97,115,109,32,123,32,48,120,56,51,44,32,36,120, 32,58,32,48,120,48,48,48,53,125,59,32,125,32,47,47, 32,83,101,116,69,118,101,110,116,70,101,101,100,98,97,99, 107,'\n',9,'\n',9,118,111,105,100,32,95,83,111,117,110,100, 40,99,111,110,115,116,32,105,110,116,32,120,41,9,9,9, 123,32,97,115,109,32,123,32,48,120,53,55,44,32,120,32, 125,59,32,125,9,47,47,32,117,115,101,32,77,117,116,101, 83,111,117,110,100,44,32,85,110,109,117,116,101,83,111,117, 110,100,32,97,110,100,32,83,101,108,101,99,116,83,111,117, 110,100,115,'\n','\n','\n',9,118,111,105,100,32,95,86,76,76, 40,99,111,110,115,116,32,105,110,116,32,38,120,41,9,9, 123,32,97,115,109,32,123,32,48,120,101,50,44,32,36,120, 32,58,32,48,120,49,48,48,48,48,48,53,125,59,32,125, 9,47,47,32,117,115,101,32,83,101,110,100,86,76,76,'\n', 9,118,111,105,100,32,95,82,84,83,40,41,9,9,9,9, 9,123,32,97,115,109,32,123,32,48,120,102,54,32,125,59, 32,125,9,47,47,32,100,111,110,39,116,32,101,118,101,114, 32,110,101,101,100,32,116,104,105,115,'\n','\n','\n',9,47,47, 32,117,115,101,32,116,104,101,115,101,32,102,111,114,32,99, 97,108,108,105,110,103,32,115,117,98,114,111,117,116,105,110, 101,115,46,46,46,102,111,114,32,101,120,97,109,112,108,101, 58,'\n',9,47,47,'\n',9,47,47,32,108,111,99,97,108,40, 48,41,32,61,32,49,59,'\n',9,47,47,32,67,97,108,108, 40,51,41,59,'\n',9,47,47,'\n',9,35,100,101,102,105,110, 101,32,108,111,99,97,108,40,110,41,9,9,9,40,64,40, 40,110,41,32,43,32,49,48,41,41,'\n',9,118,111,105,100, 32,67,97,108,108,40,99,111,110,115,116,32,105,110,116,32, 110,41,9,9,123,32,97,115,109,32,123,32,48,120,49,55, 44,32,110,32,125,59,32,125,'\n',35,101,110,100,105,102,32, 47,47,32,95,95,83,67,79,85,84,'\n','\n',35,105,102,32, 95,95,82,67,88,61,61,50,32,124,124,32,100,101,102,105, 110,101,100,40,95,95,83,80,89,41,'\n',32,32,35,100,101, 102,105,110,101,32,73,110,100,105,114,101,99,116,40,110,41, 32,64,40,48,120,50,52,48,48,48,48,32,43,32,40,110, 41,41,32,47,47,32,105,110,100,105,114,101,99,116,32,118, 97,114,105,97,98,108,101,32,114,101,103,105,115,116,101,114, 115,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,83,101,116,73,110,100,105,114,101,99,116,86,97,114, 40,99,111,110,115,116,32,105,110,116,32,38,118,44,32,99, 111,110,115,116,32,105,110,116,32,38,110,41,'\n',32,32,123, 32,97,115,109,32,123,32,48,120,48,53,44,32,48,120,50, 52,44,32,36,118,32,58,32,48,120,51,48,48,48,48,48, 49,44,32,36,110,32,125,59,32,125,'\n',35,101,110,100,105, 102,'\n','\n',35,105,102,32,100,101,102,105,110,101,100,40,95, 95,83,80,89,41,'\n','\n',32,32,47,47,32,76,69,68,39, 115,32,109,97,121,32,98,101,32,115,101,116,47,99,104,101, 99,107,101,100,32,109,97,110,117,97,108,108,121,'\n',32,32, 35,100,101,102,105,110,101,32,76,69,68,40,110,41,9,9, 9,64,40,48,120,49,54,48,48,48,48,32,43,32,40,110, 41,41,9,47,47,32,76,69,68,32,99,111,110,116,114,111, 108,32,114,101,103,105,115,116,101,114,115,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,116,76, 69,68,40,99,111,110,115,116,32,105,110,116,32,109,111,100, 101,44,32,99,111,110,115,116,32,105,110,116,32,38,118,41, 32,9,123,32,83,101,116,40,76,69,68,40,109,111,100,101, 41,44,32,118,41,59,32,125,'\n','\n',32,32,47,47,32,99, 111,110,115,116,97,110,116,115,32,102,111,114,32,116,104,101, 32,109,111,100,101,32,97,114,103,117,109,101,110,116,32,105, 110,32,83,101,116,76,69,68,40,41,'\n',32,32,47,47,32, 99,111,110,115,116,97,110,116,115,32,102,111,114,32,116,104, 101,32,109,111,100,101,32,97,114,103,117,109,101,110,116,32, 105,110,32,83,101,116,76,69,68,40,41,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,79, 78,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, 32,32,48,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,77,79,68,69,95,66,76,73,78,75,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,49,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,68, 85,82,65,84,73,79,78,32,32,32,32,32,32,32,32,32, 32,32,50,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,77,79,68,69,95,83,67,65,76,69,32,32,32,32, 32,32,32,32,32,32,32,32,32,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,83, 67,65,76,69,95,66,76,73,78,75,32,32,32,32,32,32, 32,32,52,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,77,79,68,69,95,83,67,65,76,69,95,68,85,82, 65,84,73,79,78,32,32,32,32,32,53,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,82, 69,68,95,83,67,65,76,69,32,32,32,32,32,32,32,32, 32,32,54,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,77,79,68,69,95,82,69,68,95,83,67,65,76,69, 95,66,76,73,78,75,32,32,32,32,55,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,71, 82,69,69,78,95,83,67,65,76,69,32,32,32,32,32,32, 32,32,56,'\n',32,32,35,100,101,102,105,110,101,32,76,69, 68,95,77,79,68,69,95,71,82,69,69,78,95,83,67,65, 76,69,95,66,76,73,78,75,32,32,57,'\n',32,32,35,100, 101,102,105,110,101,32,76,69,68,95,77,79,68,69,95,89, 69,76,76,79,87,32,32,32,32,32,32,32,32,32,32,32, 32,32,49,48,'\n',32,32,35,100,101,102,105,110,101,32,76, 69,68,95,77,79,68,69,95,89,69,76,76,79,87,95,66, 76,73,78,75,32,32,32,32,32,32,32,49,49,'\n',32,32, 35,100,101,102,105,110,101,32,76,69,68,95,77,79,68,69, 95,89,69,76,76,79,87,95,68,85,82,65,84,73,79,78, 32,32,32,32,49,50,'\n',32,32,35,100,101,102,105,110,101, 32,76,69,68,95,77,79,68,69,95,86,76,76,32,32,32, 32,32,32,32,32,32,32,32,32,32,32,32,32,49,51,'\n', 32,32,35,100,101,102,105,110,101,32,76,69,68,95,77,79, 68,69,95,86,76,76,95,66,76,73,78,75,32,32,32,32, 32,32,32,32,32,32,49,52,'\n',32,32,35,100,101,102,105, 110,101,32,76,69,68,95,77,79,68,69,95,86,76,76,95, 68,85,82,65,84,73,79,78,32,32,32,32,32,32,32,49, 53,'\n','\n',32,32,47,47,32,82,79,77,32,97,110,105,109, 97,116,105,111,110,115,32,40,102,111,114,32,116,104,101,32, 102,114,111,110,116,32,76,69,68,115,41,'\n',32,32,35,100, 101,102,105,110,101,32,65,78,73,77,65,84,73,79,78,95, 83,67,65,78,32,32,32,32,32,32,32,32,32,32,48,'\n', 32,32,35,100,101,102,105,110,101,32,65,78,73,77,65,84, 73,79,78,95,83,80,65,82,75,76,69,32,32,32,32,32, 32,32,49,'\n',32,32,35,100,101,102,105,110,101,32,65,78, 73,77,65,84,73,79,78,95,70,76,65,83,72,32,32,32, 32,32,32,32,32,32,50,'\n',32,32,35,100,101,102,105,110, 101,32,65,78,73,77,65,84,73,79,78,95,82,69,68,95, 84,79,95,71,82,69,69,78,32,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,65,78,73,77,65,84,73,79,78,95, 71,82,69,69,78,95,84,79,95,82,69,68,32,32,52,'\n', 32,32,35,100,101,102,105,110,101,32,65,78,73,77,65,84, 73,79,78,95,80,79,73,78,84,95,70,79,82,87,65,82, 68,32,53,'\n',32,32,35,100,101,102,105,110,101,32,65,78, 73,77,65,84,73,79,78,95,65,76,65,82,77,32,32,32, 32,32,32,32,32,32,54,'\n',32,32,35,100,101,102,105,110, 101,32,65,78,73,77,65,84,73,79,78,95,84,72,73,78, 75,73,78,71,32,32,32,32,32,32,55,'\n','\n',32,32,47, 47,32,109,97,99,114,111,32,102,111,114,32,100,101,102,105, 110,105,110,103,32,97,32,117,115,101,114,32,97,110,105,109, 97,116,105,111,110,58,'\n',32,32,47,47,9,65,78,73,77, 65,84,73,79,78,32,109,121,95,97,110,105,109,97,116,105, 111,110,32,123,32,49,44,32,49,48,44,32,50,44,32,49, 48,44,32,52,44,32,49,48,44,32,50,44,32,49,48,44, 32,50,53,53,44,32,50,53,53,32,125,59,'\n',32,32,47, 47,'\n',32,32,35,100,101,102,105,110,101,32,65,78,73,77, 65,84,73,79,78,32,95,95,114,101,115,32,51,'\n','\n',32, 32,47,47,32,102,117,110,99,116,105,111,110,32,116,111,32, 115,116,97,114,116,32,97,32,103,105,118,101,110,32,97,110, 105,109,97,116,105,111,110,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,101,116,65,110,105,109,97, 116,105,111,110,40,99,111,110,115,116,32,105,110,116,32,116, 41,9,123,32,97,115,109,32,123,32,48,120,99,55,44,32, 116,32,125,59,32,125,'\n','\n',32,32,35,100,101,102,105,110, 101,32,65,110,105,109,97,116,101,76,69,68,40,102,44,32, 116,41,32,102,44,32,116,'\n',32,32,35,100,101,102,105,110, 101,32,82,101,112,101,97,116,65,110,105,109,97,116,105,111, 110,40,41,32,48,120,70,70,44,32,48,'\n','\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,69,70,70,69, 67,84,32,95,95,114,101,115,32,50,'\n','\n',32,32,35,100, 101,102,105,110,101,32,71,97,116,101,40,111,44,32,112,41, 32,48,120,54,50,44,32,112,44,32,111,'\n',32,32,35,100, 101,102,105,110,101,32,71,97,116,101,79,102,102,40,41,32, 48,120,55,48,'\n',32,32,35,100,101,102,105,110,101,32,71, 108,105,100,101,40,115,44,32,112,44,32,116,41,32,48,120, 52,53,44,32,116,44,32,115,32,38,32,48,120,70,70,44, 32,115,32,62,62,32,56,44,32,112,32,38,32,48,120,70, 70,44,32,112,32,62,62,32,56,'\n',32,32,35,100,101,102, 105,110,101,32,86,105,98,114,97,116,111,40,115,44,32,112, 44,32,116,41,32,48,120,53,53,44,32,116,44,32,115,32, 38,32,48,120,70,70,44,32,115,32,62,62,32,56,44,32, 112,32,38,32,48,120,70,70,44,32,112,32,62,62,32,56, '\n',32,32,35,100,101,102,105,110,101,32,87,97,105,116,69, 102,102,101,99,116,40,116,41,32,48,120,50,49,44,32,116, '\n',32,32,35,100,101,102,105,110,101,32,70,105,120,101,100, 87,97,105,116,69,102,102,101,99,116,40,116,41,32,48,120, 56,49,44,32,116,'\n',32,32,35,100,101,102,105,110,101,32, 84,111,110,101,40,102,44,32,116,41,32,48,120,51,51,44, 32,116,44,32,102,32,38,32,48,120,70,70,44,32,102,32, 62,62,32,56,'\n',32,32,35,100,101,102,105,110,101,32,70, 105,120,101,100,84,111,110,101,40,102,44,32,116,41,32,48, 120,57,51,44,32,116,44,32,102,32,38,32,48,120,70,70, 44,32,102,32,62,62,32,56,'\n',32,32,35,100,101,102,105, 110,101,32,82,101,112,101,97,116,69,102,102,101,99,116,40, 41,32,48,120,49,48,'\n','\n',32,32,35,100,101,102,105,110, 101,32,69,102,102,101,99,116,83,111,117,110,100,40,41,32, 64,40,48,120,51,53,48,48,48,48,41,32,47,47,32,83, 111,117,110,100,32,69,102,102,101,99,116,115,32,99,111,110, 116,114,111,108,32,114,101,103,105,115,116,101,114,115,32,40, 48,44,49,41,'\n',32,32,35,100,101,102,105,110,101,32,69, 102,102,101,99,116,84,105,109,101,40,41,32,64,40,48,120, 51,53,48,48,48,49,41,'\n','\n',32,32,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,69,102,102,101, 99,116,83,111,117,110,100,40,99,111,110,115,116,32,105,110, 116,32,38,115,41,32,123,32,83,101,116,40,69,102,102,101, 99,116,83,111,117,110,100,40,41,44,32,115,41,59,32,125, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,83,101,116,69,102,102,101,99,116,84,105,109,101,40,99, 111,110,115,116,32,105,110,116,32,38,116,41,32,123,32,83, 101,116,40,69,102,102,101,99,116,84,105,109,101,40,41,44, 32,116,41,59,32,125,'\n','\n',32,32,35,100,101,102,105,110, 101,32,84,65,82,71,69,84,95,78,79,78,69,32,50,53, 53,'\n',32,32,35,100,101,102,105,110,101,32,73,68,95,78, 79,78,69,9,61,32,48,'\n','\n',32,32,35,100,101,102,105, 110,101,32,73,68,95,67,84,82,76,49,32,49,'\n',32,32, 35,100,101,102,105,110,101,32,73,68,95,67,84,82,76,50, 32,50,'\n',32,32,35,100,101,102,105,110,101,32,73,68,95, 67,84,82,76,51,32,51,'\n',32,32,35,100,101,102,105,110, 101,32,73,68,95,67,84,82,76,52,32,52,'\n',32,32,35, 100,101,102,105,110,101,32,73,68,95,67,84,82,76,53,32, 53,'\n',32,32,35,100,101,102,105,110,101,32,73,68,95,67, 84,82,76,54,32,54,'\n',32,32,35,100,101,102,105,110,101, 32,73,68,95,80,67,32,32,32,32,55,'\n',32,32,35,100, 101,102,105,110,101,32,73,68,95,66,79,84,95,77,73,78, 32,56,'\n',32,32,35,100,101,102,105,110,101,32,73,68,95, 66,79,84,95,77,65,88,32,50,53,53,'\n','\n',32,32,35, 100,101,102,105,110,101,32,82,65,78,71,69,95,78,79,87, 72,69,82,69,32,32,48,'\n',32,32,35,100,101,102,105,110, 101,32,82,65,78,71,69,95,65,78,89,87,72,69,82,69, 32,49,'\n',32,32,35,100,101,102,105,110,101,32,82,65,78, 71,69,95,84,72,69,82,69,32,32,32,32,50,'\n',32,32, 35,100,101,102,105,110,101,32,82,65,78,71,69,95,72,69, 82,69,32,32,32,32,32,51,'\n','\n',32,32,35,100,101,102, 105,110,101,32,68,73,82,69,67,84,73,79,78,95,76,69, 70,84,32,32,32,32,32,32,32,32,32,32,32,32,48,'\n', 32,32,35,100,101,102,105,110,101,32,68,73,82,69,67,84, 73,79,78,95,76,69,70,84,95,79,70,95,67,69,78,84, 69,82,32,32,49,'\n',32,32,35,100,101,102,105,110,101,32, 68,73,82,69,67,84,73,79,78,95,67,69,78,84,69,82, 32,32,32,32,32,32,32,32,32,32,50,'\n',32,32,35,100, 101,102,105,110,101,32,68,73,82,69,67,84,73,79,78,95, 82,73,71,72,84,95,79,70,95,67,69,78,84,69,82,32, 51,'\n',32,32,35,100,101,102,105,110,101,32,68,73,82,69, 67,84,73,79,78,95,82,73,71,72,84,32,32,32,32,32, 32,32,32,32,32,32,52,'\n','\n',32,32,35,100,101,102,105, 110,101,32,65,83,80,69,67,84,95,70,82,79,78,84,95, 76,69,70,84,32,32,48,'\n',32,32,35,100,101,102,105,110, 101,32,65,83,80,69,67,84,95,70,82,79,78,84,32,32, 32,32,32,32,32,49,'\n',32,32,35,100,101,102,105,110,101, 32,65,83,80,69,67,84,95,70,82,79,78,84,95,82,73, 71,72,84,32,50,'\n',32,32,35,100,101,102,105,110,101,32, 65,83,80,69,67,84,95,66,65,67,75,95,82,73,71,72, 84,32,32,51,'\n',32,32,35,100,101,102,105,110,101,32,65, 83,80,69,67,84,95,66,65,67,75,32,32,32,32,32,32, 32,32,52,'\n',32,32,35,100,101,102,105,110,101,32,65,83, 80,69,67,84,95,66,65,67,75,95,76,69,70,84,32,32, 32,53,'\n','\n',32,32,35,100,101,102,105,110,101,32,83,80, 89,95,84,65,82,71,69,84,73,68,32,32,48,'\n',32,32, 35,100,101,102,105,110,101,32,83,80,89,95,78,79,84,69, 32,32,32,32,32,32,49,'\n',32,32,35,100,101,102,105,110, 101,32,83,80,89,95,76,73,78,75,73,68,32,32,32,32, 50,'\n',32,32,35,100,101,102,105,110,101,32,83,80,89,95, 82,65,78,71,69,32,32,32,32,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,83,80,89,95,68,73,82,69,67,84, 73,79,78,32,52,'\n',32,32,35,100,101,102,105,110,101,32, 83,80,89,95,65,83,80,69,67,84,32,32,32,32,53,'\n', 32,32,35,100,101,102,105,110,101,32,83,80,89,95,73,78, 70,79,32,32,32,32,32,32,54,'\n',32,32,35,100,101,102, 105,110,101,32,83,80,89,95,83,72,79,82,84,73,68,32, 32,32,55,'\n','\n',32,32,35,100,101,102,105,110,101,32,82, 69,76,95,71,84,32,48,'\n',32,32,35,100,101,102,105,110, 101,32,82,69,76,95,76,84,32,49,'\n',32,32,35,100,101, 102,105,110,101,32,82,69,76,95,69,81,32,50,'\n',32,32, 35,100,101,102,105,110,101,32,82,69,76,95,78,69,32,51, '\n','\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105, 100,32,70,105,110,100,87,111,114,108,100,40,105,110,116,32, 38,118,44,32,99,111,110,115,116,32,105,110,116,32,114,101, 108,115,114,99,44,32,99,111,110,115,116,32,105,110,116,32, 99,114,105,116,44,32,99,111,110,115,116,32,105,110,116,38, 32,116,104,114,101,115,104,41,'\n',32,32,123,32,97,115,109, 32,123,32,48,120,100,53,44,32,36,118,32,58,32,48,120, 51,48,48,48,48,48,49,44,32,48,120,50,97,32,43,32, 114,101,108,115,114,99,44,32,99,114,105,116,44,32,36,116, 104,114,101,115,104,32,58,32,95,95,65,83,77,95,83,77, 65,76,76,95,86,65,76,85,69,32,125,59,32,125,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,67, 108,101,97,114,87,111,114,108,100,40,41,32,123,32,97,115, 109,32,123,32,48,120,51,54,32,125,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,84,97,114,103,101,116,40, 110,41,32,64,40,48,120,51,50,48,48,48,48,32,43,32, 110,41,'\n','\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,84,97,114,103,101,116,73,68,40, 99,111,110,115,116,32,105,110,116,32,38,118,41,32,123,32, 83,101,116,40,84,97,114,103,101,116,40,83,80,89,95,84, 65,82,71,69,84,73,68,41,44,32,118,41,59,32,125,'\n', 32,32,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,101,116,84,97,114,103,101,116,78,111,116,101,40,99,111, 110,115,116,32,105,110,116,32,38,118,41,32,123,32,83,101, 116,40,84,97,114,103,101,116,40,83,80,89,95,78,79,84, 69,41,44,32,118,41,59,32,125,'\n','\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,71,101,116,87,111, 114,108,100,40,99,111,110,115,116,32,105,110,116,32,110,44, 32,105,110,116,32,38,116,44,32,105,110,116,32,38,118,41, '\n',32,32,123,'\n',32,32,32,32,97,115,109,32,123,32,48, 120,49,52,44,32,36,118,32,58,32,95,95,65,83,77,95, 78,79,95,84,89,80,69,32,43,32,95,95,65,83,77,95, 83,77,65,76,76,95,86,65,76,85,69,44,32,48,120,50, 97,32,43,32,110,44,'\n',32,32,32,32,32,32,32,32,32, 32,32,32,32,32,32,32,36,116,32,58,32,95,95,65,83, 77,95,78,79,95,84,89,80,69,32,43,32,95,95,65,83, 77,95,83,77,65,76,76,95,86,65,76,85,69,44,32,48, 120,48,48,32,125,59,'\n',32,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,71,101,116,87,111, 114,108,100,83,104,111,114,116,73,68,40,105,110,116,32,38, 116,44,32,105,110,116,32,38,118,41,32,123,32,71,101,116, 87,111,114,108,100,40,83,80,89,95,83,72,79,82,84,73, 68,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,71,101,116,87, 111,114,108,100,76,105,110,107,73,68,40,105,110,116,32,38, 116,44,32,105,110,116,32,38,118,41,32,123,32,71,101,116, 87,111,114,108,100,40,83,80,89,95,76,73,78,75,73,68, 44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,71,101,116,87,111, 114,108,100,82,97,110,103,101,40,105,110,116,32,38,116,44, 32,105,110,116,32,38,118,41,32,123,32,71,101,116,87,111, 114,108,100,40,83,80,89,95,82,65,78,71,69,44,32,116, 44,32,118,41,59,32,125,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,71,101,116,87,111,114,108,100, 68,105,114,101,99,116,105,111,110,40,105,110,116,32,38,116, 44,32,105,110,116,32,38,118,41,32,123,32,71,101,116,87, 111,114,108,100,40,83,80,89,95,68,73,82,69,67,84,73, 79,78,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,71,101,116, 87,111,114,108,100,65,115,112,101,99,116,40,105,110,116,32, 38,116,44,32,105,110,116,32,38,118,41,32,123,32,71,101, 116,87,111,114,108,100,40,83,80,89,95,65,83,80,69,67, 84,44,32,116,44,32,118,41,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,71,101,116,87, 111,114,108,100,78,111,116,101,40,105,110,116,32,38,116,44, 32,105,110,116,32,38,118,41,32,123,32,71,101,116,87,111, 114,108,100,40,83,80,89,95,78,79,84,69,44,32,116,44, 32,118,41,59,32,125,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,87,111,114,108,100,78, 111,116,101,40,105,110,116,32,38,116,44,32,99,111,110,115, 116,32,105,110,116,32,38,118,41,'\n',32,32,123,32,97,115, 109,32,123,32,48,120,48,53,44,32,48,120,50,98,44,32, 36,116,32,58,32,95,95,65,83,77,95,78,79,95,84,89, 80,69,32,43,32,95,95,65,83,77,95,83,77,65,76,76, 95,86,65,76,85,69,44,32,36,118,125,59,32,125,'\n','\n', 32,32,35,100,101,102,105,110,101,32,83,116,97,99,107,40, 110,41,32,64,40,48,120,49,50,48,48,48,48,32,43,32, 40,110,41,41,'\n',32,32,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,80,117,115,104,40,99,111,110,115,116,32, 105,110,116,32,38,118,41,32,123,32,97,115,109,32,123,32, 48,120,101,51,44,32,36,118,32,125,59,32,125,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,80,111, 112,40,99,111,110,115,116,32,105,110,116,32,110,41,32,123, 32,97,115,109,32,123,32,48,120,48,49,44,32,110,32,125, 59,32,125,'\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,83,116,97,99,107,40,99,111,110, 115,116,32,105,110,116,32,105,44,32,99,111,110,115,116,32, 105,110,116,32,38,118,41,32,123,32,83,101,116,40,83,116, 97,99,107,40,105,41,44,32,118,41,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,84,73,77,69,82,95,82, 85,78,78,73,78,71,32,49,'\n',32,32,35,100,101,102,105, 110,101,32,84,73,77,69,82,95,83,84,79,80,80,69,68, 32,48,'\n',32,32,35,100,101,102,105,110,101,32,84,105,109, 101,114,83,116,97,116,101,40,110,41,32,64,40,48,120,49, 51,48,48,48,48,32,43,32,40,110,41,41,'\n',32,32,95, 95,110,111,108,105,115,116,32,118,111,105,100,32,83,101,116, 84,105,109,101,114,83,116,97,116,101,40,99,111,110,115,116, 32,105,110,116,32,110,44,32,99,111,110,115,116,32,105,110, 116,32,38,115,41,32,123,32,83,101,116,40,84,105,109,101, 114,83,116,97,116,101,40,110,41,44,32,115,41,59,32,125, '\n','\n',32,32,35,100,101,102,105,110,101,32,67,117,114,114, 101,110,116,84,97,115,107,73,68,40,41,32,64,40,48,120, 50,48,48,48,48,48,41,'\n','\n',32,32,35,100,101,102,105, 110,101,32,80,105,110,103,67,111,110,116,114,111,108,40,110, 41,32,64,40,48,120,51,51,48,48,48,48,32,43,32,40, 110,41,41,32,47,47,32,53,49,'\n',32,32,35,100,101,102, 105,110,101,32,80,105,110,103,68,97,116,97,40,41,32,80, 105,110,103,67,111,110,116,114,111,108,40,48,41,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,80,105,110,103,68,97,116,97,40,99,111,110,115,116,32, 105,110,116,32,38,100,41,32,123,32,83,101,116,40,80,105, 110,103,68,97,116,97,40,41,44,32,100,41,59,32,125,'\n', '\n',32,32,35,100,101,102,105,110,101,32,80,105,110,103,73, 110,116,101,114,118,97,108,40,41,32,80,105,110,103,67,111, 110,116,114,111,108,40,49,41,'\n',32,32,95,95,110,111,108, 105,115,116,32,118,111,105,100,32,83,101,116,80,105,110,103, 73,110,116,101,114,118,97,108,40,99,111,110,115,116,32,105, 110,116,32,38,105,41,32,123,32,83,101,116,40,80,105,110, 103,73,110,116,101,114,118,97,108,40,41,44,32,105,41,59, 32,125,'\n','\n',32,32,35,100,101,102,105,110,101,32,80,105, 110,103,73,68,40,41,32,80,105,110,103,67,111,110,116,114, 111,108,40,50,41,'\n','\n',32,32,35,100,101,102,105,110,101, 32,66,101,97,99,111,110,67,111,110,116,114,111,108,40,110, 41,32,64,40,48,120,51,52,48,48,48,48,32,43,32,40, 110,41,41,32,47,47,32,53,50,'\n','\n',32,32,35,100,101, 102,105,110,101,32,76,105,110,107,73,68,40,41,32,66,101, 97,99,111,110,67,111,110,116,114,111,108,40,48,41,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,83, 101,116,76,105,110,107,73,68,40,99,111,110,115,116,32,105, 110,116,32,38,110,41,32,123,32,83,101,116,40,76,105,110, 107,73,68,40,41,44,32,110,41,59,32,125,'\n','\n',32,32, 35,100,101,102,105,110,101,32,82,67,95,67,72,65,78,78, 69,76,95,66,82,79,65,68,67,65,83,84,32,48,'\n',32, 32,35,100,101,102,105,110,101,32,82,67,95,67,72,65,78, 78,69,76,95,49,32,49,'\n',32,32,35,100,101,102,105,110, 101,32,82,67,95,67,72,65,78,78,69,76,95,50,32,50, '\n',32,32,35,100,101,102,105,110,101,32,82,67,95,67,72, 65,78,78,69,76,95,51,32,51,'\n',32,32,35,100,101,102, 105,110,101,32,82,67,95,67,72,65,78,78,69,76,95,68, 73,83,65,66,76,69,68,32,52,'\n','\n',32,32,35,100,101, 102,105,110,101,32,82,67,82,120,67,104,97,110,110,101,108, 40,41,32,66,101,97,99,111,110,67,111,110,116,114,111,108, 40,49,41,'\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,101,116,82,67,82,120,67,104,97,110,110, 101,108,40,99,111,110,115,116,32,105,110,116,32,38,99,41, 32,123,32,83,101,116,40,82,67,82,120,67,104,97,110,110, 101,108,40,41,44,32,99,41,59,32,125,'\n','\n',32,32,35, 100,101,102,105,110,101,32,82,67,84,120,67,104,97,110,110, 101,108,40,41,32,66,101,97,99,111,110,67,111,110,116,114, 111,108,40,50,41,'\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,116,82,67,84,120,67,104,97, 110,110,101,108,40,99,111,110,115,116,32,105,110,116,32,38, 99,41,32,123,32,83,101,116,40,82,67,84,120,67,104,97, 110,110,101,108,40,41,44,32,99,41,59,32,125,'\n','\n',32, 32,35,100,101,102,105,110,101,32,82,67,84,88,77,79,68, 69,95,83,73,78,71,76,69,95,83,72,79,84,32,48,'\n', 32,32,35,100,101,102,105,110,101,32,82,67,84,88,77,79, 68,69,95,67,79,78,84,73,78,85,79,85,83,32,49,'\n', '\n',32,32,35,100,101,102,105,110,101,32,82,67,84,120,77, 111,100,101,40,41,32,66,101,97,99,111,110,67,111,110,116, 114,111,108,40,51,41,'\n',32,32,95,95,110,111,108,105,115, 116,32,118,111,105,100,32,83,101,116,82,67,84,120,77,111, 100,101,40,99,111,110,115,116,32,105,110,116,32,38,109,41, 32,123,32,83,101,116,40,82,67,84,120,77,111,100,101,40, 41,44,32,109,41,59,32,125,'\n','\n',32,32,35,100,101,102, 105,110,101,32,69,69,80,82,79,77,40,110,41,32,64,40, 48,120,49,52,48,48,48,48,32,43,32,40,110,41,41,'\n', 32,32,35,100,101,102,105,110,101,32,73,110,100,105,114,101, 99,116,69,69,80,82,79,77,40,110,41,32,64,40,48,120, 51,54,48,48,48,48,32,43,32,40,110,41,41,'\n',32,32, 95,95,110,111,108,105,115,116,32,118,111,105,100,32,83,101, 116,69,69,80,82,79,77,40,99,111,110,115,116,32,105,110, 116,32,38,105,44,32,99,111,110,115,116,32,105,110,116,32, 38,100,41,'\n',32,32,123,'\n',32,32,32,32,105,102,32,40, 95,95,116,121,112,101,40,105,41,61,61,50,41,'\n',32,32, 32,32,32,32,97,115,109,32,123,32,48,120,48,53,44,32, 48,120,49,52,44,32,36,105,32,58,32,48,120,50,48,48, 48,48,48,52,44,32,36,100,32,125,59,'\n',32,32,32,32, 101,108,115,101,'\n',32,32,32,32,32,32,97,115,109,32,123, 32,48,120,48,53,44,32,48,120,51,54,44,32,36,105,32, 58,32,48,120,51,48,48,48,48,48,49,44,32,36,100,32, 125,59,'\n',32,32,125,'\n','\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,116,97,114,116,84,97,115, 107,40,99,111,110,115,116,32,105,110,116,32,116,41,32,123, 32,97,115,109,32,123,32,48,120,55,49,44,32,116,125,59, 32,125,'\n',32,32,95,95,110,111,108,105,115,116,32,118,111, 105,100,32,83,116,111,112,84,97,115,107,40,99,111,110,115, 116,32,105,110,116,32,116,41,32,123,32,97,115,109,32,123, 32,48,120,56,49,44,32,116,125,59,32,125,'\n','\n',32,32, 35,100,101,102,105,110,101,32,67,79,78,84,82,79,76,76, 69,82,95,66,85,84,84,79,78,49,32,48,120,48,49,48, 48,'\n',32,32,35,100,101,102,105,110,101,32,67,79,78,84, 82,79,76,76,69,82,95,66,85,84,84,79,78,50,32,48, 120,48,50,48,48,'\n',32,32,35,100,101,102,105,110,101,32, 67,79,78,84,82,79,76,76,69,82,95,66,85,84,84,79, 78,51,32,48,120,48,48,48,49,'\n',32,32,35,100,101,102, 105,110,101,32,67,79,78,84,82,79,76,76,69,82,95,66, 85,84,84,79,78,52,32,48,120,48,49,48,49,'\n',32,32, 35,100,101,102,105,110,101,32,67,79,78,84,82,79,76,76, 69,82,95,66,85,84,84,79,78,53,32,48,120,48,50,48, 49,'\n','\n',32,32,47,47,32,82,79,77,32,115,117,98,114, 111,117,116,105,110,101,115,'\n',32,32,47,47,32,105,110,116, 101,114,97,99,116,105,111,110,32,115,117,98,114,111,117,116, 105,110,101,115,'\n',32,32,95,95,110,111,108,105,115,116,32, 118,111,105,100,32,83,101,110,100,83,112,121,98,111,116,77, 101,115,115,97,103,101,40,99,111,110,115,116,32,105,110,116, 32,38,110,73,110,100,101,120,44,32,99,111,110,115,116,32, 105,110,116,32,38,110,67,109,100,44,'\n',32,32,32,32,99, 111,110,115,116,32,105,110,116,32,38,110,72,105,66,121,116, 101,44,32,99,111,110,115,116,32,105,110,116,32,38,110,76, 111,66,121,116,101,41,'\n',32,32,123,'\n',32,32,32,32,97, 115,109,32,123,32,48,120,101,51,44,32,36,110,73,110,100, 101,120,32,125,59,'\n',32,32,32,32,97,115,109,32,123,32, 48,120,101,51,44,32,36,110,67,109,100,32,125,59,'\n',32, 32,32,32,97,115,109,32,123,32,48,120,101,51,44,32,36, 110,72,105,66,121,116,101,32,125,59,'\n',32,32,32,32,97, 115,109,32,123,32,48,120,101,51,44,32,36,110,76,111,66, 121,116,101,32,125,59,'\n',32,32,32,32,97,115,109,32,123, 32,48,120,49,55,44,32,51,52,32,125,59,'\n',32,32,32, 32,97,115,109,32,123,32,48,120,48,49,44,32,52,32,125, 59,'\n',32,32,125,'\n',32,32,95,95,110,111,108,105,115,116, 32,118,111,105,100,32,83,101,110,100,82,67,88,77,101,115, 115,97,103,101,40,99,111,110,115,116,32,105,110,116,32,38, 110,77,101,115,115,97,103,101,41,'\n',32,32,123,32,97,115, 109,32,123,32,48,120,101,51,44,32,36,110,77,101,115,115, 97,103,101,44,32,48,120,49,55,44,32,51,55,44,32,48, 120,48,49,44,32,49,32,125,59,32,125,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,101,110,100, 65,108,108,82,97,110,103,101,77,101,115,115,97,103,101,40, 99,111,110,115,116,32,105,110,116,32,38,110,77,101,115,115, 97,103,101,44,32,99,111,110,115,116,32,105,110,116,32,38, 110,68,97,116,97,41,'\n',32,32,123,32,97,115,109,32,123, 32,48,120,101,51,44,32,36,110,77,101,115,115,97,103,101, 44,32,48,120,101,51,44,32,36,110,68,97,116,97,44,32, 48,120,49,55,44,32,51,56,44,32,48,120,48,49,44,32, 50,32,125,59,32,125,'\n','\n',32,32,47,47,32,117,116,105, 108,115,32,115,117,98,114,111,117,116,105,110,101,115,'\n',32, 32,95,95,110,111,108,105,115,116,32,118,111,105,100,32,68, 105,115,112,40,99,111,110,115,116,32,105,110,116,32,38,100, 105,115,112,108,97,121,41,'\n',32,32,123,32,97,115,109,32, 123,32,48,120,101,51,44,32,36,100,105,115,112,108,97,121, 44,32,48,120,49,55,44,32,52,50,44,32,48,120,48,49, 44,32,49,32,125,59,32,125,'\n','\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,66,65,83,73,67,32,32, 32,32,32,48,120,48,49,48,48,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,82,65,78,68,79,77,32, 32,32,32,48,120,48,50,48,48,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,70,65,78,67,89,32,32, 32,32,32,48,120,48,51,48,48,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,83,76,79,87,68,79,87, 78,32,32,48,120,48,52,48,48,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,83,80,69,69,68,85,80, 32,32,32,48,120,48,53,48,48,'\n','\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,77,65,83,75,32,32, 32,32,32,32,48,120,48,48,102,102,'\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,84,89,80,69,95,77, 65,83,75,32,48,120,102,102,48,48,'\n','\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,70,79,82,87,65,82,68,32,32,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,49,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,66,65,67,75,87,65,82,68,32,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,50,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,83,80,73,78,95,76,69,70,84,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,83,80,73,78,95,82,73,71,72,84,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,52,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,84,85,82,78,95,76,69,70,84,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,53,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,84,85,82,78,95,82,73,71,72,84,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,54,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,65,86,79,73,68,95,76,69,70,84,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,55,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,65,86,79,73,68,95,82,73,71,72,84,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,56,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,82,69,83,84,32,32,32,32,32,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,57,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,66,65,83,73,67, 95,83,84,79,80,32,32,32,32,32,32,32,32,77,79,86, 69,95,66,65,83,73,67,32,43,32,49,48,'\n','\n',32,32, 35,100,101,102,105,110,101,32,77,79,86,69,95,82,65,78, 68,79,77,95,70,79,82,87,65,82,68,32,32,32,32,77, 79,86,69,95,82,65,78,68,79,77,32,43,32,49,'\n',32, 32,35,100,101,102,105,110,101,32,77,79,86,69,95,82,65, 78,68,79,77,95,66,65,67,75,87,65,82,68,32,32,32, 77,79,86,69,95,82,65,78,68,79,77,32,43,32,50,'\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,82, 65,78,68,79,77,95,83,80,73,78,95,76,69,70,84,32, 32,77,79,86,69,95,82,65,78,68,79,77,32,43,32,51, '\n',32,32,35,100,101,102,105,110,101,32,77,79,86,69,95, 82,65,78,68,79,77,95,83,80,73,78,95,82,73,71,72, 84,32,77,79,86,69,95,82,65,78,68,79,77,32,43,32, 52,'\n',32,32,35,100,101,102,105,110,101,32,77,79,86,69, 95,82,65,78,68,79,77,95,84,85,82,78,95,76,69,70, 84,32,32,77,79,86,69,95,82,65,78,68,79,77,32,43, 32,53,'\n',32,32,35,100,101,102,105,110,101,32,77,79,86, 69,95,82,65,78,68,79,77,95,84,85,82,78,95,82,73, 71,72,84,32,77,79,86,69,95,82,65,78,68,79,77,32, 43,32,54,'\n',32,32,35,100,101,102,105,110,101,32,77,79, 86,69,95,82,65,78,68,79,77,95,82,69,83,84,32,32, 32,32,32,32,32,77,79,86,69,95,82,65,78,68,79,77, 32,43,32,55,'\n','\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,90,73,71,90,65, 71,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,49,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,72,65,75,69, 32,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,50,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,67,65,78,32, 32,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,51,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,84,69,80,32, 32,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,52,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,84,69,80,95, 66,65,67,75,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,53,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,83,69,65,82,67, 72,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,54,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,70,65,75,69,95, 76,69,70,84,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,55,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,82,65,75,69,95, 82,73,71,72,84,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,56,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,66,85,71,95,70, 79,82,87,65,82,68,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,57,'\n',32,32,35,100,101,102,105,110,101,32, 77,79,86,69,95,70,65,78,67,89,95,76,65,90,89,32, 32,32,32,32,32,32,32,77,79,86,69,95,70,65,78,67, 89,32,43,32,49,48,'\n',32,32,35,100,101,102,105,110,101, 32,77,79,86,69,95,70,65,78,67,89,95,87,65,76,75, 32,32,32,32,32,32,32,32,77,79,86,69,95,70,65,78, 67,89,32,43,32,49,49,'\n',32,32,35,100,101,102,105,110, 101,32,77,79,86,69,95,70,65,78,67,89,95,87,65,76, 75,95,66,65,67,75,32,32,32,77,79,86,69,95,70,65, 78,67,89,32,43,32,49,50,'\n',32,32,35,100,101,102,105, 110,101,32,77,79,86,69,95,70,65,78,67,89,95,68,65, 78,67,69,32,32,32,32,32,32,32,77,79,86,69,95,70, 65,78,67,89,32,43,32,49,51,'\n','\n',32,32,35,100,101, 102,105,110,101,32,77,79,86,69,95,83,76,79,87,68,79, 87,78,95,70,79,82,87,65,82,68,32,32,32,32,77,79, 86,69,95,83,76,79,87,68,79,87,78,32,43,32,49,'\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,83, 76,79,87,68,79,87,78,95,66,65,67,75,87,65,82,68, 32,32,32,77,79,86,69,95,83,76,79,87,68,79,87,78, 32,43,32,50,'\n',32,32,35,100,101,102,105,110,101,32,77, 79,86,69,95,83,76,79,87,68,79,87,78,95,83,80,73, 78,95,76,69,70,84,32,32,77,79,86,69,95,83,76,79, 87,68,79,87,78,32,43,32,51,'\n',32,32,35,100,101,102, 105,110,101,32,77,79,86,69,95,83,76,79,87,68,79,87, 78,95,83,80,73,78,95,82,73,71,72,84,32,77,79,86, 69,95,83,76,79,87,68,79,87,78,32,43,32,52,'\n','\n', 32,32,35,100,101,102,105,110,101,32,77,79,86,69,95,83, 80,69,69,68,85,80,95,70,79,82,87,65,82,68,32,32, 32,32,32,77,79,86,69,95,83,80,69,69,68,85,80,32, 43,32,49,'\n',32,32,35,100,101,102,105,110,101,32,77,79, 86,69,95,83,80,69,69,68,85,80,95,66,65,67,75,87, 65,82,68,32,32,32,32,77,79,86,69,95,83,80,69,69, 68,85,80,32,43,32,50,'\n',32,32,35,100,101,102,105,110, 101,32,77,79,86,69,95,83,80,69,69,68,85,80,95,83, 80,73,78,95,76,69,70,84,32,32,32,77,79,86,69,95, 83,80,69,69,68,85,80,32,43,32,51,'\n',32,32,35,100, 101,102,105,110,101,32,77,79,86,69,95,83,80,69,69,68, 85,80,95,83,80,73,78,95,82,73,71,72,84,32,32,77, 79,86,69,95,83,80,69,69,68,85,80,32,43,32,52,'\n', '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,66,97,115,105,99,77,111,118,101,32,40,99,111,110,115, 116,32,105,110,116,32,38,109,111,118,101,44,32,99,111,110, 115,116,32,105,110,116,32,38,116,105,109,101,41,'\n',32,32, 123,32,97,115,109,32,123,32,48,120,101,51,44,32,36,109, 111,118,101,44,32,48,120,101,51,44,32,36,116,105,109,101, 44,32,48,120,49,55,44,32,52,51,44,32,48,120,48,49, 44,32,50,32,125,59,32,125,'\n','\n',32,32,47,47,32,110, 83,111,117,110,100,32,105,115,32,48,45,55,57,44,32,45, 49,32,61,32,110,111,32,115,111,117,110,100,'\n',32,32,47, 47,32,110,68,105,115,112,108,97,121,32,105,115,32,76,69, 68,32,97,110,105,109,97,116,105,111,110,32,40,48,45,49, 53,41,32,116,111,32,112,108,97,121,44,32,45,49,32,61, 32,110,111,32,97,110,105,109,97,116,105,111,110,'\n',32,32, 47,47,32,110,77,111,118,101,109,101,110,116,32,105,115,32, 102,114,111,109,32,116,104,101,32,42,77,111,118,101,32,114, 111,117,116,105,110,101,115,32,100,101,102,105,110,101,100,32, 98,101,108,111,119,44,32,45,49,32,61,32,110,111,32,109, 111,118,101,'\n',32,32,47,47,32,110,82,101,112,101,97,116, 32,105,115,32,110,117,109,98,101,114,32,111,102,32,116,105, 109,101,115,32,116,111,32,114,101,112,101,97,116,32,109,111, 116,105,111,110,'\n',32,32,47,47,32,110,116,105,109,101,32, 105,115,32,105,110,32,49,48,109,115,32,115,116,101,112,115, '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,65,99,116,105,111,110,32,40,99,111,110,115,116,32,105, 110,116,32,38,110,83,111,117,110,100,44,32,99,111,110,115, 116,32,105,110,116,32,38,110,68,105,115,112,108,97,121,44, '\n',32,32,32,32,99,111,110,115,116,32,105,110,116,32,38, 110,77,111,118,101,109,101,110,116,44,32,99,111,110,115,116, 32,105,110,116,32,38,110,82,101,112,101,97,116,44,32,99, 111,110,115,116,32,105,110,116,32,38,110,84,105,109,101,41, '\n',32,32,123,'\n',32,32,32,32,97,115,109,32,123,32,48, 120,101,51,44,32,36,110,83,111,117,110,100,32,125,59,'\n', 32,32,32,32,97,115,109,32,123,32,48,120,101,51,44,32, 36,110,68,105,115,112,108,97,121,32,125,59,'\n',32,32,32, 32,97,115,109,32,123,32,48,120,101,51,44,32,36,110,77, 111,118,101,109,101,110,116,32,125,59,'\n',32,32,32,32,97, 115,109,32,123,32,48,120,101,51,44,32,36,110,82,101,112, 101,97,116,32,125,59,'\n',32,32,32,32,97,115,109,32,123, 32,48,120,101,51,44,32,36,110,84,105,109,101,32,125,59, '\n',32,32,32,32,97,115,109,32,123,32,48,120,49,55,44, 32,52,52,32,125,59,'\n',32,32,32,32,97,115,109,32,123, 32,48,120,48,49,44,32,53,32,125,59,'\n',32,32,125,'\n', '\n',32,32,95,95,110,111,108,105,115,116,32,118,111,105,100, 32,82,97,110,100,111,109,77,111,118,101,32,40,99,111,110, 115,116,32,105,110,116,32,38,109,111,118,101,44,32,99,111, 110,115,116,32,105,110,116,32,38,116,105,109,101,41,'\n',32, 32,123,32,97,115,109,32,123,32,48,120,101,51,44,32,36, 109,111,118,101,44,32,48,120,101,51,44,32,36,116,105,109, 101,44,32,48,120,49,55,44,32,52,54,44,32,48,120,48, 49,44,32,50,32,125,59,32,125,'\n','\n',32,32,95,95,110, 111,108,105,115,116,32,118,111,105,100,32,70,97,110,99,121, 77,111,118,101,32,40,99,111,110,115,116,32,105,110,116,32, 38,109,111,118,101,44,32,99,111,110,115,116,32,105,110,116, 32,38,116,105,109,101,41,'\n',32,32,123,32,97,115,109,32, 123,32,48,120,101,51,44,32,36,109,111,118,101,44,32,48, 120,101,51,44,32,36,116,105,109,101,44,32,48,120,49,55, 44,32,52,55,44,32,48,120,48,49,44,32,50,32,125,59, 32,125,'\n','\n',32,32,95,95,110,111,108,105,115,116,32,118, 111,105,100,32,83,108,111,119,68,111,119,110,77,111,118,101, 32,40,99,111,110,115,116,32,105,110,116,32,38,109,111,118, 101,44,32,99,111,110,115,116,32,105,110,116,32,38,116,105, 109,101,41,'\n',32,32,123,32,97,115,109,32,123,32,48,120, 101,51,44,32,36,109,111,118,101,44,32,48,120,101,51,44, 32,36,116,105,109,101,44,32,48,120,49,55,44,32,52,56, 44,32,48,120,48,49,44,32,50,32,125,59,32,125,'\n','\n', 32,32,95,95,110,111,108,105,115,116,32,118,111,105,100,32, 83,112,101,101,100,85,112,77,111,118,101,32,40,99,111,110, 115,116,32,105,110,116,32,38,109,111,118,101,44,32,99,111, 110,115,116,32,105,110,116,32,38,116,105,109,101,41,'\n',32, 32,123,32,97,115,109,32,123,32,48,120,101,51,44,32,36, 109,111,118,101,44,32,48,120,101,51,44,32,36,116,105,109, 101,44,32,48,120,49,55,44,32,52,57,44,32,48,120,48, 49,44,32,50,32,125,59,32,125,'\n','\n',32,32,47,47,32, 65,100,100,115,32,97,32,118,97,108,117,101,32,116,111,32, 97,32,50,32,98,121,116,101,32,108,111,99,97,116,105,111, 110,32,105,110,32,69,69,112,114,111,109,'\n',32,32,95,95, 110,111,108,105,115,116,32,118,111,105,100,32,83,117,109,50, 77,101,109,32,40,99,111,110,115,116,32,105,110,116,32,38, 110,77,101,109,44,32,99,111,110,115,116,32,105,110,116,32, 38,110,86,97,108,117,101,41,'\n',32,32,123,32,97,115,109, 32,123,32,48,120,101,51,44,32,36,110,77,101,109,44,32, 48,120,101,51,44,32,36,110,86,97,108,117,101,44,32,48, 120,49,55,44,32,53,48,44,32,48,120,48,49,44,32,50, 32,125,59,32,125,'\n','\n',32,32,47,47,32,65,100,100,115, 32,97,32,118,97,108,117,101,32,116,111,32,97,32,52,32, 98,121,116,101,32,108,111,99,97,116,105,111,110,32,105,110, 32,69,69,112,114,111,109,'\n',32,32,95,95,110,111,108,105, 115,116,32,118,111,105,100,32,83,117,109,52,77,101,109,32, 40,99,111,110,115,116,32,105,110,116,32,38,110,77,101,109, 44,32,99,111,110,115,116,32,105,110,116,32,38,110,86,97, 108,117,101,41,'\n',32,32,123,32,97,115,109,32,123,32,48, 120,101,51,44,32,36,110,77,101,109,44,32,48,120,101,51, 44,32,36,110,86,97,108,117,101,44,32,48,120,49,55,44, 32,53,49,44,32,48,120,48,49,44,32,50,32,125,59,32, 125,'\n','\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,78,79,78,69,32,45,49,'\n',32,32,35,100,101, 102,105,110,101,32,83,79,85,78,68,95,83,72,79,67,75, 69,68,32,54,'\n',32,32,35,100,101,102,105,110,101,32,83, 79,85,78,68,95,70,73,82,69,95,76,65,83,69,82,32, 55,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,70,73,82,69,95,69,76,69,67,84,82,79,78,69, 84,32,56,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,70,73,82,69,95,83,80,73,78,78,69,82, 32,57,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,72,73,84,95,66,89,95,76,65,83,69,82,32, 49,48,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,72,73,84,95,66,89,95,69,76,69,67,84,82, 79,78,69,84,32,49,49,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,72,73,84,95,66,89,95,83, 80,73,78,78,69,82,32,49,50,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,84,65,71,32,49,51, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,67,82,65,83,72,32,49,52,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,70,73,71,72,84,32, 49,53,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,71,79,84,95,73,84,32,49,54,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,71,69,78, 69,82,65,76,95,65,76,69,82,84,32,49,55,'\n',32,32, 35,100,101,102,105,110,101,32,83,79,85,78,68,95,79,85, 84,95,79,70,95,69,78,69,82,71,89,95,65,76,69,82, 84,32,49,56,'\n',32,32,35,100,101,102,105,110,101,32,83, 79,85,78,68,95,76,79,87,95,69,78,69,82,71,89,95, 65,76,69,82,84,32,49,57,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,83,67,79,82,69,95,65, 76,69,82,84,32,50,48,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,84,73,77,69,95,65,76,69, 82,84,32,50,49,'\n',32,32,35,100,101,102,105,110,101,32, 83,79,85,78,68,95,80,82,79,88,73,77,73,84,89,95, 65,76,69,82,84,32,50,50,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,68,65,78,71,69,82,95, 65,76,69,82,84,32,50,51,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,66,79,77,66,95,65,76, 69,82,84,32,50,52,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,70,73,78,65,76,95,67,79,85, 78,84,68,79,87,78,32,50,53,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,84,73,67,75,95,84, 79,67,75,32,50,54,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,71,79,84,79,32,50,55,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,83, 67,65,78,32,50,56,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,80,79,73,78,84,95,84,79,32, 50,57,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85, 78,68,95,65,67,84,73,86,65,84,69,95,83,72,73,69, 76,68,83,32,51,48,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,65,67,84,73,86,65,84,69,95, 82,69,70,76,69,67,84,32,51,49,'\n',32,32,35,100,101, 102,105,110,101,32,83,79,85,78,68,95,65,67,84,73,86, 65,84,69,95,67,76,79,65,75,32,51,50,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,65,67,84, 73,86,65,84,69,95,70,76,65,83,72,95,66,76,73,78, 68,32,51,51,'\n',32,32,35,100,101,102,105,110,101,32,83, 79,85,78,68,95,77,65,71,78,69,84,32,51,52,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,81, 85,65,68,95,68,65,77,65,71,69,32,51,53,'\n',32,32, 35,100,101,102,105,110,101,32,83,79,85,78,68,95,82,69, 80,85,76,83,69,32,51,54,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,84,85,82,66,79,32,51, 55,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,70,82,69,69,90,69,32,51,56,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,83,76,79,87, 32,51,57,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,82,69,86,69,82,83,69,32,52,48,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,68, 73,90,90,89,32,52,49,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,66,79,79,83,84,32,52,50, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,68,69,65,67,84,73,86,65,84,69,95,83,72,73,69, 76,68,83,32,52,51,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,68,69,65,67,84,73,86,65,84, 69,95,82,69,70,76,69,67,84,32,52,52,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,68,69,65, 67,84,73,86,65,84,69,95,67,76,79,65,75,32,52,53, '\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78,68, 95,82,69,70,76,69,67,84,32,52,54,'\n',32,32,35,100, 101,102,105,110,101,32,83,79,85,78,68,95,69,88,80,76, 79,83,73,79,78,32,52,55,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,66,73,71,95,69,88,80, 76,79,83,73,79,78,32,52,56,'\n',32,32,35,100,101,102, 105,110,101,32,83,79,85,78,68,95,80,76,65,67,69,95, 66,79,77,66,32,52,57,'\n',32,32,35,100,101,102,105,110, 101,32,83,79,85,78,68,95,72,73,84,95,66,89,95,87, 73,78,68,32,53,48,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,79,85,67,72,32,53,49,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,71, 69,73,71,69,82,32,53,50,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,87,72,73,83,84,76,69, 32,53,51,'\n',32,32,35,100,101,102,105,110,101,32,83,79, 85,78,68,95,73,77,95,73,84,32,53,52,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,72,69,76, 80,32,53,53,'\n',32,32,35,100,101,102,105,110,101,32,83, 79,85,78,68,95,83,73,82,69,78,32,53,54,'\n',32,32, 35,100,101,102,105,110,101,32,83,79,85,78,68,95,66,85, 82,78,84,32,53,55,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,71,82,73,78,68,69,68,32,53, 56,'\n',32,32,35,100,101,102,105,110,101,32,83,79,85,78, 68,95,83,77,65,67,75,69,68,32,53,57,'\n',32,32,35, 100,101,102,105,110,101,32,83,79,85,78,68,95,84,82,73, 76,76,95,85,80,32,54,48,'\n',32,32,35,100,101,102,105, 110,101,32,83,79,85,78,68,95,84,82,73,76,76,95,68, 79,87,78,32,54,49,'\n',32,32,35,100,101,102,105,110,101, 32,83,79,85,78,68,95,89,69,76,76,32,54,50,'\n',32, 32,35,100,101,102,105,110,101,32,83,79,85,78,68,95,87, 72,73,83,80,69,82,32,54,51,'\n','\n',32,32,35,100,101, 102,105,110,101,32,76,69,68,95,82,69,68,49,32,48,120, 48,49,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,82,69,68,50,32,48,120,48,50,'\n',32,32,35,100,101, 102,105,110,101,32,76,69,68,95,82,69,68,51,32,48,120, 48,52,'\n',32,32,35,100,101,102,105,110,101,32,76,69,68, 95,71,82,69,69,78,49,32,48,120,48,56,'\n',32,32,35, 100,101,102,105,110,101,32,76,69,68,95,71,82,69,69,78, 50,32,48,120,49,48,'\n',32,32,35,100,101,102,105,110,101, 32,76,69,68,95,71,82,69,69,78,51,32,48,120,50,48, '\n',32,32,35,100,101,102,105,110,101,32,76,69,68,95,89, 69,76,76,79,87,32,48,120,52,48,'\n',32,32,35,100,101, 102,105,110,101,32,76,69,68,95,65,76,76,95,82,69,68, 32,76,69,68,95,82,69,68,49,32,43,32,76,69,68,95, 82,69,68,50,32,43,32,76,69,68,95,82,69,68,51,'\n', 32,32,35,100,101,102,105,110,101,32,76,69,68,95,65,76, 76,95,71,82,69,69,78,32,76,69,68,95,71,82,69,69, 78,49,32,43,32,76,69,68,95,71,82,69,69,78,50,32, 43,32,76,69,68,95,71,82,69,69,78,51,'\n',32,32,35, 100,101,102,105,110,101,32,76,69,68,95,65,76,76,95,82, 69,68,95,71,82,69,69,78,32,76,69,68,95,65,76,76, 95,82,69,68,32,43,32,76,69,68,95,65,76,76,95,71, 82,69,69,78,'\n',32,32,35,100,101,102,105,110,101,32,76, 69,68,95,65,76,76,32,76,69,68,95,65,76,76,95,82, 69,68,95,71,82,69,69,78,32,43,32,76,69,68,95,89, 69,76,76,79,87,'\n','\n',35,101,110,100,105,102,'\n','\n','\n', }; nqc-3.1.r6/history.txt0000600000175000017500000005267710631607362013057 0ustar blpblpNQC Release Notes ----------------- Please send bug reports to bricxcc@comcast.net. Be sure to include details about what platform you are running nqc on and a sample file that demonstrates the bug if possible. For updates and additional documentation, visit the NQC Web Site: http://bricxcc.sourceforge.net/nqc. Send emails to bricxcc@comcast.net. version 3.1 r6 -------------- * Minor code changes to support 64bit platforms. * Minor additions to the built-in API header. * USB and serial tower timing tweaks. version 3.1 r4 -------------- * Modified Spybot program code generation slightly so that it matches that generated via the MindScript compiler. Tasks that are not empty no longer are terminated by the two byte stop task sequence. Empty tasks are flagged via the standard two byte stop task sequence but the task numbers are 0-7 rather than 8-15. version 3.1 r3 -------------- * Fixed bug in NQC code generation for expressions like a = a*2 + a*3;. version 3.1 r2 -------------- * Fixed Spybot FindWorld API function. version 3.1 r1 -------------- * LASM-compatible listing output via the -c switch * Support for Dick Swan's replacement firmware * Fixes for Linux/Free BSD compilation * SetEEPROM API fix * Change to USB Tower timing (Win32) when downloading user programs version 3.0 a2 -------------- * Fixed a bug in returning from Spybotic subroutines version 3.0 a1 -------------- * -q quiet mode (no sound played after program download and firmware download) * improved firmware download (support for alternate firmwares and fast mode via USB tower on Windows platform) * changed asm statement to use $ rather than & * incorporated Spybotics API into built-in API definitions. * added support for more writable sources for RCX2 and Spybotics. * added support for pointers and function parameters of type int* and const int* version 2.5 r3 -------------- * Improved disassembly listings for Spybotics. * Fixed some bugs in the Scout API's output functions. version 2.5 r2 -------------- * added support for the USB tower Linux driver available from http://legousb.sourceforge.net/. Any questions regarding the USB driver itself should be directed to David Glance version 2.5 r1 -------------- Functionally the same as 2.5 a5, except that it is now an official release instead of in beta test. version 2.5 a5 -------------- * fixed RepeatStmt to work with Spybotics * fixed bug with writable sources and Spybotics * fixed bug with jump optimization causing jumps to end-of-program to jump to the start of program instead * fixed a bug with right shift of a negative operand * added version resource in win32 build version 2.5 a4 -------------- * added resource support for Spybotics (__res keyword) * removed a few Spybotics features from the built-in API file. The Spybotics API will be maintained as a separate file until it becomes more stable, at which point it will be merged back into the compiler. version 2.5 a3 -------------- * Added optimizations for using short branches (jmp instead of jmpl and chk instead of chkl). * Added fast firmware for USB (Mac OS X only, but framework is in place for other platforms to use). * Added the -R option to redirect text output to a file (this is somewhat redundant for operating systems that provide good control over redirecting stdout and stderr). * Added limited "goto" support. Goto should be used with care since the compiler doesn't currently check to see if the goto would enter/leave control blocks such as acquire() and monitor(). As a result, those control blocks may not be properly set up or finished. The bottom line is that you probably shouldn't be using goto in the first place, but if you need to, then you should use it with care. * Removed nullable algorithm. This was done in order to clean up some of the code generation code. The only noticeable effect is that one previous optimization (empty repeat within a while loop) is no longer made. version 2.5 a1 -------------- * Added supoprt for Spybotics. Use -Tspy to tell NQC that you are using the Spybotics brick. Currently, only serial communications are supported. Spybotics is very similar to an RCX 2.0 in terms of programming, except that it has only two motors, the sensors are pre-configured, there is no LCD display, and no Datalog. There are some new capabilities with Spybotics, but not everything has an API in NQC yet. Use "nqc -api" to view the current API definition (pay particular attention to things conditionally defined using __SPY). * Fixed a bug with the Program() call. * Removed a debugging printf (kept saying "draining") from the Unix build. * Added a check for no firmware version 2.4 r3 -------------- * fixed bug in RCX_PipeTransport::Open() that would sometimes pick the wrong pipe mode. This would result in an error when NQC started to download a program. * The Unix builds (including Mac OS X) now support disabling of calls to tcdrain() (which would hang on some flavors of Unix with some device drivers). If NQC hangs when you try to download, append ":nodrain" to the device name. For example, if your device was /dev/ttys0 then you would do this: nqc -S/dev/ttys0:nodrain -d test.nqc * Mac OS X now defaults to enabling tcdrain(). This works fine under 10.1.3 with the Keyspan serial drivers. If you are using a combination of OS / drivers that hangs when NQC tries to download a program, add ":nodrain" to the serial device name (as described above). version 2.4 r2 -------------- * added some error checking for empty -S, -I, -D, -U, and -O options * added Mac OS 9 USB support (via the Lego Ghost API) version 2.4 r1 -------------- * Fixed a bug that caused -D arguments not to be processed * Improved #pragma reserve for locals * changed -firmfast send delay to 100ms (should have better performance now) * srecord parser is now more tolerant about line endings * fixed bug with #elif not expanding macros if previous condition was false * return code from main() is now an error code instead of just 0 or -1 * reorganized the Makefile version 2.4 a4 -------------- * fixed bug that caused a crash when no serial device was specified (either with a -S option or the RCX_PORT environment variable). version 2.4 a3 -------------- * added support for the Lego USB tower under some operating systems. If supported, the tower is selected by specifying -Susb on the command line. Currently, Win32 and Mac OS X are the only platforms with USB support. I'll be adding Mac OS9 support as soon as Lego releases their driver for it. Note that fast firmware download (-firmfast) is not allowed when using a USB tower. version 2.4 a2 -------------- * added __sensor() expression for arg checking. This fixes an old problem with SensorValueRaw(SENSOR_x) and other macros that can take a SENSOR_x as an argument. * added the __NQC__ compile time symbol for the version number of NQC (for 2.4, __NQC__ is 204) * improved the predictive timing of RCX_Link * fixed a few minor bugs version 2.4 a1 -------------- * added -s option, which will cause -L to emit merged source/assembly listings. This option only has effect when a source file is compiled/listed (it is ignored when binary .rcx files are listed). The merged listing can be a bit confusing; especially since functions are expaned inline, and you will see the expanded function source mixed in with the caller's source. * improved support for various operators and assignements (<<, >>, ^, ~). The shift operators still require a constant shift amount, but the left operand may be any expression. For the other operators, all constant restrictions have been removed. * added new assignement operators (<<=, >>=, ^=, %=). The shift assignments require a constant shift amount. * added the ternary (?:) operator. * some very old deprecated features from 1.x have been removed. Specifically, the old syntax for tasks, subs, and function declaration has been removed. If you have been compiling without the -1 option and not seeing any warnings, then your code is fine and does not use the deprecated syntax. * the deprecated -s and -c options (for Scout and CyberMaster support) have been eliminated. The -T option is now the only way to specify a target. * expression evaluation when targeting RCX 2 has been optimized slightly. Specifically, prior to RCX 2 there were restrictions on the types of effective addresses that could be used in math bytecodes. So NQC would typically move data from these types of addresses to a temporary variable, then use the temporary variable as an operand to the math bytecode. With RCX 2, the restrictions have been eased, and NQC now takes advantage of this and uses the effective addresses directly as operands to math bytecodes when possible. * Mac-only: eliminated call to LMGetUnitTableEntry() when opening serial port. Apparently for a brief period of time Apple forgot to include this call in their system ROMs (after of course telling all developers to use this call rather than access the low mem globals directly). version 2.3 r1 (previously 2.3 b1) ----------------------------------- * added the -b option to force input file to be treated as binary file regardless of filename extension * automatically switches a Scout to "power mode" when downloading a program * fixed a bug with the -clear action (previously it would return an error even though the RCX was cleared) * fixed a bug that produced garbage when printing an error message that occurred at the end of the source file * fixed two bugs associated with evaluating expressions as conditions version 2.3 a1 -------------- * merged conditions and expressions - relational operators may now be used in expressions and the result of a calculation is a valid condition. The precedence and associativity is identical to that of C * implemented partial catches for monitor statements, that is it is possible to have multiple catch clauses to handle separate events. This only works for RCX 2.0. monitor(EVENT_MASK(1) + EVENT_MASK(2) + EVENT_MASK(3)) { } catch (EVENT_MASK(1)) { // will handle event 1 } catch { // will handle any other events (2 and 3) } * Added CurrentEvents() to the API. This returns the enents that triggered an event handler. In general, its simpler to just use partial catches and let the compiler do the work for you. * Fixed a bug in the definition of DisableOutput * rcxifile version updated to 1.0.2 (addition of target type) * __taskid added - this expression returns the number of the task. Note it must be possible to determine the task number lexically at compile time for this to be a valid expression (in other words, don't use it in a subroutine called from multiple tasks). version 2.2 r2 -------------- * enabled SetSleepTime() and SleepNow() in Scout API * fixed a bug in Event() * allow 16-bit unsigned constants (EVENT_MASK(15) now works) * ignore ctrl-Z characters (0x1a) in input files * error added for unterminated comments version 2.2 r1 -------------- * removed SensorParam() from the API * added SENSOR_TYPE_NONE to the API * fixed a bug where CalibrateEvent() used the args in the wrong order * fixed a bug in the disassembly listing for the chkl opcode * fixed a bug with the code generation for repeat statments that used decvjnl for looping. The offsets were not computed correctly (due to a sign bit) for offsets greater than 127 bytes. * optimized code generation when __ASM_NO_LOCAL restrictor is used with an atomic expression of a restricted source. Previously, the restricted source was moved to a local temp, then a global. Now the restricted source is moved directly to a global temp. In practice this means that AddToDatalog(Message()) takes two opcodes instead of three (and dirties one temp instead of two). version 2.2 b1 -------------- * 'for' statement added * simple array support for RCX2 added. You can declare, set, and read array elements. There is currently no support for initializing arrays, passing them as arguments, incrementing or decrementing elements with ++ and --, or any math assignment such as += or -=. * SetUserDisplay() and AddToDatalog() now correctly use a global temp rather than a local one. Even so, SetUserDisplay() should be used with care - generally a temp is the wrong thing to display! * Most of the raw serial APIs have been changed slightly. For the most part the change was replacing SerXXX with SerialXXX. * EVENT_MASK() macro added to help in building event sets * EVENT_TYPE_MAILBOX changed to EVENT_TYPE_MESSAGE * Duration() changed to ClickTime() * Most parameters, such as UpperLimit() now have calls such as SetUpperLimit() to set their value. * Most of the global output commands were removed due to how confusing the whole system was. There are now only three primitive commands: SetGlobalOutput(), SetGlobalDirection() and SetMaxPower(). * Minor changes to Scout calls for setting up the light sensor. These changes make the Scout terminology align with the RCX2 calls. * Constants for scout events, such as EVENT_1_PRESSED have been added. * fixed bug that prevented 'continue' from working in a switch nested within a loop version 2.2 a2 -------------- * "#praga reserve" may be used to prevent RCX variables from being used by NQC. The syntax is #pragma reserve start [end] For example, to reserve locations 0 and 1 (where the RCX2 counters are): #pragma reserve 0 1 * added SetSleepTime() and SleepNow() to the API * removed Display() from the API (SetUserDisplay() is sufficient) * changed SetEvent and event sources...now just specify the source literally: SetEvent(0, SENSOR_2, EVENT_TYPE_PRESSED); * Error checking netsted monitor or acquire statements * monitor/acquire exits loops and functions correctly * fixed bug where non-existant handlers could cause a crash * MonitorStmt properly restricts event sources when generating Scout code version 2.2 a1 -------------- * rcx1.nqh and rcx2.nqh are no longer supplied in the distribution. Instead, they can be generated directly from NQC (which contains ebmedded versions of these files). The -api option will cause NQC to emit the appropraite API file (normally the 2.0 api, unless 1.0 compatability mode has been selected): nqc -api nqc -1 -api * Firmware download supports large files (such as the RCX 2.0 firmware). Also fixed a bug in fast firmware download. * modulo operator (%) now supported for non-constant operands * Preliminary RCX 2.0 API - see the api file for the actual constants and functions. Use a target of rcx2 in order to generate RCX 2.0 code. For example: nqc -Trcx2 -d test.nqc * local variables are utilized when compiling for Scout or RCX 2 * event monitoring is supported with a monitor/catch construct... monitor(events) { // body } catch { // handler } 'events' is the set of events to watch. The 'catch' and handler are optional. The body is executed. If one of the monitored events occur, then body will be interrupted and the handler will be executed. Events are only availabe for Scout and RCX 2. * resource acquisition is supported with acquire/catch construct... acquire(resources) { // body } catch { // handler } 'resources' is the set of resources to acquire (ACQUIRE_OUT_A, etc) and must be a compile-time constant. An attempt is made to acquire the resources. If sucessful, execution proceeds to the body. If unsuccessful, or if during execution of the body the resources are preempted by another task, execution jumps to the handler (if any). Under normal operation resources are released at the conclusion of the body. Resource acqusition is only supported for Scout and RCX 2. NOTE - event monitoring and resource acquisition are still in preliminary form. There are a number of unimplemented details... - Nesting of monitor and/or acquire statements will almost certainly result in programs that don't operate as expected. - Statments such as break, continue, or return that cause flow control from inside a monitor/acquire statement to outside it will not operate properly. version 2.1 r2 -------------- * disabled duplicate reduction code in rcxlib when sending RCX messages. This should only affect people using the rcxlib sources for their own projects - nqc never directly used this behavior. * added an error for recursive function calls * fixed a bug in local variable allocation when one inline function calls a second one * orphan subs (those never invoked from any task) are now allowed to allocate variables from the main task's pool (previously they couldn't allocate any variables) version 2.1 r1 -------------- * code generation for repeat() has been improved quite a bit - correctly implemented for Scout - nested repeats() are now legal - the repeat count can be greater than 255 - the RCX loop counter is used whenever possible (non-nested repeat with compile time constant count of 0-255), otherwise a temporary variable is claimed to do the repeat. Note that this will break code that used every single variable and then had a repeat count that came from a variable. In previous versions of NQC, the repeat would use the built-in loop counter even though the repeat count (in the variable) may have exceeded 255. The current version of NQC is more paranoid, and will not use the built-in loop counter in this case, thus a temporary variable needs to be allocated. * total bytecode size is included in the listing version 2.1 b3 (beta 3) ----------------------- * Fixed bug where __SCOUT was not defined properly * Output files now default to being placed in the current directory rather that next to the source file. * Trailing directory delimiter (e.g. / for Unix) is now optional with the -I option. * For WIN32, command line escaping of quotes (e.g. \") is disabled. This is a temporary measure for RcxCC compatability until RcxCC can be updated. version 2.1 b2 (beta 2) ----------------------- * Added the NQC_OPTIONS environment variable, which can be used to specify extra options to be inserted into the command line. For example, setting NQC_OPTIONS to "-TScout" would cause nqc to target the Scout by default. * A 'switch' statement was added. The generated code is reasonably good considering the limitations of the RCX bytecodes. However, some optimizations (such as surpressing a 'break' in the last case) are not implemented [yet]. * Expressions are now coerced into conditions where appropriate. For example, you can do this: int x; while(x) { } * Improved Scout support - battery level is checked on download, API file merged into compiler so "scout.nqh" no longer needs to be included, PlayTone() now supports both constant and variable argument for frequency. * Switched over to official Lego mnemonics for those operations listed in the Scout SDK. Bytecodes not present on Scout still use the older NQC mnemonics, but will change eventually. * __type() operator added. This is just a nasty low-level hack to allow an inline function to call two different bytecodes depending on the type of the argument passed in. Used for PlayTone() when targeting the Scout. * fixed a bug introduced in 2.1 b1 that caused problems using include files with DOS line endings. version 2.1 b1 (beta 1) ----------------------- * Added preliminary support for Scout. See "scout.txt" for more information on Scout support in NQC. * Added support for faster firmware downloading. Firmware will download about 4 times as fast with this option, but it requires the IR tower to be in "near" mode. If you have trouble getting the fast download to work, please revert to the older (and slower) method. Fast: nqc -firmfast Slow: nqc -firmware * The -o, -e, and -s options have been removed (they were deprecated quite a while back). If you still use these options, please change to the -O, -E, and -S variant. * The -c option (cybermaster support) has been deprectaed. NQC now has a more general option to specify the target: use -TCM for cybermaster: nqc -TCM -d test.nqc Other targets include -TScout and -TRCX (the default). * A couple of bugs relating to compiling stdin were fixed. version 2.0.2 ------------- Fixed a bug which caused NQC to crash when compiling programs containing functions with certain errors in them. version 2.0.1 ------------- Fixed a bug that caused the compiler to crash when more than 32 variables were used in a program. The Win32 version no longer aborts due to serial driver errors - the retry algorithm will remain in effect. This makes download of very long programs much more reliable (especially under WinNT). The retry algorithm is now more forgiving if the IR tower doesn't echo the serial data properly. This makes very long downloads a little more reliable. version 2.0 ----------- First official release of NQC 2.0 nqc-3.1.r6/mkdata/0000700000175000017500000000000010633241725012032 5ustar blpblpnqc-3.1.r6/mkdata/mkdata.cpp0000600000175000017500000000342310156106474014004 0ustar blpblp#include #include #include "SRecord.h" using std::fopen; using std::strcmp; //static char *sTestArgs[]={"mkdata", "rcx.nqh", "rcx_data.h", "rcxData" }; static char *sTestArgs[]={"mkdata", "-s", "fastdl.srec", "RCX_nub.h", "rcxNub" }; int main(int argc, char **argv) { FILE *src; FILE *dst; int n; bool srecMode = false; SRecord srec; if (argc == 0) { // special case for debugging under the Metrowerks console argv = sTestArgs; argc = sizeof(sTestArgs) / sizeof(char *); } if (argc == 5 && (strcmp(argv[1],"-s")==0)) { for(int i=1; i<4; i++) argv[i]=argv[i+1]; argc--; srecMode = true; } if (argc != 4) { fprintf(stderr, "Usage: mkdata [-s] sourceFile destFile arrayName\n"); return -1; } src = fopen(argv[1], "r"); if (!src) { fprintf(stderr, "Error: could not open %s\n", argv[1]); return -1; } if (srecMode && !srec.Read(src, 65536)) { fprintf(stderr, "Error: %s is not a valid S-Record file\n", argv[1]); return -1; } dst = fopen(argv[2], "w"); if (!dst) { fprintf(stderr, "Error: could not create %s\n", argv[2]); fclose(src); return -1; } fprintf(dst,"static const %s char %s[]={\n", srecMode ? "unsigned" : "", argv[3]); n = 0; if (srecMode) { const UByte *ptr = srec.GetData(); int length = srec.GetLength(); while(length--) { fprintf(dst,"0x%02x,", *ptr++); if (++n == 16) { n = 0; fputs("\n", dst); } } } else { int c; while((c=fgetc(src)) != EOF) { if (c=='\n') fputs("\'\\n\',", dst); else fprintf(dst,"%d,", c); if (++n == 16) { n = 0; fputs("\n", dst); } } } fprintf(dst,"};\n"); fclose(src); fclose(dst); return 0; } nqc-3.1.r6/mkdata.cbx0000600000175000017500000003440307777475270012561 0ustar blpblp nqc-3.1.r6/mkdata.cbx.local0000600000175000017500000000036110372363202013616 0ustar blpblpbuildhistory.win32b_Preprocess[0]=Target settings buildhistory.win32b_bcc32[0]=Paths and Defines buildhistory.win32b_brcc32[0]=Paths and Defines buildhistory.win32b_ilink32[0]=Target settings buildtool_history_project.win32b[0]=ilink32 nqc-3.1.r6/nqc/0000700000175000017500000000000010633241725011352 5ustar blpblpnqc-3.1.r6/nqc/.cvsignore0000600000175000017500000000001107754122134013346 0ustar blpblp.DS_Storenqc-3.1.r6/nqc/Carbon.r0000600000175000017500000000056407754122134012752 0ustar blpblp/* * Permit this Carbon application to launch on OS X * * © 1997-2000 Metrowerks Corp. * * Questions and comments to: * * */ /*----------------------------carb ¥ Carbon on OS X launch information --------------------------*/ type 'carb' { }; resource 'carb'(0) { };nqc-3.1.r6/nqc/CmdLine.cpp0000600000175000017500000000722210216071270013367 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include "CmdLine.h" #include #include CmdLine::~CmdLine() { unsigned int i; for(i=0; i buf) { *dst = 0; if (!skip) Add(buf); } delete [] buf; } #if 0 void CmdLine::Parse(const char *line) { const char *start, *ptr; if (!line) return; ptr = line; while(*ptr) { // eat up leading whitespace for(start = ptr; *start; ++start) if (!isspace(*start)) break; if (*start == 0) break; if (*start == '\"') { ++start; // find closing quote for(ptr = start; *ptr; ++ptr) { if (*ptr == '\\') { // char was escaped if (ptr[1] != 0) ++ptr; } else if (*ptr == '\"') break; } Add(start, ptr, true); if (*ptr == '\"') ++ptr; } else { // find end of token for(ptr = start; *ptr; ++ptr) if (isspace(*ptr)) break; // new argument if (ptr > start) Add(start, ptr, false); } } } void CmdLine::Add(const char *start, const char *end, bool escape) { int len = end - start; char *arg = new char[len + 1]; char *dst = arg; while(len--) { if (escape && *start == '\\') ++start; else *dst++ = *start++; } *dst++ = 0; fArgs.Append(arg); } #endif nqc-3.1.r6/nqc/CmdLine.h0000600000175000017500000000254310216071264013040 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __CmdLine_h #define __CmdLine_h #include #include using std::atoi; using std::vector; class CmdLine { public: CmdLine() : fPos(0) {}; ~CmdLine(); void Add(const char *a); // make copy and add to arglist void Add(int argc, const char * const *argv); // add multiple args void Parse(const char *line, int skip = 0); // parse line and add args int Remain() const { return fArgs.size() - fPos; } const char *Next() { return fArgs[fPos++]; } int NextInt() { return atoi(Next()); } private: vector fArgs; int fPos; }; #endif nqc-3.1.r6/nqc/debug_env.c0000600000175000017500000000374210156104764013465 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 2000 David Baum. * All Rights Reserved. */ /* * This file is strictly for the Macintosh debug build and can be used * to test the effects of different environment variable settings by * adding the appropriate name/value pair to sEnvironment. Most release * builds of NQC rely on a real version of getenv() that actually reads * environment variables. */ #include #include #if defined(__cplusplus) && defined(_MSL_USING_NAMESPACE) namespace std { #endif static char *sEnvironment[]= { // "NQC_INCLUDE", "::nqc_src:", // "NQC_OPTIONS", "-Trcx2 -v -raw 120e00", "NQC_OPTIONS", "-Susb -Tspy -l foo.nqc", // "NQC_OPTIONS", "-firmfast firm0330.lgo", // "RCX_PORT", "/dev/cu.USA19QI21P1.1", // "RCX_PORT", "/dev/cu.IrDA-IrCOMMch-b", "RCX_PORT", "usb", }; #define kEnvCount (sizeof(sEnvironment) / (2 * sizeof(const char *))) // hack to disable SIOUX delays #ifdef SIOUX extern "C" Boolean SIOUXUseWaitNextEvent; /* Can we use WaitNextEvent? ...*/ #endif char* getenv(const char *name) { #ifdef SIOUX static bool inited = false; if (!inited) { printf("\n"); SIOUXUseWaitNextEvent = false; inited = true; } #endif int i; for(i=0; i #define DEBUG #define PDEBUG nqc-3.1.r6/nqc/DirList.cpp0000600000175000017500000000400010220015044013405 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #include #if defined(__MWERKS__) && (!__MACH__) #include #else #include #endif #include "DirList.h" using std::strcat; using std::strlen; using std::size_t; #ifdef DEBUG using std::strcpy; #endif DirList::~DirList() { Entry *e; while((e=fEntries.RemoveHead()) != 0) delete e; } void DirList::Add(const char *path) { // ignore NULL or empty path if (path==0 || *path==0) return; Entry *e = new Entry(path); fEntries.InsertTail(e); } bool DirList::Find(const char *filename, char *pathname) { struct stat stat_buf; strcpy(pathname, filename); if (stat(pathname, &stat_buf) == 0) return true; for(Entry *e = fEntries.GetHead(); e; e=e->GetNext()) { strcpy(pathname, e->GetPath()); strcat(pathname, filename); if (stat(pathname, &stat_buf) == 0) { return true; } } return false; } DirList::Entry::Entry(const char *path) { size_t length = strlen(path); fPath = new char[length+2]; // leave room for terminating delimiter strcpy(fPath, path); // should we append the delimiter? if (path[length-1] != DIR_DELIMITER) { fPath[length] = DIR_DELIMITER; fPath[length+1] = 0; } } DirList::Entry::~Entry() { delete [] fPath; } nqc-3.1.r6/nqc/DirList.h0000600000175000017500000000316510216071176013102 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1999 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifndef __DirList_h #define __DirList_h #ifndef __PListS_h #include "PListS.h" #endif class DirList { public: enum { kMaxPathname = 1024 }; ~DirList(); void Add(const char *dirspec); bool Find(const char *filename, char *pathname); private: class Entry : public PLinkS { public: Entry(const char *path); ~Entry(); const char * GetPath() const { return fPath; } private: char* fPath; }; PListS fEntries; }; /* * the following conditions attempt to set DIR_DELIMITER base * on the intended target. They may be overridden by defining * DIR_DELIMITER prior to compilation. */ #if !defined(DIR_DELIMITER) #if defined(macintosh) #define DIR_DELIMITER ':' #elif defined(WIN32) #define DIR_DELIMITER '\\' #else // assume unix #define DIR_DELIMITER '/' #endif #endif #endif nqc-3.1.r6/nqc/nqc.cpp0000600000175000017500000007467110631570666012667 0ustar blpblp/* * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * * The Initial Developer of this code is David Baum. * Portions created by David Baum are Copyright (C) 1998 David Baum. * All Rights Reserved. * * Portions created by John Hansen are Copyright (C) 2005 John Hansen. * All Rights Reserved. * */ #ifdef WIN32 #include #endif #include #include #include #include #include #include "Program.h" #include "RCX_Image.h" #include "RCX_Link.h" #include "Symbol.h" #include "PreProc.h" #include "parser.h" #include "Macro.h" #include "RCX_Cmd.h" #include "RCX_Log.h" #include "SRecord.h" #include "AutoFree.h" #include "DirList.h" #include "Buffer.h" #include "Error.h" #include "Compiler.h" #include "CmdLine.h" #include "version.h" using std::fopen; using std::printf; using std::time_t; using std::localtime; using std::tm; // use this to check for memory leaks in the compiler //#define CHECK_LEAKS // use these to debug the LEXER //#define TEST_LEXER 1 // test lexer only //#define TEST_LEXER 2 // test lexer and pre-processor #ifdef CHECK_LEAKS #include #endif // some win32 consoles are lame...use stdout instead of stderr for usage, etc. #ifdef WIN32 #define STDERR stdout #else #define STDERR stderr #endif FILE *gErrorStream = stderr; #define kMaxPrintedErrors 10 class AutoLink : public RCX_Link { public: AutoLink() : fSerialPort(0), fOpen(false) {} ~AutoLink() { Close(); } RCX_Result Open(); void Close(); RCX_Result Send(const RCX_Cmd *cmd, bool retry=true); void SetSerialPort(const char *sp) { fSerialPort = sp; } bool DownloadProgress(int soFar, int total); private: const char* fSerialPort; bool fOpen; }; class MyCompiler : public Compiler, public ErrorHandler { public: MyCompiler() {} Buffer *CreateBuffer(const char *name); void AddError(const Error &e, const LexLocation *loc); void AddDir(const char *dirspec) { fDirs.Add(dirspec); } private: DirList fDirs; } gMyCompiler; #define kMaxFirmware 65536 #define kOldIncludePathEnv "NQCC_INCLUDE" #define kNewIncludePathEnv "NQC_INCLUDE" #define kOptionsEnv "NQC_OPTIONS" #define kLowBattery 6600 #define kLow45Battery 3300 #define kRCXFileExtension ".rcx" #define kNQCFileExtension ".nqc" // error codes in addition to RCX_Result codes #define kUsageError (kRCX_LastError - 1) #define kQuietError (kRCX_LastError - 2) // codes for the actions enum { kFirstActionCode = 256, kDatalogCode = kFirstActionCode, kDatalogFullCode, kClearMemoryCode, kFirmwareCode, kFirmware4xCode, kNearCode, kFarCode, kWatchCode, kSleepCode, kRunCode, kProgramCode, kMessageCode, kRawCode, kRaw1Code, kRemoteCode, kApiCode, kHelpCode, kCompileStdinCode }; // these must be in the same order as the codes for the long options static const char *sActionNames[] = { "datalog", "datalog_full", "clear", "firmware", "firmfast", "near", "far", "watch", "sleep", "run", "pgm", "msg", "raw", "raw1", "remote", "api", "help", "" }; // these MUST be in the same order as the RCX_TargetType values static const char *sTargetNames[] = { "rcx", "cm", "scout", "rcx2", "spy", "swan" }; struct Request { const char *fSourceFile; const char *fOutputFile; const char *fListFile; bool fListing; bool fSourceListing; bool fDownload; bool fBinary; bool fGenLASM; int fFlags; }; static int GetActionCode(const char *arg); static RCX_Result ProcessCommandLine(int argc, char **argv); static void PrintError(RCX_Result error, const char *filename = 0); static void PrintUsage(); static void DefineMacro(const char *text); static RCX_Result ProcessFile(const char *sourceFile, const Request &req); static char *CreateFilename(const char *source, const char *oldExt, const char *newExt); static const char *LeafName(const char *filename); static int CheckExtension(const char *s1, const char *ext); static RCX_Image *Compile(const char *sourceFile, int flags); static bool GenerateListing(RCX_Image *image, const char *filename, bool includeSource, bool generateLASM); static RCX_Result Download(RCX_Image *image); static RCX_Result UploadDatalog(bool verbose); static RCX_Result DownloadFirmware(const char *filename, bool fast); static RCX_Result SetWatch(const char *timeSpec); static RCX_Result SetErrorFile(const char *filename); static RCX_Result RedirectOutput(const char *filename); static RCX_Result SendRawCommand(const char *text, bool retry); static RCX_Result ClearMemory(); static RCX_Result SetTarget(const char *name); static RCX_Result SendRemote(const char *event, int repeat); static void PrintToken(int t, TokenVal v); static void PrintApi(bool compatMode); static bool SameString(const char *s1, const char *s2); static void PrintVersion(); AutoLink gLink; RCX_TargetType gTargetType = kRCX_RCXTarget; bool gVerbose = false; int gTimeout = 0; bool gQuiet = false; int main(int argc, char **argv) { RCX_Result result; // add any default include paths gMyCompiler.AddDir(getenv(kOldIncludePathEnv)); gMyCompiler.AddDir(getenv(kNewIncludePathEnv)); result = ProcessCommandLine(argc, argv); PrintError(result); gLink.Close(); if (gErrorStream != stderr && gErrorStream != stdout) fclose(gErrorStream); #ifdef DEBUG_NEW printf("%d allocations, %d total bytes, %d max\n", gDebugNewAllocCount, gDebugNewAllocCurr, gDebugNewAllocMax); #endif return RCX_ERROR(result) ? result : 0; } RCX_Result ProcessCommandLine(int argc, char ** argv) { bool optionsOK = true; bool fileProcessed = false; Request req = { 0 }; // rest will be zero'ed CmdLine args; RCX_Result result = kRCX_OK; RCX_Cmd cmd; // first add environment options args.Parse(getenv(kOptionsEnv)); // add all command line args after the first one #ifdef WIN32 // For Win32, bypass the argc/argv array and get the raw command line // This is for backwards compatability with BricxCC which doesn't like its // args to be escaped by the runtime #pragma unused(argc, argv) args.Parse(GetCommandLineA(), 1); #else if (argc > 1) args.Add(argc-1, argv+1); #endif // process the args while(args.Remain() && !RCX_ERROR(result)) { const char* a=args.Next(); bool isOption = (a[0] == '-'); #ifdef WIN32 if (a[0]=='/') isOption = true; #endif if (isOption) { int code = GetActionCode(a+1); if (code) { optionsOK = false; } else { if (!optionsOK) return kUsageError; code = a[1]; } switch(code) { // options case '1': req.fFlags |= Compiler::kCompat_Flag; break; case 'D': if (*(a+2)=='\0') return kUsageError; DefineMacro(a+2); break; case 'E': result = SetErrorFile(a+2); break; case 'I': if (*(a+2)=='\0') return kUsageError; gMyCompiler.AddDir(a+2); break; case 'L': req.fListing = true; req.fListFile = a[2] ? a+2 : 0; break; case 'R': result = RedirectOutput(a+2); break; case 's': req.fSourceListing = true; break; case 'c': req.fGenLASM = true; break; case 'O': if (*(a+2)=='\0') return kUsageError; req.fOutputFile = a+2; break; case 'S': if (*(a+2)=='\0') return kUsageError; gLink.SetSerialPort(a+2); break; case 'T': if (*(a+2)=='\0') return kUsageError; result = SetTarget(a+2); break; case 'x': gLink.SetOmitHeader(true); break; // case 'p': // if (*(a+2)=='\0') return kUsageError; // gLink.SetRCXProgramChunkSize(atoi(a+2)); // break; case 'f': if (*(a+2)=='\0') return kUsageError; gLink.SetRCXFirmwareChunkSize(atoi(a+2)); break; case 'w': if (*(a+2)=='\0') return kUsageError; gLink.SetDownloadWaitTime(atoi(a+2)); break; case 'U': if (*(a+2)=='\0') return kUsageError; Compiler::Get()->Undefine(a+2); break; case 'd': req.fDownload = true; break; case 'l': req.fListing = true; break; case 'n': req.fFlags |= Compiler::kNoSysFile_Flag; break; case 'b': req.fBinary = true; break; case 't': if (!args.Remain()) return kUsageError; gTimeout = args.NextInt(); break; case 'v': gVerbose = true; break; case 'q': gQuiet = true; break; // actions case kCompileStdinCode: result = ProcessFile(nil, req); fileProcessed = true; break; case kDatalogCode: result = UploadDatalog(false); break; case kDatalogFullCode: result = UploadDatalog(true); break; case kClearMemoryCode: result = ClearMemory(); break; case kFirmwareCode: if (!args.Remain()) return kUsageError; result = DownloadFirmware(args.Next(), false); break; case kFirmware4xCode: if (!args.Remain()) return kUsageError; result = DownloadFirmware(args.Next(), true); break; case kNearCode: result = gLink.Send(cmd.Set(kRCX_IRModeOp, 0)); break; case kFarCode: result = gLink.Send(cmd.Set(kRCX_IRModeOp, 1)); break; case kWatchCode: if (!args.Remain()) return kUsageError; result = SetWatch(args.Next()); break; case kSleepCode: if (!args.Remain()) return kUsageError; result = gLink.Send(cmd.Set(kRCX_AutoOffOp, (UByte)args.NextInt())); break; case kRunCode: result = gLink.Send(cmd.Set(kRCX_StartTaskOp, getTarget(gTargetType)->fRanges[kRCX_TaskChunk].fBase)); break; case kProgramCode: if (!args.Remain()) return kUsageError; result = gLink.Send(cmd.Set(kRCX_SelectProgramOp, (UByte)(args.NextInt()-1))); break; case kMessageCode: if (!args.Remain()) return kUsageError; result = gLink.Send(cmd.Set(kRCX_Message, (UByte)(args.NextInt())), false); break; case kRawCode: case kRaw1Code: // one-time send, no retry if (!args.Remain()) return kUsageError; result = SendRawCommand(args.Next(), code == kRawCode); break; case kRemoteCode: if (args.Remain() < 2) return kUsageError; { const char *event = args.Next(); int repeat = args.NextInt(); result = SendRemote(event, repeat); } break; case kApiCode: PrintApi(req.fFlags & Compiler::kCompat_Flag); break; case kHelpCode: PrintUsage(); break; default: return kUsageError; } } else if (!fileProcessed) { result = ProcessFile(a, req); #ifdef CHECK_LEAKS int firstAllocCount = gDebugNewAllocCount; Compiler::Get()->Reset(); result = ProcessFile(a, req); printf("%d leaked allocations\n", gDebugNewAllocCount - firstAllocCount); #endif optionsOK = false; fileProcessed = true; } else return kUsageError; } // check if we did anything (compile and/or actions) if (optionsOK) return kUsageError; return result; } void PrintApi(bool compatMode) { Buffer *b = Compiler::CreateApiBuffer(compatMode); fwrite(b->GetData(), b->GetLength(), 1, stdout); delete b; } RCX_Result SetTarget(const char *name) { for(unsigned int i=0; itm_hour; minute = tmp->tm_min; } else { int t = atoi(timeSpec); hour = t / 100; minute = t % 100; } return gLink.Send(cmd.Set(kRCX_SetWatchOp, (UByte)hour, (UByte)minute)); } RCX_Result ProcessFile(const char *sourceFile, const Request &req) { RCX_Image *image; RCX_Result result = kRCX_OK; bool ok = true; bool compiled = false; if (sourceFile && (req.fBinary || CheckExtension(sourceFile, kRCXFileExtension))) { // load RCX image file image = new RCX_Image(); result = image->Read(sourceFile); if (RCX_ERROR(result)) { PrintError(result, sourceFile); delete image; return kQuietError; } } else { // compile file compiled = true; image = Compile(sourceFile, req.fFlags); if (!image) { int errors = ErrorHandler::Get()->GetErrorCount(); if (errors) fprintf(gErrorStream, "# %d error%s during compilation\n", errors, errors==1 ? "" : "s"); return kQuietError; } const char *outputFile = req.fOutputFile; char *newFilename = 0; if (!req.fDownload && !req.fListing && !req.fOutputFile && sourceFile) outputFile = newFilename = CreateFilename(LeafName(sourceFile), kNQCFileExtension, kRCXFileExtension); if (outputFile) { if (!image->Write(outputFile)) { fprintf(gErrorStream, "Error: could not create output file \"%s\"\n", outputFile); ok = false; } } if (newFilename) delete [] newFilename; } // generate the listing if (req.fListing) { if (!GenerateListing(image, req.fListFile, compiled && req.fSourceListing, req.fGenLASM)) ok = false; } // reset the compiler after generating the listing so that the Compiler's // buffers will be available for inserting source code into the listing if (compiled) Compiler::Get()->Reset(); if (req.fDownload) { result = Download(image); } // Check for the case of a listing or output file failure but // download ok. In this case an error code must still be returned // so that command line processing stops and main() indicates // the failure if (result==kRCX_OK && !ok) result = kQuietError; delete image; return result; } bool GenerateListing(RCX_Image *image, const char *filename, bool includeSource, bool generateLASM) { FILE *fp; if (filename) { fp = fopen(filename, "w"); if (!fp) { fprintf(STDERR, "Error: could not generate listing to file %s\n", filename); return false; } } else fp = stdout; RCX_StdioPrinter dst(fp); image->Print(&dst, includeSource ? Compiler::Get() : 0, generateLASM); if (fp != stdout) fclose(fp); return true; } RCX_Result Download(RCX_Image *image) { RCX_Result result; RCX_Cmd cmd; fprintf(STDERR, "Downloading Program:"); result = gLink.Open(); if (result != kRCX_OK) goto ErrorReturn; result = image->Download(&gLink); if (result != kRCX_OK) goto ErrorReturn; fprintf(STDERR, "complete\n"); result = gLink.GetBatteryLevel(); if (!RCX_ERROR(result)) { fprintf(STDERR, "Battery Level = %3.1f V\n", (double)result / 1000); int lowBatt = (gTargetType==kRCX_SpyboticsTarget) ? kLow45Battery : kLowBattery; if (result < lowBatt) fprintf(STDERR, "*** Warning: batteries are low ***\n"); } return kRCX_OK; ErrorReturn: fprintf(STDERR, "error\n"); return result; } RCX_Image *Compile(const char *sourceFile, int flags) { Buffer *mainBuf; if (sourceFile) { FILE *fp = fopen(sourceFile, "rb"); if (!fp) { fprintf(gErrorStream, "Error: could not open file \"%s\"\n", sourceFile); return nil; } mainBuf = new Buffer(); mainBuf->Create(sourceFile, fp); fclose(fp); } else { mainBuf = new Buffer(); mainBuf->Create("", stdin); } #ifdef TEST_LEXER LexPush(mainBuf); int t; TokenVal v; LexLocation loc; #if TEST_LEXER > 1 while((t=gPreProc->Get(v)) != 0) #else while((t=yylex(v)) != 0) #endif { LexCurrentLocation(loc); printf("%3d (%2d) : ", loc.fOffset, loc.fLength); PrintToken(t, v); } LexCurrentLocation(loc); printf("%3d (%2d) : EOF\n", loc.fOffset, loc.fLength); return 0; #else Buffer *b = new Buffer(); b->Create(mainBuf->GetName(), mainBuf->GetData(), mainBuf->GetLength()); return Compiler::Get()->Compile(mainBuf, getTarget(gTargetType), flags); #endif } RCX_Result UploadDatalog(bool verbose) { RCX_Log log; RCX_Result result; int i; fprintf(STDERR, "Uploading Datalog"); result = gLink.Open(); if (RCX_ERROR(result)) return result; result = log.Upload(&gLink); if (RCX_ERROR(result)) return result; fprintf(STDERR, "\n"); for(i=0; i 0) { for(int i=0; i= filename) { // check for delimiter if (*ptr == DIR_DELIMITER) break; #ifdef WIN32 // extra check for ':' in paths for Windows if (*ptr == ':') break; #endif --ptr; } // we either stopped at the char before the first, or at // the delimiter - either way return pointer to next char return ptr+1; } RCX_Result SetErrorFile(const char *filename) { FILE *fp; if (*filename==0) { gErrorStream = stdout; return kRCX_OK; } fp = fopen(filename, "w"); if (!fp) { fprintf(STDERR, "Error: could not open error file \'%s\'\n", filename); return kQuietError; } gErrorStream = fp; return kRCX_OK; } RCX_Result RedirectOutput(const char *filename) { if (*filename==0) { fprintf(STDERR, "Error: -R requires a filename\n"); return kQuietError; } if (!freopen(filename, "w", stdout)) { fprintf(STDERR, "Error: could not open output file \'%s\'\n", filename); return kQuietError; } return kRCX_OK; } void DefineMacro(const char *text) { const char *body; body = strchr(text, '='); if (body) { // create a copy of the symbol name int length = body - text; char *name = new char[length+1]; memcpy(name, text, (size_t)length); name[length] = 0; Compiler::Get()->Define(name, body+1); delete [] name; } else { Compiler::Get()->Define(text); } } int GetActionCode(const char *arg) { for(int i=0; i< (int)(sizeof(sActionNames)/sizeof(const char *)); ++i) if (strcmp(sActionNames[i], arg)==0) return i+kFirstActionCode; return 0; } void PrintError(RCX_Result error, const char *filename) { const char *targetName = getTarget(gTargetType)->fName; if (!filename) filename = "?"; if (error >= 0) return; switch(error) { case kRCX_RequestError: fprintf(STDERR, "Request error\n"); break; case kRCX_OpenSerialError: fprintf(STDERR, "Could not open serial port or USB device\n"); break; case kRCX_IREchoError: fprintf(STDERR, "Problem talking to IR device\n"); break; case kRCX_ReplyError: if (gLink.WasErrorFromMissingFirmware()) { fprintf(STDERR, "No firmware installed on %s\n", targetName); } else { fprintf(STDERR, "No reply from %s\n", targetName); } break; case kRCX_MemFullError: fprintf(STDERR, "Not enough free memory in %s to download program\n", targetName); break; case kRCX_FileError: fprintf(STDERR, "Could not access file \'%s\'\n", filename); break; case kRCX_FormatError: fprintf(STDERR, "File \'%s\' is not a valid RCX image\n", filename); break; case kUsageError: PrintVersion(); fprintf(STDERR,"Usage error: try \'nqc -help\' to display options\n"); break; case kQuietError: break; case kRCX_PipeModeError: fprintf(STDERR,"USB driver does not support -firmfast, CyberMaster, or Spybotics\n"); break; case kRCX_USBUnsupportedError: fprintf(STDERR,"USB Tower not supported\n"); break; case kRCX_GhostNotFoundError: fprintf(STDERR,"Ghost libraries are not installed properly\n"); break; default: fprintf(STDERR, "Error #%d\n", -error); break; } } void PrintVersion() { fprintf(STDERR,"nqc version %s (built "__DATE__", " __TIME__")\n", VERSION_STRING); fprintf(STDERR," Copyright (C) 2005 John Hansen. All Rights Reserved.\n"); } void PrintUsage() { PrintVersion(); fprintf(stdout,"Usage: nqc [options] [actions] [ - | filename ] [actions]\n"); fprintf(stdout," - : read from stdin instead of a source_file\n"); fprintf(stdout,"Options:\n"); fprintf(stdout," -T: target can be RCX, CM, Scout, RCX2, Spy, or Swan\n"); fprintf(stdout," -d: download program\n"); fprintf(stdout," -n: prevent the system file (rcx.nqh) from being included\n"); fprintf(stdout," -b: treat input file as a binary file (don't compile it)\n"); fprintf(stdout," -D[=] : define macro \n"); fprintf(stdout," -E[] : write compiler errors to (or stdout)\n"); fprintf(stdout," -R : redirect text output (datalog, etc) to \n"); fprintf(stdout," -I: search for include files\n"); fprintf(stdout," -L[] : generate code listing to (or stdout)\n"); fprintf(stdout," -s: include source code in listings if possible\n"); fprintf(stdout," -c: generate LASM compatible listings\n"); fprintf(stdout," -v: verbose\n"); fprintf(stdout," -q: quiet\n"); fprintf(stdout," -x: omit packet header (RCX only)\n"); fprintf(stdout," -f: set firmware chunk size\n"); fprintf(stdout," -w: set the download wait timeout\n"); // fprintf(stdout," -p: set program chunk size\n"); // fprintf(stdout," -X: set USB tower speed factor (<100=faster, >100=slower)\n"); fprintf(stdout," -O: specify output file\n"); fprintf(stdout," -S: specify serial port\n"); fprintf(stdout," -U: undefine macro \n"); fprintf(stdout,"Actions:\n"); fprintf(stdout," -run: run current program\n"); fprintf(stdout," -pgm : select program number\n"); fprintf(stdout," -datalog | -datalog_full: upload datalog\n"); fprintf(stdout," -near: set IR to near mode\n"); fprintf(stdout," -far: set IR to far mode\n"); fprintf(stdout," -watch