Ton reviewed and gave his blessing.
Zr, can you have a look ?
see :
http://projects.blender.org/tracker/?func=detail&atid=127&aid=3039&group_id=9
for initial comments.
N_T : the solver itself (elbeem) needs some works to get rid of
warnings
# include nan_subdirs.mk
ALLDIRS = string ghost guardedalloc bmfont moto container memutil
-ALLDIRS += decimation iksolver bsp SoundSystem opennl
+ALLDIRS += decimation iksolver bsp SoundSystem opennl elbeem
all::
@for i in $(ALLDIRS); do \
'memutil/SConscript/',
'decimation/SConscript',
'iksolver/SConscript',
+ 'elbeem/SConscript',
'opennl/SConscript'])
NEW_CSG='false'
--- /dev/null
+ All code distributed as part of El'Bemm is covered by the following
+ version of the GNU General Public License, expcept for excerpts of
+ the trimesh2 package in src/isosurface.cpp (see COPYING_trimesh2
+ for details).
+
+ 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.
+
+ Copyright (c) 2003-2005 Nils Thuerey. All rights reserved.
+
+
+
+
+ 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) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 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) year 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.
--- /dev/null
+This distribution includes source to "miniball", "freeGLUT",
+and "GLUI", which are covered under their own licenses.
+
+All other code distributed as part of trimesh2 is covered
+by the following license:
+
+
+Copyright (c) 2004 Szymon Rusinkiewicz.
+All rights reserved.
+
+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.
+
+
+
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 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.
+\f
+ 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.)
+\f
+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.
+\f
+ 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.
+\f
+ 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
--- /dev/null
+#
+# $Id$
+#
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# 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. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Hans Lambermont
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+# elbeem main makefile.
+#
+
+include nan_definitions.mk
+
+unexport NAN_QUIET
+
+LIBNAME = elbeem
+SOURCEDIR = intern/$(LIBNAME)
+DIR = $(OCGDIR)/$(SOURCEDIR)
+DIRS = intern
+#not ready yet TESTDIRS = test
+
+include nan_subdirs.mk
+
+install: all debug
+ @[ -d $(NAN_ELBEEM) ] || mkdir $(NAN_ELBEEM)
+ @[ -d $(NAN_ELBEEM)/include ] || mkdir $(NAN_ELBEEM)/include
+ @[ -d $(NAN_ELBEEM)/lib ] || mkdir $(NAN_ELBEEM)/lib
+ @[ -d $(NAN_ELBEEM)/lib/debug ] || mkdir $(NAN_ELBEEM)/lib/debug
+ @../tools/cpifdiff.sh $(DIR)/libelbeem.a $(NAN_ELBEEM)/lib/
+ @../tools/cpifdiff.sh $(DIR)/debug/libelbeem.a $(NAN_ELBEEM)/lib/debug/
+ifeq ($(OS),darwin)
+ ranlib $(NAN_ELBEEM)/lib/libelbeem.a
+ ranlib $(NAN_ELBEEM)/lib/debug/libelbeem.a
+endif
+ @../tools/cpifdiff.sh extern/*.h $(NAN_ELBEEM)/include/
+
--- /dev/null
+#!/usr/bin/python
+Import ('library_env')
+Import('user_options_dict');
+
+print "Including El'Beem Fluid Simulation..."
+elbeem_env = library_env.Copy();
+elbeem_env.Append(CXXFLAGS= ' -DNOGUI -DELBEEM_BLENDER=1 ');
+elbeem_env.Append(CCFLAGS= ' -DNOGUI -DELBEEM_BLENDER=1 ');
+#elbeem_env.Append(CPPPATH= '../src');
+#elbeem_env.Append(CCPATH= '../src');
+
+elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
+elbeem_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
+elbeem_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
+elbeem_env.Append (CCPATH = user_options_dict['PNG_INCLUDE'])
+elbeem_env.Append (CCPATH = user_options_dict['Z_INCLUDE'])
+elbeem_env.Append (CCPATH = user_options_dict['SDL_INCLUDE'])
+
+#Export('elbeem_env');
+#SConscript(['src/SConscript'])
+
+# main build----------------------------------------
+#Import('elbeem_env');
+#srcenv = elbeem_env.Copy();
+
+Sources = [
+
+ "intern/cfgparser.cpp",
+ "intern/cfglexer.cpp",
+
+ "intern/attributes.cpp",
+ "intern/elbeem.cpp",
+ "intern/factory_fsgr.cpp",
+ "intern/isosurface.cpp",
+ "intern/lbminterface.cpp",
+ "intern/ntl_blenderdumper.cpp",
+ "intern/ntl_bsptree.cpp",
+ "intern/ntl_geometrybox.cpp",
+ "intern/ntl_geometrymodel.cpp",
+ "intern/ntl_geometryobject.cpp",
+ "intern/ntl_geometrysphere.cpp",
+ "intern/ntl_image.cpp",
+ "intern/ntl_lightobject.cpp",
+ "intern/ntl_ray.cpp",
+ "intern/ntl_raytracer.cpp",
+ "intern/ntl_scene.cpp",
+ "intern/parametrizer.cpp",
+ "intern/particletracer.cpp",
+ "intern/simulation_object.cpp",
+ "intern/utilities.cpp",
+ "intern/blendercall.cpp"
+
+ ]; # sources
+
+elbeem_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_elbeem', source=Sources)
+
--- /dev/null
+/**
+ * BKE_fluidsim.h
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ *
+ * 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. The Blender
+ * Foundation also sells licenses for use in proprietary software under
+ * the Blender License. See http://www.blender.org/BL/ for information
+ * about this.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+#ifndef LBM_FLUIDSIM_H
+#define LBM_FLUIDSIM_H
+
+struct Mesh;
+struct DerivedMesh;
+struct Object;
+struct fluidsimDerivedMesh;
+
+extern double fluidsimViscosityPreset[6];
+extern char* fluidsimViscosityPresetString[6];
+
+/* allocates and initializes fluidsim data */
+struct FluidsimSettings* fluidsimSettingsNew(struct Object *srcob);
+
+/* frees internal data itself */
+void fluidsimSettingsFree(struct FluidsimSettings* sb);
+
+/* export blender geometry to fluid solver */
+void fluidsimBake(struct Object* ob);
+
+/* read & write bobj / bobj.gz files (e.g. for fluid sim surface meshes) */
+void writeBobjgz(char *filename, struct Object *ob);
+struct Mesh* readBobjgz(char *filename, struct Mesh *orgmesh);
+
+/* create derived mesh for fluid sim objects */
+// WARNING - currently implemented in DerivedMesh.c!
+struct DerivedMesh *getFluidsimDerivedMesh(struct Object *srcob, int useRenderParams, float *extverts, float *nors);
+
+/* run simulation with given config file */
+// WARNING - implemented in intern/elbeem/blendercall.cpp
+int performElbeemSimulation(char *cfgfilename);
+
+#endif
+
+
--- /dev/null
+#
+# $Id$
+#
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# 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. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License. See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): none yet.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+# elbeem intern Makefile
+#
+
+LIBNAME = elbeem
+DIR = $(OCGDIR)/intern/$(LIBNAME)
+
+include nan_compile.mk
+
+unexport NAN_QUIET
+
+CCFLAGS += $(LEVEL_2_CPP_WARNINGS)
+
+CPPFLAGS += -DNOGUI -DELBEEM_BLENDER
+CPPFLAGS += -I.
+CPPFLAGS += -I../extern
+CPPFLAGS += $(NAN_SDLCFLAGS)
+CPPFLAGS += -I$(NAN_PNG)/include
+CPPFLAGS += -I$(NAN_PNG)/include/libpng
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2003,2004 Nils Thuerey
+ *
+ * Array class definitions
+ *
+ *****************************************************************************/
+#ifndef ARRAYS_H
+#include <string>
+#include <sstream>
+#include <fstream>
+
+
+/*****************************************************************************/
+/* array handling "cutting off" access along the border */
+template<class T>
+class ArrayCutoffBc {
+ public:
+ //! constructor
+ ArrayCutoffBc() :
+ mpVal( NULL ), mElemSize( sizeof(T) ),
+ mAllocSize(0),
+ mSizex(0), mSizey(0), mSizez(0)
+ { };
+ //! destructor
+ virtual ~ArrayCutoffBc() {
+ if((mpVal)&&(mAllocSize>0)) delete[] mpVal;
+ mpVal = NULL;
+ }
+
+ //! init sizes
+ void initializeArray(int setx, int sety, int setz) {
+ mSizex = setx;
+ mSizey = sety;
+ mSizez = setz;
+ }
+
+ //! allocate a new array
+ inline void allocate() {
+ int size = mSizex*mSizey*mSizez;
+ if(size == mAllocSize) return; // dont reallocate
+ T* newval = new T[size];
+ for(int i=0;i<size;i++) newval[i] = (T)(0.0);
+ mpVal = (unsigned char *)newval;
+ mAllocSize = size;
+ };
+
+ //! set the scalar field pointer
+ inline void setValuePointer(T *pnt, int elem) { mpVal = (unsigned char *)pnt; mElemSize = elem; };
+
+ //! internal array index calculator
+ inline int arrayIndex(int x, int y, int z) {
+ if(x<0) x=0;
+ if(y<0) y=0;
+ if(z<0) z=0;
+ if(x>mSizex-1) x=mSizex-1;
+ if(y>mSizey-1) y=mSizey-1;
+ if(z>mSizez-1) z=mSizez-1;
+ return z*mSizex*mSizey + y*mSizex + x;
+ }
+ //! phi access function
+ inline T& getValue(int x, int y, int z) {
+ unsigned char *bpnt = &mpVal[ arrayIndex(x,y,z)*mElemSize ];
+ return *((T*)bpnt);
+ //return mpPhi[ z*mSizex*mSizey + y*mSizex + x];
+ }
+ //! return relative offset in direction dir (x=0,y=1,z=2)
+ inline T& getOffset(T *base,int off, int dir) {
+ unsigned char *basep = (unsigned char *)base;
+ int multiplier = 1;
+ if(dir==1) multiplier=mSizex;
+ if(dir==2) multiplier=mSizex*mSizey;
+ // check boundary
+ unsigned char *bpnt = (basep+ ((off*multiplier)*mElemSize) );
+ if(bpnt<mpVal) bpnt = basep;
+ if(bpnt>= (unsigned char *)&getValue(mSizex-1,mSizey-1,mSizez-1) ) bpnt = basep;
+ return *((T*)bpnt);
+ }
+
+ //! perform trilinear interpolation of array values
+ inline T interpolateValueAt(LbmFloat x, LbmFloat y, LbmFloat z) {
+ const LbmFloat gsx=1.0, gsy=1.0, gsz=1.0;
+ int i= (int)x;
+ int j= (int)y;
+ int k= (int)z;
+
+ int in = i+1;
+ int jn = j+1;
+ int kn = k+1;
+ if(in>=mSizex) in = mSizex-1;
+ if(jn>=mSizey) jn = mSizey-1;
+ if(kn>=mSizez) kn = mSizez-1;
+
+ LbmVec mStart(0.0); // TODO remove?
+ LbmFloat x1 = mStart[0]+ (LbmFloat)(i)*gsx;
+ LbmFloat x2 = mStart[0]+ (LbmFloat)(in)*gsx;
+ LbmFloat y1 = mStart[1]+ (LbmFloat)(j)*gsy;
+ LbmFloat y2 = mStart[1]+ (LbmFloat)(jn)*gsy;
+ LbmFloat z1 = mStart[2]+ (LbmFloat)(k)*gsz;
+ LbmFloat z2 = mStart[2]+ (LbmFloat)(kn)*gsz;
+
+ if(mSizez==1) {
+ z1=0.0; z2=1.0;
+ k = kn = 0;
+ }
+
+ T v1, v2, v3, v4, v5, v6, v7, v8;
+ v1 = getValue(i ,j ,k );
+ v2 = getValue(in ,j ,k );
+ v3 = getValue(i ,jn ,k );
+ v4 = getValue(in ,jn ,k );
+ v5 = getValue(i ,j ,kn );
+ v6 = getValue(in ,j ,kn );
+ v7 = getValue(i ,jn ,kn );
+ v8 = getValue(in ,jn ,kn );
+
+ T val =
+ ( v1 *(x2-x)* (y2-y)* (z2-z) +
+ v2 *(x-x1)* (y2-y)* (z2-z) +
+ v3 *(x2-x)* (y-y1)* (z2-z) +
+ v4 *(x-x1)* (y-y1)* (z2-z) +
+ v5 *(x2-x)* (y2-y)* (z-z1) +
+ v6 *(x-x1)* (y2-y)* (z-z1) +
+ v7 *(x2-x)* (y-y1)* (z-z1) +
+ v8 *(x-x1)* (y-y1)* (z-z1)
+ ) * (1.0/(gsx*gsy*gsz)) ;
+ return val;
+ }
+
+ //! get size of an element
+ inline int getElementSize(){ return mElemSize; }
+ //! get array sizes
+ inline int getSizeX(){ return mSizex; }
+ inline int getSizeY(){ return mSizey; }
+ inline int getSizeZ(){ return mSizez; }
+ //! get array pointer
+ inline T* getPointer(){ return (T*)mpVal; }
+
+ //! testing, gnuplot dump (XY plane for k=Z/2)
+ void dumpToFile(std::string filebase, int id, int nr) {
+ std::ostringstream filename;
+ filename << filebase << "_"<< id <<"_"<< nr <<".dump";
+ std::ofstream outfile( filename.str().c_str() );
+ for(int k=mSizez/2; k<=mSizez/2; k++) {
+ for(int j=0; j<mSizey; j++) {
+ for(int i=0; i<mSizex; i++) {
+ outfile <<i<<" "<<j<<" " << getValue(i,j,k)<<" " <<std::endl;
+ }
+ outfile << std::endl;
+ }
+ }
+ }
+ //! testing, grid text dump (XY plane for k=Z/2)
+ void dumpToGridFile(std::string filebase, int id, int nr) {
+ std::ostringstream filename;
+ filename << filebase << "_"<< id <<"_"<< nr <<".dump";
+ std::ofstream outfile( filename.str().c_str() );
+ for(int k=mSizez/2; k<=mSizez/2; k++) {
+ for(int j=0; j<mSizey; j++) {
+ for(int i=0; i<mSizex; i++) {
+ outfile <<getValue(i,j,k)<<"\t";
+ }
+ outfile << std::endl;
+ }
+ }
+ }
+
+ protected:
+ //! pointer for the value field (unsigned char for adding element size)
+ unsigned char *mpVal;
+ //! element offset in array
+ int mElemSize;
+ //! store allocated size
+ int mAllocSize;
+
+ //! Sizes of the scal array in each dimension
+ int mSizex,mSizey,mSizez;
+};
+
+/*****************************************************************************/
+/* array handling "cutting off" access along the border */
+template<class T>
+class ArrayPlain {
+ public:
+ //! constructor
+ ArrayPlain() :
+ mpVal( NULL ), mElemSize( sizeof(T) ),
+ mAllocSize(0),
+ mSizex(0), mSizey(0), mSizez(0)
+ { };
+ //! destructor
+ virtual ~ArrayPlain() {
+ if((mpVal)&&(mAllocSize>0)) delete[] mpVal;
+ mpVal = NULL;
+ }
+
+ //! init sizes
+ void initializeArray(int setx, int sety, int setz) {
+ mSizex = setx;
+ mSizey = sety;
+ mSizez = setz;
+ }
+
+ //! allocate a new array
+ inline void allocate() {
+ int size = mSizex*mSizey*mSizez;
+ if(size == mAllocSize) return; // dont reallocate
+ T* newval = new T[size];
+ for(int i=0;i<size;i++) newval[i] = (T)(0.0);
+ mpVal = (unsigned char *)newval;
+ mAllocSize = size;
+ };
+
+ //! set the scalar field pointer
+ inline void setValuePointer(T *pnt, int elem) { mpVal = (unsigned char *)pnt; mElemSize = elem; };
+
+ //! phi access function
+ inline T& getValue(const int x, const int y, const int z) const {
+ unsigned char *bpnt = &mpVal[ (z*mSizex*mSizey + y*mSizex + x)*mElemSize ];
+ return *((T*)bpnt);
+ }
+ //! return relative offset in direction dir (x=0,y=1,z=2)
+ inline T& getOffset(T *base,int off, int dir) {
+ unsigned char *basep = (unsigned char *)base;
+ int multiplier = 1;
+ if(dir==1) multiplier=mSizex;
+ if(dir==2) multiplier=mSizex*mSizey;
+ // check boundary
+ unsigned char *bpnt = (basep+ ((off*multiplier)*mElemSize) );
+ if(bpnt<mpVal) bpnt = basep;
+ if(bpnt>= (unsigned char *)&getValue(mSizex-1,mSizey-1,mSizez-1) ) bpnt = basep;
+ return *((T*)bpnt);
+ }
+
+ //! get size of an element
+ inline int getElementSize(){ return mElemSize; }
+ //! get array sizes
+ inline int getSizeX(){ return mSizex; }
+ inline int getSizeY(){ return mSizey; }
+ inline int getSizeZ(){ return mSizez; }
+ //! get array pointer
+ inline T* getPointer(){ return (T*)mpVal; }
+
+ //! testing, gnuplot dump (XY plane for k=Z/2)
+ void dumpToFile(std::string filebase, int id, int nr) {
+ std::ostringstream filename;
+ filename << filebase << "_"<< id <<"_"<< nr <<".dump";
+ std::ofstream outfile( filename.str().c_str() );
+ for(int k=mSizez/2; k<=mSizez/2; k++) {
+ for(int j=0; j<mSizey; j++) {
+ for(int i=0; i<mSizex; i++) {
+ outfile <<i<<" "<<j<<" " << getValue(i,j,k)<<" " <<std::endl;
+ }
+ outfile << std::endl;
+ }
+ }
+ }
+ //! testing, grid text dump (XY plane for k=Z/2)
+ void dumpToGridFile(std::string filebase, int id, int nr) {
+ std::ostringstream filename;
+ filename << filebase << "_"<< id <<"_"<< nr <<".dump";
+ std::ofstream outfile( filename.str().c_str() );
+ for(int k=mSizez/2; k<=mSizez/2; k++) {
+ for(int j=0; j<mSizey; j++) {
+ for(int i=0; i<mSizex; i++) {
+ outfile <<getValue(i,j,k)<<"\t";
+ }
+ outfile << std::endl;
+ }
+ }
+ }
+
+ protected:
+ //! pointer for the value field (unsigned char for adding element size)
+ unsigned char *mpVal;
+ //! element offset in array
+ int mElemSize;
+ //! store allocated size
+ int mAllocSize;
+
+ //! Sizes of the scal array in each dimension
+ int mSizex,mSizey,mSizez;
+};
+
+
+
+#define ARRAYS_H
+#endif
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2003,2004 Nils Thuerey
+ *
+ * configuration attribute storage class and attribute class
+ *
+ *****************************************************************************/
+
+#include "attributes.h"
+#include <sstream>
+
+
+//! output attribute values? on=1/off=0
+#define DEBUG_ATTRIBUTES 0
+
+
+/******************************************************************************
+ * attribute conversion functions
+ *****************************************************************************/
+
+// get value as string
+string Attribute::getAsString()
+{
+ if(mValue.size()!=1) {
+ //errMsg("Attribute::getAsString", "Attribute \"" << mName << "\" used as string has invalid value '"<< getCompleteString() <<"' ");
+ // for directories etc. , this might be valid! cutoff "..." first
+ string comp = getCompleteString();
+ if(comp.size()<2) return string("");
+ return comp.substr(1, comp.size()-2);
+ }
+ return mValue[0];
+}
+
+// get value as integer value
+int Attribute::getAsInt()
+{
+ bool success = true;
+ int ret = 0;
+ if(mValue.size()!=1) success = false;
+ else {
+ const char *str = mValue[0].c_str();
+ char *endptr;
+ ret = strtol(str, &endptr, 10);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+ }
+
+ if(!success) {
+ errMsg("Attribute::getAsString", "Attribute \"" << mName << "\" used as int has invalid value '"<< getCompleteString() <<"' ");
+ errMsg("Attribute::getAsString", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ errMsg("Attribute::getAsString", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ return 0;
+ }
+ return ret;
+}
+
+
+// get value as integer value
+bool Attribute::getAsBool()
+{
+ int val = getAsInt();
+ if(val==0) return false;
+ else return true;
+}
+
+
+// get value as double value
+double Attribute::getAsFloat()
+{
+ bool success = true;
+ double ret = 0.0;
+ if(mValue.size()!=1) success = false;
+ else {
+ const char *str = mValue[0].c_str();
+ char *endptr;
+ ret = strtod(str, &endptr);
+ if((str!=endptr) && (*endptr != '\0')) success = false;
+ }
+
+ if(!success) {
+ errMsg("Attribute::getAsFloat", "Attribute \"" << mName << "\" used as double has invalid value '"<< getCompleteString() <<"' ");
+ errMsg("Attribute::getAsFloat", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ errMsg("Attribute::getAsFloat", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ return 0.0;
+ }
+ return ret;
+}
+
+// get value as 3d vector
+ntlVec3d Attribute::getAsVec3d()
+{
+ bool success = true;
+ ntlVec3d ret(0.0);
+ if(mValue.size()==1) {
+ const char *str = mValue[0].c_str();
+ char *endptr;
+ double rval = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+ if(success) ret = ntlVec3d( rval );
+ } else if(mValue.size()==3) {
+ char *endptr;
+ const char *str = NULL;
+
+ str = mValue[0].c_str();
+ double rval1 = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+
+ str = mValue[1].c_str();
+ double rval2 = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+
+ str = mValue[2].c_str();
+ double rval3 = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+
+ if(success) ret = ntlVec3d( rval1, rval2, rval3 );
+ } else {
+ success = false;
+ }
+
+ if(!success) {
+ errMsg("Attribute::getAsVec3d", "Attribute \"" << mName << "\" used as Vec3d has invalid value '"<< getCompleteString() <<"' ");
+ errMsg("Attribute::getAsVec3d", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ errMsg("Attribute::getAsVec3d", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ return ntlVec3d(0.0);
+ }
+ return ret;
+}
+
+// get value as 4x4 matrix
+ntlMat4Gfx Attribute::getAsMat4Gfx()
+{
+ bool success = true;
+ ntlMat4Gfx ret(0.0);
+ char *endptr;
+ const char *str = NULL;
+
+ if(mValue.size()==1) {
+ const char *str = mValue[0].c_str();
+ char *endptr;
+ double rval = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) )success = false;
+ if(success) {
+ ret = ntlMat4Gfx( 0.0 );
+ ret.value[0][0] = rval;
+ ret.value[1][1] = rval;
+ ret.value[2][2] = rval;
+ ret.value[3][3] = 1.0;
+ }
+ } else if(mValue.size()==9) {
+ // 3x3
+ for(int i=0; i<3;i++) {
+ for(int j=0; j<3;j++) {
+ str = mValue[i*3+j].c_str();
+ ret.value[i][j] = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) ) success = false;
+ }
+ }
+ } else if(mValue.size()==16) {
+ // 4x4
+ for(int i=0; i<4;i++) {
+ for(int j=0; j<4;j++) {
+ str = mValue[i*4+j].c_str();
+ ret.value[i][j] = strtod(str, &endptr);
+ if( (str==endptr) ||
+ ((str!=endptr) && (*endptr != '\0')) ) success = false;
+ }
+ }
+
+ } else {
+ success = false;
+ }
+
+ if(!success) {
+ errMsg("Attribute::getAsMat4Gfx", "Attribute \"" << mName << "\" used as Mat4x4 has invalid value '"<< getCompleteString() <<"' ");
+ errMsg("Attribute::getAsMat4Gfx", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ errMsg("Attribute::getAsMat4Gfx", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" );
+ return ntlMat4Gfx(0.0);
+ }
+ return ret;
+}
+
+
+// get the concatenated string of all value string
+string Attribute::getCompleteString()
+{
+ string ret;
+ for(size_t i=0;i<mValue.size();i++) {
+ ret += mValue[i];
+ if(i<mValue.size()-1) ret += " ";
+ }
+ return ret;
+}
+
+
+/******************************************************************************
+ * check if there were unknown params
+ *****************************************************************************/
+bool AttributeList::checkUnusedParams()
+{
+ bool found = false;
+ for(map<string, Attribute*>::iterator i=mAttrs.begin();
+ i != mAttrs.end(); i++) {
+ if((*i).second) {
+ if(!(*i).second->getUsed()) {
+ errorOut("Attribute "<<mName<<" has unknown parameter '"<<(*i).first<<"' = '"<< mAttrs[(*i).first]->getAsString() <<"' ");
+ found = true;
+ }
+ }
+ }
+ return found;
+}
+//! set all params to used, for invisible objects
+void AttributeList::setAllUsed() {
+ for(map<string, Attribute*>::iterator i=mAttrs.begin();
+ i != mAttrs.end(); i++) {
+ if((*i).second) {
+ (*i).second->setUsed(true);
+ }
+ }
+}
+
+/******************************************************************************
+ * Attribute list read functions
+ *****************************************************************************/
+int AttributeList::readInt(string name, int defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readInt error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsInt();
+}
+bool AttributeList::readBool(string name, bool defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readBool error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsBool();
+}
+double AttributeList::readFloat(string name, double defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readFloat error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsFloat();
+}
+string AttributeList::readString(string name, string defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readInt error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsString();
+}
+ntlVec3d AttributeList::readVec3d(string name, ntlVec3d defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readInt error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsVec3d();
+}
+
+ntlMat4Gfx AttributeList::readMat4Gfx(string name, ntlMat4Gfx defaultValue, string source,string target, bool needed) {
+ if(!exists(name)) {
+ if(needed) { errorOut("AttributeList::readInt error: Required attribute '"<<name<<"' for "<< source <<" not set! "); exit(1); }
+ return defaultValue;
+ }
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Var '"<< target <<"' set to '"<< find(name)->getCompleteString() <<"' as type int " , 3); }
+ find(name)->setUsed(true);
+ return find(name)->getAsMat4Gfx();
+}
+
+// set that a parameter can be given, and will be ignored...
+bool AttributeList::ignoreParameter(string name, string source) {
+ if(!exists(name)) return false;
+ find(name)->setUsed(true);
+ if(DEBUG_ATTRIBUTES==1) { debugOut( source << " Param '"<< name <<"' set but ignored... " , 3); }
+ return true;
+}
+
+/******************************************************************************
+ * destructor
+ *****************************************************************************/
+AttributeList::~AttributeList() {
+ for(map<string, Attribute*>::iterator i=mAttrs.begin();
+ i != mAttrs.end(); i++) {
+ if((*i).second) {
+ delete (*i).second;
+ (*i).second = NULL;
+ }
+ }
+};
+
+
+/******************************************************************************
+ * debugging
+ *****************************************************************************/
+
+//! debug function, prints value
+void Attribute::print()
+{
+ std::ostringstream ostr;
+ ostr << " "<< mName <<"= ";
+ for(size_t i=0;i<mValue.size();i++) {
+ ostr <<"'"<< mValue[i]<<"' ";
+ }
+ ostr <<" (at line "<<mLine<<") "; //<< std::endl;
+ debugOut( ostr.str(), 10);
+}
+
+//! debug function, prints all attribs
+void AttributeList::print()
+{
+ debugOut("Attribute "<<mName<<" values:", 10);
+ for(map<string, Attribute*>::iterator i=mAttrs.begin();
+ i != mAttrs.end(); i++) {
+ if((*i).second) {
+ (*i).second->print();
+ }
+ }
+}
+
+
+
+/******************************************************************************
+ * import attributes from other attribute list
+ *****************************************************************************/
+void AttributeList::import(AttributeList *oal)
+{
+ for(map<string, Attribute*>::iterator i=oal->mAttrs.begin();
+ i !=oal->mAttrs.end(); i++) {
+ // FIXME - check freeing of copyied attributes
+ if((*i).second) {
+ Attribute *newAttr = new Attribute( *(*i).second );
+ mAttrs[ (*i).first ] = newAttr;
+ }
+ }
+}
+
+
+
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2003,2004 Nils Thuerey
+ *
+ * configuration attribute storage class and attribute class
+ *
+ *****************************************************************************/
+
+
+#ifndef NTL_ATTRIBUTES_H
+
+#include "utilities.h"
+#include "ntl_matrices.h"
+
+
+//! A single attribute
+class Attribute
+{
+ public:
+ //! Standard constructor
+ Attribute(string mn, vector<string> &value, int setline) :
+ mName(mn), mValue(value),
+ mLine(setline), mUsed(false) { };
+ //! Copy constructor
+ Attribute(Attribute &a) :
+ mName(a.mName), mValue(a.mValue),
+ mLine(a.mLine), mUsed(false) { };
+ //! Destructor
+ ~Attribute() { /* empty */ };
+
+ //! set used flag
+ void setUsed(bool set){ mUsed = set; }
+ //! get used flag
+ bool getUsed() { return mUsed; }
+
+ //! get value as string
+ string getAsString();
+
+ //! get value as integer value
+ int getAsInt();
+
+ //! get value as boolean
+ bool getAsBool();
+
+ //! get value as double value
+ double getAsFloat();
+
+ //! get value as 3d vector
+ ntlVec3d getAsVec3d();
+
+ //! get value as 4x4 matrix
+ ntlMat4Gfx getAsMat4Gfx();
+
+ //! get the concatenated string of all value string
+ string getCompleteString();
+
+ //! debug function, prints value
+ void print();
+
+ protected:
+
+ /*! the attr name */
+ string mName;
+
+ /*! the attr value */
+ vector<string> mValue;
+
+ /*! line where the value was defined in the config file (for error messages) */
+ int mLine;
+
+ /*! was this attribute used? */
+ bool mUsed;
+};
+
+
+//! The list of configuration attributes
+class AttributeList
+{
+ public:
+ //! Standard constructor
+ AttributeList(string name) :
+ mName(name), mAttrs() { };
+ //! Destructor , delete all contained attribs
+ ~AttributeList();
+
+ /*! add an attribute to this list */
+ void addAttr(string name, vector<string> &value, int line) {
+ if(exists(name)) delete mAttrs[name];
+ mAttrs[name] = new Attribute(name,value,line);
+ }
+
+ /*! check if an attribute is set */
+ bool exists(string name) {
+ if(mAttrs.find(name) == mAttrs.end()) return false;
+ return true;
+ }
+
+ /*! get an attribute */
+ Attribute *find(string name) {
+ if(mAttrs.find(name) == mAttrs.end()) {
+ errorOut("AttributeList::find error: Invalid attribute '"<<name<<"' , not found..." );
+ exit(1);
+ }
+ return mAttrs[name];
+ }
+
+ //! set all params to used, for invisible objects
+ void setAllUsed();
+ //! check if there were unknown params
+ bool checkUnusedParams();
+
+ //! import attributes from other attribute list
+ void import(AttributeList *oal);
+
+ //! read attributes for object initialization
+ int readInt(string name, int defaultValue, string source,string target, bool needed);
+ bool readBool(string name, bool defaultValue, string source,string target, bool needed);
+ double readFloat(string name, double defaultValue, string source,string target, bool needed);
+ string readString(string name, string defaultValue, string source,string target, bool needed);
+ ntlVec3d readVec3d(string name, ntlVec3d defaultValue, string source,string target, bool needed);
+ ntlMat4Gfx readMat4Gfx(string name, ntlMat4Gfx defaultValue, string source,string target, bool needed);
+
+ //! set that a parameter can be given, and will be ignored...
+ bool ignoreParameter(string name, string source);
+
+ //! debug function, prints all attribs
+ void print();
+
+ protected:
+
+ /*! attribute name (form config file) */
+ string mName;
+
+ /*! the global attribute storage */
+ map<string, Attribute*> mAttrs;
+
+};
+
+
+#define NTL_ATTRIBUTES_H
+#endif
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * All code distributed as part of El'Beem is covered by the version 2 of the
+ * GNU General Public License. See the file COPYING for details.
+ * Copyright 2003-2005 Nils Thuerey
+ *
+ * Blender call interface
+ *
+ *****************************************************************************/
+
+#include "globals.h"
+#include "ntl_raytracer.h"
+#include "ntl_blenderdumper.h"
+
+extern "C"
+int performElbeemSimulation(char *cfgfilename) {
+ fprintf(GEN_userstream, "Running El'Beem from Blender with file '%s' ...\n",cfgfilename);
+ // load given file in command line mode
+ ntlBlenderDumper elbeem(cfgfilename, true);
+ myTime_t timestart = getTime();
+ elbeem.renderAnimation();
+ myTime_t timeend = getTime();
+ fprintf(GEN_userstream, "El'Beem simulation done, time: %f seconds.\n", ((timeend-timestart)/(double)1000.0) );
+ return 1;
+};
+
+
--- /dev/null
+
+#line 3 "<stdout>"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 31
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yy_restart(yy_in )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int yy_leng;
+
+extern FILE *yy_in, *yy_out;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yy_text. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yy_text again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr) )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yy_restart()), so that the user can continue scanning by
+ * just pointing yy_in at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when yy_text is formed. */
+static char yy_hold_char;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yy_leng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yy_wrap()'s to do buffer switches
+ * instead of setting up a fresh yy_in. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yy_restart (FILE *input_file );
+void yy__switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy__create_buffer (FILE *file,int size );
+void yy__delete_buffer (YY_BUFFER_STATE b );
+void yy__flush_buffer (YY_BUFFER_STATE b );
+void yy_push_buffer_state (YY_BUFFER_STATE new_buffer );
+void yy_pop_buffer_state (void );
+
+static void yy_ensure_buffer_stack (void );
+static void yy__load_buffer_state (void );
+static void yy__init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER yy__flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy__scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE yy__scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE yy__scan_bytes (yyconst char *bytes,int len );
+
+void *yy_alloc (yy_size_t );
+void *yy_realloc (void *,yy_size_t );
+void yy_free (void * );
+
+#define yy_new_buffer yy__create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yy_ensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy__create_buffer(yy_in,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yy_ensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy__create_buffer(yy_in,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+typedef unsigned char YY_CHAR;
+
+FILE *yy_in = (FILE *) 0, *yy_out = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yy_lineno;
+
+int yy_lineno = 1;
+
+extern char *yy_text;
+#define yytext_ptr yy_text
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yy_text.
+ */
+#define YY_DO_BEFORE_ACTION \
+ (yytext_ptr) = yy_bp; \
+ yy_leng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 97
+#define YY_END_OF_BUFFER 98
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[562] =
+ { 0,
+ 0, 0, 0, 0, 6, 6, 98, 96, 96, 94,
+ 95, 96, 92, 96, 96, 96, 88, 96, 96, 96,
+ 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
+ 96, 96, 96, 96, 96, 1, 2, 96, 95, 4,
+ 3, 6, 7, 6, 6, 6, 7, 1, 2, 0,
+ 1, 2, 0, 92, 0, 88, 89, 93, 91, 88,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 84, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 1, 2, 0, 3,
+ 4, 3, 6, 6, 5, 6, 6, 6, 90, 91,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 44,
+ 0, 0, 0, 0, 0, 0, 0, 0, 51, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 85, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 17, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 63, 0, 0, 0, 75, 0,
+ 0, 52, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 86, 43, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 62,
+ 0, 0, 78, 0, 0, 0, 0, 0, 0, 0,
+ 87, 0, 0, 0, 0, 0, 0, 0, 0, 74,
+ 0, 0, 0, 0, 0, 0, 0, 0, 61, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 50,
+ 0, 0, 0, 16, 0, 0, 76, 0, 0, 0,
+
+ 0, 18, 0, 0, 0, 0, 0, 77, 0, 0,
+ 0, 39, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 59, 0, 15, 0, 0, 67, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 45, 0, 0, 0, 0, 55, 0, 64, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 65, 0, 0, 0, 0, 0, 72, 0, 0,
+ 0, 0, 0, 0, 0, 0, 53, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 49, 0, 0, 21, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 14, 58, 25,
+ 8, 0, 42, 0, 60, 0, 0, 0, 46, 0,
+ 79, 0, 0, 0, 0, 0, 0, 66, 34, 0,
+ 0, 0, 0, 0, 0, 22, 0, 13, 38, 0,
+ 0, 0, 0, 0, 0, 0, 0, 10, 0, 0,
+ 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 82, 0, 0, 0, 0, 0, 0, 0,
+ 37, 20, 0, 0, 0, 0, 0, 0, 9, 33,
+ 0, 73, 57, 0, 0, 0, 35, 11, 0, 0,
+ 0, 12, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 36, 47, 0, 0, 83, 0, 40, 30, 56, 54,
+ 0, 69, 0, 0, 0, 71, 0, 0, 0, 19,
+ 23, 0, 0, 0, 0, 0, 0, 0, 0, 68,
+ 31, 0, 0, 0, 0, 0, 0, 0, 0, 29,
+ 70, 0, 0, 0, 80, 0, 0, 48, 26, 0,
+ 0, 0, 81, 0, 0, 27, 28, 0, 32, 41,
+ 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 4, 1, 5, 6, 1, 1, 1, 1, 1,
+ 1, 7, 1, 1, 8, 9, 10, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 12, 13, 1,
+ 14, 1, 1, 1, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 33,
+ 1, 15, 1, 1, 16, 1, 17, 18, 19, 20,
+
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 33, 42, 1, 43, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[44] =
+ { 0,
+ 1, 2, 3, 4, 1, 1, 1, 5, 6, 5,
+ 6, 5, 2, 1, 5, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 1, 1
+ } ;
+
+static yyconst flex_int16_t yy_base[572] =
+ { 0,
+ 0, 0, 43, 86, 128, 170, 699, 700, 60, 700,
+ 63, 0, 0, 43, 687, 53, 50, 47, 53, 78,
+ 47, 39, 87, 676, 43, 82, 54, 80, 117, 92,
+ 93, 112, 116, 664, 99, 123, 138, 149, 152, 0,
+ 141, 0, 700, 690, 156, 101, 700, 157, 160, 163,
+ 175, 180, 689, 0, 682, 176, 681, 700, 0, 177,
+ 655, 672, 153, 657, 652, 668, 101, 646, 161, 46,
+ 175, 178, 665, 663, 655, 654, 644, 642, 186, 648,
+ 640, 646, 653, 644, 168, 640, 644, 643, 645, 648,
+ 639, 700, 647, 636, 174, 625, 192, 648, 131, 647,
+
+ 628, 198, 630, 623, 626, 624, 214, 219, 222, 226,
+ 0, 227, 0, 653, 652, 230, 0, 235, 700, 0,
+ 631, 630, 146, 629, 632, 618, 624, 620, 619, 700,
+ 612, 612, 615, 613, 607, 618, 614, 619, 700, 608,
+ 604, 617, 612, 595, 606, 599, 604, 611, 596, 606,
+ 602, 607, 593, 592, 604, 206, 595, 700, 598, 592,
+ 591, 579, 594, 582, 596, 582, 595, 583, 593, 593,
+ 590, 576, 573, 578, 586, 585, 584, 583, 567, 577,
+ 238, 563, 579, 565, 562, 580, 577, 570, 571, 573,
+ 562, 556, 554, 183, 572, 565, 557, 565, 548, 553,
+
+ 562, 216, 562, 700, 560, 550, 558, 544, 540, 540,
+ 558, 540, 556, 541, 700, 540, 549, 538, 700, 545,
+ 544, 543, 529, 530, 538, 545, 540, 532, 528, 521,
+ 523, 520, 526, 519, 524, 700, 700, 533, 530, 532,
+ 528, 518, 530, 529, 517, 508, 525, 508, 520, 700,
+ 516, 514, 700, 504, 503, 218, 515, 516, 499, 508,
+ 700, 501, 514, 502, 494, 507, 491, 490, 491, 700,
+ 488, 498, 481, 487, 492, 485, 498, 489, 700, 485,
+ 490, 497, 475, 493, 477, 473, 470, 480, 486, 700,
+ 475, 193, 488, 700, 464, 475, 700, 466, 472, 466,
+
+ 474, 700, 461, 466, 462, 478, 475, 700, 472, 461,
+ 466, 474, 453, 467, 457, 466, 456, 466, 456, 454,
+ 447, 700, 458, 700, 462, 458, 700, 436, 440, 454,
+ 457, 443, 441, 452, 449, 444, 449, 431, 437, 448,
+ 700, 444, 213, 446, 422, 700, 440, 432, 438, 422,
+ 440, 420, 418, 437, 433, 227, 424, 431, 410, 432,
+ 414, 700, 411, 425, 424, 415, 418, 700, 401, 424,
+ 412, 418, 415, 412, 408, 399, 700, 404, 408, 397,
+ 401, 413, 404, 411, 393, 405, 405, 388, 389, 221,
+ 700, 397, 218, 700, 386, 399, 389, 382, 386, 382,
+
+ 391, 227, 396, 392, 391, 375, 385, 700, 700, 700,
+ 700, 377, 700, 389, 700, 375, 375, 386, 700, 368,
+ 700, 373, 378, 381, 363, 368, 366, 700, 700, 372,
+ 377, 374, 373, 359, 369, 700, 366, 700, 355, 369,
+ 352, 348, 352, 354, 367, 349, 353, 700, 353, 344,
+ 360, 700, 357, 341, 346, 354, 340, 350, 355, 350,
+ 335, 339, 350, 331, 335, 335, 332, 338, 338, 332,
+ 700, 700, 326, 324, 341, 321, 324, 334, 700, 700,
+ 320, 700, 700, 329, 317, 316, 700, 700, 330, 309,
+ 312, 700, 322, 321, 317, 325, 307, 325, 305, 319,
+
+ 700, 700, 319, 307, 700, 307, 311, 700, 700, 700,
+ 304, 700, 309, 316, 294, 700, 310, 306, 299, 700,
+ 700, 235, 298, 304, 308, 286, 305, 288, 301, 700,
+ 700, 298, 295, 295, 280, 273, 266, 263, 262, 700,
+ 700, 268, 257, 260, 700, 266, 249, 700, 700, 245,
+ 225, 224, 700, 237, 166, 700, 700, 155, 700, 700,
+ 700, 267, 273, 276, 282, 113, 288, 294, 300, 306,
+ 312
+ } ;
+
+static yyconst flex_int16_t yy_def[572] =
+ { 0,
+ 561, 1, 562, 562, 563, 563, 561, 561, 561, 561,
+ 561, 564, 565, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 566,
+ 561, 567, 561, 568, 569, 567, 561, 567, 567, 561,
+ 561, 561, 564, 565, 561, 561, 561, 561, 570, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 566, 561, 567, 568, 568, 569, 567, 571, 561, 570,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 571, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 0, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561
+ } ;
+
+static yyconst flex_int16_t yy_nxt[744] =
+ { 0,
+ 8, 9, 10, 11, 12, 13, 8, 14, 15, 16,
+ 17, 8, 8, 8, 8, 8, 18, 19, 20, 21,
+ 22, 23, 24, 8, 25, 8, 8, 26, 27, 28,
+ 29, 30, 8, 31, 32, 33, 34, 35, 8, 8,
+ 8, 36, 37, 8, 38, 10, 39, 8, 13, 8,
+ 8, 55, 16, 56, 8, 8, 41, 8, 55, 58,
+ 60, 50, 59, 50, 50, 61, 50, 71, 73, 66,
+ 85, 72, 81, 133, 134, 62, 63, 82, 86, 74,
+ 67, 64, 65, 68, 36, 37, 8, 38, 10, 39,
+ 8, 13, 8, 8, 69, 16, 87, 8, 8, 41,
+
+ 8, 51, 52, 75, 51, 52, 83, 117, 70, 96,
+ 118, 76, 84, 97, 77, 94, 88, 78, 111, 105,
+ 79, 128, 95, 106, 107, 129, 107, 36, 37, 9,
+ 43, 11, 44, 45, 89, 98, 101, 46, 90, 108,
+ 47, 108, 112, 99, 112, 91, 92, 100, 93, 102,
+ 109, 170, 109, 109, 171, 109, 103, 54, 107, 54,
+ 107, 108, 110, 108, 50, 110, 50, 184, 54, 48,
+ 49, 9, 43, 11, 44, 45, 107, 123, 107, 46,
+ 185, 108, 47, 108, 55, 55, 56, 60, 124, 560,
+ 51, 52, 135, 51, 52, 131, 136, 132, 137, 138,
+
+ 559, 162, 145, 152, 51, 52, 146, 153, 163, 343,
+ 165, 48, 49, 166, 174, 107, 253, 107, 175, 254,
+ 108, 167, 108, 109, 344, 109, 168, 112, 112, 112,
+ 112, 54, 387, 54, 176, 110, 120, 216, 120, 120,
+ 433, 120, 54, 217, 262, 263, 310, 120, 388, 311,
+ 120, 400, 436, 437, 533, 445, 434, 558, 401, 557,
+ 556, 402, 446, 51, 52, 555, 534, 40, 40, 40,
+ 40, 40, 40, 42, 42, 42, 42, 42, 42, 53,
+ 53, 53, 54, 54, 554, 54, 54, 54, 113, 553,
+ 552, 551, 113, 113, 114, 550, 549, 548, 114, 114,
+
+ 116, 116, 547, 116, 116, 116, 120, 120, 546, 120,
+ 120, 120, 181, 181, 545, 181, 181, 181, 544, 543,
+ 542, 541, 540, 539, 538, 537, 536, 535, 532, 531,
+ 530, 529, 528, 527, 526, 525, 524, 523, 522, 521,
+ 520, 519, 518, 517, 516, 515, 514, 513, 512, 511,
+ 510, 509, 508, 507, 506, 505, 504, 503, 502, 501,
+ 500, 499, 498, 497, 496, 495, 494, 493, 492, 491,
+ 490, 489, 488, 487, 486, 485, 484, 483, 482, 481,
+ 480, 479, 478, 477, 476, 475, 474, 473, 472, 471,
+ 470, 469, 468, 467, 466, 465, 464, 463, 462, 461,
+
+ 460, 459, 458, 457, 456, 455, 454, 453, 452, 451,
+ 450, 449, 448, 447, 444, 443, 442, 441, 440, 439,
+ 438, 435, 432, 431, 430, 429, 428, 427, 426, 425,
+ 424, 423, 422, 421, 420, 419, 418, 417, 416, 415,
+ 414, 413, 412, 411, 410, 409, 408, 407, 406, 405,
+ 404, 403, 399, 398, 397, 396, 395, 394, 393, 392,
+ 391, 390, 389, 386, 385, 384, 383, 382, 381, 380,
+ 379, 378, 377, 376, 375, 374, 373, 372, 371, 370,
+ 369, 368, 367, 366, 365, 364, 363, 362, 361, 360,
+ 359, 358, 357, 356, 355, 354, 353, 352, 351, 350,
+
+ 349, 348, 347, 346, 345, 342, 341, 340, 339, 338,
+ 337, 336, 335, 334, 333, 332, 331, 330, 329, 328,
+ 327, 326, 325, 324, 323, 322, 321, 320, 319, 318,
+ 317, 316, 315, 314, 313, 312, 309, 308, 307, 306,
+ 305, 304, 303, 302, 301, 300, 299, 298, 297, 296,
+ 295, 294, 293, 292, 291, 290, 289, 288, 287, 286,
+ 285, 284, 283, 282, 281, 280, 279, 278, 277, 276,
+ 275, 274, 273, 272, 271, 270, 269, 268, 267, 266,
+ 265, 264, 261, 260, 259, 258, 257, 256, 255, 252,
+ 251, 250, 249, 248, 247, 246, 245, 244, 243, 242,
+
+ 241, 240, 239, 238, 237, 236, 235, 234, 233, 232,
+ 231, 230, 229, 228, 227, 226, 225, 224, 223, 222,
+ 221, 220, 219, 218, 215, 214, 213, 212, 211, 210,
+ 209, 208, 207, 206, 205, 204, 203, 202, 201, 200,
+ 199, 198, 197, 196, 195, 194, 193, 192, 191, 190,
+ 189, 188, 187, 186, 183, 182, 115, 115, 180, 179,
+ 178, 177, 173, 172, 169, 164, 161, 160, 159, 158,
+ 157, 156, 155, 154, 151, 150, 149, 148, 147, 144,
+ 143, 142, 141, 140, 139, 130, 127, 126, 125, 122,
+ 121, 57, 57, 119, 115, 104, 80, 57, 561, 7,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561
+ } ;
+
+static yyconst flex_int16_t yy_chk[744] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 3, 3, 3, 3, 3, 3, 3,
+ 3, 14, 3, 14, 3, 3, 3, 3, 17, 16,
+ 17, 9, 16, 9, 11, 18, 11, 21, 22, 19,
+ 27, 21, 25, 70, 70, 18, 18, 25, 27, 22,
+ 19, 18, 18, 19, 3, 3, 4, 4, 4, 4,
+ 4, 4, 4, 4, 20, 4, 28, 4, 4, 4,
+
+ 4, 9, 9, 23, 11, 11, 26, 46, 20, 31,
+ 46, 23, 26, 31, 23, 30, 28, 23, 566, 35,
+ 23, 67, 30, 35, 36, 67, 36, 4, 4, 5,
+ 5, 5, 5, 5, 29, 32, 33, 5, 29, 37,
+ 5, 37, 41, 32, 41, 29, 29, 32, 29, 33,
+ 38, 99, 38, 39, 99, 39, 33, 45, 48, 45,
+ 48, 49, 38, 49, 50, 39, 50, 123, 45, 5,
+ 5, 6, 6, 6, 6, 6, 51, 63, 51, 6,
+ 123, 52, 6, 52, 56, 60, 56, 60, 63, 558,
+ 38, 38, 71, 39, 39, 69, 71, 69, 72, 72,
+
+ 555, 95, 79, 85, 50, 50, 79, 85, 95, 292,
+ 97, 6, 6, 97, 102, 107, 194, 107, 102, 194,
+ 108, 97, 108, 109, 292, 109, 97, 110, 112, 110,
+ 112, 116, 343, 116, 102, 109, 118, 156, 118, 181,
+ 390, 181, 116, 156, 202, 202, 256, 118, 343, 256,
+ 181, 356, 393, 393, 522, 402, 390, 554, 356, 552,
+ 551, 356, 402, 109, 109, 550, 522, 562, 562, 562,
+ 562, 562, 562, 563, 563, 563, 563, 563, 563, 564,
+ 564, 564, 565, 565, 547, 565, 565, 565, 567, 546,
+ 544, 543, 567, 567, 568, 542, 539, 538, 568, 568,
+
+ 569, 569, 537, 569, 569, 569, 570, 570, 536, 570,
+ 570, 570, 571, 571, 535, 571, 571, 571, 534, 533,
+ 532, 529, 528, 527, 526, 525, 524, 523, 519, 518,
+ 517, 515, 514, 513, 511, 507, 506, 504, 503, 500,
+ 499, 498, 497, 496, 495, 494, 493, 491, 490, 489,
+ 486, 485, 484, 481, 478, 477, 476, 475, 474, 473,
+ 470, 469, 468, 467, 466, 465, 464, 463, 462, 461,
+ 460, 459, 458, 457, 456, 455, 454, 453, 451, 450,
+ 449, 447, 446, 445, 444, 443, 442, 441, 440, 439,
+ 437, 435, 434, 433, 432, 431, 430, 427, 426, 425,
+
+ 424, 423, 422, 420, 418, 417, 416, 414, 412, 407,
+ 406, 405, 404, 403, 401, 400, 399, 398, 397, 396,
+ 395, 392, 389, 388, 387, 386, 385, 384, 383, 382,
+ 381, 380, 379, 378, 376, 375, 374, 373, 372, 371,
+ 370, 369, 367, 366, 365, 364, 363, 361, 360, 359,
+ 358, 357, 355, 354, 353, 352, 351, 350, 349, 348,
+ 347, 345, 344, 342, 340, 339, 338, 337, 336, 335,
+ 334, 333, 332, 331, 330, 329, 328, 326, 325, 323,
+ 321, 320, 319, 318, 317, 316, 315, 314, 313, 312,
+ 311, 310, 309, 307, 306, 305, 304, 303, 301, 300,
+
+ 299, 298, 296, 295, 293, 291, 289, 288, 287, 286,
+ 285, 284, 283, 282, 281, 280, 278, 277, 276, 275,
+ 274, 273, 272, 271, 269, 268, 267, 266, 265, 264,
+ 263, 262, 260, 259, 258, 257, 255, 254, 252, 251,
+ 249, 248, 247, 246, 245, 244, 243, 242, 241, 240,
+ 239, 238, 235, 234, 233, 232, 231, 230, 229, 228,
+ 227, 226, 225, 224, 223, 222, 221, 220, 218, 217,
+ 216, 214, 213, 212, 211, 210, 209, 208, 207, 206,
+ 205, 203, 201, 200, 199, 198, 197, 196, 195, 193,
+ 192, 191, 190, 189, 188, 187, 186, 185, 184, 183,
+
+ 182, 180, 179, 178, 177, 176, 175, 174, 173, 172,
+ 171, 170, 169, 168, 167, 166, 165, 164, 163, 162,
+ 161, 160, 159, 157, 155, 154, 153, 152, 151, 150,
+ 149, 148, 147, 146, 145, 144, 143, 142, 141, 140,
+ 138, 137, 136, 135, 134, 133, 132, 131, 129, 128,
+ 127, 126, 125, 124, 122, 121, 115, 114, 106, 105,
+ 104, 103, 101, 100, 98, 96, 94, 93, 91, 90,
+ 89, 88, 87, 86, 84, 83, 82, 81, 80, 78,
+ 77, 76, 75, 74, 73, 68, 66, 65, 64, 62,
+ 61, 57, 55, 53, 44, 34, 24, 15, 7, 561,
+
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561, 561, 561, 561, 561, 561, 561, 561,
+ 561, 561, 561
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy__flex_debug;
+int yy__flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yy_text;
+#line 1 "src/cfglexer.ll"
+/*---------------------------------------------------------------------------*/
+/* */
+/* Minimal Flex Lexer */
+/* */
+/*---------------------------------------------------------------------------*/
+#line 11 "src/cfglexer.ll"
+
+/*---------------------------------------------------------------------------*/
+/* bison grammar tokens */
+/*---------------------------------------------------------------------------*/
+
+/* this header file is automatically generated by bison
+ * and includes all token definitions, as well as yy_lval */
+#include "cfgparser.hpp"
+#include "utilities.h"
+
+#include <string.h>
+#define CHAR_BUFFER_SIZE 8000
+ char charBuffer[ CHAR_BUFFER_SIZE ];
+
+ int lineCount = 1;
+
+// for windos compiler...
+extern "C" int yy_wrap (void ) { return 1; }
+#define YY_NO_UNISTD_H
+
+/*----------------------------------------------------------------------------*/
+/* definitions */
+/*----------------------------------------------------------------------------*/
+
+
+/*----------------------------------------------------------------------------*/
+/*
+ * rules start
+ */
+/*----------------------------------------------------------------------------*/
+#line 826 "<stdout>"
+
+#define INITIAL 0
+#define ATTR 1
+#define ATTRVALUE 2
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yy_wrap (void );
+#else
+extern int yy_wrap (void );
+#endif
+#endif
+
+ static void yyunput (int c,char *buf_ptr );
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yy_text, yy_leng, 1, yy_out )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yy_in )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yy_in ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yy_in))==0 && ferror(yy_in)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yy_in); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yy_lex (void);
+
+#define YY_DECL int yy_lex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yy_text and yy_leng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 51 "src/cfglexer.ll"
+
+
+
+#line 983 "<stdout>"
+
+ if ( (yy_init) )
+ {
+ (yy_init) = 0;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yy_in )
+ yy_in = stdin;
+
+ if ( ! yy_out )
+ yy_out = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yy_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy__create_buffer(yy_in,YY_BUF_SIZE );
+ }
+
+ yy__load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
+
+ /* Support of yy_text. */
+ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = (yy_start);
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 562 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_current_state != 561 );
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+#line 54 "src/cfglexer.ll"
+{ return KW_PAROPEN; }
+ YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 55 "src/cfglexer.ll"
+{ BEGIN(INITIAL); // '}' always closes scopes
+ return KW_PARCLOSE; }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 58 "src/cfglexer.ll"
+{
+ BEGIN(ATTRVALUE);
+ return KW_EQUALS; }
+ YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 61 "src/cfglexer.ll"
+{ /* attribute name = normal string */
+ strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
+ yy_lval.charValue = charBuffer;
+ return DT_ATTRNAME; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 65 "src/cfglexer.ll"
+{ /* quoted string! attribute name = normal string */
+ strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
+ /* get rid of " " */
+ for(unsigned int j=0;j<strlen(charBuffer);j++) charBuffer[j]=charBuffer[j+1];
+ charBuffer[ strlen(charBuffer)-1 ] = 0;
+ yy_lval.charValue = charBuffer;
+ return DT_ATTRVALUE; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 72 "src/cfglexer.ll"
+{ /* ends at newline or ';' */
+ strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
+ yy_lval.charValue = charBuffer;
+ return DT_ATTRVALUE; }
+ YY_BREAK
+case 7:
+/* rule 7 can match eol */
+YY_RULE_SETUP
+#line 76 "src/cfglexer.ll"
+{ /* return end token... */
+ BEGIN(ATTR);
+ return KW_ATTREND; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 81 "src/cfglexer.ll"
+{ return KW_LBMSIM; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 82 "src/cfglexer.ll"
+{ return KW_COMPARELBM; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 83 "src/cfglexer.ll"
+{ return KW_DEBUGMODE; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 84 "src/cfglexer.ll"
+{ return KW_RAYTRACING; }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+#line 87 "src/cfglexer.ll"
+{ return KW_RESOLUTION; }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 88 "src/cfglexer.ll"
+{ return KW_ANTIALIAS; }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 89 "src/cfglexer.ll"
+{ return KW_EYEPOINT; }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+#line 90 "src/cfglexer.ll"
+{ return KW_LOOKAT ; }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+#line 91 "src/cfglexer.ll"
+{ return KW_UPVEC ; }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+#line 92 "src/cfglexer.ll"
+{ return KW_FOVY; }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+#line 93 "src/cfglexer.ll"
+{ return KW_ASPECT ; }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+#line 94 "src/cfglexer.ll"
+{ return KW_AMBIENCE; }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 95 "src/cfglexer.ll"
+{ return KW_BACKGROUND; }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 96 "src/cfglexer.ll"
+{ return KW_ANISTART; }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 97 "src/cfglexer.ll"
+{ return KW_ANIFRAMES; }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 98 "src/cfglexer.ll"
+{ return KW_ANIFRAMETIME; }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 99 "src/cfglexer.ll"
+{ return KW_FRAMESKIP; }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 100 "src/cfglexer.ll"
+{ return KW_FILENAME; }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+#line 101 "src/cfglexer.ll"
+{ return KW_PMCAUSTICS; }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+#line 102 "src/cfglexer.ll"
+{ return KW_CAUSTICDIST; }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+#line 103 "src/cfglexer.ll"
+{ return KW_CAUSTICPHOT; }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+#line 104 "src/cfglexer.ll"
+{ return KW_SHADOWMAPBIAS; }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+#line 105 "src/cfglexer.ll"
+{ return KW_MAXRAYDEPTH; }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+#line 106 "src/cfglexer.ll"
+{ return KW_TREEMAXDEPTH; }
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+#line 107 "src/cfglexer.ll"
+{ return KW_TREEMAXTRIANGLES; }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+#line 108 "src/cfglexer.ll"
+{ return KW_DEBUGPIXEL; }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+#line 109 "src/cfglexer.ll"
+{ return KW_TESTMODE; }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+#line 110 "src/cfglexer.ll"
+{ return KW_OPENGLATTR; }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+#line 111 "src/cfglexer.ll"
+{ return KW_BLENDERATTR; }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+#line 113 "src/cfglexer.ll"
+{ return KW_OBJATTR; /* assign attr to obj */ }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+#line 114 "src/cfglexer.ll"
+{ BEGIN(ATTR); return KW_ATTRIBUTE; /* global attr list */ }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+#line 115 "src/cfglexer.ll"
+{ BEGIN(ATTR); return KW_DEFINEATTR; /* obj defines new attrs */ }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+#line 116 "src/cfglexer.ll"
+{ BEGIN(ATTR); return KW_DEFINEATTR; }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+#line 117 "src/cfglexer.ll"
+{ BEGIN(ATTR); return KW_DEFINEATTR; }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+#line 119 "src/cfglexer.ll"
+{ return KW_GEOMETRY; }
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+#line 120 "src/cfglexer.ll"
+{ return KW_TYPE; }
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+#line 121 "src/cfglexer.ll"
+{ return KW_GEOTYPE_BOX; }
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+#line 122 "src/cfglexer.ll"
+{ return KW_GEOTYPE_SPHERE; }
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+#line 123 "src/cfglexer.ll"
+{ return KW_GEOTYPE_OBJMODEL; }
+ YY_BREAK
+case 47:
+YY_RULE_SETUP
+#line 124 "src/cfglexer.ll"
+{ return KW_CASTSHADOWS; }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+#line 125 "src/cfglexer.ll"
+{ return KW_RECEIVESHADOWS ; }
+ YY_BREAK
+case 49:
+YY_RULE_SETUP
+#line 126 "src/cfglexer.ll"
+{ return KW_VISIBLE; }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+#line 127 "src/cfglexer.ll"
+{ return KW_BOX_START; }
+ YY_BREAK
+case 51:
+YY_RULE_SETUP
+#line 128 "src/cfglexer.ll"
+{ return KW_BOX_END; }
+ YY_BREAK
+case 52:
+YY_RULE_SETUP
+#line 129 "src/cfglexer.ll"
+{ return KW_POLY ; }
+ YY_BREAK
+case 53:
+YY_RULE_SETUP
+#line 130 "src/cfglexer.ll"
+{ return KW_POLY ; }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+#line 131 "src/cfglexer.ll"
+{ return KW_NUMVERTICES; }
+ YY_BREAK
+case 55:
+YY_RULE_SETUP
+#line 132 "src/cfglexer.ll"
+{ return KW_VERTEX; }
+ YY_BREAK
+case 56:
+YY_RULE_SETUP
+#line 133 "src/cfglexer.ll"
+{ return KW_NUMPOLYGONS; }
+ YY_BREAK
+case 57:
+YY_RULE_SETUP
+#line 134 "src/cfglexer.ll"
+{ return KW_ISOSURF; }
+ YY_BREAK
+case 58:
+YY_RULE_SETUP
+#line 135 "src/cfglexer.ll"
+{ return KW_FILEMODE; }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
+#line 136 "src/cfglexer.ll"
+{ return KW_INVERT; }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+#line 138 "src/cfglexer.ll"
+{ return KW_MATERIAL; }
+ YY_BREAK
+case 61:
+YY_RULE_SETUP
+#line 139 "src/cfglexer.ll"
+{ return KW_MATTYPE_PHONG; }
+ YY_BREAK
+case 62:
+YY_RULE_SETUP
+#line 140 "src/cfglexer.ll"
+{ return KW_MATTYPE_BLINN; }
+ YY_BREAK
+case 63:
+YY_RULE_SETUP
+#line 141 "src/cfglexer.ll"
+{ return KW_NAME; }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+#line 142 "src/cfglexer.ll"
+{ return KW_AMBIENT; }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+#line 143 "src/cfglexer.ll"
+{ return KW_DIFFUSE; }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+#line 144 "src/cfglexer.ll"
+{ return KW_SPECULAR; }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+#line 145 "src/cfglexer.ll"
+{ return KW_MIRROR; }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+#line 146 "src/cfglexer.ll"
+{ return KW_TRANSPARENCE; }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+#line 147 "src/cfglexer.ll"
+{ return KW_REFRACINDEX; }
+ YY_BREAK
+case 70:
+YY_RULE_SETUP
+#line 148 "src/cfglexer.ll"
+{ return KW_TRANSADDITIVE; }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+#line 149 "src/cfglexer.ll"
+{ return KW_TRANSATTCOL; }
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
+#line 150 "src/cfglexer.ll"
+{ return KW_FRESNEL; }
+ YY_BREAK
+case 73:
+YY_RULE_SETUP
+#line 151 "src/cfglexer.ll"
+{ return KW_FRESNEL; }
+ YY_BREAK
+case 74:
+YY_RULE_SETUP
+#line 153 "src/cfglexer.ll"
+{ return KW_LIGHT; }
+ YY_BREAK
+case 75:
+YY_RULE_SETUP
+#line 154 "src/cfglexer.ll"
+{ return KW_LIGHT_OMNI; }
+ YY_BREAK
+case 76:
+YY_RULE_SETUP
+#line 155 "src/cfglexer.ll"
+{ return KW_ACTIVE; }
+ YY_BREAK
+case 77:
+YY_RULE_SETUP
+#line 156 "src/cfglexer.ll"
+{ return KW_COLOUR; }
+ YY_BREAK
+case 78:
+YY_RULE_SETUP
+#line 157 "src/cfglexer.ll"
+{ return KW_COLOUR; }
+ YY_BREAK
+case 79:
+YY_RULE_SETUP
+#line 158 "src/cfglexer.ll"
+{ return KW_POSITION; }
+ YY_BREAK
+case 80:
+YY_RULE_SETUP
+#line 159 "src/cfglexer.ll"
+{ return KW_CAUSTICPHOTONS; }
+ YY_BREAK
+case 81:
+YY_RULE_SETUP
+#line 160 "src/cfglexer.ll"
+{ return KW_CAUSTICSTRENGTH; }
+ YY_BREAK
+case 82:
+YY_RULE_SETUP
+#line 161 "src/cfglexer.ll"
+{ return KW_SHADOWMAP; }
+ YY_BREAK
+case 83:
+YY_RULE_SETUP
+#line 162 "src/cfglexer.ll"
+{ return KW_CAUSTICSMAP; }
+ YY_BREAK
+case 84:
+YY_RULE_SETUP
+#line 164 "src/cfglexer.ll"
+{ yy_lval.intValue = 1; return DT_INTEGER; }
+ YY_BREAK
+case 85:
+YY_RULE_SETUP
+#line 165 "src/cfglexer.ll"
+{ yy_lval.intValue = 0; return DT_INTEGER; }
+ YY_BREAK
+case 86:
+YY_RULE_SETUP
+#line 166 "src/cfglexer.ll"
+{ yy_lval.intValue = 1; return DT_INTEGER; }
+ YY_BREAK
+case 87:
+YY_RULE_SETUP
+#line 167 "src/cfglexer.ll"
+{ yy_lval.intValue = 0; return DT_INTEGER; }
+ YY_BREAK
+case 88:
+YY_RULE_SETUP
+#line 170 "src/cfglexer.ll"
+{ // integer number
+ yy_lval.intValue = atoi( yy_text );
+ return DT_INTEGER; }
+ YY_BREAK
+case 89:
+YY_RULE_SETUP
+#line 174 "src/cfglexer.ll"
+{ // floating point number
+ yy_lval.floatValue = atof( yy_text );
+ return DT_FLOAT; }
+ YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 178 "src/cfglexer.ll"
+{ /* normal character strings, now also for paths/filenames */
+ strncpy( charBuffer, yy_text, CHAR_BUFFER_SIZE-2 );
+ /* get rid of " " */
+ for(unsigned int j=0;j<strlen(charBuffer);j++) charBuffer[j]=charBuffer[j+1];
+ charBuffer[ strlen(charBuffer)-1 ] = 0;
+ yy_lval.charValue = charBuffer;
+ return DT_STRING; }
+ YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 186 "src/cfglexer.ll"
+{ /* one line comment */ }
+ YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 187 "src/cfglexer.ll"
+{ /* one line comment */ }
+ YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 188 "src/cfglexer.ll"
+{ /* multiline comment */
+ register int c;
+ for ( ; ; ) {
+ while ( (c = yyinput()) != '*' &&
+ c != EOF ) {
+ /* eat up text of comment, count lines */
+ if(c == '\n') lineCount++;
+ }
+
+ if ( c == '*' ) {
+ while ( (c = yyinput()) == '*' ); /* search '*' */
+ if ( c == '/' ) break; /* found the end */
+ if ( c == '\n' ) lineCount++;
+ }
+
+ if ( c == EOF ) {
+ errorOut( "cfgLexer, Line "<<lineCount<<" :End of file found in comment..." );
+ break;
+ }
+ } /* multline comment done */
+ }
+ YY_BREAK
+case 94:
+/* rule 94 can match eol */
+YY_RULE_SETUP
+#line 212 "src/cfglexer.ll"
+{ // count line numbers
+ lineCount++; }
+ YY_BREAK
+case 95:
+YY_RULE_SETUP
+#line 215 "src/cfglexer.ll"
+{ /* do nothing by default... */ }
+ YY_BREAK
+case 96:
+YY_RULE_SETUP
+#line 217 "src/cfglexer.ll"
+{ /*errorOut( "cfgLexer, Line "<<lineCount<<" : Unknown character '"<<(char)yyinput()<<"' " ); exit(1); */ }
+ YY_BREAK
+case 97:
+YY_RULE_SETUP
+#line 220 "src/cfglexer.ll"
+ECHO;
+ YY_BREAK
+#line 1597 "<stdout>"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(ATTR):
+case YY_STATE_EOF(ATTRVALUE):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yy_in at a new source and called
+ * yy_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yy_in;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yy_wrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yy_text, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of yy_lex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ size_t num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yy_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yy_restart(yy_in );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (void)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = (yy_start);
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 562 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 562 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 561);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yy_text */
+ *yy_cp = (yy_hold_char);
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (void)
+#else
+ static int input (void)
+#endif
+
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yy_restart(yy_in );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yy_wrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yy_text */
+ (yy_hold_char) = *++(yy_c_buf_p);
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void yy_restart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yy_ensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy__create_buffer(yy_in,YY_BUF_SIZE );
+ }
+
+ yy__init_buffer(YY_CURRENT_BUFFER,input_file );
+ yy__load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void yy__switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yy_pop_buffer_state();
+ * yy_push_buffer_state(new_buffer);
+ */
+ yy_ensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy__load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yy_wrap()) processing, but the only time this flag
+ * is looked at is after yy_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy__load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yy_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE yy__create_buffer (FILE * file, int size )
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy__create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_alloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy__create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy__init_buffer(b,file );
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy__create_buffer()
+ *
+ */
+ void yy__delete_buffer (YY_BUFFER_STATE b )
+{
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yy_free((void *) b->yy_ch_buf );
+
+ yy_free((void *) b );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yy_restart() or at EOF.
+ */
+ static void yy__init_buffer (YY_BUFFER_STATE b, FILE * file )
+
+{
+ int oerrno = errno;
+
+ yy__flush_buffer(b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy__init_buffer was _probably_
+ * called from yy_restart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void yy__flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy__load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void yy_push_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ yy_ensure_buffer_stack();
+
+ /* This block is copied from yy__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy__switch_to_buffer. */
+ yy__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void yy_pop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy__load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void yy_ensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yy_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yy_realloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy__scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yy_alloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy__switch_to_buffer(b );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yy_lex() will
+ * scan from a @e copy of @a str.
+ * @param str a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy__scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy__scan_string (yyconst char * yy_str )
+{
+
+ return yy__scan_bytes(yy_str,strlen(yy_str) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yy_lex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy__scan_bytes (yyconst char * bytes, int len )
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = len + 2;
+ buf = (char *) yy_alloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy__scan_bytes()" );
+
+ for ( i = 0; i < len; ++i )
+ buf[i] = bytes[i];
+
+ buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy__scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy__scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yy_text. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yy_text[yy_leng] = (yy_hold_char); \
+ (yy_c_buf_p) = yy_text + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yy_leng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ *
+ */
+int yy_get_lineno (void)
+{
+
+ return yy_lineno;
+}
+
+/** Get the input stream.
+ *
+ */
+FILE *yy_get_in (void)
+{
+ return yy_in;
+}
+
+/** Get the output stream.
+ *
+ */
+FILE *yy_get_out (void)
+{
+ return yy_out;
+}
+
+/** Get the length of the current token.
+ *
+ */
+int yy_get_leng (void)
+{
+ return yy_leng;
+}
+
+/** Get the current token.
+ *
+ */
+
+char *yy_get_text (void)
+{
+ return yy_text;
+}
+
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void yy_set_lineno (int line_number )
+{
+
+ yy_lineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see yy__switch_to_buffer
+ */
+void yy_set_in (FILE * in_str )
+{
+ yy_in = in_str ;
+}
+
+void yy_set_out (FILE * out_str )
+{
+ yy_out = out_str ;
+}
+
+int yy_get_debug (void)
+{
+ return yy__flex_debug;
+}
+
+void yy_set_debug (int bdebug )
+{
+ yy__flex_debug = bdebug ;
+}
+
+/* yy_lex_destroy is for both reentrant and non-reentrant scanners. */
+int yy_lex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy__delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yy_pop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ yy_free((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yy_alloc (yy_size_t size )
+{
+ return (void *) malloc( size );
+}
+
+void *yy_realloc (void * ptr, yy_size_t size )
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void yy_free (void * ptr )
+{
+ free( (char *) ptr ); /* see yy_realloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef yytext_ptr
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+#line 220 "src/cfglexer.ll"
--- /dev/null
+/* A Bison parser, made by GNU Bison 1.875d. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Written by Richard Stallman by simplifying the original so called
+ ``semantic'' parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 0
+
+/* Using locations. */
+#define YYLSP_NEEDED 0
+
+/* If NAME_PREFIX is specified substitute the variables and functions
+ names. */
+#define yyparse yy_parse
+#define yylex yy_lex
+#define yyerror yy_error
+#define yylval yy_lval
+#define yychar yy_char
+#define yydebug yy_debug
+#define yynerrs yy_nerrs
+
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ DT_INTEGER = 258,
+ DT_FLOAT = 259,
+ DT_STRING = 260,
+ DT_ATTRNAME = 261,
+ DT_ATTRVALUE = 262,
+ KW_LBMSIM = 263,
+ KW_COMPARELBM = 264,
+ KW_ANIFRAMETIME = 265,
+ KW_DEBUGMODE = 266,
+ KW_P_RELAXTIME = 267,
+ KW_P_REYNOLDS = 268,
+ KW_P_VISCOSITY = 269,
+ KW_P_SOUNDSPEED = 270,
+ KW_P_DOMAINSIZE = 271,
+ KW_P_FORCE = 272,
+ KW_P_TIMELENGTH = 273,
+ KW_P_STEPTIME = 274,
+ KW_P_TIMEFACTOR = 275,
+ KW_P_ANIFRAMETIME = 276,
+ KW_P_ANISTART = 277,
+ KW_P_SURFACETENSION = 278,
+ KW_P_ACTIVATE = 279,
+ KW_P_DEACTIVATE = 280,
+ KW_P_DENSITY = 281,
+ KW_P_CELLSIZE = 282,
+ KW_P_GSTAR = 283,
+ KW_PFSPATH = 284,
+ KW_PARTLINELENGTH = 285,
+ KW_PARTICLES = 286,
+ KW_FRAMESPERSEC = 287,
+ KW_RAYTRACING = 288,
+ KW_PAROPEN = 289,
+ KW_PARCLOSE = 290,
+ KW_FILENAME = 291,
+ KW_PMCAUSTICS = 292,
+ KW_MAXRAYDEPTH = 293,
+ KW_CAUSTICDIST = 294,
+ KW_CAUSTICPHOT = 295,
+ KW_SHADOWMAPBIAS = 296,
+ KW_TREEMAXDEPTH = 297,
+ KW_TREEMAXTRIANGLES = 298,
+ KW_RESOLUTION = 299,
+ KW_ANTIALIAS = 300,
+ KW_EYEPOINT = 301,
+ KW_ANISTART = 302,
+ KW_ANIFRAMES = 303,
+ KW_FRAMESKIP = 304,
+ KW_LOOKAT = 305,
+ KW_UPVEC = 306,
+ KW_FOVY = 307,
+ KW_ASPECT = 308,
+ KW_AMBIENCE = 309,
+ KW_BACKGROUND = 310,
+ KW_DEBUGPIXEL = 311,
+ KW_TESTMODE = 312,
+ KW_OPENGLATTR = 313,
+ KW_BLENDERATTR = 314,
+ KW_ATTRIBUTE = 315,
+ KW_OBJATTR = 316,
+ KW_EQUALS = 317,
+ KW_DEFINEATTR = 318,
+ KW_ATTREND = 319,
+ KW_GEOMETRY = 320,
+ KW_TYPE = 321,
+ KW_GEOTYPE_BOX = 322,
+ KW_GEOTYPE_FLUID = 323,
+ KW_GEOTYPE_OBJMODEL = 324,
+ KW_GEOTYPE_SPHERE = 325,
+ KW_CASTSHADOWS = 326,
+ KW_RECEIVESHADOWS = 327,
+ KW_VISIBLE = 328,
+ KW_BOX_END = 329,
+ KW_BOX_START = 330,
+ KW_POLY = 331,
+ KW_NUMVERTICES = 332,
+ KW_VERTEX = 333,
+ KW_NUMPOLYGONS = 334,
+ KW_ISOSURF = 335,
+ KW_FILEMODE = 336,
+ KW_INVERT = 337,
+ KW_MATERIAL = 338,
+ KW_MATTYPE_PHONG = 339,
+ KW_MATTYPE_BLINN = 340,
+ KW_NAME = 341,
+ KW_AMBIENT = 342,
+ KW_DIFFUSE = 343,
+ KW_SPECULAR = 344,
+ KW_MIRROR = 345,
+ KW_TRANSPARENCE = 346,
+ KW_REFRACINDEX = 347,
+ KW_TRANSADDITIVE = 348,
+ KW_TRANSATTCOL = 349,
+ KW_FRESNEL = 350,
+ KW_LIGHT = 351,
+ KW_ACTIVE = 352,
+ KW_COLOUR = 353,
+ KW_POSITION = 354,
+ KW_LIGHT_OMNI = 355,
+ KW_CAUSTICPHOTONS = 356,
+ KW_CAUSTICSTRENGTH = 357,
+ KW_SHADOWMAP = 358,
+ KW_CAUSTICSMAP = 359
+ };
+#endif
+#define DT_INTEGER 258
+#define DT_FLOAT 259
+#define DT_STRING 260
+#define DT_ATTRNAME 261
+#define DT_ATTRVALUE 262
+#define KW_LBMSIM 263
+#define KW_COMPARELBM 264
+#define KW_ANIFRAMETIME 265
+#define KW_DEBUGMODE 266
+#define KW_P_RELAXTIME 267
+#define KW_P_REYNOLDS 268
+#define KW_P_VISCOSITY 269
+#define KW_P_SOUNDSPEED 270
+#define KW_P_DOMAINSIZE 271
+#define KW_P_FORCE 272
+#define KW_P_TIMELENGTH 273
+#define KW_P_STEPTIME 274
+#define KW_P_TIMEFACTOR 275
+#define KW_P_ANIFRAMETIME 276
+#define KW_P_ANISTART 277
+#define KW_P_SURFACETENSION 278
+#define KW_P_ACTIVATE 279
+#define KW_P_DEACTIVATE 280
+#define KW_P_DENSITY 281
+#define KW_P_CELLSIZE 282
+#define KW_P_GSTAR 283
+#define KW_PFSPATH 284
+#define KW_PARTLINELENGTH 285
+#define KW_PARTICLES 286
+#define KW_FRAMESPERSEC 287
+#define KW_RAYTRACING 288
+#define KW_PAROPEN 289
+#define KW_PARCLOSE 290
+#define KW_FILENAME 291
+#define KW_PMCAUSTICS 292
+#define KW_MAXRAYDEPTH 293
+#define KW_CAUSTICDIST 294
+#define KW_CAUSTICPHOT 295
+#define KW_SHADOWMAPBIAS 296
+#define KW_TREEMAXDEPTH 297
+#define KW_TREEMAXTRIANGLES 298
+#define KW_RESOLUTION 299
+#define KW_ANTIALIAS 300
+#define KW_EYEPOINT 301
+#define KW_ANISTART 302
+#define KW_ANIFRAMES 303
+#define KW_FRAMESKIP 304
+#define KW_LOOKAT 305
+#define KW_UPVEC 306
+#define KW_FOVY 307
+#define KW_ASPECT 308
+#define KW_AMBIENCE 309
+#define KW_BACKGROUND 310
+#define KW_DEBUGPIXEL 311
+#define KW_TESTMODE 312
+#define KW_OPENGLATTR 313
+#define KW_BLENDERATTR 314
+#define KW_ATTRIBUTE 315
+#define KW_OBJATTR 316
+#define KW_EQUALS 317
+#define KW_DEFINEATTR 318
+#define KW_ATTREND 319
+#define KW_GEOMETRY 320
+#define KW_TYPE 321
+#define KW_GEOTYPE_BOX 322
+#define KW_GEOTYPE_FLUID 323
+#define KW_GEOTYPE_OBJMODEL 324
+#define KW_GEOTYPE_SPHERE 325
+#define KW_CASTSHADOWS 326
+#define KW_RECEIVESHADOWS 327
+#define KW_VISIBLE 328
+#define KW_BOX_END 329
+#define KW_BOX_START 330
+#define KW_POLY 331
+#define KW_NUMVERTICES 332
+#define KW_VERTEX 333
+#define KW_NUMPOLYGONS 334
+#define KW_ISOSURF 335
+#define KW_FILEMODE 336
+#define KW_INVERT 337
+#define KW_MATERIAL 338
+#define KW_MATTYPE_PHONG 339
+#define KW_MATTYPE_BLINN 340
+#define KW_NAME 341
+#define KW_AMBIENT 342
+#define KW_DIFFUSE 343
+#define KW_SPECULAR 344
+#define KW_MIRROR 345
+#define KW_TRANSPARENCE 346
+#define KW_REFRACINDEX 347
+#define KW_TRANSADDITIVE 348
+#define KW_TRANSATTCOL 349
+#define KW_FRESNEL 350
+#define KW_LIGHT 351
+#define KW_ACTIVE 352
+#define KW_COLOUR 353
+#define KW_POSITION 354
+#define KW_LIGHT_OMNI 355
+#define KW_CAUSTICPHOTONS 356
+#define KW_CAUSTICSTRENGTH 357
+#define KW_SHADOWMAP 358
+#define KW_CAUSTICSMAP 359
+
+
+
+
+/* Copy the first part of user declarations. */
+#line 14 "src/cfgparser.yy"
+
+
+#define YYDEBUG 1
+
+/* library functions */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "attributes.h"
+
+ void yy_warn(char *s);
+ void yy_error(const char *s);
+
+ /* imported from flex... */
+ extern int yy_lex();
+ extern int lineCount;
+ extern FILE *yy_in;
+
+ /* the parse function from bison */
+ int yy_parse( void );
+
+// local variables to access objects
+#include "simulation_object.h"
+#ifdef LBM_INCLUDE_TESTSOLVERS
+#include "simulation_complbm.h"
+#endif // LBM_INCLUDE_TESTSOLVERS
+
+#include "parametrizer.h"
+#include "ntl_renderglobals.h"
+#include "ntl_scene.h"
+
+#include "ntl_lightobject.h"
+#include "ntl_material.h"
+#include "ntl_geometrybox.h"
+#include "ntl_geometrysphere.h"
+#include "ntl_geometrymodel.h"
+#include "globals.h"
+
+ /* global variables */
+ static map<string,AttributeList*> attrs; /* global attribute storage */
+ vector<string> currentAttrValue; /* build string vector */
+
+ // global raytracing settings, stores object,lights,material lists etc.
+ // lists are freed by ntlScene upon deletion
+ static ntlRenderGlobals *reglob; /* raytracing global settings */
+
+ /* light initialization checks */
+ ntlLightObject *currentLight;
+ ntlLightObject *currentLightOmni;
+
+ /* geometry initialization checks */
+ ntlGeometryClass *currentGeoClass;
+ ntlGeometryObject *currentGeoObj;
+ ntlGeometryBox *currentGeometryBox;
+ ntlGeometrySphere *currentGeometrySphere;
+ SimulationObject *currentGeometrySim;
+ ntlGeometryObjModel *currentGeometryModel;
+ AttributeList *currentAttrib;
+ string currentAttrName, currentAttribAddName;
+
+ /* material init checks */
+ ntlMaterial *currentMaterial;
+
+
+
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 1
+#endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 85 "src/cfgparser.yy"
+typedef union YYSTYPE {
+ int intValue;
+ float floatValue;
+ char *charValue;
+} YYSTYPE;
+/* Line 191 of yacc.c. */
+#line 364 "bld-std-gcc/src/cfgparser.cpp"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations. */
+
+
+/* Line 214 of yacc.c. */
+#line 376 "bld-std-gcc/src/cfgparser.cpp"
+
+#if ! defined (yyoverflow) || YYERROR_VERBOSE
+
+# ifndef YYFREE
+# define YYFREE free
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# endif
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# define YYSTACK_ALLOC alloca
+# endif
+# else
+# if defined (alloca) || defined (_ALLOCA_H)
+# define YYSTACK_ALLOC alloca
+# else
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# else
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# endif
+#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+
+
+#if (! defined (yyoverflow) \
+ && (! defined (__cplusplus) \
+ || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ short int yyss;
+ YYSTYPE yyvs;
+ };
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (short int) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined (__GNUC__) && 1 < __GNUC__
+# define YYCOPY(To, From, Count) \
+ __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# else
+# define YYCOPY(To, From, Count) \
+ do \
+ { \
+ register YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (To)[yyi] = (From)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack, Stack, yysize); \
+ Stack = &yyptr->Stack; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined (__STDC__) || defined (__cplusplus)
+ typedef signed char yysigned_char;
+#else
+ typedef short int yysigned_char;
+#endif
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 12
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 278
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 105
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 77
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 136
+/* YYNRULES -- Number of states. */
+#define YYNSTATES 237
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 359
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+static const unsigned char yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+ YYRHS. */
+static const unsigned short int yyprhs[] =
+{
+ 0, 0, 3, 6, 8, 10, 12, 14, 17, 22,
+ 25, 27, 29, 31, 33, 35, 37, 39, 41, 43,
+ 45, 47, 49, 51, 53, 55, 57, 59, 61, 63,
+ 65, 67, 69, 71, 73, 75, 77, 80, 83, 86,
+ 89, 93, 96, 101, 106, 111, 114, 117, 122, 127,
+ 130, 133, 136, 139, 143, 146, 149, 152, 159, 162,
+ 164, 166, 168, 170, 172, 174, 177, 180, 185, 190,
+ 191, 199, 202, 204, 206, 208, 210, 212, 214, 216,
+ 218, 220, 222, 224, 226, 228, 230, 232, 235, 238,
+ 241, 244, 247, 252, 257, 260, 265, 272, 275, 277,
+ 279, 281, 283, 285, 287, 289, 291, 293, 295, 297,
+ 299, 301, 304, 309, 314, 318, 321, 324, 327, 330,
+ 335, 338, 339, 346, 349, 351, 352, 353, 360, 363,
+ 365, 367, 369, 371, 373, 375, 377
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const short int yyrhs[] =
+{
+ 106, 0, -1, 106, 107, -1, 107, -1, 109, -1,
+ 169, -1, 108, -1, 11, 3, -1, 33, 34, 110,
+ 35, -1, 110, 111, -1, 111, -1, 114, -1, 112,
+ -1, 113, -1, 115, -1, 116, -1, 117, -1, 118,
+ -1, 119, -1, 120, -1, 121, -1, 122, -1, 123,
+ -1, 124, -1, 125, -1, 126, -1, 127, -1, 128,
+ -1, 129, -1, 130, -1, 131, -1, 132, -1, 133,
+ -1, 141, -1, 172, -1, 155, -1, 47, 180, -1,
+ 10, 180, -1, 48, 179, -1, 49, 181, -1, 44,
+ 179, 179, -1, 45, 3, -1, 46, 178, 178, 178,
+ -1, 50, 178, 178, 178, -1, 51, 178, 178, 178,
+ -1, 52, 178, -1, 53, 178, -1, 54, 178, 178,
+ 178, -1, 55, 178, 178, 178, -1, 36, 5, -1,
+ 42, 179, -1, 43, 179, -1, 38, 179, -1, 56,
+ 3, 3, -1, 57, 181, -1, 58, 5, -1, 59,
+ 5, -1, 96, 34, 66, 135, 134, 35, -1, 134,
+ 136, -1, 136, -1, 100, -1, 137, -1, 138, -1,
+ 139, -1, 140, -1, 97, 181, -1, 71, 181, -1,
+ 98, 178, 178, 178, -1, 99, 178, 178, 178, -1,
+ -1, 65, 34, 66, 144, 142, 143, 35, -1, 143,
+ 145, -1, 145, -1, 67, -1, 70, -1, 69, -1,
+ 8, -1, 9, -1, 146, -1, 147, -1, 148, -1,
+ 149, -1, 150, -1, 151, -1, 152, -1, 153, -1,
+ 154, -1, 86, 5, -1, 83, 5, -1, 71, 181,
+ -1, 72, 181, -1, 73, 181, -1, 75, 178, 178,
+ 178, -1, 74, 178, 178, 178, -1, 61, 5, -1,
+ 63, 34, 171, 35, -1, 83, 34, 66, 157, 156,
+ 35, -1, 156, 158, -1, 158, -1, 84, -1, 85,
+ -1, 159, -1, 160, -1, 161, -1, 162, -1, 163,
+ -1, 165, -1, 164, -1, 166, -1, 167, -1, 168,
+ -1, 86, 5, -1, 87, 176, 176, 176, -1, 88,
+ 176, 176, 176, -1, 89, 178, 178, -1, 90, 177,
+ -1, 91, 177, -1, 92, 178, -1, 93, 177, -1,
+ 94, 178, 178, 178, -1, 95, 180, -1, -1, 60,
+ 6, 34, 170, 171, 35, -1, 171, 172, -1, 172,
+ -1, -1, -1, 6, 62, 173, 175, 174, 64, -1,
+ 175, 7, -1, 7, -1, 177, -1, 178, -1, 4,
+ -1, 3, -1, 3, -1, 3, -1, 3, -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+static const unsigned short int yyrline[] =
+{
+ 0, 144, 144, 145, 148, 149, 150, 154, 164, 165,
+ 165, 168, 169, 170, 171, 173, 174, 175, 176, 177,
+ 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
+ 188, 189, 191, 192, 193, 194, 199, 203, 208, 212,
+ 218, 222, 226, 230, 234, 238, 242, 246, 250, 254,
+ 258, 262, 266, 270, 274, 278, 283, 292, 303, 304,
+ 307, 315, 316, 317, 318, 322, 327, 332, 337, 355,
+ 354, 374, 375, 378, 383, 388, 393, 399, 411, 412,
+ 413, 414, 415, 416, 417, 418, 419, 424, 429, 435,
+ 441, 447, 452, 464, 477, 483, 493, 504, 505, 508,
+ 513, 517, 518, 519, 520, 521, 522, 523, 524, 525,
+ 526, 531, 536, 541, 546, 552, 557, 562, 567, 572,
+ 577, 588, 588, 598, 598, 601, 602, 601, 609, 612,
+ 622, 625, 637, 639, 645, 656, 668
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE
+/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "$end", "error", "$undefined", "DT_INTEGER", "DT_FLOAT", "DT_STRING",
+ "DT_ATTRNAME", "DT_ATTRVALUE", "KW_LBMSIM", "KW_COMPARELBM",
+ "KW_ANIFRAMETIME", "KW_DEBUGMODE", "KW_P_RELAXTIME", "KW_P_REYNOLDS",
+ "KW_P_VISCOSITY", "KW_P_SOUNDSPEED", "KW_P_DOMAINSIZE", "KW_P_FORCE",
+ "KW_P_TIMELENGTH", "KW_P_STEPTIME", "KW_P_TIMEFACTOR",
+ "KW_P_ANIFRAMETIME", "KW_P_ANISTART", "KW_P_SURFACETENSION",
+ "KW_P_ACTIVATE", "KW_P_DEACTIVATE", "KW_P_DENSITY", "KW_P_CELLSIZE",
+ "KW_P_GSTAR", "KW_PFSPATH", "KW_PARTLINELENGTH", "KW_PARTICLES",
+ "KW_FRAMESPERSEC", "KW_RAYTRACING", "KW_PAROPEN", "KW_PARCLOSE",
+ "KW_FILENAME", "KW_PMCAUSTICS", "KW_MAXRAYDEPTH", "KW_CAUSTICDIST",
+ "KW_CAUSTICPHOT", "KW_SHADOWMAPBIAS", "KW_TREEMAXDEPTH",
+ "KW_TREEMAXTRIANGLES", "KW_RESOLUTION", "KW_ANTIALIAS", "KW_EYEPOINT",
+ "KW_ANISTART", "KW_ANIFRAMES", "KW_FRAMESKIP", "KW_LOOKAT", "KW_UPVEC",
+ "KW_FOVY", "KW_ASPECT", "KW_AMBIENCE", "KW_BACKGROUND", "KW_DEBUGPIXEL",
+ "KW_TESTMODE", "KW_OPENGLATTR", "KW_BLENDERATTR", "KW_ATTRIBUTE",
+ "KW_OBJATTR", "KW_EQUALS", "KW_DEFINEATTR", "KW_ATTREND", "KW_GEOMETRY",
+ "KW_TYPE", "KW_GEOTYPE_BOX", "KW_GEOTYPE_FLUID", "KW_GEOTYPE_OBJMODEL",
+ "KW_GEOTYPE_SPHERE", "KW_CASTSHADOWS", "KW_RECEIVESHADOWS", "KW_VISIBLE",
+ "KW_BOX_END", "KW_BOX_START", "KW_POLY", "KW_NUMVERTICES", "KW_VERTEX",
+ "KW_NUMPOLYGONS", "KW_ISOSURF", "KW_FILEMODE", "KW_INVERT",
+ "KW_MATERIAL", "KW_MATTYPE_PHONG", "KW_MATTYPE_BLINN", "KW_NAME",
+ "KW_AMBIENT", "KW_DIFFUSE", "KW_SPECULAR", "KW_MIRROR",
+ "KW_TRANSPARENCE", "KW_REFRACINDEX", "KW_TRANSADDITIVE",
+ "KW_TRANSATTCOL", "KW_FRESNEL", "KW_LIGHT", "KW_ACTIVE", "KW_COLOUR",
+ "KW_POSITION", "KW_LIGHT_OMNI", "KW_CAUSTICPHOTONS",
+ "KW_CAUSTICSTRENGTH", "KW_SHADOWMAP", "KW_CAUSTICSMAP", "$accept",
+ "desc_line", "desc_expression", "toggledebug_expression",
+ "raytrace_section", "raytrace_line", "raytrace_expression",
+ "anistart_expression", "aniframetime_expression", "aniframes_expression",
+ "frameskip_expression", "resolution_expression", "antialias_expression",
+ "eyepoint_expression", "lookat_expression", "upvec_expression",
+ "fovy_expression", "aspect_expression", "ambience_expression",
+ "background_expression", "filename_expression",
+ "treemaxdepth_expression", "treemaxtriangles_expression",
+ "maxraydepth_expression", "debugpixel_expression", "testmode_expression",
+ "openglattr_expr", "blenderattr_expr", "light_expression",
+ "lightsettings_line", "lighttype_expression", "lightsettings_expression",
+ "lightactive_expression", "lightcastshadows_expression",
+ "lightcolor_expression", "lightposition_expression",
+ "geometry_expression", "@1", "geometrysettings_line",
+ "geometrytype_expression", "geometrysettings_expression",
+ "geometryexpression_name", "geometryexpression_propname",
+ "geometryexpression_castshadows", "geometryexpression_recshadows",
+ "geometryexpression_visible", "geometryexpression_boxstart",
+ "geometryexpression_boxend", "geometryexpression_attrib",
+ "geometryexpression_defattrib", "material_expression",
+ "materialsettings_line", "materialtype_expression",
+ "materialsettings_expression", "materialexpression_name",
+ "materialexpression_ambient", "materialexpression_diffuse",
+ "materialexpression_specular", "materialexpression_mirror",
+ "materialexpression_transparence", "materialexpression_refracindex",
+ "materialexpression_transadd", "materialexpression_transattcol",
+ "materialexpression_fresnel", "attribute_section", "@2",
+ "attribute_line", "attribute_expression", "@3", "@4", "attrvalue_list",
+ "DT_COLOR", "DT_ZEROTOONE", "DT_REALVAL", "DT_INTLTZERO", "DT_POSINT",
+ "DT_BOOLEAN", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+ token YYLEX-NUM. */
+static const unsigned short int yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
+ 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
+ 355, 356, 357, 358, 359
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const unsigned char yyr1[] =
+{
+ 0, 105, 106, 106, 107, 107, 107, 108, 109, 110,
+ 110, 111, 111, 111, 111, 111, 111, 111, 111, 111,
+ 111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
+ 111, 111, 111, 111, 111, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
+ 126, 127, 128, 129, 130, 131, 132, 133, 134, 134,
+ 135, 136, 136, 136, 136, 137, 138, 139, 140, 142,
+ 141, 143, 143, 144, 144, 144, 144, 144, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 146, 147, 148,
+ 149, 150, 151, 152, 153, 154, 155, 156, 156, 157,
+ 157, 158, 158, 158, 158, 158, 158, 158, 158, 158,
+ 158, 159, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 170, 169, 171, 171, 173, 174, 172, 175, 175,
+ 176, 177, 178, 178, 179, 180, 181
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
+static const unsigned char yyr2[] =
+{
+ 0, 2, 2, 1, 1, 1, 1, 2, 4, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 2, 2, 2, 2,
+ 3, 2, 4, 4, 4, 2, 2, 4, 4, 2,
+ 2, 2, 2, 3, 2, 2, 2, 6, 2, 1,
+ 1, 1, 1, 1, 1, 2, 2, 4, 4, 0,
+ 7, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
+ 2, 2, 4, 4, 2, 4, 6, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 4, 4, 3, 2, 2, 2, 2, 4,
+ 2, 0, 6, 2, 1, 0, 0, 6, 2, 1,
+ 1, 1, 1, 1, 1, 1, 1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+ STATE-NUM when YYTABLE doesn't specify something else to do. Zero
+ means the default is an error. */
+static const unsigned char yydefact[] =
+{
+ 0, 0, 0, 0, 0, 3, 6, 4, 5, 7,
+ 0, 0, 1, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 10, 12, 13, 11, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 35, 34, 121, 125, 135, 37,
+ 49, 134, 52, 50, 51, 0, 41, 133, 132, 0,
+ 36, 38, 136, 39, 0, 0, 45, 46, 0, 0,
+ 0, 54, 55, 56, 0, 0, 0, 8, 9, 0,
+ 0, 40, 0, 0, 0, 0, 0, 53, 0, 0,
+ 0, 0, 124, 129, 126, 42, 43, 44, 47, 48,
+ 76, 77, 73, 75, 74, 69, 99, 100, 0, 60,
+ 0, 122, 123, 128, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 98, 101, 102,
+ 103, 104, 105, 107, 106, 108, 109, 110, 0, 0,
+ 0, 0, 0, 59, 61, 62, 63, 64, 127, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 72,
+ 78, 79, 80, 81, 82, 83, 84, 85, 86, 111,
+ 0, 130, 131, 0, 0, 115, 116, 117, 118, 0,
+ 120, 96, 97, 66, 65, 0, 0, 57, 58, 94,
+ 0, 89, 90, 91, 0, 0, 88, 87, 70, 71,
+ 0, 0, 114, 0, 0, 0, 0, 0, 0, 112,
+ 113, 119, 67, 68, 95, 93, 92
+};
+
+/* YYDEFGOTO[NTERM-NUM]. */
+static const short int yydefgoto[] =
+{
+ -1, 4, 5, 6, 7, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 162,
+ 130, 163, 164, 165, 166, 167, 63, 135, 178, 125,
+ 179, 180, 181, 182, 183, 184, 185, 186, 187, 188,
+ 64, 146, 128, 147, 148, 149, 150, 151, 152, 153,
+ 154, 155, 156, 157, 8, 99, 111, 65, 100, 134,
+ 114, 190, 191, 192, 72, 69, 83
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+#define YYPACT_NINF -111
+static const short int yypact[] =
+{
+ 31, 10, -18, 22, 12, -111, -111, -111, -111, -111,
+ 172, -2, -111, -111, -26, 41, 45, 43, 43, 43,
+ 43, 48, 21, 41, 43, 51, 21, 21, 21, 21,
+ 21, 21, 55, 51, 54, 60, 19, 34, 35, 50,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, 43, -111, -111, -111, 21,
+ -111, -111, -111, -111, 21, 21, -111, -111, 21, 21,
+ 67, -111, -111, -111, -11, 5, 23, -111, -111, 81,
+ 83, -111, 21, 21, 21, 21, 21, -111, 9, -50,
+ 11, 8, -111, -111, 105, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, 183, -111,
+ 52, -111, -111, -111, 57, 171, 113, 21, 21, 21,
+ 21, 21, 21, 21, 21, 41, 75, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, 51, 51,
+ 21, 21, -24, -111, -111, -111, -111, -111, -111, 114,
+ 90, 51, 51, 51, 21, 21, 120, 121, -34, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ 21, -111, -111, 21, 21, -111, -111, -111, -111, 21,
+ -111, -111, -111, -111, -111, 21, 21, -111, -111, -111,
+ 81, -111, -111, -111, 21, 21, -111, -111, -111, -111,
+ 21, 21, -111, 21, 21, 21, 13, 21, 21, -111,
+ -111, -111, -111, -111, -111, -111, -111
+};
+
+/* YYPGOTO[NTERM-NUM]. */
+static const yysigned_char yypgoto[] =
+{
+ -111, -111, 125, -111, -111, -111, 92, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -28, -111, -111, -111, -111, -111, -111, -111, -111,
+ -43, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -10, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -73, -96, -111, -111,
+ -111, -77, -110, -22, 2, -13, -31
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule which
+ number is the opposite. If zero, do what YYDEFACT says.
+ If YYTABLE_NINF, syntax error. */
+#define YYTABLE_NINF -1
+static const unsigned char yytable[] =
+{
+ 79, 218, 91, 112, 84, 85, 86, 87, 88, 89,
+ 80, 207, 12, 9, 14, 132, 10, 120, 121, 14,
+ 73, 74, 75, 1, 77, 78, 81, 169, 11, 170,
+ 195, 196, 66, 198, 126, 127, 67, 171, 172, 173,
+ 174, 175, 1, 131, 68, 2, 71, 158, 234, 176,
+ 70, 76, 177, 94, 82, 108, 14, 102, 90, 92,
+ 15, 193, 103, 104, 2, 93, 105, 106, 95, 96,
+ 107, 109, 3, 159, 160, 161, 122, 101, 123, 124,
+ 115, 116, 117, 118, 119, 97, 16, 14, 17, 110,
+ 113, 3, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 201, 129, 133, 220, 112, 36, 221, 194, 189, 209,
+ 197, 168, 199, 158, 210, 216, 217, 203, 204, 13,
+ 132, 98, 200, 37, 208, 219, 202, 226, 205, 206,
+ 211, 212, 213, 229, 230, 0, 38, 0, 0, 159,
+ 160, 161, 214, 215, 0, 0, 0, 0, 0, 0,
+ 0, 136, 137, 138, 139, 140, 141, 142, 143, 144,
+ 145, 0, 222, 0, 0, 0, 0, 223, 14, 0,
+ 0, 0, 15, 224, 225, 0, 0, 0, 0, 0,
+ 0, 0, 227, 228, 0, 0, 0, 0, 0, 0,
+ 0, 231, 232, 233, 0, 235, 236, 0, 16, 0,
+ 17, 0, 0, 0, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 169, 0, 170, 0, 0, 36, 0, 0,
+ 0, 0, 171, 172, 173, 174, 175, 0, 0, 0,
+ 0, 0, 0, 0, 176, 37, 0, 177, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 38, 136,
+ 137, 138, 139, 140, 141, 142, 143, 144, 145
+};
+
+static const short int yycheck[] =
+{
+ 22, 35, 33, 99, 26, 27, 28, 29, 30, 31,
+ 23, 35, 0, 3, 6, 111, 34, 8, 9, 6,
+ 18, 19, 20, 11, 3, 4, 24, 61, 6, 63,
+ 140, 141, 34, 143, 84, 85, 62, 71, 72, 73,
+ 74, 75, 11, 35, 3, 33, 3, 71, 35, 83,
+ 5, 3, 86, 34, 3, 66, 6, 79, 3, 5,
+ 10, 138, 84, 85, 33, 5, 88, 89, 34, 34,
+ 3, 66, 60, 97, 98, 99, 67, 75, 69, 70,
+ 102, 103, 104, 105, 106, 35, 36, 6, 38, 66,
+ 7, 60, 42, 43, 44, 45, 46, 47, 48, 49,
+ 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+ 35, 100, 7, 190, 210, 65, 193, 139, 5, 5,
+ 142, 64, 144, 71, 34, 5, 5, 158, 159, 4,
+ 226, 39, 145, 83, 162, 178, 146, 210, 160, 161,
+ 171, 172, 173, 220, 221, -1, 96, -1, -1, 97,
+ 98, 99, 174, 175, -1, -1, -1, -1, -1, -1,
+ -1, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, -1, 194, -1, -1, -1, -1, 199, 6, -1,
+ -1, -1, 10, 205, 206, -1, -1, -1, -1, -1,
+ -1, -1, 214, 215, -1, -1, -1, -1, -1, -1,
+ -1, 223, 224, 225, -1, 227, 228, -1, 36, -1,
+ 38, -1, -1, -1, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 61, -1, 63, -1, -1, 65, -1, -1,
+ -1, -1, 71, 72, 73, 74, 75, -1, -1, -1,
+ -1, -1, -1, -1, 83, 83, -1, 86, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 96, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const unsigned char yystos[] =
+{
+ 0, 11, 33, 60, 106, 107, 108, 109, 169, 3,
+ 34, 6, 0, 107, 6, 10, 36, 38, 42, 43,
+ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 65, 83, 96, 110,
+ 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
+ 131, 132, 133, 141, 155, 172, 34, 62, 3, 180,
+ 5, 3, 179, 179, 179, 179, 3, 3, 4, 178,
+ 180, 179, 3, 181, 178, 178, 178, 178, 178, 178,
+ 3, 181, 5, 5, 34, 34, 34, 35, 111, 170,
+ 173, 179, 178, 178, 178, 178, 178, 3, 66, 66,
+ 66, 171, 172, 7, 175, 178, 178, 178, 178, 178,
+ 8, 9, 67, 69, 70, 144, 84, 85, 157, 100,
+ 135, 35, 172, 7, 174, 142, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 156, 158, 159, 160,
+ 161, 162, 163, 164, 165, 166, 167, 168, 71, 97,
+ 98, 99, 134, 136, 137, 138, 139, 140, 64, 61,
+ 63, 71, 72, 73, 74, 75, 83, 86, 143, 145,
+ 146, 147, 148, 149, 150, 151, 152, 153, 154, 5,
+ 176, 177, 178, 176, 178, 177, 177, 178, 177, 178,
+ 180, 35, 158, 181, 181, 178, 178, 35, 136, 5,
+ 34, 181, 181, 181, 178, 178, 5, 5, 35, 145,
+ 176, 176, 178, 178, 178, 178, 171, 178, 178, 176,
+ 176, 178, 178, 178, 35, 178, 178
+};
+
+#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
+# define YYSIZE_T __SIZE_TYPE__
+#endif
+#if ! defined (YYSIZE_T) && defined (size_t)
+# define YYSIZE_T size_t
+#endif
+#if ! defined (YYSIZE_T)
+# if defined (__STDC__) || defined (__cplusplus)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# endif
+#endif
+#if ! defined (YYSIZE_T)
+# define YYSIZE_T unsigned int
+#endif
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror. This remains here temporarily
+ to ease the transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+
+#define YYFAIL goto yyerrlab
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ yytoken = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror ("syntax error: cannot back up");\
+ YYERROR; \
+ } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+/* YYLLOC_DEFAULT -- Compute the default location (before the actions
+ are run). */
+
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ ((Current).first_line = (Rhs)[1].first_line, \
+ (Current).first_column = (Rhs)[1].first_column, \
+ (Current).last_line = (Rhs)[N].last_line, \
+ (Current).last_column = (Rhs)[N].last_column)
+#endif
+
+/* YYLEX -- calling `yylex' with the right arguments. */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#endif
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+# define YYDSYMPRINT(Args) \
+do { \
+ if (yydebug) \
+ yysymprint Args; \
+} while (0)
+
+# define YYDSYMPRINTF(Title, Token, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yysymprint (stderr, \
+ Token, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_stack_print (short int *bottom, short int *top)
+#else
+static void
+yy_stack_print (bottom, top)
+ short int *bottom;
+ short int *top;
+#endif
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (/* Nothing. */; bottom <= top; ++bottom)
+ YYFPRINTF (stderr, " %d", *bottom);
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yy_reduce_print (int yyrule)
+#else
+static void
+yy_reduce_print (yyrule)
+ int yyrule;
+#endif
+{
+ int yyi;
+ unsigned int yylno = yyrline[yyrule];
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
+ yyrule - 1, yylno);
+ /* Print the symbols being reduced, and their result. */
+ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
+ YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
+ YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (Rule); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YYDSYMPRINT(Args)
+# define YYDSYMPRINTF(Title, Token, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
+# undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+\f
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined (__GLIBC__) && defined (_STRING_H)
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+# if defined (__STDC__) || defined (__cplusplus)
+yystrlen (const char *yystr)
+# else
+yystrlen (yystr)
+ const char *yystr;
+# endif
+{
+ register const char *yys = yystr;
+
+ while (*yys++ != '\0')
+ continue;
+
+ return yys - yystr - 1;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+# if defined (__STDC__) || defined (__cplusplus)
+yystpcpy (char *yydest, const char *yysrc)
+# else
+yystpcpy (yydest, yysrc)
+ char *yydest;
+ const char *yysrc;
+# endif
+{
+ register char *yyd = yydest;
+ register const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+#endif /* !YYERROR_VERBOSE */
+
+\f
+
+#if YYDEBUG
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yysymprint (yyoutput, yytype, yyvaluep)
+ FILE *yyoutput;
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ if (yytype < YYNTOKENS)
+ {
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+# ifdef YYPRINT
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ }
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+ YYFPRINTF (yyoutput, ")");
+}
+
+#endif /* ! YYDEBUG */
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+#if defined (__STDC__) || defined (__cplusplus)
+static void
+yydestruct (int yytype, YYSTYPE *yyvaluep)
+#else
+static void
+yydestruct (yytype, yyvaluep)
+ int yytype;
+ YYSTYPE *yyvaluep;
+#endif
+{
+ /* Pacify ``unused variable'' warnings. */
+ (void) yyvaluep;
+
+ switch (yytype)
+ {
+
+ default:
+ break;
+ }
+}
+\f
+
+/* Prevent warnings from -Wmissing-prototypes. */
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM);
+# else
+int yyparse ();
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The lookahead symbol. */
+int yychar;
+
+/* The semantic value of the lookahead symbol. */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far. */
+int yynerrs;
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+#ifdef YYPARSE_PARAM
+# if defined (__STDC__) || defined (__cplusplus)
+int yyparse (void *YYPARSE_PARAM)
+# else
+int yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+# endif
+#else /* ! YYPARSE_PARAM */
+#if defined (__STDC__) || defined (__cplusplus)
+int
+yyparse (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+
+ register int yystate;
+ register int yyn;
+ int yyresult;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+
+ /* Three stacks and their tools:
+ `yyss': related to states,
+ `yyvs': related to semantic values,
+ `yyls': related to locations.
+
+ Refer to the stacks thru separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ short int yyssa[YYINITDEPTH];
+ short int *yyss = yyssa;
+ register short int *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs = yyvsa;
+ register YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK (yyvsp--, yyssp--)
+
+ YYSIZE_T yystacksize = YYINITDEPTH;
+
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+
+ /* When reducing, the number of symbols on the RHS of the reduced
+ rule. */
+ int yylen;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss;
+ yyvsp = yyvs;
+
+
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks.
+ */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short int *yyss1 = yyss;
+
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow ("parser stack overflow",
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyoverflowlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyoverflowlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ short int *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyoverflowlab;
+ YYSTACK_RELOCATE (yyss);
+ YYSTACK_RELOCATE (yyvs);
+
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYPACT_NINF)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = YYLEX;
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yyn == 0 || yyn == YYTABLE_NINF)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+ YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ `$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 7:
+#line 154 "src/cfgparser.yy"
+ { yy_debug = yyvsp[0].intValue; }
+ break;
+
+ case 36:
+#line 200 "src/cfgparser.yy"
+ { reglob->setAniStart( yyvsp[0].intValue ); }
+ break;
+
+ case 37:
+#line 204 "src/cfgparser.yy"
+ { reglob->setAniFrameTime( yyvsp[0].intValue ); }
+ break;
+
+ case 38:
+#line 209 "src/cfgparser.yy"
+ { reglob->setAniFrames( (yyvsp[0].intValue)-1 ); }
+ break;
+
+ case 39:
+#line 213 "src/cfgparser.yy"
+ { reglob->setFrameSkip( (yyvsp[0].intValue) ); }
+ break;
+
+ case 40:
+#line 219 "src/cfgparser.yy"
+ { reglob->setResX( yyvsp[-1].intValue ); reglob->setResY( yyvsp[0].intValue); }
+ break;
+
+ case 41:
+#line 223 "src/cfgparser.yy"
+ { reglob->setAADepth( yyvsp[0].intValue ); }
+ break;
+
+ case 42:
+#line 227 "src/cfgparser.yy"
+ { reglob->setEye( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); }
+ break;
+
+ case 43:
+#line 231 "src/cfgparser.yy"
+ { reglob->setLookat( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); }
+ break;
+
+ case 44:
+#line 235 "src/cfgparser.yy"
+ { reglob->setUpVec( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); }
+ break;
+
+ case 45:
+#line 239 "src/cfgparser.yy"
+ { reglob->setFovy( yyvsp[0].floatValue ); }
+ break;
+
+ case 46:
+#line 243 "src/cfgparser.yy"
+ { reglob->setAspect( yyvsp[0].floatValue ); }
+ break;
+
+ case 47:
+#line 247 "src/cfgparser.yy"
+ { reglob->setAmbientLight( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); }
+ break;
+
+ case 48:
+#line 251 "src/cfgparser.yy"
+ { reglob->setBackgroundCol( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); }
+ break;
+
+ case 49:
+#line 255 "src/cfgparser.yy"
+ { reglob->setOutFilename( yyvsp[0].charValue ); }
+ break;
+
+ case 50:
+#line 259 "src/cfgparser.yy"
+ { reglob->setTreeMaxDepth( yyvsp[0].intValue ); }
+ break;
+
+ case 51:
+#line 263 "src/cfgparser.yy"
+ { reglob->setTreeMaxTriangles( yyvsp[0].intValue ); }
+ break;
+
+ case 52:
+#line 267 "src/cfgparser.yy"
+ { reglob->setRayMaxDepth( yyvsp[0].intValue ); }
+ break;
+
+ case 53:
+#line 271 "src/cfgparser.yy"
+ { reglob->setDebugPixel( yyvsp[-1].intValue, yyvsp[0].intValue ); }
+ break;
+
+ case 54:
+#line 275 "src/cfgparser.yy"
+ { reglob->setTestMode( yyvsp[0].intValue ); }
+ break;
+
+ case 55:
+#line 279 "src/cfgparser.yy"
+ { if(attrs[yyvsp[0].charValue] == NULL){ yyerror("OPENGL ATTRIBUTES: The attribute was not found!"); }
+ reglob->getOpenGlAttributes()->import( attrs[yyvsp[0].charValue] ); }
+ break;
+
+ case 56:
+#line 284 "src/cfgparser.yy"
+ { if(attrs[yyvsp[0].charValue] == NULL){ yyerror("BLENDER ATTRIBUTES: The attribute was not found!"); }
+ reglob->getBlenderAttributes()->import( attrs[yyvsp[0].charValue] ); }
+ break;
+
+ case 57:
+#line 296 "src/cfgparser.yy"
+ {
+ /* reset light pointers */
+ currentLightOmni = NULL;
+ }
+ break;
+
+ case 60:
+#line 308 "src/cfgparser.yy"
+ { currentLightOmni = new ntlLightObject( reglob );
+ currentLight = currentLightOmni;
+ reglob->getLightList()->push_back(currentLight);
+ }
+ break;
+
+ case 65:
+#line 322 "src/cfgparser.yy"
+ {
+ currentLight->setActive( yyvsp[0].intValue );
+ }
+ break;
+
+ case 66:
+#line 327 "src/cfgparser.yy"
+ {
+ currentLight->setCastShadows( yyvsp[0].intValue );
+ }
+ break;
+
+ case 67:
+#line 332 "src/cfgparser.yy"
+ {
+ currentLight->setColor( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) );
+ }
+ break;
+
+ case 68:
+#line 337 "src/cfgparser.yy"
+ {
+ int init = 0;
+ if(currentLightOmni != NULL) {
+ currentLightOmni->setPosition( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init = 1; }
+ if(!init) yyerror("This property can only be set for omni-directional and rectangular lights!");
+ }
+ break;
+
+ case 69:
+#line 355 "src/cfgparser.yy"
+ {
+ // geo classes have attributes...
+ reglob->getScene()->addGeoClass(currentGeoClass);
+ currentAttrib = currentGeoClass->getAttributeList();
+ }
+ break;
+
+ case 70:
+#line 361 "src/cfgparser.yy"
+ {
+ /* reset geometry object pointers */
+ currentGeoObj = NULL;
+ currentGeoClass = NULL;
+ currentGeometryBox = NULL;
+ currentGeometrySim = NULL;
+ currentGeometryModel = NULL;
+ currentGeometrySphere = NULL;
+ currentAttrib = NULL;
+ }
+ break;
+
+ case 73:
+#line 378 "src/cfgparser.yy"
+ {
+ currentGeometryBox = new ntlGeometryBox( );
+ currentGeoClass = currentGeometryBox;
+ currentGeoObj = (ntlGeometryObject*)( currentGeometryBox );
+ }
+ break;
+
+ case 74:
+#line 383 "src/cfgparser.yy"
+ {
+ currentGeometrySphere = new ntlGeometrySphere( );
+ currentGeoClass = currentGeometrySphere;
+ currentGeoObj = (ntlGeometryObject*)( currentGeometrySphere );
+ }
+ break;
+
+ case 75:
+#line 388 "src/cfgparser.yy"
+ {
+ currentGeometryModel = new ntlGeometryObjModel( );
+ currentGeoClass = currentGeometryModel;
+ currentGeoObj = (ntlGeometryObject*)( currentGeometryModel );
+ }
+ break;
+
+ case 76:
+#line 393 "src/cfgparser.yy"
+ {
+ currentGeometrySim = new SimulationObject();
+ currentGeoClass = currentGeometrySim;
+ reglob->getSims()->push_back(currentGeometrySim);
+ // dont add mcubes to geo list!
+ }
+ break;
+
+ case 77:
+#line 399 "src/cfgparser.yy"
+ {
+#ifdef LBM_INCLUDE_TESTSOLVERS
+ currentGeometrySim = new SimulationCompareLbm();
+ currentGeoClass = currentGeometrySim;
+ reglob->getSims()->push_back(currentGeometrySim);
+#else // LBM_INCLUDE_TESTSOLVERS
+ errMsg("El'Beem::cfg","compare test solver not supported!");
+#endif // LBM_INCLUDE_TESTSOLVERS
+ }
+ break;
+
+ case 87:
+#line 424 "src/cfgparser.yy"
+ {
+ currentGeoClass->setName( yyvsp[0].charValue );
+ }
+ break;
+
+ case 88:
+#line 429 "src/cfgparser.yy"
+ {
+ if(currentGeoObj == NULL){ yyerror(" MATERIAL : This property can only be set for geometry objects!"); }
+ currentGeoObj->setMaterialName( yyvsp[0].charValue );
+ }
+ break;
+
+ case 89:
+#line 435 "src/cfgparser.yy"
+ {
+ if(currentGeoObj == NULL){ yyerror(" CAST_SHADOW : This property can only be set for geometry objects!"); }
+ currentGeoObj->setCastShadows( yyvsp[0].intValue );
+ }
+ break;
+
+ case 90:
+#line 441 "src/cfgparser.yy"
+ {
+ if(currentGeoObj == NULL){ yyerror(" RECEIVE_SHADOW : This property can only be set for geometry objects!"); }
+ currentGeoObj->setReceiveShadows( yyvsp[0].intValue );
+ }
+ break;
+
+ case 91:
+#line 447 "src/cfgparser.yy"
+ {
+ currentGeoClass->setVisible( yyvsp[0].intValue );
+ }
+ break;
+
+ case 92:
+#line 452 "src/cfgparser.yy"
+ {
+ int init = 0;
+ if(currentGeometryBox != NULL){
+ currentGeometryBox->setStart( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(currentGeometrySim != NULL){
+ currentGeometrySim->setGeoStart( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(currentGeometryModel != NULL){
+ currentGeometryModel->setStart( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(!init ){ yyerror("BOXSTART : This property can only be set for box, objmodel, fluid and isosurface objects!"); }
+ }
+ break;
+
+ case 93:
+#line 464 "src/cfgparser.yy"
+ {
+ int init = 0;
+ if(currentGeometryBox != NULL){
+ currentGeometryBox->setEnd( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(currentGeometrySim != NULL){
+ currentGeometrySim->setGeoEnd( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(currentGeometryModel != NULL){
+ currentGeometryModel->setEnd( ntlVec3Gfx(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) ); init=1; }
+ if(!init ){ yyerror("BOXEND : This property can only be set for box, objmodel, fluid and isosurface objects!"); }
+ }
+ break;
+
+ case 94:
+#line 477 "src/cfgparser.yy"
+ {
+ if(attrs[yyvsp[0].charValue] == NULL){ yyerror("GEO ATTRIBUTES: The attribute was not found!"); }
+ currentGeoClass->getAttributeList()->import( attrs[yyvsp[0].charValue] );
+ }
+ break;
+
+ case 95:
+#line 485 "src/cfgparser.yy"
+ { }
+ break;
+
+ case 96:
+#line 497 "src/cfgparser.yy"
+ {
+ /* reset geometry object pointers */
+ currentMaterial = NULL;
+ }
+ break;
+
+ case 99:
+#line 509 "src/cfgparser.yy"
+ { currentMaterial = new ntlMaterial( );
+ currentMaterial = currentMaterial;
+ reglob->getMaterials()->push_back(currentMaterial);
+ }
+ break;
+
+ case 100:
+#line 513 "src/cfgparser.yy"
+ {
+ yyerror("MATTYPE: Blinn NYI!"); }
+ break;
+
+ case 111:
+#line 531 "src/cfgparser.yy"
+ {
+ currentMaterial->setName( yyvsp[0].charValue );
+ }
+ break;
+
+ case 112:
+#line 536 "src/cfgparser.yy"
+ {
+ currentMaterial->setAmbientRefl( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) );
+ }
+ break;
+
+ case 113:
+#line 541 "src/cfgparser.yy"
+ {
+ currentMaterial->setDiffuseRefl( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) );
+ }
+ break;
+
+ case 114:
+#line 546 "src/cfgparser.yy"
+ {
+ currentMaterial->setSpecular( yyvsp[-1].floatValue );
+ currentMaterial->setSpecExponent( yyvsp[0].floatValue );
+ }
+ break;
+
+ case 115:
+#line 552 "src/cfgparser.yy"
+ {
+ currentMaterial->setMirror( yyvsp[0].floatValue );
+ }
+ break;
+
+ case 116:
+#line 557 "src/cfgparser.yy"
+ {
+ currentMaterial->setTransparence( yyvsp[0].floatValue );
+ }
+ break;
+
+ case 117:
+#line 562 "src/cfgparser.yy"
+ {
+ currentMaterial->setRefracIndex( yyvsp[0].floatValue );
+ }
+ break;
+
+ case 118:
+#line 567 "src/cfgparser.yy"
+ {
+ currentMaterial->setTransAdditive( yyvsp[0].floatValue );
+ }
+ break;
+
+ case 119:
+#line 572 "src/cfgparser.yy"
+ {
+ currentMaterial->setTransAttCol( ntlColor(yyvsp[-2].floatValue,yyvsp[-1].floatValue,yyvsp[0].floatValue) );
+ }
+ break;
+
+ case 120:
+#line 577 "src/cfgparser.yy"
+ {
+ currentMaterial->setFresnel( yyvsp[0].intValue );
+ }
+ break;
+
+ case 121:
+#line 588 "src/cfgparser.yy"
+ {
+ currentAttrib = new AttributeList(yyvsp[-1].charValue);
+ currentAttrName = yyvsp[-1].charValue; }
+ break;
+
+ case 122:
+#line 591 "src/cfgparser.yy"
+ { // store attribute
+ //std::cerr << " NEW ATTR " << currentAttrName << std::endl;
+ //currentAttrib->print();
+ attrs[currentAttrName] = currentAttrib;
+ currentAttrib = NULL; }
+ break;
+
+ case 125:
+#line 601 "src/cfgparser.yy"
+ { currentAttrValue.clear(); currentAttribAddName = yyvsp[-1].charValue; }
+ break;
+
+ case 126:
+#line 602 "src/cfgparser.yy"
+ {
+ currentAttrib->addAttr( currentAttribAddName, currentAttrValue, lineCount);
+ //std::cerr << " ADD ATTR " << currentAttribAddName << std::endl;
+ //currentAttrib->find( currentAttribAddName )->print();
+ }
+ break;
+
+ case 128:
+#line 609 "src/cfgparser.yy"
+ {
+ //std::cerr << "LLL "<<$2<<endl;
+ currentAttrValue.push_back(yyvsp[0].charValue); }
+ break;
+
+ case 129:
+#line 612 "src/cfgparser.yy"
+ {
+ //std::cerr << "LRR "<<$1<<endl;
+ currentAttrValue.push_back(yyvsp[0].charValue); }
+ break;
+
+ case 131:
+#line 626 "src/cfgparser.yy"
+ {
+ if ( (yyvsp[0].floatValue < 0.0) || (yyvsp[0].floatValue > 1.0) ) {
+ yyerror("Value out of range (only 0 to 1 allowed)");
+ }
+
+ /* pass that value up the tree */
+ yyval.floatValue = yyvsp[0].floatValue;
+}
+ break;
+
+ case 132:
+#line 638 "src/cfgparser.yy"
+ { yyval.floatValue = yyvsp[0].floatValue; }
+ break;
+
+ case 133:
+#line 640 "src/cfgparser.yy"
+ { yyval.floatValue = (float) yyvsp[0].intValue; /* conversion from integers */ }
+ break;
+
+ case 134:
+#line 646 "src/cfgparser.yy"
+ {
+ if ( yyvsp[0].intValue <= 0 ) {
+ yy_error("Value out of range (has to be above zero)");
+ }
+
+ /* pass that value up the tree */
+ yyval.intValue = yyvsp[0].intValue;
+}
+ break;
+
+ case 135:
+#line 657 "src/cfgparser.yy"
+ {
+ //cout << " " << $1 << " ";
+ if ( yyvsp[0].intValue < 0 ) {
+ yy_error("Value out of range (has to be above or equal to zero)");
+ }
+
+ /* pass that value up the tree */
+ yyval.intValue = yyvsp[0].intValue;
+}
+ break;
+
+ case 136:
+#line 669 "src/cfgparser.yy"
+ {
+ if( ( yyvsp[0].intValue != 0 ) && ( yyvsp[0].intValue != 1 ) ) {
+ yy_error("Boolean value has to be 1|0, 'true'|'false' or 'on'|'off'!");
+ }
+ /* pass that value up the tree */
+ yyval.intValue = yyvsp[0].intValue;
+}
+ break;
+
+
+ }
+
+/* Line 1010 of yacc.c. */
+#line 2051 "bld-std-gcc/src/cfgparser.cpp"
+\f
+ yyvsp -= yylen;
+ yyssp -= yylen;
+
+
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+
+ /* Now `shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (YYPACT_NINF < yyn && yyn < YYLAST)
+ {
+ YYSIZE_T yysize = 0;
+ int yytype = YYTRANSLATE (yychar);
+ const char* yyprefix;
+ char *yymsg;
+ int yyx;
+
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 0;
+
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
+ yycount += 1;
+ if (yycount == 5)
+ {
+ yysize = 0;
+ break;
+ }
+ }
+ yysize += (sizeof ("syntax error, unexpected ")
+ + yystrlen (yytname[yytype]));
+ yymsg = (char *) YYSTACK_ALLOC (yysize);
+ if (yymsg != 0)
+ {
+ char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
+ yyp = yystpcpy (yyp, yytname[yytype]);
+
+ if (yycount < 5)
+ {
+ yyprefix = ", expecting ";
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ yyp = yystpcpy (yyp, yyprefix);
+ yyp = yystpcpy (yyp, yytname[yyx]);
+ yyprefix = " or ";
+ }
+ }
+ yyerror (yymsg);
+ YYSTACK_FREE (yymsg);
+ }
+ else
+ yyerror ("syntax error; also virtual memory exhausted");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror ("syntax error");
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* If at end of input, pop the error token,
+ then the rest of the stack, then return failure. */
+ if (yychar == YYEOF)
+ for (;;)
+ {
+ YYPOPSTACK;
+ if (yyssp == yyss)
+ YYABORT;
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[*yyssp], yyvsp);
+ }
+ }
+ else
+ {
+ YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
+ yydestruct (yytoken, &yylval);
+ yychar = YYEMPTY;
+
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+#ifdef __GNUC__
+ /* Pacify GCC when the user code never invokes YYERROR and the label
+ yyerrorlab therefore never appears in user code. */
+ if (0)
+ goto yyerrorlab;
+#endif
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (yyn != YYPACT_NINF)
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+ YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
+ yydestruct (yystos[yystate], yyvsp);
+ YYPOPSTACK;
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ YYDPRINTF ((stderr, "Shifting error token, "));
+
+ *++yyvsp = yylval;
+
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#ifndef yyoverflow
+/*----------------------------------------------.
+| yyoverflowlab -- parser overflow comes here. |
+`----------------------------------------------*/
+yyoverflowlab:
+ yyerror ("parser stack overflow");
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+ return yyresult;
+}
+
+
+#line 677 "src/cfgparser.yy"
+
+
+/*---------------------------------------------------------------------------*/
+/* parser functions */
+/*---------------------------------------------------------------------------*/
+
+
+/* parse warnings */
+void yy_warn(char *s)
+{
+ printf("Config Parse Warning at Line %d: %s \n", lineCount, s);
+}
+
+/* parse errors */
+void yy_error(const char *s)
+{
+ //errorOut("Current token: "<<yytname[ (int)yytranslate[yychar] ]);
+ errorOut("Config Parse Error at Line "<<lineCount<<": "<<s );
+ exit(1);
+}
+
+
+/* get the global pointers from calling program */
+char pointersInited = 0;
+void setPointers(ntlRenderGlobals *setglob)
+{
+ if(
+ (!setglob) ||
+ (!setglob)
+ ) {
+ errMsg("setPointers","Config Parse Error: Invalid Pointers!\n");
+ exit(1);
+ }
+
+ reglob = setglob;
+ pointersInited = 1;
+}
+
+
+/* parse given file as config file */
+void parseFile(string filename)
+{
+ if(!pointersInited) {
+ errMsg("parseFile","Config Parse Error: Pointers not set!\n");
+ exit(1);
+ }
+
+ /* open file */
+ yy_in = fopen( filename.c_str(), "r");
+ if(!yy_in) {
+ errMsg("parseFile","Config Parse Error: Unable to open '"<<filename.c_str() <<"'!\n" );
+ exit(1);
+ }
+
+ /* parse */
+ //yy_debug = 1; /* Enable debugging? */
+ yy_parse();
+
+ /* close file */
+ fclose( yy_in );
+ // cleanup static map<string,AttributeList*> attrs
+ for(map<string, AttributeList*>::iterator i=attrs.begin();
+ i != attrs.end(); i++) {
+ if((*i).second) {
+ delete (*i).second;
+ (*i).second = NULL;
+ }
+ }
+}
+
+
+
+
--- /dev/null
+/* A Bison parser, made by GNU Bison 1.875d. */
+
+/* Skeleton parser for Yacc-like parsing with Bison,
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* As a special exception, when this file is copied by Bison into a
+ Bison output file, you may use that output file without restriction.
+ This special exception was added by the Free Software Foundation
+ in version 1.24 of Bison. */
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum yytokentype {
+ DT_INTEGER = 258,
+ DT_FLOAT = 259,
+ DT_STRING = 260,
+ DT_ATTRNAME = 261,
+ DT_ATTRVALUE = 262,
+ KW_LBMSIM = 263,
+ KW_COMPARELBM = 264,
+ KW_ANIFRAMETIME = 265,
+ KW_DEBUGMODE = 266,
+ KW_P_RELAXTIME = 267,
+ KW_P_REYNOLDS = 268,
+ KW_P_VISCOSITY = 269,
+ KW_P_SOUNDSPEED = 270,
+ KW_P_DOMAINSIZE = 271,
+ KW_P_FORCE = 272,
+ KW_P_TIMELENGTH = 273,
+ KW_P_STEPTIME = 274,
+ KW_P_TIMEFACTOR = 275,
+ KW_P_ANIFRAMETIME = 276,
+ KW_P_ANISTART = 277,
+ KW_P_SURFACETENSION = 278,
+ KW_P_ACTIVATE = 279,
+ KW_P_DEACTIVATE = 280,
+ KW_P_DENSITY = 281,
+ KW_P_CELLSIZE = 282,
+ KW_P_GSTAR = 283,
+ KW_PFSPATH = 284,
+ KW_PARTLINELENGTH = 285,
+ KW_PARTICLES = 286,
+ KW_FRAMESPERSEC = 287,
+ KW_RAYTRACING = 288,
+ KW_PAROPEN = 289,
+ KW_PARCLOSE = 290,
+ KW_FILENAME = 291,
+ KW_PMCAUSTICS = 292,
+ KW_MAXRAYDEPTH = 293,
+ KW_CAUSTICDIST = 294,
+ KW_CAUSTICPHOT = 295,
+ KW_SHADOWMAPBIAS = 296,
+ KW_TREEMAXDEPTH = 297,
+ KW_TREEMAXTRIANGLES = 298,
+ KW_RESOLUTION = 299,
+ KW_ANTIALIAS = 300,
+ KW_EYEPOINT = 301,
+ KW_ANISTART = 302,
+ KW_ANIFRAMES = 303,
+ KW_FRAMESKIP = 304,
+ KW_LOOKAT = 305,
+ KW_UPVEC = 306,
+ KW_FOVY = 307,
+ KW_ASPECT = 308,
+ KW_AMBIENCE = 309,
+ KW_BACKGROUND = 310,
+ KW_DEBUGPIXEL = 311,
+ KW_TESTMODE = 312,
+ KW_OPENGLATTR = 313,
+ KW_BLENDERATTR = 314,
+ KW_ATTRIBUTE = 315,
+ KW_OBJATTR = 316,
+ KW_EQUALS = 317,
+ KW_DEFINEATTR = 318,
+ KW_ATTREND = 319,
+ KW_GEOMETRY = 320,
+ KW_TYPE = 321,
+ KW_GEOTYPE_BOX = 322,
+ KW_GEOTYPE_FLUID = 323,
+ KW_GEOTYPE_OBJMODEL = 324,
+ KW_GEOTYPE_SPHERE = 325,
+ KW_CASTSHADOWS = 326,
+ KW_RECEIVESHADOWS = 327,
+ KW_VISIBLE = 328,
+ KW_BOX_END = 329,
+ KW_BOX_START = 330,
+ KW_POLY = 331,
+ KW_NUMVERTICES = 332,
+ KW_VERTEX = 333,
+ KW_NUMPOLYGONS = 334,
+ KW_ISOSURF = 335,
+ KW_FILEMODE = 336,
+ KW_INVERT = 337,
+ KW_MATERIAL = 338,
+ KW_MATTYPE_PHONG = 339,
+ KW_MATTYPE_BLINN = 340,
+ KW_NAME = 341,
+ KW_AMBIENT = 342,
+ KW_DIFFUSE = 343,
+ KW_SPECULAR = 344,
+ KW_MIRROR = 345,
+ KW_TRANSPARENCE = 346,
+ KW_REFRACINDEX = 347,
+ KW_TRANSADDITIVE = 348,
+ KW_TRANSATTCOL = 349,
+ KW_FRESNEL = 350,
+ KW_LIGHT = 351,
+ KW_ACTIVE = 352,
+ KW_COLOUR = 353,
+ KW_POSITION = 354,
+ KW_LIGHT_OMNI = 355,
+ KW_CAUSTICPHOTONS = 356,
+ KW_CAUSTICSTRENGTH = 357,
+ KW_SHADOWMAP = 358,
+ KW_CAUSTICSMAP = 359
+ };
+#endif
+#define DT_INTEGER 258
+#define DT_FLOAT 259
+#define DT_STRING 260
+#define DT_ATTRNAME 261
+#define DT_ATTRVALUE 262
+#define KW_LBMSIM 263
+#define KW_COMPARELBM 264
+#define KW_ANIFRAMETIME 265
+#define KW_DEBUGMODE 266
+#define KW_P_RELAXTIME 267
+#define KW_P_REYNOLDS 268
+#define KW_P_VISCOSITY 269
+#define KW_P_SOUNDSPEED 270
+#define KW_P_DOMAINSIZE 271
+#define KW_P_FORCE 272
+#define KW_P_TIMELENGTH 273
+#define KW_P_STEPTIME 274
+#define KW_P_TIMEFACTOR 275
+#define KW_P_ANIFRAMETIME 276
+#define KW_P_ANISTART 277
+#define KW_P_SURFACETENSION 278
+#define KW_P_ACTIVATE 279
+#define KW_P_DEACTIVATE 280
+#define KW_P_DENSITY 281
+#define KW_P_CELLSIZE 282
+#define KW_P_GSTAR 283
+#define KW_PFSPATH 284
+#define KW_PARTLINELENGTH 285
+#define KW_PARTICLES 286
+#define KW_FRAMESPERSEC 287
+#define KW_RAYTRACING 288
+#define KW_PAROPEN 289
+#define KW_PARCLOSE 290
+#define KW_FILENAME 291
+#define KW_PMCAUSTICS 292
+#define KW_MAXRAYDEPTH 293
+#define KW_CAUSTICDIST 294
+#define KW_CAUSTICPHOT 295
+#define KW_SHADOWMAPBIAS 296
+#define KW_TREEMAXDEPTH 297
+#define KW_TREEMAXTRIANGLES 298
+#define KW_RESOLUTION 299
+#define KW_ANTIALIAS 300
+#define KW_EYEPOINT 301
+#define KW_ANISTART 302
+#define KW_ANIFRAMES 303
+#define KW_FRAMESKIP 304
+#define KW_LOOKAT 305
+#define KW_UPVEC 306
+#define KW_FOVY 307
+#define KW_ASPECT 308
+#define KW_AMBIENCE 309
+#define KW_BACKGROUND 310
+#define KW_DEBUGPIXEL 311
+#define KW_TESTMODE 312
+#define KW_OPENGLATTR 313
+#define KW_BLENDERATTR 314
+#define KW_ATTRIBUTE 315
+#define KW_OBJATTR 316
+#define KW_EQUALS 317
+#define KW_DEFINEATTR 318
+#define KW_ATTREND 319
+#define KW_GEOMETRY 320
+#define KW_TYPE 321
+#define KW_GEOTYPE_BOX 322
+#define KW_GEOTYPE_FLUID 323
+#define KW_GEOTYPE_OBJMODEL 324
+#define KW_GEOTYPE_SPHERE 325
+#define KW_CASTSHADOWS 326
+#define KW_RECEIVESHADOWS 327
+#define KW_VISIBLE 328
+#define KW_BOX_END 329
+#define KW_BOX_START 330
+#define KW_POLY 331
+#define KW_NUMVERTICES 332
+#define KW_VERTEX 333
+#define KW_NUMPOLYGONS 334
+#define KW_ISOSURF 335
+#define KW_FILEMODE 336
+#define KW_INVERT 337
+#define KW_MATERIAL 338
+#define KW_MATTYPE_PHONG 339
+#define KW_MATTYPE_BLINN 340
+#define KW_NAME 341
+#define KW_AMBIENT 342
+#define KW_DIFFUSE 343
+#define KW_SPECULAR 344
+#define KW_MIRROR 345
+#define KW_TRANSPARENCE 346
+#define KW_REFRACINDEX 347
+#define KW_TRANSADDITIVE 348
+#define KW_TRANSATTCOL 349
+#define KW_FRESNEL 350
+#define KW_LIGHT 351
+#define KW_ACTIVE 352
+#define KW_COLOUR 353
+#define KW_POSITION 354
+#define KW_LIGHT_OMNI 355
+#define KW_CAUSTICPHOTONS 356
+#define KW_CAUSTICSTRENGTH 357
+#define KW_SHADOWMAP 358
+#define KW_CAUSTICSMAP 359
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#line 85 "src/cfgparser.yy"
+typedef union YYSTYPE {
+ int intValue;
+ float floatValue;
+ char *charValue;
+} YYSTYPE;
+/* Line 1285 of yacc.c. */
+#line 251 "bld-std-gcc/src/cfgparser.hpp"
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yy_lval;
+
+
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * All code distributed as part of El'Beem is covered by the version 2 of the
+ * GNU General Public License. See the file COPYING for details.
+ * Copyright 2003-2005 Nils Thuerey
+ *
+ * Main program functions
+ *
+ */
+
+//#include "globals.h"
+
+
+/*****************************************************************************/
+// region of interest global vars
+// currently used by e.g. fsgr solver
+double guiRoiSX = 0.0;
+double guiRoiSY = 0.0;
+double guiRoiSZ = 0.0;
+double guiRoiEX = 1.0;
+double guiRoiEY = 1.0;
+double guiRoiEZ = 1.0;
+int guiRoiMaxLev=6, guiRoiMinLev=0;
+
+//! global raytracer pointer (=world)
+class ntlRaytracer;
+ntlRaytracer *gpWorld = (ntlRaytracer*)0;
+
+//! debug output switch
+bool myDebugOut = false;
+
+//! global leave program variable
+bool gQuit = false;
+
+//! start simulation?
+bool gThreadRunning = false;
+
+/* usage message */
+char* usageString =
+ "El'Beem - Lattice Boltzmann Free Surface Simulator\n\
+ Command-line Options: \n\
+ -b : .obj file dump mode for Blender\n\
+ -c : Force command line mode for rendering \n\
+ -d : Dump mode for ECR\n\
+ -f <filename> : Specify fluid description file to use as <filename>\n\
+ -h : Display this message \n\
+ -o : single frame output to given file\n\
+ \n ";
+
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2003,2004,2005 Nils Thuerey
+ *
+ * Standard LBM Factory implementation
+ *
+ *****************************************************************************/
+
+#include "factory_lbm.h"
+
+// compiler sanity check
+#ifndef LBMDIM
+#if LBMDIM!=2
+#if LBMDIM!=3
+print("Error - LBMDIM has to be defined (2/3)!");
+#endif
+#endif
+#endif
+
+// disable sometimes to speed up compiling/2d tests
+#define DISABLE 0
+
+#include "lbmdimensions.h"
+#include "lbmfsgrsolver.h"
+
+//! lbm factory functions
+LbmSolverInterface* createSolverLbmFsgr() {
+#if DISABLE!=1
+#if LBMDIM==2
+ return new LbmFsgrSolver< LbmBGK2D >();
+#endif // LBMDIM==2
+#if LBMDIM==3
+ return new LbmFsgrSolver< LbmBGK3D >();
+#endif // LBMDIM==3
+#endif // DISABLE
+ return NULL;
+}
+
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2003,2004 Nils Thuerey
+ *
+ * 2D/3D LBM Factory header
+ *
+ *****************************************************************************/
+
+#include "lbminterface.h"
+
+//! lbm factory functions
+LbmSolverInterface* createSolverLbmFsgr();
+#ifdef LBM_INCLUDE_TESTSOLVERS
+LbmSolverInterface* createSolverOld();
+#endif // LBM_INCLUDE_OLD
+
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * All code distributed as part of El'Beem is covered by the version 2 of the
+ * GNU General Public License. See the file COPYING for details.
+ * Copyright 2003-2005 Nils Thuerey
+ *
+ * Global variables (unavoidable at times...)
+ * all defines in main.cpp
+ *
+ *****************************************************************************/
+
+
+/*****************************************************************************/
+//! user interface variables
+
+// global raytracer pointer (=world)
+class ntlRaytracer;
+extern ntlRaytracer *gpWorld;
+
+// debug output switch
+extern bool myDebugOut;
+
+// global leave program variable
+extern bool gQuit;
+
+//! start simulation?
+extern bool gThreadRunning;
+
+//! short manual
+extern char* usageString;
+
--- /dev/null
+/******************************************************************************
+ *
+ * El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
+ * Copyright 2005 Nils Thuerey
+ *
+ * Marching Cubes surface mesh generation
+ *
+ *****************************************************************************/
+
+// IMPL ----------------------------------------------------------------------------------------
+#include "isosurface.h"
+#include "mcubes_tables.h"
+#include "ntl_scene.h"
+
+#include <algorithm>
+#include <stdio.h>
+#define MCUBES_MAXPOLNUM 10000
+#define MCUBES_MAXVERTNUM 30000
+
+
+
+/******************************************************************************
+ * Constructor
+ *****************************************************************************/
+IsoSurface::IsoSurface(double iso, double blend) :
+ ntlGeometryObject(),
+ mSizex(-1), mSizey(-1), mSizez(-1),
+ mIsoValue( iso ),
+ mBlendVal( blend ),
+ mPoints(),
+ mpEdgeVerticesX(NULL), mpEdgeVerticesY(NULL), mpEdgeVerticesZ(NULL),
+ mIndices(),
+
+ mStart(0.0), mEnd(0.0), mDomainExtent(0.0),
+ mInitDone(false),
+ mLoopSubdivs(0), mSmoothSurface(0.0), mSmoothNormals(0.0),
+ mAcrossEdge(), mAdjacentFaces()
+{
+}
+
+
+/******************************************************************************
+ * The real init...
+ *****************************************************************************/
+void IsoSurface::initializeIsosurface(int setx, int sety, int setz, ntlVec3Gfx extent)
+{
+ // init solver and size
+ mSizex = setx;
+ mSizey = sety;
+ if(setz == 1) {// 2D, create thin 2D surface
+ setz = 5;
+ }
+ mSizez = setz;
+ mDomainExtent = extent;
+
+ /* check triangulation size (for raytraing) */
+ if( ( mStart[0] >= mEnd[0] ) && ( mStart[1] >= mEnd[1] ) && ( mStart[2] >= mEnd[2] ) ){
+ // extent was not set, use normalized one from parametrizer
+ mStart = ntlVec3Gfx(0.0) - extent*0.5;
+ mEnd = ntlVec3Gfx(0.0) + extent*0.5;
+ }
+
+ // init
+ mIndices.clear();
+ mPoints.clear();
+
+ int nodes = mSizez*mSizey*mSizex;
+ mpData = new float[nodes];
+ for(int i=0;i<nodes;i++) { mpData[i] = 0.0; }
+
+ // allocate edge arrays (last slices are never used...)
+ mpEdgeVerticesX = new int[nodes];
+ mpEdgeVerticesY = new int[nodes];
+ mpEdgeVerticesZ = new int[nodes];
+ for(int i=0;i<nodes;i++) { mpEdgeVerticesX[i] = mpEdgeVerticesY[i] = mpEdgeVerticesZ[i] = -1; }
+
+ // marching cubes are ready
+ mInitDone = true;
+ unsigned long int memCnt = (3*sizeof(int)*nodes + sizeof(float)*nodes);
+ double memd = memCnt;
+ char *sizeStr = "";
+ const double sfac = 1000.0;
+ if(memd>sfac){ memd /= sfac; sizeStr="KB"; }
+ if(memd>sfac){ memd /= sfac; sizeStr="MB"; }
+ if(memd>sfac){ memd /= sfac; sizeStr="GB"; }
+ if(memd>sfac){ memd /= sfac; sizeStr="TB"; }
+
+ debMsgStd("IsoSurface::initializeIsosurface",DM_MSG,"Inited "<<PRINT_VEC(setx,sety,setz)<<" alloced:"<< memd<<" "<<sizeStr<<"." ,10);
+}
+
+
+
+
+/******************************************************************************
+ * Destructor
+ *****************************************************************************/
+IsoSurface::~IsoSurface( void )
+{
+
+ if(mpEdgeVerticesX) delete [] mpEdgeVerticesX;
+ if(mpEdgeVerticesY) delete [] mpEdgeVerticesY;
+ if(mpEdgeVerticesZ) delete [] mpEdgeVerticesZ;
+
+}
+
+
+
+
+/******************************************************************************
+ * triangulate the scalar field given by pointer
+ *****************************************************************************/
+void IsoSurface::triangulate( void )
+{
+ double gsx,gsy,gsz; // grid spacing in x,y,z direction
+ double px,py,pz; // current position in grid in x,y,z direction
+ IsoLevelCube cubie; // struct for a small subcube
+ myTime_t tritimestart = getTime();
+
+ if(!mpData) {
+ errorOut("IsoSurface::triangulate fatal error: no LBM object, and no scalar field...!");
+ exit( -1 );
+ }
+
+ // get grid spacing
+ gsx = (mEnd[0]-mStart[0])/(double)(mSizex-1.0);
+ gsy = (mEnd[1]-mStart[1])/(double)(mSizey-1.0);
+ gsz = (mEnd[2]-mStart[2])/(double)(mSizez-1.0);
+
+ // clean up previous frame
+ mIndices.clear();
+ mPoints.clear();
+
+ // reset edge vertices
+ for(int i=0;i<(mSizex*mSizey*mSizez);i++) {
+ mpEdgeVerticesX[i] = -1;
+ mpEdgeVerticesY[i] = -1;
+ mpEdgeVerticesZ[i] = -1;
+ }
+
+ ntlVec3Gfx pos[8];
+ float value[8];
+ int cubeIndex; // index entry of the cube
+ int triIndices[12]; // vertex indices
+ int *eVert[12];
+ IsoLevelVertex ilv;
+
+ // edges between which points?
+ const int mcEdges[24] = {
+ 0,1, 1,2, 2,3, 3,0,
+ 4,5, 5,6, 6,7, 7,4,
+ 0,4, 1,5, 2,6, 3,7 };
+
+ const int cubieOffsetX[8] = {
+ 0,1,1,0, 0,1,1,0 };
+ const int cubieOffsetY[8] = {
+ 0,0,1,1, 0,0,1,1 };
+ const int cubieOffsetZ[8] = {
+ 0,0,0,0, 1,1,1,1 };
+
+ // let the cubes march
+ pz = mStart[2]-gsz;
+ for(int k=0;k<(mSizez-2);k++) {
+ pz += gsz;
+ py = mStart[1]-gsy;
+ for(int j=0;j<(mSizey-2);j++) {
+ py += gsy;
+ px = mStart[0]-gsx;
+ for(int i=0;i<(mSizex-2);i++) {
+ px += gsx;
+ int baseIn = ISOLEVEL_INDEX( i+0, j+0, k+0);
+
+ value[0] = *getData(i ,j ,k );
+ value[1] = *getData(i+1,j ,k );
+ value[2] = *getData(i+1,j+1,k );
+ value[3] = *getData(i ,j+1,k );
+ value[4] = *getData(i ,j ,k+1);
+ value[5] = *getData(i+1,j ,k+1);
+ value[6] = *getData(i+1,j+1,k+1);
+ value[7] = *getData(i ,j+1,k+1);
+ //errMsg("ISOT2D"," at "<<PRINT_IJK<<" "
+ //<<" v0="<<value[0] <<" v1="<<value[1] <<" v2="<<value[2] <<" v3="<<value[3]
+ //<<" v4="<<value[4] <<" v5="<<value[5] <<" v6="<<value[6] <<" v7="<<value[7] );
+
+ // check intersections of isosurface with edges, and calculate cubie index
+ cubeIndex = 0;
+ if (value[0] < mIsoValue) cubeIndex |= 1;
+ if (value[1] < mIsoValue) cubeIndex |= 2;
+ if (value[2] < mIsoValue) cubeIndex |= 4;
+ if (value[3] < mIsoValue) cubeIndex |= 8;
+ if (value[4] < mIsoValue) cubeIndex |= 16;
+ if (value[5] < mIsoValue) cubeIndex |= 32;
+ if (value[6] < mIsoValue) cubeIndex |= 64;
+ if (value[7] < mIsoValue) cubeIndex |= 128;
+
+ // No triangles to generate?
+ if (mcEdgeTable[cubeIndex] == 0) {
+ continue;
+ }
+
+ // where to look up if this point already exists
+ eVert[ 0] = &mpEdgeVerticesX[ baseIn ];
+ eVert[ 1] = &mpEdgeVerticesY[ baseIn + 1 ];
+ eVert[ 2] = &mpEdgeVerticesX[ ISOLEVEL_INDEX( i+0, j+1, k+0) ];
+ eVert[ 3] = &mpEdgeVerticesY[ baseIn ];
+
+ eVert[ 4] = &mpEdgeVerticesX[ ISOLEVEL_INDEX( i+0, j+0, k+1) ];
+ eVert[ 5] = &mpEdgeVerticesY[ ISOLEVEL_INDEX( i+1, j+0, k+1) ];
+ eVert[ 6] = &mpEdgeVerticesX[ ISOLEVEL_INDEX( i+0, j+1, k+1) ];
+ eVert[ 7] = &mpEdgeVerticesY[ ISOLEVEL_INDEX( i+0, j+0, k+1) ];
+
+ eVert[ 8] = &mpEdgeVerticesZ[ baseIn ];
+ eVert[ 9] = &mpEdgeVerticesZ[ ISOLEVEL_INDEX( i+1, j+0, k+0) ];
+ eVert[10] = &mpEdgeVerticesZ[ ISOLEVEL_INDEX( i+1, j+1, k+0) ];
+ eVert[11] = &mpEdgeVerticesZ[ ISOLEVEL_INDEX( i+0, j+1, k+0) ];
+
+ // grid positions
+ pos[0] = ntlVec3Gfx(px ,py ,pz);
+ pos[1] = ntlVec3Gfx(px+gsx,py ,pz);
+ pos[2] = ntlVec3Gfx(px+gsx,py+gsy,pz);
+ pos[3] = ntlVec3Gfx(px ,py+gsy,pz);
+ pos[4] = ntlVec3Gfx(px ,py ,pz+gsz);
+ pos[5] = ntlVec3Gfx(px+gsx,py ,pz+gsz);
+ pos[6] = ntlVec3Gfx(px+gsx,py+gsy,pz+gsz);
+ pos[7] = ntlVec3Gfx(px ,py+gsy,pz+gsz);
+
+ // check all edges
+ for(int e=0;e<12;e++) {
+
+ if (mcEdgeTable[cubeIndex] & (1<<e)) {
+ // is the vertex already calculated?
+ if(*eVert[ e ] < 0) {
+ // interpolate edge
+ const int e1 = mcEdges[e*2 ];
+ const int e2 = mcEdges[e*2+1];
+ const ntlVec3Gfx p1 = pos[ e1 ]; // scalar field pos 1
+ const ntlVec3Gfx p2 = pos[ e2 ]; // scalar field pos 2
+ const float valp1 = value[ e1 ]; // scalar field val 1
+ const float valp2 = value[ e2 ]; // scalar field val 2
+ //double mu; // interpolation value
+ //ntlVec3Gfx p; // new point
+
+ // choose if point should be calculated by interpolation,
+ // or "Karolin" method
+
+ //double deltaVal = ABS(valp2-valp1);
+ //if(deltaVal >-10.0) {
+ // standard interpolation
+ //vertInfo[e].type = 0;
+ /*if (ABS(mIsoValue-valp1) < 0.000000001) {
+ mu = 0.0;
+ } else {
+ if (ABS(mIsoValue-valp2) < 0.000000001) {
+ mu = 1.0;
+ } else {
+ mu = (mIsoValue - valp1) / (valp2 - valp1);
+ }
+ } */
+ /*} else {
+ errorOut(" ? ");
+ // use fill grade (=karo)
+ vertInfo[e].type = 1;
+ if(valp1 < valp2) { mu = 1.0- (valp1 + valp2 - mIsoValue);
+ } else { mu = 0.0+ (valp1 + valp2 - mIsoValue); }
+ } */
+
+ //const float mu = (mIsoValue - valp1) / (valp2 - valp1);
+ float mu;
+ if(valp1 < valp2) {
+ mu = 1.0 - 1.0*(valp1 + valp2 - mIsoValue);
+ } else {
+ mu = 0.0 + 1.0*(valp1 + valp2 - mIsoValue);
+ }
+
+ float isov2 = mIsoValue;
+ isov2 = (valp1+valp2)*0.5;
+ mu = (isov2 - valp1) / (valp2 - valp1);
+ mu = (isov2) / (valp2 - valp1);
+
+ mu = (mIsoValue - valp1) / (valp2 - valp1);
+ //mu *= mu;
+
+
+
+ // init isolevel vertex
+ ilv.v = p1 + (p2-p1)*mu;
+ ilv.n = getNormal( i+cubieOffsetX[e1], j+cubieOffsetY[e1], k+cubieOffsetZ[e1]) * (1.0-mu) +
+ getNormal( i+cubieOffsetX[e2], j+cubieOffsetY[e2], k+cubieOffsetZ[e2]) * ( mu) ;
+ mPoints.push_back( ilv );
+
+ triIndices[e] = (mPoints.size()-1);
+ // store vertex
+ *eVert[ e ] = triIndices[e];
+ } else {
+ // retrieve from vert array
+ triIndices[e] = *eVert[ e ];
+ }
+ } // along all edges
+
+ }
+
+
+ // Create the triangles...
+ for(int e=0; mcTriTable[cubeIndex][e]!=-1; e+=3) {
+ //errMsg("MC","tri "<<mIndices.size() <<" "<< triIndices[ mcTriTable[cubeIndex][e+0] ]<<" "<< triIndices[ mcTriTable[cubeIndex][e+1] ]<<" "<< triIndices[ mcTriTable[cubeIndex][e+2] ] );
+ mIndices.push_back( triIndices[ mcTriTable[cubeIndex][e+0] ] );
+ mIndices.push_back( triIndices[ mcTriTable[cubeIndex][e+1] ] );
+ mIndices.push_back( triIndices[ mcTriTable[cubeIndex][e+2] ] );
+ }
+
+
+ }
+ }
+
+ } // k
+
+
+ // precalculate normals using an approximation of the scalar field gradient
+ for(int ni=0;ni<(int)mPoints.size();ni++) {
+ // use triangle normals?, this seems better for File-IsoSurf
+ normalize( mPoints[ni].n );
+ }
+
+ if(mSmoothSurface>0.0) {
+ // not needed for post normal smoothing?
+ // if(mSmoothNormals<=0.0) { smoothNormals(mSmoothSurface*0.5); }
+ smoothSurface(mSmoothSurface);
+ }
+ for(int i=0; i<mLoopSubdivs; i++) {
+ subdivide();
+ }
+ if(mSmoothNormals>0.0) {
+ smoothNormals(mSmoothNormals);
+ }
+ myTime_t tritimeend = getTime();
+#if ELBEEM_BLENDER!=1
+ debMsgStd("IsoSurface::triangulate",DM_MSG,"Took "<< ((tritimeend-tritimestart)/(double)1000.0)<<"s) " , 10 );
+#endif // ELBEEM_BLENDER!=1
+}
+
+
+
+
+
+/******************************************************************************
+ * Get triangles for rendering
+ *****************************************************************************/
+void IsoSurface::getTriangles( vector<ntlTriangle> *triangles,
+ vector<ntlVec3Gfx> *vertices,
+ vector<ntlVec3Gfx> *normals, int objectId )
+{
+ if(!mInitDone) {
+ debugOut("IsoSurface::getTriangles warning: Not initialized! ", 10);
+ return;
+ }
+
+ /* triangulate field */
+ triangulate();
+ //errMsg("TRIS"," "<<mIndices.size() );
+
+ // new output with vertice reuse
+ int iniVertIndex = (*vertices).size();
+ int iniNormIndex = (*normals).size();
+ if(iniVertIndex != iniNormIndex) {
+ errorOut("getTriangles Error for '"<<mName<<"': Vertices and normal array sizes to not match!!!");
+ exit(1); }
+ //errMsg("NM"," ivi"<<iniVertIndex<<" ini"<<iniNormIndex<<" vs"<<vertices->size()<<" ns"<<normals->size()<<" ts"<<triangles->size() );
+ //errMsg("NM"," ovs"<<mVertices.size()<<" ons"<<mVertNormals.size()<<" ots"<<mIndices.size() );
+
+ for(int i=0;i<(int)mPoints.size();i++) {
+ vertices->push_back( mPoints[i].v );
+ }
+ for(int i=0;i<(int)mPoints.size();i++) {
+ normals->push_back( mPoints[i].n );
+ }
+
+ //errMsg("N2"," ivi"<<iniVertIndex<<" ini"<<iniNormIndex<<" vs"<<vertices->size()<<" ns"<<normals->size()<<" ts"<<triangles->size() );
+ //errMsg("N2"," ovs"<<mVertices.size()<<" ons"<<mVertNormals.size()<<" ots"<<mIndices.size() );
+
+ for(int i=0;i<(int)mIndices.size();i+=3) {
+ const int smooth = 1;
+ int t1 = mIndices[i];
+ int t2 = mIndices[i+1];
+ int t3 = mIndices[i+2];
+ //errMsg("NM"," tri"<<t1<<" "<<t2<<" "<<t3 );
+
+ ntlTriangle tri;
+
+ tri.getPoints()[0] = t1+iniVertIndex;
+ tri.getPoints()[1] = t2+iniVertIndex;
+ tri.getPoints()[2] = t3+iniVertIndex;
+
+ /* init flags */
+ int flag = 0;
+ if(getVisible()){ flag |= TRI_GEOMETRY; }
+ if(getCastShadows() ) {
+ flag |= TRI_CASTSHADOWS; }
+ if( (getMaterial()->getMirror()>0.0) ||
+ (getMaterial()->getTransparence()>0.0) ||
+ (getMaterial()->getFresnel()>0.0) ) {
+ flag |= TRI_MAKECAUSTICS; }
+ else {
+ flag |= TRI_NOCAUSTICS; }
+
+ /* init geo init id */
+ int geoiId = getGeoInitId();
+ if(geoiId > 0) {
+ flag |= (1<< (geoiId+4));
+ flag |= mGeoInitType;
+ }
+
+ tri.setFlags( flag );
+
+ /* triangle normal missing */
+ tri.setNormal( ntlVec3Gfx(0.0) );
+ tri.setSmoothNormals( smooth );
+ tri.setObjectId( objectId );
+ triangles->push_back( tri );
+ }
+ //errMsg("N3"," ivi"<<iniVertIndex<<" ini"<<iniNormIndex<<" vs"<<vertices->size()<<" ns"<<normals->size()<<" ts"<<triangles->size() );
+ return;
+}
+
+
+
+inline ntlVec3Gfx IsoSurface::getNormal(int i, int j,int k) {
+ // WARNING - this assumes a security boundary layer...
+ /*
+ if(i<=0) i=1;
+ if(j<=0) j=1;
+ if(k<=0) k=1;
+ if(i>=(mSizex-1)) i=mSizex-2;
+ if(j>=(mSizex-1)) j=mSizex-2;
+ if(k>=(mSizex-1)) k=mSizex-2; // */
+
+ ntlVec3Gfx ret(0.0);
+ ret[0] = *getData(i-1,j ,k ) -
+ *getData(i+1,j ,k );
+ ret[1] = *getData(i ,j-1,k ) -
+ *getData(i ,j+1,k );
+ ret[2] = *getData(i ,j ,k-1 ) -
+ *getData(i ,j ,k+1 );
+ return ret;
+}
+
+#define RECALCNORMALS 0
+
+// Subdivide a mesh allways loop
+void IsoSurface::subdivide()
+{
+ int i;
+
+ mAdjacentFaces.clear();
+ mAcrossEdge.clear();
+
+ //void TriMesh::need_adjacentfaces()
+ {
+ vector<int> numadjacentfaces(mPoints.size());
+ //errMsg("SUBDIV ADJFA1", " "<<mPoints.size()<<" - "<<numadjacentfaces.size() );
+ int i;
+ for (i = 0; i < (int)mIndices.size()/3; i++) {
+ numadjacentfaces[mIndices[i*3 + 0]]++;
+ numadjacentfaces[mIndices[i*3 + 1]]++;
+ numadjacentfaces[mIndices[i*3 + 2]]++;
+ }
+
+ mAdjacentFaces.resize(mPoints.size());
+ for (i = 0; i < (int)mPoints.size(); i++)
+ mAdjacentFaces[i].reserve(numadjacentfaces[i]);
+
+ for (i = 0; i < (int)mIndices.size()/3; i++) {
+ for (int j = 0; j < 3; j++)
+ mAdjacentFaces[mIndices[i*3 + j]].push_back(i);
+ }
+
+ }
+
+ // Find the face across each edge from each other face (-1 on boundary)
+ // If topology is bad, not necessarily what one would expect...
+ //void TriMesh::need_across_edge()
+ {
+ mAcrossEdge.resize(mIndices.size(), -1);
+
+ for (int i = 0; i < (int)mIndices.size()/3; i++) {
+ for (int j = 0; j < 3; j++) {
+ if (mAcrossEdge[i*3 + j] != -1)
+ continue;
+ int v1 = mIndices[i*3 + ((j+1)%3)];
+ int v2 = mIndices[i*3 + ((j+2)%3)];
+ const vector<int> &a1 = mAdjacentFaces[v1];
+ const vector<int> &a2 = mAdjacentFaces[v2];
+ for (int k1 = 0; k1 < (int)a1.size(); k1++) {
+ int other = a1[k1];
+ if (other == i)
+ continue;
+ vector<int>::const_iterator it =
+ std::find(a2.begin(), a2.end(), other);
+ if (it == a2.end())
+ continue;
+
+ //int ind = (faces[other].indexof(v1)+1)%3;
+ int ind = -1;
+ if( mIndices[other*3+0] == (unsigned int)v1 ) ind = 0;
+ else if( mIndices[other*3+1] == (unsigned int)v1 ) ind = 1;
+ else if( mIndices[other*3+2] == (unsigned int)v1 ) ind = 2;
+ ind = (ind+1)%3;
+
+ if ( (int)mIndices[other*3 + ((ind+1)%3)] != v2)
+ continue;
+ mAcrossEdge[i*3 + j] = other;
+ mAcrossEdge[other*3 + ind] = i;
+ break;
+ }
+ }
+ }
+
+ //errMsg("SUBDIV ACREDG", "Done.\n");
+ }
+
+ //errMsg("SUBDIV","start");
+ // Introduce new vertices
+ int nf = (int)mIndices.size() / 3;
+
+ //vector<TriMesh::Face> newverts(nf, TriMesh::Face(-1,-1,-1));
+ vector<int> newverts(nf*3); //, TriMesh::Face(-1,-1,-1));
+ for(int j=0; j<(int)newverts.size(); j++) newverts[j] = -1;
+
+ int old_nv = (int)mPoints.size();
+ mPoints.reserve(4 * old_nv);
+ vector<int> newvert_count(old_nv + 3*nf); // wichtig...?
+ //errMsg("NC", newvert_count.size() );
+
+ for (i = 0; i < nf; i++) {
+ for (int j = 0; j < 3; j++) {
+ int ae = mAcrossEdge[i*3 + j];
+ if (newverts[i*3 + j] == -1 && ae != -1) {
+ if (mAcrossEdge[ae*3 + 0] == i)
+ newverts[i*3 + j] = newverts[ae*3 + 0];
+ else if (mAcrossEdge[ae*3 + 1] == i)
+ newverts[i*3 + j] = newverts[ae*3 + 1];
+ else if (mAcrossEdge[ae*3 + 2] == i)
+ newverts[i*3 + j] = newverts[ae*3 + 2];
+ }
+ if (newverts[i*3 + j] == -1) {
+ IsoLevelVertex ilv;
+ ilv.v = ntlVec3Gfx(0.0);
+ ilv.n = ntlVec3Gfx(0.0);
+ mPoints.push_back(ilv);
+ newverts[i*3 + j] = (int)mPoints.size() - 1;
+ if (ae != -1) {
+ if (mAcrossEdge[ae*3 + 0] == i)
+ newverts[ae*3 + 0] = newverts[i*3 + j];
+ else if (mAcrossEdge[ae*3 + 1] == i)
+ newverts[ae*3 + 1] = newverts[i*3 + j];
+ else if (mAcrossEdge[ae*3 + 2] == i)
+ newverts[ae*3 + 2] = newverts[i*3 + j];
+ }
+ }
+ if(ae != -1) {
+ mPoints[newverts[i*3 + j]].v +=
+ mPoints[ mIndices[i*3 + ( j )] ].v * 0.25f + // j = 0,1,2?
+ mPoints[ mIndices[i*3 + ((j+1)%3)] ].v * 0.375f +
+ mPoints[ mIndices[i*3 + ((j+2)%3)] ].v * 0.375f;
+#if RECALCNORMALS==0
+ mPoints[newverts[i*3 + j]].n +=
+ mPoints[ mIndices[i*3 + ( j )] ].n * 0.25f + // j = 0,1,2?
+ mPoints[ mIndices[i*3 + ((j+1)%3)] ].n * 0.375f +
+ mPoints[ mIndices[i*3 + ((j+2)%3)] ].n * 0.375f;
+#endif // RECALCNORMALS==0
+ } else {
+ mPoints[newverts[i*3 + j]].v +=
+ mPoints[ mIndices[i*3 + ((j+1)%3)] ].v * 0.5f +
+ mPoints[ mIndices[i*3 + ((j+2)%3)] ].v * 0.5f ;
+#if RECALCNORMALS==0
+ mPoints[newverts[i*3 + j]].n +=
+ mPoints[ mIndices[i*3 + ((j+1)%3)] ].n * 0.5f +
+ mPoints[ mIndices[i*3 + ((j+2)%3)] ].n * 0.5f ;
+#endif // RECALCNORMALS==0
+ }
+
+ newvert_count[newverts[i*3 + j]]++;
+ }
+ }
+ for (i = old_nv; i < (int)mPoints.size(); i++) {
+ if (!newvert_count[i])
+ continue;
+ float scale = 1.0f / newvert_count[i];
+ mPoints[i].v *= scale;
+
+#if RECALCNORMALS==0
+ //mPoints[i].n *= scale;
+ //normalize( mPoints[i].n );
+#endif // RECALCNORMALS==0
+ }
+
+ // Update old vertices
+ for (i = 0; i < old_nv; i++) {
+ ntlVec3Gfx bdyavg(0.0), nbdyavg(0.0);
+ ntlVec3Gfx norm_bdyavg(0.0), norm_nbdyavg(0.0); // N
+ int nbdy = 0, nnbdy = 0;
+ int naf = (int)mAdjacentFaces[i].size();
+ if (!naf)
+ continue;
+ for (int j = 0; j < naf; j++) {
+ int af = mAdjacentFaces[i][j];
+
+ int afi = -1;
+ if( mIndices[af*3+0] == (unsigned int)i ) afi = 0;
+ else if( mIndices[af*3+1] == (unsigned int)i ) afi = 1;
+ else if( mIndices[af*3+2] == (unsigned int)i ) afi = 2;
+
+ int n1 = (afi+1) % 3;
+ int n2 = (afi+2) % 3;
+ if (mAcrossEdge[af*3 + n1] == -1) {
+ bdyavg += mPoints[newverts[af*3 + n1]].v;
+#if RECALCNORMALS==0
+ //norm_bdyavg += mPoints[newverts[af*3 + n1]].n;
+#endif // RECALCNORMALS==0
+ nbdy++;
+ } else {
+ nbdyavg += mPoints[newverts[af*3 + n1]].v;
+#if RECALCNORMALS==0
+ //norm_nbdyavg += mPoints[newverts[af*3 + n1]].n;
+#endif // RECALCNORMALS==0
+ nnbdy++;
+ }
+ if (mAcrossEdge[af*3 + n2] == -1) {
+ bdyavg += mPoints[newverts[af*3 + n2]].v;
+#if RECALCNORMALS==0
+ //norm_bdyavg += mPoints[newverts[af*3 + n2]].n;
+#endif // RECALCNORMALS==0
+ nbdy++;
+ } else {
+ nbdyavg += mPoints[newverts[af*3 + n2]].v;
+#if RECALCNORMALS==0
+ //norm_nbdyavg += mPoints[newverts[af*3 + n2]].n;
+#endif // RECALCNORMALS==0
+ nnbdy++;
+ }
+ }
+
+ float alpha;
+ ntlVec3Gfx newpt;
+ if (nbdy) {
+ newpt = bdyavg / (float) nbdy;
+ alpha = 0.5f;
+ } else if (nnbdy) {
+ newpt = nbdyavg / (float) nnbdy;
+ if (nnbdy == 6)
+ alpha = 1.05;
+ else if (nnbdy == 8)
+ alpha = 0.86;
+ else if (nnbdy == 10)
+ alpha = 0.7;
+ else
+ alpha = 0.6;
+ &n