Author: stepan
Date: 2006-10-30 17:29:59 +0100 (Mon, 30 Oct 2006)
New Revision: 108
Added:
fcode-utils/COPYING
fcode-utils/README
fcode-utils/TODO
fcode-utils/romheaders/COPYING
Log:
some more infrastructure
Added: fcode-utils/COPYING
===================================================================
--- fcode-utils/COPYING (rev 0)
+++ fcode-utils/COPYING 2006-10-30 16:29:59 UTC (rev 108)
@@ -0,0 +1,341 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Added: fcode-utils/README
===================================================================
--- fcode-utils/README (rev 0)
+++ fcode-utils/README 2006-10-30 16:29:59 UTC (rev 108)
@@ -0,0 +1,16 @@
+This is the OpenBIOS FCODE suite.
+
+It consists of:
+
+- toke
+- detok
+- romheaders
+- localvalues
+
+NOTE: all parts of the OpenBIOS FCODE suite are GPL v2, except the localvalues
+implementation which is released under the Common Public License (CPL) version
+1.0 (see: http://www.opensource.org/licenses/cpl1.0.php)
+
+
+For information please contact info(a)coresystems.de
+
Added: fcode-utils/TODO
===================================================================
--- fcode-utils/TODO (rev 0)
+++ fcode-utils/TODO 2006-10-30 16:29:59 UTC (rev 108)
@@ -0,0 +1,298 @@
+fcode-utils/detok/decode.c
+ Line 46:
+ *
+ * Still to be done:
+ * Handling of indent-level is not correct. Branches should
+ * balance with their resolvers; constructs like do..loop
+ * case/of/endof/endcase are a few major examples.
+ * This will be tricky; the rules need to be carefully thought
+ * out, and the implementation might be more complex than
+ * at first meets the eye...
+ *
+
+ Line 280:
+ *
+ * Still to be done:
+ * More sophisticated error-checking for invalid offsets. Look
+ * at the type of branch, and what should be expected in the
+ * vicinity of the destination. (This might be best served
+ * by a separate routine).
+ * This might also help with handling the indent-level correctly...
+ * Also, if indentation were to be handled in this routine,
+ * there would be no need to return the value of the offset.
+ *
+
+
+fcode-utils/detok/pcihdr.c
+ Line 67:
+ *
+ * Still to be done:
+ * Print (as remarks) full descriptions of headers' fields
+ * Error check for wrong "Format"
+ * Skip past non-FCode blocks, thru multiple data-blocks
+ * Recognize PCI header in unexpected place or out-of-place
+ *
+
+ Line 130:
+ *
+ * Still to be done:
+ * Error-check; look for inconsistencies:
+ * Return a Negative Number if data-stream appears to be a PCI
+ * header, but has erroneous or inconsistent sub-field contents.
+ * Value and meaning of the Negative Number yet to be defined.
+ *
+
+ Line 188:
+ *
+ * Still to be done:
+ * Error-check; look for wrong "Code Type" or other inconsistencies:
+ * Return a Negative Number if data-stream appears to be a
+ * valid PCI Data Structure, but has erroneous or inconsistent
+ * sub-field contents.
+ * Value and meaning of the Negative Number yet to be defined.
+ * Skip past non-FCode data-blocks, even multiple blocks
+ *
+
+ Line 364:
+ *
+ * Still to be done:
+ * Handle error cases. At present, neither is_pci_header()
+ * nor is_pci_data_struct() returns a negative number,
+ * but when they are modified to do so, we must handle it.
+ *
+
+ Line 442:
+ *
+ * Still to be done:
+ * Come up with something more elegant for non-zero filler.
+ *
+
+
+fcode-utils/detok/printformats.c
+ Line 74:
+ *
+ * Still to be done:
+ * Define a routine, call it PrintComment , to print the given
+ * string surrounded by open-paren-space ... space-close-paren
+ * Define a single central routine, call it safe_malloc ,
+ * to do the test for null and print "No Memory" and exit.
+ * Define a single central routine, call it PrintError , to:
+ * Print the given error message
+ * Show the input file and line number
+ * Collect error-flags for failure-exit at end of operation.
+ *
+
+
+fcode-utils/toke/devnode.c
+ Line 67:
+ *
+ * Still to be done:
+ * Add a pair of fields to the data-structure for the Input File and
+ * Line Number where "finish-device" occurred. When a device-node
+ * is "finish"ed, do not delete it, but instead fill in those
+ * fields and the move the node to a separate linked-list.
+ * When looking whether a word exists in an ancestor-node, also
+ * check whether it was in a device-node that was finished and
+ * print both where it was started and where it was finished.
+ *
+
+
+fcode-utils/toke/emit.c
+ Line 34:
+ *
+ * Still to be done:
+ * Re-arrange routine and variable locations to clarify the
+ * functions of this file and its companion, stream.c
+ * This file should be concerned primarily with management
+ * of the Outputs; stream.c should be primarily concerned
+ * with management of the Inputs.
+ * Hard to justify, pragmatically, but will make for easier
+ * maintainability down the proverbial road...
+ *
+
+
+fcode-utils/toke/flowcontrol.c
+ Line 75:
+ *
+ * Still to be done:
+ * Correct analysis of Return-Stack usage around Flow-Control
+ * constructs, including within Do-Loops or before Loop
+ * Elements like I and J or UNLOOP or LEAVE.
+ * Similarly, Return-Stack usage around IF ... ELSE ... THEN
+ * statements needs analysis. For instance, the following:
+ *
+ * blablabla >R yadayada IF R> gubble ELSE flubble R> THEN
+ *
+ * is, in fact, correct, while something like:
+ *
+ * blablabla >R yadayada IF R> gubble THEN
+ *
+ * is an error.
+ *
+ * Implementing an analysis that would be sufficiently accurate
+ * to justify reporting an ERROR with certainty (rather than
+ * a mere WARNING speculatively) would probably require full
+ * coordination with management of Flow-Control constructs,
+ * and so is noted here.
+ *
+
+
+fcode-utils/toke/macros.c
+ Line 166:
+ *
+ * Still to be done:
+ * If an error is encountered during Macro evaluation, display
+ * supplemental information giving the name of the Macro
+ * being run, and the file and line number in which it was
+ * defined.
+ * This will require changes to the way user Macros are added
+ * and retained, and to the way error messages are displayed.
+ *
+
+
+fcode-utils/toke/nextfcode.c
+ Line 90:
+ *
+ * Still to be done:
+ * Detect and report when the Current Range stops overlapping
+ * one particular Range and starts overlapping another.
+ *
+
+
+fcode-utils/toke/scanner.c
+ Line 1046:
+ *
+ * Still to be done:
+ * Better protection against PC pointer-over-run past END.
+ * Currently, this works, but it's held together by threads:
+ * Because init_stream forces a null-byte at the end of
+ * the input buffer, parse_number() exits immediately upon
+ * encountering it. This situation could be covered more
+ * robustly...
+ *
+
+ Line 2192:
+ *
+ * Still to be done:
+ * Full detection of whether the Return-Stack has been cleared
+ * when required, including analysis of Return-Stack usage
+ * within Flow-Control constructs, and before Loop elements...
+ *
+
+ Line 2259:
+ *
+ * Still to be done:
+ * Correct analysis of Return-Stack usage around Flow-Control
+ * constructs. Consider, for instance, the following:
+ *
+ * blablabla >R yadayada IF R> gubble ELSE flubble R> THEN
+ *
+ * It is, in fact, correct, but the present scheme would
+ * tag it as a possible error. Conversely, something like:
+ *
+ * blablabla >R yadayada IF R> gubble THEN
+ *
+ * would not get tagged, even though it is actually an error.
+ *
+ * The current simple scheme also does not cover Return-Stack
+ * usage within Do-Loops or before Loop elements like I and
+ * J or UNLOOP or LEAVE. Implementing something like that
+ * would probably need to be integrated in with Flow-Control
+ * constructs, and will be noted in flowcontrol.c
+ *
+
+ Line 2323:
+ *
+ * Still to be done:
+ * Correct analysis of Return-Stack usage...
+ *
+
+ Line 3299:
+ *
+ * Still to be done:
+ * If the definer-name is not found, we might still look up
+ * the target name in the various vocabularies and use
+ * a phrase for those. E.g., if it is a valid token,
+ * we could say it's defined as a "primitive". (I'm
+ * not sure what we'd say about an FWord...)
+ *
+
+ Line 4617:
+ *
+ * Still to be done:
+ * Correct analysis of Return-Stack usage within Do-Loops
+ * or before Loop Elements like I and J or UNLOOP or LEAVE.
+ *
+
+
+fcode-utils/toke/stream.c
+ Line 60:
+ *
+ * Still to be done:
+ * Re-arrange routine and variable locations to clarify the
+ * functions of this file and its companion, emit.c
+ * This file should be concerned primarily with management
+ * of the Inputs; emit.c should be primarily concerned
+ * with management of the Outputs.
+ * Hard to justify, pragmatically, but will make for easier
+ * maintainability down the proverbial road...
+ *
+
+ Line 1070:
+ *
+ * Still to be done:
+ * Set a flag when carr-ret has been replaced by space;
+ * when a string crosses a line, if this flag is set,
+ * issue a warning that an extra space has been inserted.
+ *
+
+
+fcode-utils/toke/toke.c
+ Line 363:
+ *
+ * Still to be done:
+ * Devise a syntax to allow the command-line to specify multiple
+ * input files together with an output file name for each.
+ * Currently, the syntax allows only one output file name to be
+ * specified; when multiple input file names are specified,
+ * the specification of an output file name is disallowed,
+ * and only the default output file names are permitted.
+ * While this works around the immediate problem, a more
+ * elegant solution could be devised...
+ *
+
+
+fcode-utils/toke/usersymbols.c
+ Line 78:
+ *
+ * Still to be done:
+ * Convert the handling of user-defined symbols to the T.I.C.
+ * data-structure and its support routines. This should
+ * eliminate any further need of String-Substitution-type
+ * vocabularies. User-defined symbols will, however, still
+ * need to be a separate vocabulary from the Global, because
+ * they are required to stay in effect for the duration of
+ * the entire batch of tokenizations...
+ * (Afterthought: This is only true for user-defined symbols that
+ * were created on the command-line; if we ever allow symbols
+ * to be defined in the Source file, they should be as volatile
+ * as anything else that comes from a source file...
+ * Appending source-file-derived user-defined symbols to the Global
+ * Vocabulary could be a quasi-simple way to accomplish this.)
+ *
+
+ Line 246:
+ *
+ * Still to be done:
+ * Hook-in this routine to the processing of: ['] F['] H# FLOAD
+ * etc., and wherever else it might be needed or useful.
+ *
+
+ Line 316:
+ *
+ * Still to be done:
+ * Space the duplicate-name notation evenly; line it up past
+ * the longest name-with-value.
+ *
+
+
Added: fcode-utils/romheaders/COPYING
===================================================================
--- fcode-utils/romheaders/COPYING (rev 0)
+++ fcode-utils/romheaders/COPYING 2006-10-30 16:29:59 UTC (rev 108)
@@ -0,0 +1,341 @@
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
Author: stepan
Date: 2006-10-30 17:25:35 +0100 (Mon, 30 Oct 2006)
New Revision: 107
Added:
fcode-utils/testsuite/TokBrack/TokBrkTst_04.fth
fcode-utils/testsuite/TokMisc/ContErr0.fth
fcode-utils/testsuite/TokMisc/DtkVSFcTst.scr
fcode-utils/testsuite/TokMisc/VSFCtest.fth
fcode-utils/testsuite/TokMisc/VendSpecFCodes
fcode-utils/testsuite/TokeErrs/DecodProp.fth
fcode-utils/testsuite/TokoLoco/GlobalLocalValuesDevel.fth
fcode-utils/testsuite/TokoLoco/LocalValuesDevelSupport.fth
fcode-utils/testsuite/TokoLoco/LocalValuesSupport.fth
fcode-utils/testsuite/TokoLoco/TotalLocalValuesSupport.fth
Removed:
fcode-utils/testsuite/TokMisc/OldTkzr/
Modified:
fcode-utils/testsuite/TokBrack/TestArgs
fcode-utils/testsuite/TokCondl/CondMacAlias_01.fth
fcode-utils/testsuite/TokCondl/TestArgs
fcode-utils/testsuite/TokMisc/AllBiFCTypes.fth
fcode-utils/testsuite/TokMisc/ContErr3.fth
fcode-utils/testsuite/TokMisc/MiscFeatures.DOS.fth
fcode-utils/testsuite/TokMisc/MiscFeatures.fth
fcode-utils/testsuite/TokMisc/StringsGenl.fth
fcode-utils/testsuite/TokMisc/TestArgs
fcode-utils/testsuite/TokeErrs/DevImbal.fth
fcode-utils/testsuite/TokeErrs/DupNams.fth
fcode-utils/testsuite/TokeErrs/MiscFeatErrs.fth
fcode-utils/testsuite/TokeErrs/TestArgs
fcode-utils/testsuite/TokoLoco/GlobalLocalValues.fth
fcode-utils/testsuite/TokoLoco/TestArgs
Log:
update testsuite to 1.0.2
Modified: fcode-utils/testsuite/TokBrack/TestArgs
===================================================================
--- fcode-utils/testsuite/TokBrack/TestArgs 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokBrack/TestArgs 2006-10-30 16:25:35 UTC (rev 107)
@@ -10,7 +10,7 @@
# Lines that have no label, no switches, and no script
# do not need any commas.
-# Updated Wed, 08 Mar 2006 at 19:11 PST by David L. Paktor
+# Updated Wed, 11 Oct 2006 at 24:44 PDT by David L. Paktor
# Might as well get the date-and-time one out of the way first...
TokBrkTst_02 , , -i -l
@@ -18,3 +18,4 @@
TokBrkTst_01 , alwyshdr , -i -f ALWays-heADers
TokBrkTst_03
TokBrkErrTst_01 , , -i
+TokBrkTst_04 , , -i -T pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz -T whatsis
Added: fcode-utils/testsuite/TokBrack/TokBrkTst_04.fth
===================================================================
--- fcode-utils/testsuite/TokBrack/TokBrkTst_04.fth (rev 0)
+++ fcode-utils/testsuite/TokBrack/TokBrkTst_04.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,76 @@
+\ Test of long names and duplication of names and maybe Tracing
+\ Updated Wed, 18 Oct 2006 at 13:34 PDT by David L. Paktor
+
+fcode-version2
+
+global-definitions
+
+true constant flunky?
+
+alias whoosis whatsis
+alias whatsis whoosis
+
+external
+decimal
+
+100 constant pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
+
+device-definitions
+
+headers
+
+h# 3760 constant whatsis
+
+#message" Sync Up Diffs w/ prev. release."n"
+alias whoosis pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
+#message"
+Sync Up again."n"
+headerless
+: pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
+ 100
+;
+pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz 2 * constant clone
+
+\ Make sure the matching goes all the way...
+instance
+: pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_oilum
+ clone
+ ['] whoosis execute
+;
+
+new-device
+80 constant this_name_has_a_whole_lot_of_syllables_and_so_would_not_be_a_good_ingredient_in_ice_cream_but_at_least_you_know_what_it_means
+
+headers
+ f[ 1cec6ea3 constant a_name_with_too_many_letters_should_not_matter_in_tokenizer_escape_mode
+ ]f
+
+: brand-x-ice-cream \ Because it uses ingredients with too many syllables
+ pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz dup 20 - do i . loop cr
+ ." Nameless one..." this_name_has_a_whole_lot_of_syllables_and_so_would_not_be_a_good_ingredient_in_ice_cream_but_at_least_you_know_what_it_means ." equals " . cr
+ ." But everyone likes an "
+ f[ a_name_with_too_many_letters_should_not_matter_in_tokenizer_escape_mode
+ f] fliteral .
+ clone . cr
+;
+
+flunky? if
+ d# 3760 constant whatsis
+else
+ d# 374 constant whatsis
+then
+
+
+finish-device
+
+overload : clone
+ pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_aretz
+ pele_yoetz_ne-ema-an_anochi_hu_ha-omer_v-oseh_v-ain_c-moni_bchol_ha_oilum
+ whatsis
+ whoosis
+;
+
+end0
+
+
+
Modified: fcode-utils/testsuite/TokCondl/CondMacAlias_01.fth
===================================================================
--- fcode-utils/testsuite/TokCondl/CondMacAlias_01.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokCondl/CondMacAlias_01.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -76,7 +76,7 @@
f[ ." Let's try some spurious [else] action, whaddya say?" ]f
: [else] ." Don't do it" ; [message] Fake [else] got through
create [else] [message] Fake [else] got through
- h# defeca8e constant [else] [message] Fake [else] got through
+ h# DeFeCA8e constant [else] [message] Fake [else] got through
h# -41100132 value [else] [message] Fake [else] got through
d# 64 buffer: [else] [message] Fake [else] got through
struct
Modified: fcode-utils/testsuite/TokCondl/TestArgs
===================================================================
--- fcode-utils/testsuite/TokCondl/TestArgs 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokCondl/TestArgs 2006-10-30 16:25:35 UTC (rev 107)
@@ -10,7 +10,7 @@
# Lines that have no label, no switches, and no script
# do not need any commas.
-# Updated Thu, 27 Jul 2006 at 15:20 PDT by David L. Paktor
+# Updated Fri, 13 Oct 2006 at 16:19 PDT by David L. Paktor
TokExstCondTstY , , -l
TokExstCondTstN , , -l
Modified: fcode-utils/testsuite/TokMisc/AllBiFCTypes.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/AllBiFCTypes.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/AllBiFCTypes.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,7 +1,7 @@
\ Test all the known Built-In FCode tokens
\ that have specific definition Types
-\ Updated Wed, 16 Aug 2006 at 14:30 PDT by David L. Paktor
+\ Updated Tue, 10 Oct 2006 at 11:00 PDT by David L. Paktor
\ Applying "TO" to them ought to generate errors
\ except for the ones that legitimately take "TO",
@@ -9,7 +9,6 @@
fcode-version2
-
[message] Constants. Should generate errors
d# 10 to -1 ( CONST )
d# 10 to -1 ( CONST )
@@ -61,4 +60,12 @@
h# 12 to span ( VRBLE )
h# 12 to state ( VRBLE )
+multi-line #message" Using ['] on words that are both FWords and FCodes "\
+ should generate no errors"
+['] new-device drop
+['] finish-device drop
+['] offset16 drop
+['] instance drop
+['] end0 drop
+
fcode-end
Added: fcode-utils/testsuite/TokMisc/ContErr0.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/ContErr0.fth (rev 0)
+++ fcode-utils/testsuite/TokMisc/ContErr0.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,73 @@
+\ Test Erroneous Control Constructs, cunningly contrived
+\ to pass the "Old" tokenizer, which doesn't have the
+\ check for Control-Structure matching.
+
+\ Updated Thu, 29 Jun 2006 at 14:52 PDT by David L. Paktor
+
+
+fcode-version2
+
+headers
+
+: garfield
+ ." if" if
+ ." begin" begin
+ \ \ Leave this out because Old tokenizer duzzent dew it rite....
+ \ ." Question-Leave?" ?leave
+ ." 0 if unloop exit then" 0 if unloop exit then
+ ." Would you be leave..." leave
+ ." loop?" loop
+ ." Done with garfield"
+;
+
+: odie
+ ." 0 0 ?do" 0 0 ?do
+ ." i drop" i drop
+ ." zero if unloop exit then" 0 if unloop exit then
+ ." Who would be leave..." leave
+ ." again" again
+ ." then" then
+ ." Done with odie"
+;
+
+." Outside of colon"
+." 1 0 do" 1 0 do
+ i constant what? ." This is actually supposed to be legit..."
+." again" again
+." then" then
+." Was that awful or what?"
+
+\ Snippet similar to something in Firmworks manual
+
+h# 5000 constant /DHCP-SCRATCH
+
+/DHCP-SCRATCH ( size ) ['] alloc-mem
+." dhcp-scratch alloc-mem" cr .s cr
+catch
+." catch dhcp-scratch alloc-mem" cr .s cr
+?dup if
+ ." alloc-mem Failed!!!" cr .s cr
+ throw
+ ." This is also worng..." exit
+else
+ ." alloc-mem okay." .s cr
+ ( vaddr )
+ ( vaddr ) constant DHCP-SCRATCH
+then
+
+\ A CASE statement where the ENDOFs are missing
+\ still passes the "Old" tokenizer.
+
+: crazy-aces ( n -- )
+ case
+ 0 of ." And a-nutt'n'"
+ 1 of ." And a-won"
+ 2 of ." And a-too"
+ 3 of ." And a-tree"
+ 4 of ." and afford"
+ 5 of ." Dat's enuff"
+ ( default ) ." It's not my default!"
+ endcase ." Just in case you end up here..."
+;
+
+fcode-end
Modified: fcode-utils/testsuite/TokMisc/ContErr3.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/ContErr3.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/ContErr3.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -132,8 +132,8 @@
then
loop
-#message" Same line as a loop" ." ...Same line as a loop"
-
+#message"
+ Same line as a loop" ." ...Same line as a loop"
4 0 do i test_something if to targ : runny_stuff begin
1 0 do targ u. #message" Error here, too..." j
#message" But not here either" 1 0 do j . loop
Added: fcode-utils/testsuite/TokMisc/DtkVSFcTst.scr
===================================================================
--- fcode-utils/testsuite/TokMisc/DtkVSFcTst.scr (rev 0)
+++ fcode-utils/testsuite/TokMisc/DtkVSFcTst.scr 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,41 @@
+#! /bin/csh -f
+#
+# Script to run detokenizer with Vendor-Specific FCodes.
+# This worked just fine on the TestArgs command line, in the "script" field
+# on CygWin and GNU_Linux, but gets jammed-up on AI
+# So we have to pump it into a separate script. Fooey!
+#
+# Well, in for a penny and all that...X
+# Let's make it a bit more general.
+# First param is the base-name of both the input .fc file
+# and the output .DeTok file
+# Second param is the name of the Vendor-Specific FCodes file
+
+# If it's already a script, might as well error-check
+alias onecr 'echo "" ; alias onecr true'
+if ( $#argv < 1 ) then
+ onecr
+ echo $0 Missing First arg, Base-name of input .fc and output .DeTok files
+ set ERROR
+endif
+if ( $#argv < 2 ) then
+ onecr
+ echo $0 Missing Second arg, Name of the Vendor-Specific FCodes file
+ set ERROR
+endif
+if ( $?ERROR ) exit 1
+
+if ( ! -r $1.fc ) then
+ onecr
+ echo $0 Cannot read input file $1.fc
+ set ERROR
+endif
+if ( ! -r $2 ) then
+ onecr
+ echo $0 Cannot read Vendor-Specific FCodes file $2
+ set ERROR
+endif
+if ( $?ERROR ) exit 2
+
+
+../detok -v -o -f $2 $1.fc > $1.DeTok
Property changes on: fcode-utils/testsuite/TokMisc/DtkVSFcTst.scr
___________________________________________________________________
Name: svn:executable
+ *
Modified: fcode-utils/testsuite/TokMisc/MiscFeatures.DOS.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/MiscFeatures.DOS.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/MiscFeatures.DOS.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,7 +1,6 @@
\ Obvious pun intended...
-\ Updated Tue, 31 May 2005 at 12:07 by David L. Paktor
+\ Updated Tue, 17 Oct 2006 at 12:57 PDT by David L. Paktor
-
alias // \
fcode-version2
@@ -12,21 +11,41 @@
char G emit
control G emit
control [ emit
+global-definitions
+\ Each dev-node will create its own debug-flag and alias it to debug-me?
+\ Each dev-node will create a macro called my-dev-name giving its device-name
+ [macro] .fname&dev [function-name] type ." in " my-dev-name type
+ [macro] name-my-dev my-dev-name device-name
+ [macro] .dbg-enter debug-me? @ if ." Entering " .fname&dev cr then
+ [macro] .dbg-leave debug-me? @ if ." Leaving " .fname&dev cr then
+device-definitions
+
+\ Top-most device, named billy
+[macro] my-dev-name " billy"
+name-my-dev
+
+variable debug-bell? debug-bell? off alias debug-me? debug-bell?
: bell
+ .dbg-enter
[char] G dup
control G 3drop
+ .dbg-leave
;
: factl recursive ( n -- n! )
+ ." Entering First vers. of " [function-name] type cr
?dup 0= if 1
- else dup 1- * factl
+ else dup 1- factl *
then
+ ." Leaving First vers. of " [function-name] type cr
;
: factl ( n -- n! )
+ ." Entering Second vers. of " [function-name] type cr
?dup 0= if 1 factl
else dup 1- recurse *
then
+ ." Leaving Second vers. of " [function-name] type cr
;
variable naught
@@ -41,31 +60,88 @@
constant /four
: peril
+ .dbg-enter
['] noop is do-nothing
100 is thirty
5 is naught
thirty dup - abort" Never Happen"
+ .dbg-leave
;
: thirty ( new-val -- )
+ .dbg-enter
dup to thirty
alias .dec .d \ Should this be allowed?
." Dirty" .dec
+ .dbg-leave
;
tokenizer[
alias fliteral1 fliteral // This should be a harmless remark.
h# deadc0de ]tokenizer fliteral1
+\ First subsidiary device, "child" of billy
+new-device
+ instance variable cheryl
+ [macro] my-dev-name " cheryl"
+ name-my-dev
+
+ instance
+ \ Third-level device, "grandchild" of billy
+ new-device
+ [macro] my-dev-name " meryl"
+ name-my-dev
+
+ variable beryl
+
+ variable debug-meryl? debug-meryl? off
+ alias debug-me? debug-meryl?
+ : meryl
+ .dbg-enter
+ cheryl
+ alias .deck .dec
+ alias feral cheryl
+ alias .heck .h
+ .dbg-leave
+ ;
+ finish-device
+
+ \ Now we're back to "cheryl"
+
+ variable debug-cheryl? debug-cheryl? off
+ alias debug-me? debug-cheryl?
+ : queryl
+ .dbg-enter
+ over rot dup nip drop swap \ Not the most useful code... ;-}
+ .dbg-leave
+ ;
+finish-device
+
+\ Some interpretation-time after the fact markers...
+alias colon :
+overload [macro] : ." Cleared " [input-file-name] type ." line " [line-number] .d cr colon
+
+alias semicolon ;
+overload [macro] ; semicolon ." Finished defining " [function-name] type cr
+
+\ And we're back to billy.
: droop ( -- )
+ .dbg-enter \ This will display Entering droop in billy
twenty
tokenizer[
alias .x .h \ Should this generate a warning?
+ [function-name]
]tokenizer
0 ?do i .x loop
-;
+ .dbg-leave
+; f[ [function-name] ]f
+headerless
: ploop ( -- )
+ .dbg-enter
fifty 0 do i drop 2 +loop
+ .dbg-leave
;
+overload alias : colon
+overload alias ; semicolon
fcode-end
Modified: fcode-utils/testsuite/TokMisc/MiscFeatures.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/MiscFeatures.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/MiscFeatures.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,5 +1,5 @@
\ Obvious pun intended...
-\ Updated Fri, 10 Feb 2006 at 15:53 PST by David L. Paktor
+\ Updated Tue, 17 Oct 2006 at 12:57 PDT by David L. Paktor
alias // \
fcode-version2
@@ -116,22 +116,32 @@
;
finish-device
+\ Some interpretation-time after the fact markers...
+alias colon :
+overload [macro] : ." Cleared " [input-file-name] type ." line " [line-number] .d cr colon
+
+alias semicolon ;
+overload [macro] ; semicolon ." Finished defining " [function-name] type cr
+
\ And we're back to billy.
: droop ( -- )
.dbg-enter \ This will display Entering droop in billy
twenty
tokenizer[
alias .x .h \ Should this generate a warning?
+ [function-name]
]tokenizer
0 ?do i .x loop
.dbg-leave
-;
+; f[ [function-name] ]f
headerless
: ploop ( -- )
.dbg-enter
fifty 0 do i drop 2 +loop
.dbg-leave
;
+overload alias : colon
+overload alias ; semicolon
fcode-end
Modified: fcode-utils/testsuite/TokMisc/StringsGenl.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/StringsGenl.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/StringsGenl.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,6 +1,6 @@
\ Test of various formats of strings
-\ Updated Mon, 06 Mar 2006 at 17:39 PST by David L. Paktor
+\ Updated Tue, 10 Oct 2006 at 11:46 PDT by David L. Paktor
fcode-version2
@@ -9,13 +9,14 @@
."
Empty string next."
." "
-." BSlashes: \t\1fea9\abdc\n\1f\\fece"
+." BSlashes#1: \t\1fea9\abdc\n\1f\\fece"
decimal
-." BSlashes: \t\a7\c01a"
+." BSlashes#2: \t\a7\c01a"
+." Dec 1193176 = 0x1234D8 Dec 176 = 0xB0 \1193176\"
hex
-." BSlashes: \n\a7\c01a"
-." BSlashes: \t\a7\\c0\\1a"
-." BSlashes: \t\a7\\c0\\1a"( feedface)"
+." BSlashes#3: \n\a7\c01a"
+." BSlashes#4: \t\a7\\c0\\1a"
+." BSlashes#5: \t\a7\\c0\\1a"( feedface)"
." 3 BSlashes, then QOpen. \t\Q\n"(090abcdefeca8e beeffece b020)Zoh. "(1 23 4 567 8 9 0 1 2 3 0 a b c 30)"
.( Dot-Paren-NoSpace)cr cr
.( Dot-Paren Space) cr cr
Modified: fcode-utils/testsuite/TokMisc/TestArgs
===================================================================
--- fcode-utils/testsuite/TokMisc/TestArgs 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokMisc/TestArgs 2006-10-30 16:25:35 UTC (rev 107)
@@ -7,8 +7,9 @@
# A script-command with arguments (but no commas).
# Lines that have no label, no switches, and no script
# do not need any commas.
+# A leading +V in the script-command field will suppress -v
-# Updated Thu, 07 Sep 2006 at 11:49 PDT by David L. Paktor
+# Updated Mon, 16 Oct 2006 at 17:22 PDT by David L. Paktor
MiscFeatures , , -i
MiscFeatures , applabq , -i -f NOSUN-ABORT-Quote
@@ -23,15 +24,15 @@
StringsGenl , noqbsrmk , -f NOSTRING-REMARK-ESCAPE
BasicCont
ExtCont
-OldTkzr/ContErr0 , , -i
+ContErr0 , , -i
ContErr1 , , -i
ContErr2 , , -i
ContErr3 , , -i
MulDev , , -i
MulDev_01 , , -i
MulDev_02 , , -i -T jeeky -T kinky
+MulDev_02 , NoV , -T jeeky -T kinky , +V
MinPCIHtst
-OldTkzr/SimplStrEscs
StrEscs
StrEscs_01
FlagSet , , -i
@@ -72,3 +73,7 @@
BatchTst , Help , -I. -I../TokeCommon -l -h , rm *_cpy*
CaseTkns
+
+# Vendor-Specific FCodes, just a little...
+VSFCtest
+VSFCtest , VSfc , , DtkVSFcTst.scr VSFCtest.VSfc VendSpecFCodes
Added: fcode-utils/testsuite/TokMisc/VSFCtest.fth
===================================================================
--- fcode-utils/testsuite/TokMisc/VSFCtest.fth (rev 0)
+++ fcode-utils/testsuite/TokMisc/VSFCtest.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,62 @@
+\ Generate something that looks like FCode generated by a Very Custom Tokenizer
+
+
+fcode-version1
+
+headers
+hex
+
+F[
+ \ If we want to test this against the previous release,
+ \ we can't do this: 341 emit-fcode
+ \ Instead, we have to do it in two parts:
+
+ 03 emit-byte 41 emit-byte \ 0341 = "Simple" Vendor-specific FCode"
+ ]F
+-1
+dup 0> if
+F[
+ \ Likewise here 369 emit-fcode
+ 03 emit-byte 69 emit-byte \ 0369 = "double(lit)"
+ ff emit-byte
+ ff emit-byte
+ ff emit-byte
+ ff emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ ]F
+then
+dup 0= if
+F[
+ \ Here, too 369 emit-fcode
+ 03 emit-byte 69 emit-byte \ 0369 = "double(lit)"
+ ff emit-byte
+ ff emit-byte
+ ff emit-byte
+ f0 emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ 00 emit-byte
+ ]F
+then
+
+0< if
+F[
+ \ Last one 369 emit-fcode
+ 03 emit-byte 69 emit-byte \ 0369 = "double(lit)"
+ de emit-byte
+ fe emit-byte
+ ca emit-byte
+ 8e emit-byte
+ be emit-byte
+ ef emit-byte
+ fe emit-byte
+ ce emit-byte
+ ]F
+then
+constant moochie
+
+fcode-end
Added: fcode-utils/testsuite/TokMisc/VendSpecFCodes
===================================================================
--- fcode-utils/testsuite/TokMisc/VendSpecFCodes (rev 0)
+++ fcode-utils/testsuite/TokMisc/VendSpecFCodes 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,4 @@
+# Sample of Vendor-Specific FCodes for test
+
+ 0x341 Three-for-One,aBargain!
+ 0x369 double(lit) Special-Function pre-defined name
Added: fcode-utils/testsuite/TokeErrs/DecodProp.fth
===================================================================
--- fcode-utils/testsuite/TokeErrs/DecodProp.fth (rev 0)
+++ fcode-utils/testsuite/TokeErrs/DecodProp.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,26 @@
+\ Updated Tue, 17 Oct 2006 at 15:32 PDT by David L. Paktor
+
+
+fcode-version2
+
+\ The classic definition, using the return-stack
+[macro] decade-bites >r over r@ + swap r@ - rot r>
+
+" grubby-nit-picker" device-name
+" bloated lackey of the capitalist toy-mongers"
+ encode-bytes " santa-claus" property
+
+" name" get-my-property if ." Sorry, Charlie!"
+else
+ 6 decade-bites ." Starts with: " type
+ 2drop
+then cr
+
+
+" santa-claus" get-my-property if ." Eat flaming death!"
+else
+ 7 decode-bytes ." Starts with: " type
+ 2drop
+then cr
+
+fcode-end
Modified: fcode-utils/testsuite/TokeErrs/DevImbal.fth
===================================================================
--- fcode-utils/testsuite/TokeErrs/DevImbal.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokeErrs/DevImbal.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -22,7 +22,12 @@
new-device
create eek! 18 c, 17 c, 80 c, 79 c,
: freek eek! 4 bounds ?do i c@ . 1 +loop ;
-: greek -1 if freek then ;
+: greek
+ recursive -1 if ." By name" greek
+ ." other name" freek
+ else ." Re-Curse you!" recurse
+ then
+;
[message] About to access method from parent node
: hierareek
eek!
Modified: fcode-utils/testsuite/TokeErrs/DupNams.fth
===================================================================
--- fcode-utils/testsuite/TokeErrs/DupNams.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokeErrs/DupNams.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,10 +1,39 @@
\ Let's make a batch of duplicate definitions in various scopes...
-\ Updated Fri, 02 Jun 2006 at 09:48 PDT by David L. Paktor
+\ Updated Thu, 12 Oct 2006 at 13:17 PDT by David L. Paktor
+\ Tracing: alley-oop boop croop doop drop dup foop
+\ gloop _harpo hoop koop loop noop poop
+\ shtoop zoop
+\ fontbytes blink-screen base bell
+
+\ alley-oop
+\ boop
+\ croop Global Macro
+\ doop
+\ drop Built-in word, aliased, invoked
+\ dup Built-in word
+\ foop Global alias to dup
+\ floop Global Macro, Alias to flop (alias to drop),
+\ redefined in subordinate device
+\ gloop Undefined, invoked
+\ _harpo Local, in subordinate device
+\ hoop
+\ koop
+\ loop Built-in word
+\ noop Built-in word, redefined in second FCode block
+\ poop
+\ shtoop
+\ zoop
+\ fontbytes Built-in VALUE
+\ blink-screen Built-in DEFER
+\ base Built-in VARIABLE
+\ bell Built-in CONSTANT
+
+
alias foop dup
-[macro] croop foop message" Using FOOP "
+[macro] croop foop #message" Using FOOP "
alias dup croop
@@ -22,7 +51,8 @@
global-definitions
alias flop drop
-[macro] floop flop message" Using FLOOP "
+#message" Sync Up Diffs w/ prev. Release."n"n"
+[macro] floop flop #message" Using FLOOP "
alias drop floop
device-definitions
@@ -32,13 +62,15 @@
fcode-version2
: noop ." Op? No!" ;
-[macro] zoop noop message" I Care."
+[macro] zoop noop #message" I Care."
: poop h# -21013572 ;
new-device
: zoop ." Nothing like the other zoop" croop ;
: croop ." Sort of like F-Troop with a higher GPA..."
foop
+ drop
+ floop
;
: foop ." Shop bop-a-looma, a-lop bam boom!" ;
: floop ." Oh, Jiggly!" ;
@@ -46,6 +78,7 @@
f[ 127 constant _harpo ]f
poop -> _cheeko
f[ _cheeko constant a__gent ]f
+ floop
;
alias droop drop
@@ -59,6 +92,8 @@
_harpo
droop
drupe
+ boop
+ floop
;
alias shoop encode-int
@@ -73,6 +108,18 @@
finish-device
+ : stoop
+ floop
+ gloop
+ shoop
+ ;
+ alias coop floop
+ : troop
+ shoop
+ coop
+ poop
+ ;
+
finish-device
start4 \ Let's just stick in an extra, and another error besides...
fcode-end
Modified: fcode-utils/testsuite/TokeErrs/MiscFeatErrs.fth
===================================================================
--- fcode-utils/testsuite/TokeErrs/MiscFeatErrs.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokeErrs/MiscFeatErrs.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,11 +1,17 @@
\ Obvious pun intended...
-\ Updated Fri, 14 Jul 2006 at 12:50 PDT by David L. Paktor
+\ Updated Mon, 09 Oct 2006 at 09:57 PDT by David L. Paktor
[flag] Local-Values
f[ ." This is a test" ]f
fcode-version1
-fload LocalValuesSupport.fth
+global-definitions
+ headers
+ h# 130 constant _local-storage-size_
+ headerless
+device-definitions
+
+fload TotalLocalValuesSupport.fth
noop noop noop
headers
@@ -59,10 +65,16 @@
_a _b + i * dup -> d
_c * to _e
j . loop
+ ['] _a
+ f['] _e
+ f[ f['] _b
+ f['] dup emit-fcode
+ h# 0f emit-fcode ]f
+ _a _b + _c * [']
+ factl catch if ." Run in circles, scream and shout!" then
;
-
: DMA-ALLOC ( n -- vaddr ) " dma-alloc" $call-parent ;
: HOOBARTH ( n -- vaddr ) " hoobarth" $call-parent ;
: MY-END0 ( -- n ) ['] end0 ;
Modified: fcode-utils/testsuite/TokeErrs/TestArgs
===================================================================
--- fcode-utils/testsuite/TokeErrs/TestArgs 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokeErrs/TestArgs 2006-10-30 16:25:35 UTC (rev 107)
@@ -13,21 +13,26 @@
# Most files in this category need the -i switch
# Some may have additional variants.
-# Updated Thu, 07 Sep 2006 at 11:49 PDT by David L. Paktor
+# Updated Wed, 18 Oct 2006 at 11:44 PDT by David L. Paktor
MiscFeatErrs , , -i -I. -I..
-LocalTest , NoLvSupp , -i -f Local-Values -I. -I..
-LocalTest , , -i -f Local-Values -I. -I.. -f Always-Headers -d dont_omit_support
-LocalTest1 , , -f Local-Values -f noLV-Legacy-Message -I. -I..
+MiscFeatErrs , GLoc , -i -I. -I.. -d Global-Locals
+MiscFeatErrs , LocR , -i -I. -I.. -d Locals-Release
+MiscFeatErrs , GlLr , -i -I. -I.. -d Global-Locals -d Locals-Release
+MiscFeatErrs , Lss , -i -I. -I.. -d _local-storage-size_=3022
+MiscFeatErrs , NoLss , -i -I. -I.. -d _local-storage-size_
+LocalTest , NoLvSupp , -i -f Local-Values -I. -I../TokoLoco
+LocalTest , , -i -f Local-Values -I. -I../TokoLoco -f Always-Headers -d dont_omit_support
+LocalTest1 , , -f Local-Values -f noLV-Legacy-Message -I. -I../TokoLoco
ControlMismatch , , -i
-SuppLocErrTest4 , , -i -f Local-Values -l -I. -I..
-testLocDevSupG , , -i -f Local-Values -I. -I..
-testLocDevSupG , SymSiz , -i -f Local-Values -d "_local-storage-size_= d# 120" -I. -I..
+SuppLocErrTest4 , , -i -f Local-Values -l -I. -I../TokoLoco
+testLocDevSupG , , -i -f Local-Values -I. -I../TokoLoco
+testLocDevSupG , SymSiz , -i -f Local-Values -d "_local-storage-size_= d# 120" -I. -I../TokoLoco
PCIhdrErrs , , -i
FCShdrErrs , , -i
PCI_FCShdrErrs , , -i
CommOvrRun , , -i -l
-LocOvrRun , , -i -f Local-Values -l -I. -I..
+LocOvrRun , , -i -f Local-Values -l -I. -I../TokoLoco
SplitImbal , , -i -l
TokCondUnconcF , , -i -l
TokCondUnconcT , , -i -l
@@ -46,13 +51,13 @@
UserMacroErrors , , -i
CStrEscOvflw , , -i -l
DevImbal , , -i
-DevNodAli , , -i -l -I. -I..
-DevNodAli_01 , , -i -l -I. -I..
-GlobScopErrTst , NoI , -f Local-Values -I. -I..
-GlobScopErrTst , , -i -f Local-Values -I. -I..
-GlobScopErrTst_01 , , -i -f Local-Values -I. -I..
-GlobScopErrTst_02 , , -i -f Local-Values -I. -I..
-GlobScopErrTst_03 , , -i -f Local-Values -I. -I..
+DevNodAli , , -i -l -I. -I../TokoLoco
+DevNodAli_01 , , -i -l -I. -I../TokoLoco
+GlobScopErrTst , NoI , -f Local-Values -I. -I../TokoLoco
+GlobScopErrTst , , -i -f Local-Values -I. -I../TokoLoco
+GlobScopErrTst_01 , , -i -f Local-Values -I. -I../TokoLoco
+GlobScopErrTst_02 , , -i -f Local-Values -I. -I../TokoLoco
+GlobScopErrTst_03 , , -i -f Local-Values -I. -I../TokoLoco
# The script-fields below prepare for the ExpPath InclLst and DePList tests
Frinstnce , , -i , touch ExpPath.NoV.{P,f{c,l{,.missing}}}
Frinstnce , NoI , , chmod a-rw ../TokeCommon/{MyBeerAndYouCannotHaveIt.fth,NoRead.bin} ExpPath.NoV.{P,f{c,l{,.missing}}}
@@ -69,7 +74,7 @@
# Done with the ExpPath and InclLst tests
ToAtEnd , , -i
-ToAtEnd , WLocSup , -i -I . -I ..
+ToAtEnd , WLocSup , -i -I . -I ../TokoLoco
ObsoFCodes , , -i
ObsoFCodes , NoWarn , -f NoObsolete-FCode-Warning
@@ -84,7 +89,7 @@
AbrtWQuotStr , , -i
# The new "Trace" feature, and handling of duplicate and mis-scoped names...
-DupNams , , -f Local-Values -T croop -T drop -T _harpo -T dup -T noop -T zoop -T foop
+DupNams , , -f Local-Values -T alley-oop -T boop -T croop -T doop -T drop -T dup -T foop -T floop -T gloop -T _harpo -T koop -T loop -T noop -T poop -T shtoop -T zoop -T fontbytes -T blink-screen -T base -T bell
TooManyFCodes , , -l -o TooManyFCodes.fl
TooManyFCodes , Reg , -i
@@ -98,3 +103,6 @@
RetStkDep , , -i
CondlDefn , , -i
+
+DecodProp
+DecodProp , nrsi , -f noRet-Stk-Interp
Modified: fcode-utils/testsuite/TokoLoco/GlobalLocalValues.fth
===================================================================
--- fcode-utils/testsuite/TokoLoco/GlobalLocalValues.fth 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokoLoco/GlobalLocalValues.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -1,7 +1,13 @@
+\ %Z%%M% %I% %W% %G% %U%
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
\ Load Locals Support under Global-Definitions. Bypass Instance warning
-\ Updated Fri, 10 Mar 2006 at 14:47 PST by David L. Paktor
-
\ Make sure this option is turned on.
[flag] Local-Values
Added: fcode-utils/testsuite/TokoLoco/GlobalLocalValuesDevel.fth
===================================================================
--- fcode-utils/testsuite/TokoLoco/GlobalLocalValuesDevel.fth (rev 0)
+++ fcode-utils/testsuite/TokoLoco/GlobalLocalValuesDevel.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,31 @@
+\ %Z%%M% %I% %W% %G% %U%
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Load Support file for development of FCode that uses Local Values
+\ under Global-Definitions. Bypass Instance warning.
+\ Replace this with GlobalLocalValues.fth in your final product.
+
+\ Make sure this option is turned on.
+[flag] Local-Values
+
+global-definitions
+
+\ Bypass warning about Instance without altering LocalValuesSupport file
+alias generic-instance instance
+[macro] bypass-instance f[ noop .( Bypassed instance!) f]
+
+overload alias instance bypass-instance
+
+fload LocalValuesSupport.fth
+fload LocalValuesDevelSupport.fth
+
+\ Replace normal meaning of Instance, still in Global scope.
+overload alias instance generic-instance
+
+\ Restore Device-Definitions scope.
+device-definitions
Added: fcode-utils/testsuite/TokoLoco/LocalValuesDevelSupport.fth
===================================================================
--- fcode-utils/testsuite/TokoLoco/LocalValuesDevelSupport.fth (rev 0)
+++ fcode-utils/testsuite/TokoLoco/LocalValuesDevelSupport.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,46 @@
+\ %Z%%M% %I% %W% %G% %U%
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Support file for development of FCode that uses Local Values
+\ FLoad this right after LocalValuesSupport.fth
+\ Remove it from your final product.
+
+\ Exported Function: max-local-storage-size ( -- n )
+\ Returns the measured maximum size of storage for Local Values
+\ used by any given test run. This number can be used to guide
+\ the declaration of _local-storage-size_
+\
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Count the current depth on a per-instance basis,
+\ but collect the maximum depth over all instances.
+
+headers
+0 instance value local-storage-depth
+
+external
+0 value max-local-storage-size
+headers
+
+\ Overload the {push-locals} and {pop-locals} routines to do this.
+\ Do not suppress the overload warnings; they'll serve as a reminder.
+: {pop-locals} ( #locals -- )
+ local-storage-depth over - to local-storage-depth
+ {pop-locals}
+;
+
+: {push-locals} ( #ilocals #ulocals -- )
+ 2dup + local-storage-depth +
+ dup to local-storage-depth
+ max-local-storage-size max
+ to max-local-storage-size
+ {push-locals}
+;
+
+
Added: fcode-utils/testsuite/TokoLoco/LocalValuesSupport.fth
===================================================================
--- fcode-utils/testsuite/TokoLoco/LocalValuesSupport.fth (rev 0)
+++ fcode-utils/testsuite/TokoLoco/LocalValuesSupport.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,134 @@
+\ %Z%%M% %I% %W% %G% %U%
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ The support routines for Local Values in FCode.
+
+\ Function imported
+\ _local-storage-size_ \ Size, in cells, of backing store for locals
+\ \ A constant. If not supplied, default value of d# 64 will be used.
+\
+\ Functions exported:
+\ {push-locals} ( #ilocals #ulocals -- )
+\ {pop-locals} ( #locals -- )
+\ _{local} ( local-var# -- addr )
+\
+\ Additional overloaded function:
+\ catch \ Restore Locals after a throw
+
+\ The user is responsible for declaring the maximum depth of the
+\ run-time Locals stack, in storage units, by defining the
+\ constant _local-storage-size_ before floading this file.
+\ The definition may be created either by defining it as a constant
+\ in the startup-file that FLOADs this and other files in the
+\ source program, or via a command-line user-symbol definition
+\ of a form resembling: -d '_local-storage-size_=d# 42'
+\ (be sure to enclose it within quotes so that the shell treats
+\ it as a single string, and, of course, replace the "42" with
+\ the actual number you need...)
+\ If both forms are present, the command-line user-symbol value will
+\ be used to create a duplicate definition of the named constant,
+\ which will prevail over the earlier definition, and will remain
+\ available for examination during development and testing. The
+\ duplicate-name warning, which will not be suppressed, will also
+\ act to alert the developer of this condition.
+\ To measure the actual usage (in a test run), use the separate tool
+\ found in the file LocalValuesDevelSupport.fth .
+\ If the user omits defining _local-storage-size_ the following
+\ ten-line sequence will supply a default:
+
+[ifdef] _local-storage-size_
+ f[ [defined] _local-storage-size_ true ]f
+[else]
+ [ifexist] _local-storage-size_
+ f[ false ]f
+ [else]
+ f[ d# 64 true ]f
+ [then]
+[then] ( Compile-time: size true | false )
+[if] fliteral constant _local-storage-size_ [then]
+
+_local-storage-size_ \ The number of storage units to allocate
+ cells \ Convert to address units
+ dup \ Keep a copy around...
+ ( n ) instance buffer: locals-storage \ Use one of the copies
+
+\ The Locals Pointer, added to the base address of locals-storage
+\ points to the base-address of the currently active set of Locals.
+\ Locals will be accessed as a positive offset from there.
+\ Start the Locals Pointer at end of the buffer.
+\ A copy of ( N ), the number of address units that were allocated
+\ for the buffer, is still on the stack. Use it here.
+ ( n ) instance value locals-pointer
+
+\ Support for {push-locals}
+
+\ Error-check.
+: not-enough-locals? ( #ilocals #ulocals -- error? )
+ + cells locals-pointer swap - 0<
+;
+
+\ Error message.
+: .not-enough-locals ( -- )
+ cr ." FATAL ERROR: Local Values Usage exceeds allocation." cr
+;
+
+\ Detect, announce and handle error.
+: check-enough-locals ( #ilocals #ulocals -- | <ABORT> )
+ not-enough-locals? if
+ .not-enough-locals
+ abort
+ then
+;
+
+\ The uninitialized locals can be allocated in a single batch
+: push-uninitted-locals ( #ulocals -- )
+ cells locals-pointer swap - to locals-pointer
+;
+
+\ The Initialized locals are initted from the items on top of the stack
+\ at the start of the routine. If we allocate them one at a time,
+\ we get them into the right order. I.e., the last-one named gets
+\ the top item, the earlier ones get successively lower items.
+: push-one-initted-local ( pstack-item -- )
+ locals-pointer 1 cells -
+ dup to locals-pointer
+ locals-storage + !
+;
+
+\ Push all the Initialized locals.
+: push-initted-locals ( N_#ilocals-1 ... N_0 #ilocals -- )
+ 0 ?do push-one-initted-local loop
+;
+
+: {push-locals} ( N_#ilocals ... N_1 #ilocals #ulocals -- )
+ 2dup check-enough-locals
+ push-uninitted-locals ( ..... #i )
+ push-initted-locals ( )
+;
+
+\ Pop all the locals.
+\ The param is the number to pop.
+: {pop-locals} ( total#locals -- )
+ cells locals-pointer + to locals-pointer
+;
+
+\ The address from/to which values will be moved, given the local-var#
+: _{local} ( local-var# -- addr )
+ cells locals-pointer + locals-storage +
+;
+
+\ We need to overload catch such that the state of the Locals Pointer
+\ will be preserved and restored after a throw .
+overload : catch ( ??? xt -- ???' false | ???'' throw-code )
+ locals-pointer >r ( ??? xt ) ( R: old-locals-ptr )
+ catch ( ???' false | ???'' throw-code ) ( R: old-locals-ptr )
+ \ No need to inspect the throw-code.
+ \ If catch returned a zero, the Locals Pointer
+ \ is valid anyway, so restoring it is harmless.
+ r> to locals-pointer
+;
Modified: fcode-utils/testsuite/TokoLoco/TestArgs
===================================================================
--- fcode-utils/testsuite/TokoLoco/TestArgs 2006-10-30 13:26:11 UTC (rev 106)
+++ fcode-utils/testsuite/TokoLoco/TestArgs 2006-10-30 16:25:35 UTC (rev 107)
@@ -12,18 +12,18 @@
# All files in this category need the -f Local-Values switch
# Some will have additional variants.
-# Updated Mon, 20 Mar 2006 at 11:18 PST by David L. Paktor
+# Updated Fri, 13 Oct 2006 at 16:19 PDT by David L. Paktor
-testNest , , -f Local-Values -l -I. -I..
-SupportedLocalTest , , -f LOCAL-Values -l -I. -I..
-SupportedLocalTest3 , , -f Local-VALUES -l -I. -I..
-SupportedLocalTest4 , , -f Local-Values -l -I. -I..
-testDevelSupport , , -f local-values -I. -I..
+testNest , , -f Local-Values -l
+SupportedLocalTest , , -f LOCAL-Values -l
+SupportedLocalTest3 , , -f Local-VALUES -l
+SupportedLocalTest4 , , -f Local-Values -l
+testDevelSupport , , -f local-values
# Additional variants:
-SupportedLocalTest , nodupwrn , -f Local-VALUES -f NOWarn-if-DUPLicate -l -I. -I..
-SupportedLocalTest , nolegacy , -f LoCAL-VALUes -f NoLV-Legacy-Separator -l -I. -I..
-SupportedLocalTest , nolgcmsg , -f Local-ValUES -f NOLV-LEGAcy-Message -l -I. -I..
-SupportedLocalTest , nolocals , -i -f noLocal-Values -l -I. -I..
-SupportedLocalTest3 , DefLocStgSiz , -f Local-VALUes -d '_loCAL-STORagE-SIZe_=h# 42' -l -I. -I..
+SupportedLocalTest , nodupwrn , -f Local-VALUES -f NOWarn-if-DUPLicate -l
+SupportedLocalTest , nolegacy , -f LoCAL-VALUes -f NoLV-Legacy-Separator -l
+SupportedLocalTest , nolgcmsg , -f Local-ValUES -f NOLV-LEGAcy-Message -l
+SupportedLocalTest , nolocals , -i -f noLocal-Values -l
+SupportedLocalTest3 , DefLocStgSiz , -f Local-VALUes -d '_loCAL-STORagE-SIZe_=h# 42' -l
Added: fcode-utils/testsuite/TokoLoco/TotalLocalValuesSupport.fth
===================================================================
--- fcode-utils/testsuite/TokoLoco/TotalLocalValuesSupport.fth (rev 0)
+++ fcode-utils/testsuite/TokoLoco/TotalLocalValuesSupport.fth 2006-10-30 16:25:35 UTC (rev 107)
@@ -0,0 +1,52 @@
+\ %Z%%M% %I% %W% %G% %U%
+\ (C) Copyright 2005-2006 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Control file for loading of Local Values Support file with variants.
+\ Command-line Symbol-definitions select whether the support will
+\ be under Global-Definitions, and whether to include the extra
+\ Development-time support features.
+\
+\ The command-line symbols are:
+\ Global-Locals
+\ and
+\ Locals-Release
+\
+\ The default is device-node-specific support in a Development-time setting.
+\
+\ If Global-Locals is defined, support will be under Global-Definitions
+\ If Locals-Release is defined, this is a final production release run,
+\ and the Development-time support features will be removed.
+
+\ Make sure this option is turned on.
+[flag] Local-Values
+
+[ifdef] Global-Locals
+ \ Load Support file under Global-Definitions.
+ global-definitions
+
+ \ Bypass warning about Instance without altering LocalValuesSupport file
+ alias generic-instance instance
+ [macro] bypass-instance f[ noop .( Bypassed instance!) f]
+
+ overload alias instance bypass-instance
+[endif] \ Global-Locals
+
+fload LocalValuesSupport.fth
+
+[ifndef] Locals-Release
+ \ Load Development-time support features
+ fload LocalValuesDevelSupport.fth
+[endif] \ not Locals-Release
+
+[ifdef] Global-Locals
+ \ Replace normal meaning of Instance, still in Global scope.
+ overload alias instance generic-instance
+
+ \ Restore Device-Definitions scope.
+ device-definitions
+[endif] \ Global-Locals
Author: stepan
Date: 2006-10-30 14:26:11 +0100 (Mon, 30 Oct 2006)
New Revision: 106
Modified:
fcode-utils/testsuite/GlobalLocalValues.fth
fcode-utils/testsuite/GlobalLocalValuesDevel.fth
fcode-utils/testsuite/LocalValuesDevelSupport.fth
fcode-utils/testsuite/LocalValuesSupport.fth
fcode-utils/testsuite/TotalLocalValuesSupport.fth
Log:
fix links to use our own copy.
Modified: fcode-utils/testsuite/GlobalLocalValues.fth
===================================================================
--- fcode-utils/testsuite/GlobalLocalValues.fth 2006-10-30 11:59:18 UTC (rev 105)
+++ fcode-utils/testsuite/GlobalLocalValues.fth 2006-10-30 13:26:11 UTC (rev 106)
@@ -1 +1 @@
-link ../../LocalValues/GlobalLocalValues.fth
\ No newline at end of file
+link ../localvalues/GlobalLocalValues.fth
\ No newline at end of file
Modified: fcode-utils/testsuite/GlobalLocalValuesDevel.fth
===================================================================
--- fcode-utils/testsuite/GlobalLocalValuesDevel.fth 2006-10-30 11:59:18 UTC (rev 105)
+++ fcode-utils/testsuite/GlobalLocalValuesDevel.fth 2006-10-30 13:26:11 UTC (rev 106)
@@ -1 +1 @@
-link ../../LocalValues/GlobalLocalValuesDevel.fth
\ No newline at end of file
+link ../localvalues/GlobalLocalValuesDevel.fth
\ No newline at end of file
Modified: fcode-utils/testsuite/LocalValuesDevelSupport.fth
===================================================================
--- fcode-utils/testsuite/LocalValuesDevelSupport.fth 2006-10-30 11:59:18 UTC (rev 105)
+++ fcode-utils/testsuite/LocalValuesDevelSupport.fth 2006-10-30 13:26:11 UTC (rev 106)
@@ -1 +1 @@
-link ../../LocalValues/LocalValuesDevelSupport.fth
\ No newline at end of file
+link ../localvalues/LocalValuesDevelSupport.fth
\ No newline at end of file
Modified: fcode-utils/testsuite/LocalValuesSupport.fth
===================================================================
--- fcode-utils/testsuite/LocalValuesSupport.fth 2006-10-30 11:59:18 UTC (rev 105)
+++ fcode-utils/testsuite/LocalValuesSupport.fth 2006-10-30 13:26:11 UTC (rev 106)
@@ -1 +1 @@
-link ../../LocalValues/LocalValuesSupport.fth
\ No newline at end of file
+link ../localvalues/LocalValuesSupport.fth
\ No newline at end of file
Modified: fcode-utils/testsuite/TotalLocalValuesSupport.fth
===================================================================
--- fcode-utils/testsuite/TotalLocalValuesSupport.fth 2006-10-30 11:59:18 UTC (rev 105)
+++ fcode-utils/testsuite/TotalLocalValuesSupport.fth 2006-10-30 13:26:11 UTC (rev 106)
@@ -1 +1 @@
-link ../../LocalValues/TotalLocalValuesSupport.fth
\ No newline at end of file
+link ../localvalues/TotalLocalValuesSupport.fth
\ No newline at end of file
Author: stepan
Date: 2006-10-30 12:59:18 +0100 (Mon, 30 Oct 2006)
New Revision: 105
Modified:
fcode-utils/detok/addfcodes.c
fcode-utils/detok/dictionary.c
Log:
detok 1.0.2 merge part 3
Modified: fcode-utils/detok/addfcodes.c
===================================================================
--- fcode-utils/detok/addfcodes.c 2006-10-30 11:31:16 UTC (rev 104)
+++ fcode-utils/detok/addfcodes.c 2006-10-30 11:59:18 UTC (rev 105)
@@ -46,6 +46,10 @@
* Identified this need when working with in-house code,
* which uses some custom functions. This solution
* is (hoped to be) general enough to cover all cases.
+ * Mon, 16 Oct 2006 by David L. Paktor
+ * Add "special function" words. So far, only one added:
+ * double-literal Infrastructure will support
+ * adding others as needed.
*
**************************************************************************** */
@@ -58,6 +62,21 @@
*
**************************************************************************** */
+
+/* **************************************************************************
+ *
+ * Global Variables Exported :
+ *
+ * For "special function" identification, we will need to
+ * export Global Variables, each of which is a pointer
+ * to the address of the FCode field of the entry in
+ * the Special Functions List for that function.
+ *
+ * Variable Associated Name
+ * double_lit_code double-literal
+ *
+ **************************************************************************** */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -73,6 +92,8 @@
* vfc_remainder Remainder of Vendor-FCodes buffer to be scanned
* vfc_line_no Number of current line in Vendor-FCodes buffer
* vfc_buf_end Pointer to end of Vendor-FCodes buffer
+ * spcl_func_list List of reserved Special Function names
+ * spcl_func_count Number of reserved Special Function names
*
**************************************************************************** */
@@ -81,6 +102,22 @@
static int vfc_line_no = 0;
static char *vfc_buf_end;
+/* Special Functions List */
+/* Initial fcode-field value of -1 guarantees they won't be used */
+token_t spcl_func_list[] = {
+ TOKEN_ENTRY( -1, "double(lit)" ), /* Entry [0] */
+};
+
+static const int spcl_func_count = (sizeof(spcl_func_list)/sizeof(token_t)) ;
+
+/* Global Variables for "special function" identification */
+/* Each is a pointer to the FCode field of the entry in
+ * the Special Functions List for that function.
+ */
+
+u16 *double_lit_code = &spcl_func_list[0].fcode;
+
+
/* **************************************************************************
*
* Function name: skip_whitespace
@@ -231,11 +268,19 @@
* after the name will be ignored, so an extra "comment"
* is permitted. The FCode number must be in hex, with
* an optional leading 0x or 0X For example: 0X407
- * The valid range is 0x010 to 0x7ff. Numbers above 0x800
- * infringe upon the are reserved for FCodes generated
- * by the tokenization process.
+ * The valid range for the FCode numbers is 0x010 to 0x7ff.
+ * Numbers above 0x800 infringe upon the area reserved
+ * for FCodes generated by the tokenization process.
* Numbers already in use will be ignored. A Message will be
* printed even if the name matches the one on the line.
+ * Names may not be longer than 31 characters.
+ * Certain names will be reserved for special functions.
+ * Those names will be entered in the detok_table
+ * with a value of -1 and again in the static
+ * table associated with this function, below, to
+ * supply the variable that will be used to match
+ * the name with the special function.
+ *
*
**************************************************************************** */
@@ -267,6 +312,13 @@
char *lookup_result;
char *fc_name_cpy;
+ /* For each line of input, we need to check that we have
+ * two strings, one of which is the number and the
+ * second of which is the name. We will check for
+ * the various formats allowed for the number
+ */
+
+ /* Start with a lower-case 0x */
scan_result = sscanf(current_vfc_line, "0x%x %32s",
&vs_fc_number, vs_fc_name);
@@ -315,6 +367,28 @@
continue;
}
+ /* Check if the name is on the "Special Functions List" */
+ {
+ bool found_spf = FALSE;
+ int indx;
+ for (indx = 0; indx < spcl_func_count; indx++) {
+ if ( strcmp( vs_fc_name, spcl_func_list[indx].name) == 0 ) {
+ char strbuf[64];
+ found_spf = TRUE;
+ spcl_func_list[indx].fcode = vs_fc_number;
+ link_token( &spcl_func_list[indx]);
+ added_fc_count++;
+ sprintf( strbuf, "Added Special Function FCode "
+ "number 0x%03x, name %s\n", vs_fc_number, vs_fc_name);
+ printremark( strbuf);
+ break;
+ }
+ }
+
+ if (found_spf)
+ continue;
+ }
+
/* We've passed all the tests! */
fc_name_cpy = strdup(vs_fc_name);
add_token((u16) vs_fc_number, fc_name_cpy);
@@ -323,11 +397,10 @@
}
if (verbose) {
- char *strbfr = malloc(85);
+ char strbfr[32];
sprintf(strbfr,
"Added %d FCode numbers\n", added_fc_count);
printremark(strbfr);
- free(strbfr);
}
close_stream();
Modified: fcode-utils/detok/dictionary.c
===================================================================
--- fcode-utils/detok/dictionary.c 2006-10-30 11:31:16 UTC (rev 104)
+++ fcode-utils/detok/dictionary.c 2006-10-30 11:59:18 UTC (rev 105)
@@ -37,13 +37,6 @@
#include "detok.h"
bool check_tok_seq = TRUE;
-
-typedef struct token {
- char *name;
- u16 fcode;
- struct token *next;
-} token_t;
-#define TOKEN_ENTRY(num, name) { name, (u16)num, (token_t *)NULL }
static token_t *dictionary; /* Initialize dynamically to accommodate AIX */
static char *fcerror = "ferror";
@@ -52,7 +45,7 @@
{
token_t *curr;
- for (curr = dictionary; curr != NULL; curr = curr->next)
+ for (curr = dictionary; curr != NULL; curr = curr->prev)
if (curr->fcode == number)
break;
@@ -64,6 +57,33 @@
/* **************************************************************************
*
+ * Function name: link_token
+ * Synopsis: Simply link a ready-made token-table entry to
+ * the dictionary, without side-effects.
+ *
+ * Inputs:
+ * Parameters:
+ * curr_token The token-table entry to link
+ * Local Static Variables:
+ * dictionary Pointer to the "tail" of the
+ * FCode-Tokens vocabulary.
+ *
+ * Outputs:
+ * Returned Value: NONE
+ * Local Static Variables:
+ * dictionary Updated to point to the new entry.
+ *
+ **************************************************************************** */
+
+void link_token( token_t *curr_token)
+{
+ curr_token->prev = dictionary;
+
+ dictionary = curr_token;
+}
+
+/* **************************************************************************
+ *
* Function name: add_token
* Synopsis: Add an entry to the FCode-Tokens vocabulary.
*
@@ -72,8 +92,6 @@
* number Numeric value of the FCode token
* name Name of the function to display
* Global/Static Variables:
- * dictionary Pointer to the "tail" of the
- * FCode-Tokens vocabulary.
* check_tok_seq TRUE = "Check Token Sequence"
* A retro-fit to accommodate
* adding Vendor FCodes
@@ -81,7 +99,6 @@
* Outputs:
* Returned Value: NONE
* Global/Static Variables:
- * dictionary Updated to point to the new entry.
* last_defined_token Updated to the given FCode token
* Memory Allocated
* For the new entry.
@@ -116,11 +133,10 @@
exit(-ENOMEM);
}
- curr->next = dictionary;
- curr->fcode = number;
curr->name = name;
+ curr->fcode=number;
- dictionary = curr;
+ link_token( curr);
if (check_tok_seq) {
/* Error-check, but not for first time. */
@@ -543,7 +559,7 @@
dictionary_reset_position = dictionary;
for (indx = 1; indx < dictionary_indx_max; indx++) {
- detok_table[indx].next = &detok_table[indx - 1];
+ detok_table[indx].prev = &detok_table[indx - 1];
}
}
@@ -553,7 +569,7 @@
next_t = dictionary;
while (next_t != dictionary_reset_position) {
- next_t = dictionary->next;
+ next_t = dictionary->prev;
free(dictionary->name);
free(dictionary);
dictionary = next_t;
Author: stepan
Date: 2006-10-30 10:50:41 +0100 (Mon, 30 Oct 2006)
New Revision: 102
Added:
fcode-utils/localvalues/
fcode-utils/localvalues/GlobalLocalValues.fth
fcode-utils/localvalues/GlobalLocalValuesDevel.fth
fcode-utils/localvalues/LocalValuesDevelSupport.fth
fcode-utils/localvalues/LocalValuesSupport.fth
fcode-utils/localvalues/TotalLocalValuesSupport.fth
Log:
localvalues support, contributed by David Paktor <dlpaktor(a)netscape.net>
Added: fcode-utils/localvalues/GlobalLocalValues.fth
===================================================================
--- fcode-utils/localvalues/GlobalLocalValues.fth (rev 0)
+++ fcode-utils/localvalues/GlobalLocalValues.fth 2006-10-30 09:50:41 UTC (rev 102)
@@ -0,0 +1,27 @@
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Load Locals Support under Global-Definitions. Bypass Instance warning
+
+\ Make sure this option is turned on.
+[flag] Local-Values
+
+global-definitions
+
+\ Bypass warning about Instance without altering LocalValuesSupport file
+alias generic-instance instance
+[macro] bypass-instance f[ noop .( Bypassed instance!) f]
+
+overload alias instance bypass-instance
+
+fload LocalValuesSupport.fth
+
+\ Replace normal meaning of Instance, still in Global scope.
+overload alias instance generic-instance
+
+\ Restore Device-Definitions scope.
+device-definitions
Added: fcode-utils/localvalues/GlobalLocalValuesDevel.fth
===================================================================
--- fcode-utils/localvalues/GlobalLocalValuesDevel.fth (rev 0)
+++ fcode-utils/localvalues/GlobalLocalValuesDevel.fth 2006-10-30 09:50:41 UTC (rev 102)
@@ -0,0 +1,30 @@
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Load Support file for development of FCode that uses Local Values
+\ under Global-Definitions. Bypass Instance warning.
+\ Replace this with GlobalLocalValues.fth in your final product.
+
+\ Make sure this option is turned on.
+[flag] Local-Values
+
+global-definitions
+
+\ Bypass warning about Instance without altering LocalValuesSupport file
+alias generic-instance instance
+[macro] bypass-instance f[ noop .( Bypassed instance!) f]
+
+overload alias instance bypass-instance
+
+fload LocalValuesSupport.fth
+fload LocalValuesDevelSupport.fth
+
+\ Replace normal meaning of Instance, still in Global scope.
+overload alias instance generic-instance
+
+\ Restore Device-Definitions scope.
+device-definitions
Added: fcode-utils/localvalues/LocalValuesDevelSupport.fth
===================================================================
--- fcode-utils/localvalues/LocalValuesDevelSupport.fth (rev 0)
+++ fcode-utils/localvalues/LocalValuesDevelSupport.fth 2006-10-30 09:50:41 UTC (rev 102)
@@ -0,0 +1,45 @@
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Support file for development of FCode that uses Local Values
+\ FLoad this right after LocalValuesSupport.fth
+\ Remove it from your final product.
+
+\ Exported Function: max-local-storage-size ( -- n )
+\ Returns the measured maximum size of storage for Local Values
+\ used by any given test run. This number can be used to guide
+\ the declaration of _local-storage-size_
+\
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Count the current depth on a per-instance basis,
+\ but collect the maximum depth over all instances.
+
+headers
+0 instance value local-storage-depth
+
+external
+0 value max-local-storage-size
+headers
+
+\ Overload the {push-locals} and {pop-locals} routines to do this.
+\ Do not suppress the overload warnings; they'll serve as a reminder.
+: {pop-locals} ( #locals -- )
+ local-storage-depth over - to local-storage-depth
+ {pop-locals}
+;
+
+: {push-locals} ( #ilocals #ulocals -- )
+ 2dup + local-storage-depth +
+ dup to local-storage-depth
+ max-local-storage-size max
+ to max-local-storage-size
+ {push-locals}
+;
+
+
Added: fcode-utils/localvalues/LocalValuesSupport.fth
===================================================================
--- fcode-utils/localvalues/LocalValuesSupport.fth (rev 0)
+++ fcode-utils/localvalues/LocalValuesSupport.fth 2006-10-30 09:50:41 UTC (rev 102)
@@ -0,0 +1,133 @@
+\ (C) Copyright 2005 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ The support routines for Local Values in FCode.
+
+\ Function imported
+\ _local-storage-size_ \ Size, in cells, of backing store for locals
+\ \ A constant. If not supplied, default value of d# 64 will be used.
+\
+\ Functions exported:
+\ {push-locals} ( #ilocals #ulocals -- )
+\ {pop-locals} ( #locals -- )
+\ _{local} ( local-var# -- addr )
+\
+\ Additional overloaded function:
+\ catch \ Restore Locals after a throw
+
+\ The user is responsible for declaring the maximum depth of the
+\ run-time Locals stack, in storage units, by defining the
+\ constant _local-storage-size_ before floading this file.
+\ The definition may be created either by defining it as a constant
+\ in the startup-file that FLOADs this and other files in the
+\ source program, or via a command-line user-symbol definition
+\ of a form resembling: -d '_local-storage-size_=d# 42'
+\ (be sure to enclose it within quotes so that the shell treats
+\ it as a single string, and, of course, replace the "42" with
+\ the actual number you need...)
+\ If both forms are present, the command-line user-symbol value will
+\ be used to create a duplicate definition of the named constant,
+\ which will prevail over the earlier definition, and will remain
+\ available for examination during development and testing. The
+\ duplicate-name warning, which will not be suppressed, will also
+\ act to alert the developer of this condition.
+\ To measure the actual usage (in a test run), use the separate tool
+\ found in the file LocalValuesDevelSupport.fth .
+\ If the user omits defining _local-storage-size_ the following
+\ ten-line sequence will supply a default:
+
+[ifdef] _local-storage-size_
+ f[ [defined] _local-storage-size_ true ]f
+[else]
+ [ifexist] _local-storage-size_
+ f[ false ]f
+ [else]
+ f[ d# 64 true ]f
+ [then]
+[then] ( Compile-time: size true | false )
+[if] fliteral constant _local-storage-size_ [then]
+
+_local-storage-size_ \ The number of storage units to allocate
+ cells \ Convert to address units
+ dup \ Keep a copy around...
+ ( n ) instance buffer: locals-storage \ Use one of the copies
+
+\ The Locals Pointer, added to the base address of locals-storage
+\ points to the base-address of the currently active set of Locals.
+\ Locals will be accessed as a positive offset from there.
+\ Start the Locals Pointer at end of the buffer.
+\ A copy of ( N ), the number of address units that were allocated
+\ for the buffer, is still on the stack. Use it here.
+ ( n ) instance value locals-pointer
+
+\ Support for {push-locals}
+
+\ Error-check.
+: not-enough-locals? ( #ilocals #ulocals -- error? )
+ + cells locals-pointer swap - 0<
+;
+
+\ Error message.
+: .not-enough-locals ( -- )
+ cr ." FATAL ERROR: Local Values Usage exceeds allocation." cr
+;
+
+\ Detect, announce and handle error.
+: check-enough-locals ( #ilocals #ulocals -- | <ABORT> )
+ not-enough-locals? if
+ .not-enough-locals
+ abort
+ then
+;
+
+\ The uninitialized locals can be allocated in a single batch
+: push-uninitted-locals ( #ulocals -- )
+ cells locals-pointer swap - to locals-pointer
+;
+
+\ The Initialized locals are initted from the items on top of the stack
+\ at the start of the routine. If we allocate them one at a time,
+\ we get them into the right order. I.e., the last-one named gets
+\ the top item, the earlier ones get successively lower items.
+: push-one-initted-local ( pstack-item -- )
+ locals-pointer 1 cells -
+ dup to locals-pointer
+ locals-storage + !
+;
+
+\ Push all the Initialized locals.
+: push-initted-locals ( N_#ilocals-1 ... N_0 #ilocals -- )
+ 0 ?do push-one-initted-local loop
+;
+
+: {push-locals} ( N_#ilocals ... N_1 #ilocals #ulocals -- )
+ 2dup check-enough-locals
+ push-uninitted-locals ( ..... #i )
+ push-initted-locals ( )
+;
+
+\ Pop all the locals.
+\ The param is the number to pop.
+: {pop-locals} ( total#locals -- )
+ cells locals-pointer + to locals-pointer
+;
+
+\ The address from/to which values will be moved, given the local-var#
+: _{local} ( local-var# -- addr )
+ cells locals-pointer + locals-storage +
+;
+
+\ We need to overload catch such that the state of the Locals Pointer
+\ will be preserved and restored after a throw .
+overload : catch ( ??? xt -- ???' false | ???'' throw-code )
+ locals-pointer >r ( ??? xt ) ( R: old-locals-ptr )
+ catch ( ???' false | ???'' throw-code ) ( R: old-locals-ptr )
+ \ No need to inspect the throw-code.
+ \ If catch returned a zero, the Locals Pointer
+ \ is valid anyway, so restoring it is harmless.
+ r> to locals-pointer
+;
Added: fcode-utils/localvalues/TotalLocalValuesSupport.fth
===================================================================
--- fcode-utils/localvalues/TotalLocalValuesSupport.fth (rev 0)
+++ fcode-utils/localvalues/TotalLocalValuesSupport.fth 2006-10-30 09:50:41 UTC (rev 102)
@@ -0,0 +1,51 @@
+\ (C) Copyright 2005-2006 IBM Corporation. All Rights Reserved.
+\ Licensed under the Common Public License (CPL) version 1.0
+\ for full details see:
+\ http://www.opensource.org/licenses/cpl1.0.php
+\
+\ Module Author: David L. Paktor dlpaktor(a)us.ibm.com
+
+\ Control file for loading of Local Values Support file with variants.
+\ Command-line Symbol-definitions select whether the support will
+\ be under Global-Definitions, and whether to include the extra
+\ Development-time support features.
+\
+\ The command-line symbols are:
+\ Global-Locals
+\ and
+\ Locals-Release
+\
+\ The default is device-node-specific support in a Development-time setting.
+\
+\ If Global-Locals is defined, support will be under Global-Definitions
+\ If Locals-Release is defined, this is a final production release run,
+\ and the Development-time support features will be removed.
+
+\ Make sure this option is turned on.
+[flag] Local-Values
+
+[ifdef] Global-Locals
+ \ Load Support file under Global-Definitions.
+ global-definitions
+
+ \ Bypass warning about Instance without altering LocalValuesSupport file
+ alias generic-instance instance
+ [macro] bypass-instance f[ noop .( Bypassed instance!) f]
+
+ overload alias instance bypass-instance
+[endif] \ Global-Locals
+
+fload LocalValuesSupport.fth
+
+[ifndef] Locals-Release
+ \ Load Development-time support features
+ fload LocalValuesDevelSupport.fth
+[endif] \ not Locals-Release
+
+[ifdef] Global-Locals
+ \ Replace normal meaning of Instance, still in Global scope.
+ overload alias instance generic-instance
+
+ \ Restore Device-Definitions scope.
+ device-definitions
+[endif] \ Global-Locals