From ba139578e0dc7416a31a21bea68fa130c1cef1c0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 14 Jul 2005 22:46:01 +0000 Subject: [PATCH] replace explicit crossbar with last_saved_result interface; integrate with DX8 --- panda/src/display/graphicsStateGuardian.I | 15 +- panda/src/display/graphicsStateGuardian.cxx | 2 +- panda/src/display/graphicsStateGuardian.h | 4 +- panda/src/doc/eggSyntax.txt | 13 +- panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx | 19 +- panda/src/egg/eggTexture.I | 35 + panda/src/egg/eggTexture.cxx | 13 + panda/src/egg/eggTexture.h | 5 + panda/src/egg/lexer.cxx.prebuilt | 5908 +++++++++-------- panda/src/egg/parser.cxx.prebuilt | 3943 ++++++----- panda/src/egg/parser.h.prebuilt | 310 +- panda/src/egg/parser.yxx | 3 + panda/src/egg2pg/eggLoader.cxx | 5 + .../glstuff/glGraphicsStateGuardian_src.cxx | 84 +- .../src/glstuff/glGraphicsStateGuardian_src.h | 4 +- panda/src/gobj/textureStage.I | 783 +-- panda/src/gobj/textureStage.cxx | 130 +- panda/src/gobj/textureStage.h | 119 +- panda/src/putil/bam.h | 3 +- 19 files changed, 5584 insertions(+), 5814 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.I b/panda/src/display/graphicsStateGuardian.I index f9a89f7cd8..42c1574b05 100644 --- a/panda/src/display/graphicsStateGuardian.I +++ b/panda/src/display/graphicsStateGuardian.I @@ -249,19 +249,16 @@ get_supports_texture_combine() const { } //////////////////////////////////////////////////////////////////// -// Function: GraphicsStateGuardian::get_supports_texture_crossbar +// Function: GraphicsStateGuardian::get_supports_texture_saved_result // Access: Published // Description: Returns true if this GSG can use the -// TextureStage::CS_crossbar_stage blend source, which -// allows you to specify an arbitrary TextureStage as a -// source parameter to set_combine_rgb() or -// set_combine_alpha(). If this is false, you must use -// choose from one of the available enumerated values -// for the source of each operand. +// TextureStage::CS_last_saved_result source, which +// allows you to save the result of a TextureStage and +// re-use it for multiple inputs. //////////////////////////////////////////////////////////////////// INLINE bool GraphicsStateGuardian:: -get_supports_texture_crossbar() const { - return _supports_texture_crossbar; +get_supports_texture_saved_result() const { + return _supports_texture_saved_result; } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index 75c472b7ba..e99dbc2d66 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -123,7 +123,7 @@ GraphicsStateGuardian(const FrameBufferProperties &properties, // Assume we don't support these fairly advanced texture combiner // modes. _supports_texture_combine = false; - _supports_texture_crossbar = false; + _supports_texture_saved_result = false; _supports_texture_dot3 = false; // Assume no limits on number of lights or clip planes. diff --git a/panda/src/display/graphicsStateGuardian.h b/panda/src/display/graphicsStateGuardian.h index 24ca5bce24..3137b7dcbe 100644 --- a/panda/src/display/graphicsStateGuardian.h +++ b/panda/src/display/graphicsStateGuardian.h @@ -95,7 +95,7 @@ PUBLISHED: INLINE int get_max_cube_map_dimension() const; INLINE bool get_supports_texture_combine() const; - INLINE bool get_supports_texture_crossbar() const; + INLINE bool get_supports_texture_saved_result() const; INLINE bool get_supports_texture_dot3() const; INLINE int get_max_lights() const; @@ -367,7 +367,7 @@ protected: int _max_cube_map_dimension; bool _supports_texture_combine; - bool _supports_texture_crossbar; + bool _supports_texture_saved_result; bool _supports_texture_dot3; int _max_lights; diff --git a/panda/src/doc/eggSyntax.txt b/panda/src/doc/eggSyntax.txt index 5ef3fa0330..7623d0c77a 100644 --- a/panda/src/doc/eggSyntax.txt +++ b/panda/src/doc/eggSyntax.txt @@ -257,6 +257,7 @@ appear before they are referenced. PRIMARY-COLOR PREVIOUS CONSTANT_COLOR_SCALE + LAST_SAVED_RESULT combine-operand may be one of: @@ -525,7 +526,7 @@ appear before they are referenced. (1 1 1 1). The morph-list is an optional list of entries. - [name] { u v [morph-list] } + [name] { u v [tangent] [binormal] [morph-list] } This gives the texture coordinates of the vertex. This must be specified if a texture is to be mapped onto this geometry. As @@ -536,6 +537,16 @@ appear before they are referenced. support for multitexturing. The name may be omitted to specify the default UV's. + The UV's also support an optional tangent and binormal. These + values are based on the vertex normal and the UV coordinates of + connected vertices, and are used to render normal maps and similar + lighting effects. They are defined within the entry because + there may be a different set of tangents and binormals for each + different UV coordinate set. If present, they have the expected + syntax: + + [name] { u v { x y z } { x y z } } + name { vertices } diff --git a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx index 8e0097277b..a2de9e56bd 100644 --- a/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx +++ b/panda/src/dxgsg8/dxGraphicsStateGuardian8.cxx @@ -115,10 +115,6 @@ DXGraphicsStateGuardian8(const FrameBufferProperties &properties) : Geom::GR_point_perspective | Geom::GR_point_sprite | Geom::GR_triangle_strip | Geom::GR_triangle_fan | Geom::GR_flat_first_vertex; - - _supports_texture_combine = true; - _supports_texture_crossbar = false; - _supports_texture_dot3 = true; } //////////////////////////////////////////////////////////////////// @@ -1519,6 +1515,10 @@ reset() { _max_vertex_transforms = d3d_caps.MaxVertexBlendMatrices; _max_vertex_transform_indices = d3d_caps.MaxVertexBlendMatrixIndex; + _supports_texture_combine = ((d3d_caps.TextureOpCaps & D3DTEXOPCAPS_LERP) != 0); + _supports_texture_saved_result = ((d3d_caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP) != 0); + _supports_texture_dot3 = true; + ZeroMemory(&_lmodel_ambient, sizeof(Colorf)); _d3d_device->SetRenderState(D3DRS_AMBIENT, 0x0); @@ -2243,6 +2243,7 @@ do_issue_texture() { bool any_point_sprite = false; switch (mode) { case TexGenAttrib::M_off: + case TexGenAttrib::M_light_vector: _d3d_device->SetTextureStageState(i, D3DTSS_TEXCOORDINDEX, texcoord_index); break; @@ -2888,6 +2889,12 @@ set_texture_blend_mode(int i, const TextureStage *stage) { break; } + if (stage->get_saved_result()) { + _d3d_device->SetTextureStageState(i, D3DTSS_RESULTARG, D3DTA_TEMP); + } else { + _d3d_device->SetTextureStageState(i, D3DTSS_RESULTARG, D3DTA_CURRENT); + } + if (stage->uses_color()) { // Set up the constant color for this stage. @@ -3299,8 +3306,8 @@ get_texture_argument(TextureStage::CombineSource source, case TextureStage::CS_previous: return D3DTA_CURRENT | get_texture_argument_modifier(operand); - case TextureStage::CS_crossbar_stage: - break; + case TextureStage::CS_last_saved_result: + return D3DTA_TEMP | get_texture_argument_modifier(operand); } dxgsg8_cat.error() << "Invalid TextureStage::CombineSource value (" << (int)source << ")\n"; diff --git a/panda/src/egg/eggTexture.I b/panda/src/egg/eggTexture.I index fc09afbfed..61b8a6daa4 100644 --- a/panda/src/egg/eggTexture.I +++ b/panda/src/egg/eggTexture.I @@ -306,6 +306,41 @@ get_combine_operand(CombineChannel channel, int n) const { return _combiner[channel]._ops[n]._operand; } +//////////////////////////////////////////////////////////////////// +// Function: EggTexture::set_saved_result +// Access: Published +// Description: Sets the saved_result flag. When this is true, the +// output of this stage is not part of the normal +// pipeline--that is, it will not be supplied as the +// "previous" source for the next texture stage--but it +// will instead be supplied as the "last_saved_result" +// source for any future stages, until the next +// TextureStage with a saved_result set true is +// encountered. +// +// This can be used to reuse the results of this texture +// stage as input to more than one stage later in the +// pipeline. +// +// The last texture in the pipeline (the one with the +// highest sort value) should not have this flag set. +//////////////////////////////////////////////////////////////////// +INLINE void EggTexture:: +set_saved_result(bool saved_result) { + _saved_result = saved_result; +} + +//////////////////////////////////////////////////////////////////// +// Function: EggTexture::get_saved_result +// Access: Published +// Description: Returns the current setting of the saved_result flag. +// See set_saved_result(). +//////////////////////////////////////////////////////////////////// +INLINE bool EggTexture:: +get_saved_result() const { + return _saved_result; +} + //////////////////////////////////////////////////////////////////// // Function: EggTexture::set_tex_gen // Access: Published diff --git a/panda/src/egg/eggTexture.cxx b/panda/src/egg/eggTexture.cxx index 4c08be28d1..9e843741f6 100644 --- a/panda/src/egg/eggTexture.cxx +++ b/panda/src/egg/eggTexture.cxx @@ -43,6 +43,7 @@ EggTexture(const string &tref_name, const string &filename) _magfilter = FT_unspecified; _anisotropic_degree = 0; _env_type = ET_unspecified; + _saved_result = false; _tex_gen = TG_unspecified; _priority = 0; _color.set(0.0f, 0.0f, 0.0f, 1.0f); @@ -82,6 +83,7 @@ operator = (const EggTexture ©) { _magfilter = copy._magfilter; _anisotropic_degree = copy._anisotropic_degree; _env_type = copy._env_type; + _saved_result = copy._saved_result; _tex_gen = copy._tex_gen; _stage_name = copy._stage_name; _priority = copy._priority; @@ -196,6 +198,11 @@ write(ostream &out, int indent_level) const { } } + if (get_saved_result()) { + indent(out, indent_level + 2) + << " saved-result { 1 }\n"; + } + if (get_tex_gen() != TG_unspecified) { indent(out, indent_level + 2) << " tex-gen { " << get_tex_gen() << " }\n"; @@ -763,6 +770,9 @@ string_combine_source(const string &string) { } else if (cmp_nocase_uh(string, "constant_color_scale") == 0) { return CS_constant_color_scale; + } else if (cmp_nocase_uh(string, "last_saved_result") == 0) { + return CS_last_saved_result; + } else { return CS_unspecified; } @@ -1097,6 +1107,9 @@ operator << (ostream &out, EggTexture::CombineSource cs) { case EggTexture::CS_constant_color_scale: return out << "constant_color_scale"; + + case EggTexture::CS_last_saved_result: + return out << "last_saved_result"; } return out << "**invalid CombineSource(" << (int)cs << ")**"; diff --git a/panda/src/egg/eggTexture.h b/panda/src/egg/eggTexture.h index 6302e738c8..568d666191 100644 --- a/panda/src/egg/eggTexture.h +++ b/panda/src/egg/eggTexture.h @@ -119,6 +119,7 @@ PUBLISHED: CS_primary_color, CS_previous, CS_constant_color_scale, + CS_last_saved_result, }; enum CombineOperand { CO_unspecified, @@ -180,6 +181,9 @@ PUBLISHED: INLINE void set_combine_operand(CombineChannel channel, int n, CombineOperand co); INLINE CombineOperand get_combine_operand(CombineChannel channel, int n) const; + INLINE void set_saved_result(bool saved_result); + INLINE bool get_saved_result() const; + INLINE void set_tex_gen(TexGen tex_gen); INLINE TexGen get_tex_gen() const; @@ -270,6 +274,7 @@ private: FilterType _minfilter, _magfilter; int _anisotropic_degree; EnvType _env_type; + bool _saved_result; TexGen _tex_gen; string _stage_name; int _priority; diff --git a/panda/src/egg/lexer.cxx.prebuilt b/panda/src/egg/lexer.cxx.prebuilt index 8747001e5b..9867a9bd56 100644 --- a/panda/src/egg/lexer.cxx.prebuilt +++ b/panda/src/egg/lexer.cxx.prebuilt @@ -1,2943 +1,2965 @@ -#define yy_create_buffer eggyy_create_buffer -#define yy_delete_buffer eggyy_delete_buffer -#define yy_scan_buffer eggyy_scan_buffer -#define yy_scan_string eggyy_scan_string -#define yy_scan_bytes eggyy_scan_bytes -#define yy_flex_debug eggyy_flex_debug -#define yy_init_buffer eggyy_init_buffer -#define yy_flush_buffer eggyy_flush_buffer -#define yy_load_buffer_state eggyy_load_buffer_state -#define yy_switch_to_buffer eggyy_switch_to_buffer -#define yyin eggyyin -#define yyleng eggyyleng -#define yylex eggyylex -#define yyout eggyyout -#define yyrestart eggyyrestart -#define yytext eggyytext -#define yywrap eggyywrap - -#line 20 "lex.yy.c" -/* A lexical scanner generated by flex */ - -/* Scanner skeleton version: - * $Header$ - */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 - -#include - - -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif -#endif - - -#ifdef __cplusplus - -#include - -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -#if __STDC__ - -#define YY_USE_PROTOS -#define YY_USE_CONST - -#endif /* __STDC__ */ -#endif /* ! __cplusplus */ - -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#define YY_BUF_SIZE 16384 - -typedef struct yy_buffer_state *YY_BUFFER_STATE; - -extern int yyleng; -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yytext_ptr ) - -/* The following is because we cannot portably get our hands on size_t - * (without autoconf's help, which isn't available because we want - * flex-generated scanners to compile on their own). - */ -typedef unsigned int yy_size_t; - - -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - }; - -static YY_BUFFER_STATE yy_current_buffer = 0; - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - */ -#define YY_CURRENT_BUFFER yy_current_buffer - - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; - -static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart YY_PROTO(( FILE *input_file )); - -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) - -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); - -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - -typedef unsigned char YY_CHAR; -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; -typedef int yy_state_type; -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 98 -#define YY_END_OF_BUFFER 99 -static yyconst short int yy_accept[557] = - { 0, - 0, 0, 99, 97, 2, 1, 96, 97, 97, 97, - 97, 90, 90, 97, 97, 97, 5, 97, 1, 97, - 90, 97, 90, 4, 3, 90, 92, 97, 91, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 3, 3, 92, 97, 90, 91, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 66, 97, 97, 97, 94, 97, 95, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 18, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 32, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 81, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 24, 97, 97, 97, 97, - - 22, 97, 97, 97, 97, 97, 31, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 52, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 67, 97, 97, 97, - 97, 97, 97, 97, 97, 78, 97, 97, 97, 97, - 97, 97, 93, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 19, 97, 97, 97, 97, 23, - 97, 28, 97, 97, 97, 97, 97, 97, 37, 38, - 97, 97, 97, 43, 97, 97, 97, 97, 97, 97, - 97, 53, 97, 55, 56, 57, 97, 97, 97, 97, - - 97, 97, 97, 97, 97, 97, 97, 97, 74, 97, - 77, 97, 97, 97, 97, 97, 97, 93, 97, 7, - 97, 97, 97, 12, 97, 97, 97, 97, 97, 97, - 97, 21, 26, 97, 97, 30, 97, 97, 33, 34, - 97, 97, 42, 97, 97, 97, 97, 48, 97, 97, - 97, 97, 97, 97, 60, 97, 97, 97, 65, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 11, 13, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 44, 97, 97, 97, 97, 97, 97, 54, 58, 59, - - 97, 97, 63, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 84, 97, 97, 97, 97, - 97, 97, 97, 14, 15, 97, 97, 97, 20, 97, - 97, 35, 97, 97, 40, 41, 97, 97, 97, 97, - 97, 51, 97, 62, 97, 68, 69, 70, 97, 97, - 97, 97, 79, 80, 82, 83, 97, 97, 97, 97, - 97, 97, 10, 97, 97, 25, 97, 97, 36, 39, - 97, 97, 97, 97, 97, 61, 97, 71, 97, 97, - 97, 97, 97, 97, 97, 88, 97, 97, 8, 97, - 16, 97, 97, 97, 97, 97, 97, 97, 97, 97, - - 72, 73, 97, 97, 97, 97, 87, 97, 97, 97, - 97, 97, 29, 45, 97, 47, 49, 50, 97, 97, - 97, 85, 86, 97, 6, 97, 97, 97, 97, 97, - 75, 97, 89, 97, 97, 97, 46, 97, 97, 97, - 97, 97, 97, 76, 97, 97, 97, 97, 9, 97, - 97, 64, 17, 97, 27, 0 - } ; - -static yyconst int yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 1, 4, 1, 5, 1, 1, 1, 1, - 1, 6, 7, 1, 8, 9, 10, 11, 12, 13, - 14, 15, 13, 13, 13, 13, 13, 1, 1, 16, - 1, 17, 1, 1, 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, - 1, 1, 1, 1, 18, 1, 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, 1, 45, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst int yy_meta[46] = - { 0, - 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2 - } ; - -static yyconst short int yy_base[562] = - { 0, - 0, 44, 663, 0, 664, 0, 664, 8, 81, 22, - 18, 100, 19, 123, 630, 642, 664, 0, 0, 29, - 30, 628, 51, 0, 65, 68, 14, 159, 164, 61, - 91, 170, 43, 623, 631, 625, 623, 623, 70, 68, - 66, 86, 621, 93, 175, 181, 128, 111, 629, 628, - 619, 626, 136, 0, 18, 207, 213, 0, 605, 629, - 45, 615, 627, 612, 102, 627, 607, 605, 604, 607, - 614, 602, 597, 593, 603, 604, 595, 599, 597, 173, - 603, 596, 596, 594, 588, 603, 601, 587, 586, 593, - 598, 581, 100, 594, 597, 578, 596, 595, 578, 593, - - 584, 209, 568, 586, 176, 570, 578, 577, 588, 575, - 0, 574, 566, 570, 0, 589, 0, 572, 577, 567, - 563, 573, 558, 556, 562, 199, 555, 0, 552, 572, - 550, 551, 566, 562, 567, 539, 563, 558, 562, 540, - 561, 0, 547, 538, 543, 536, 550, 538, 146, 548, - 546, 538, 548, 544, 543, 527, 532, 520, 545, 542, - 195, 528, 529, 519, 535, 518, 525, 537, 528, 48, - 520, 519, 526, 174, 532, 516, 515, 0, 514, 513, - 506, 538, 500, 518, 517, 519, 502, 507, 530, 512, - 507, 510, 499, 509, 513, 0, 510, 497, 508, 502, - - 0, 508, 493, 506, 496, 487, 0, 481, 500, 480, - 480, 499, 498, 478, 486, 482, 494, 491, 472, 487, - 471, 487, 467, 479, 0, 486, 464, 484, 483, 482, - 471, 79, 474, 469, 474, 471, 0, 470, 465, 452, - 465, 452, 471, 455, 469, 0, 452, 451, 450, 449, - 458, 461, 231, 443, 461, 444, 445, 452, 457, 451, - 450, 439, 438, 442, 0, 436, 448, 449, 448, 0, - 437, 0, 440, 445, 439, 428, 442, 441, 0, 0, - 430, 414, 438, 0, 424, 194, 415, 435, 419, 420, - 416, 0, 425, 0, 0, 0, 416, 410, 428, 412, - - 411, 416, 424, 408, 402, 402, 399, 134, 0, 411, - 0, 397, 396, 395, 394, 389, 398, 0, 408, 0, - 409, 408, 409, 0, 408, 401, 385, 399, 389, 399, - 389, 0, 0, 397, 398, 0, 393, 394, 0, 0, - 395, 221, 0, 396, 373, 372, 372, 0, 384, 381, - 375, 389, 388, 387, 0, 382, 377, 120, 0, 363, - 362, 376, 372, 364, 377, 365, 357, 356, 355, 354, - 230, 363, 350, 352, 357, 0, 0, 369, 368, 352, - 364, 359, 364, 340, 357, 361, 354, 346, 358, 357, - 0, 337, 336, 328, 347, 344, 351, 0, 0, 0, - - 344, 349, 0, 332, 347, 346, 345, 324, 324, 321, - 335, 340, 339, 338, 337, 0, 321, 319, 328, 319, - 313, 326, 330, 0, 0, 308, 307, 327, 0, 320, - 319, 0, 324, 323, 0, 0, 299, 314, 303, 304, - 309, 0, 317, 0, 301, 0, 0, 0, 315, 300, - 307, 224, 0, 0, 0, 0, 302, 295, 303, 239, - 286, 241, 0, 308, 301, 0, 287, 286, 0, 0, - 298, 301, 296, 280, 279, 0, 294, 0, 298, 297, - 294, 274, 280, 280, 292, 0, 271, 284, 0, 283, - 0, 268, 266, 286, 285, 280, 283, 282, 281, 270, - - 0, 0, 264, 259, 277, 276, 0, 287, 274, 258, - 246, 265, 0, 0, 264, 0, 0, 0, 248, 268, - 257, 0, 0, 266, 0, 244, 244, 238, 262, 251, - 0, 243, 0, 253, 227, 229, 0, 227, 242, 204, - 209, 174, 160, 0, 122, 76, 35, 32, 0, 21, - 1, 0, 0, 1, 0, 664, 266, 0, 269, 271, - 273 - } ; - -static yyconst short int yy_def[562] = - { 0, - 557, 557, 556, 558, 556, 559, 556, 558, 558, 558, - 558, 558, 12, 558, 558, 558, 556, 558, 559, 558, - 12, 558, 558, 558, 560, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 560, 561, 558, 558, 558, 29, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 253, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, - 558, 558, 558, 558, 558, 0, 556, 556, 556, 556, - 556 - } ; - -static yyconst short int yy_nxt[710] = - { 0, - 18, 5, 6, 7, 556, 556, 8, 9, 10, 11, - 12, 13, 13, 13, 13, 14, 20, 555, 21, 21, - 21, 21, 21, 24, 55, 55, 15, 25, 55, 55, - 554, 16, 23, 23, 23, 23, 23, 553, 18, 23, - 23, 23, 23, 23, 17, 5, 6, 7, 552, 18, - 8, 9, 10, 11, 12, 13, 13, 13, 13, 14, - 18, 23, 23, 23, 23, 23, 54, 551, 54, 76, - 15, 18, 77, 28, 120, 16, 121, 239, 23, 23, - 23, 23, 23, 59, 60, 240, 85, 61, 17, 20, - 28, 21, 21, 21, 21, 21, 83, 298, 88, 62, - - 86, 299, 84, 87, 89, 90, 550, 22, 26, 54, - 21, 21, 21, 21, 21, 94, 63, 95, 110, 27, - 64, 91, 28, 65, 92, 96, 157, 111, 112, 158, - 66, 125, 126, 113, 127, 107, 403, 54, 549, 54, - 404, 29, 30, 31, 32, 108, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 364, 44, 45, - 46, 47, 48, 365, 49, 56, 56, 109, 214, 57, - 57, 57, 57, 57, 58, 58, 58, 58, 58, 97, - 54, 215, 58, 58, 58, 58, 58, 58, 67, 142, - 68, 548, 244, 143, 172, 98, 69, 99, 173, 102, - - 100, 70, 174, 103, 245, 71, 547, 72, 73, 144, - 104, 74, 75, 227, 345, 101, 105, 57, 57, 57, - 57, 57, 106, 57, 57, 57, 57, 57, 167, 192, - 346, 546, 193, 168, 389, 390, 228, 229, 230, 545, - 169, 318, 318, 318, 318, 318, 416, 481, 417, 318, - 318, 318, 318, 318, 318, 486, 487, 489, 544, 543, - 482, 490, 542, 418, 541, 419, 4, 4, 4, 19, - 19, 53, 53, 54, 54, 540, 539, 538, 537, 536, - 535, 534, 533, 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, 488, 485, 484, 483, 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, 446, 445, 444, 443, 442, 441, 440, - 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, - 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, - 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, - - 405, 402, 401, 400, 399, 398, 397, 396, 395, 394, - 393, 392, 391, 388, 387, 386, 385, 384, 383, 382, - 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, - 371, 370, 369, 368, 367, 366, 363, 362, 361, 360, - 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, - 349, 348, 347, 344, 343, 342, 341, 340, 339, 338, - 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, - 327, 326, 325, 324, 323, 322, 321, 320, 319, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 305, 304, 303, 302, 301, 300, 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, 263, 262, 261, 260, 259, 258, 257, 256, 255, - 254, 253, 252, 251, 250, 249, 248, 247, 246, 243, - 242, 241, 238, 237, 236, 235, 234, 233, 232, 231, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 213, 212, 211, 210, 209, 208, 207, 206, 205, - 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, - 194, 191, 190, 189, 188, 187, 186, 185, 184, 183, - - 182, 181, 180, 179, 178, 177, 176, 175, 171, 170, - 166, 165, 164, 163, 162, 161, 160, 159, 156, 155, - 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, - 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, - 131, 130, 129, 128, 124, 123, 122, 119, 118, 117, - 116, 115, 114, 93, 82, 81, 80, 79, 78, 52, - 51, 50, 556, 3, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - - 556, 556, 556, 556, 556, 556, 556, 556, 556 - } ; - -static yyconst short int yy_chk[710] = - { 0, - 558, 1, 1, 1, 0, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 554, 8, 8, - 8, 8, 8, 11, 27, 27, 1, 11, 55, 55, - 551, 1, 10, 10, 10, 10, 10, 550, 13, 20, - 20, 20, 20, 20, 1, 2, 2, 2, 548, 21, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 13, 23, 23, 23, 23, 23, 25, 547, 25, 33, - 2, 21, 33, 23, 61, 2, 61, 170, 26, 26, - 26, 26, 26, 30, 30, 170, 40, 30, 2, 9, - 26, 9, 9, 9, 9, 9, 39, 232, 41, 30, - - 40, 232, 39, 40, 41, 42, 546, 9, 12, 25, - 12, 12, 12, 12, 12, 44, 31, 44, 48, 12, - 31, 42, 12, 31, 42, 44, 93, 48, 48, 93, - 31, 65, 65, 48, 65, 47, 358, 53, 545, 53, - 358, 12, 14, 14, 14, 47, 14, 14, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 308, 14, 14, - 14, 14, 14, 308, 14, 28, 28, 47, 149, 28, - 28, 28, 28, 28, 29, 29, 29, 29, 29, 45, - 53, 149, 29, 29, 29, 29, 29, 29, 32, 80, - 32, 543, 174, 80, 105, 45, 32, 45, 105, 46, - - 45, 32, 105, 46, 174, 32, 542, 32, 32, 80, - 46, 32, 32, 161, 286, 45, 46, 56, 56, 56, - 56, 56, 46, 57, 57, 57, 57, 57, 102, 126, - 286, 541, 126, 102, 342, 342, 161, 161, 161, 540, - 102, 253, 253, 253, 253, 253, 371, 452, 371, 253, - 253, 253, 253, 253, 253, 460, 460, 462, 539, 538, - 452, 462, 536, 371, 535, 371, 557, 557, 557, 559, - 559, 560, 560, 561, 561, 534, 532, 530, 529, 528, - 527, 526, 524, 521, 520, 519, 515, 512, 511, 510, - 509, 508, 506, 505, 504, 503, 500, 499, 498, 497, - - 496, 495, 494, 493, 492, 490, 488, 487, 485, 484, - 483, 482, 481, 480, 479, 477, 475, 474, 473, 472, - 471, 468, 467, 465, 464, 461, 459, 458, 457, 451, - 450, 449, 445, 443, 441, 440, 439, 438, 437, 434, - 433, 431, 430, 428, 427, 426, 423, 422, 421, 420, - 419, 418, 417, 415, 414, 413, 412, 411, 410, 409, - 408, 407, 406, 405, 404, 402, 401, 397, 396, 395, - 394, 393, 392, 390, 389, 388, 387, 386, 385, 384, - 383, 382, 381, 380, 379, 378, 375, 374, 373, 372, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - - 360, 357, 356, 354, 353, 352, 351, 350, 349, 347, - 346, 345, 344, 341, 338, 337, 335, 334, 331, 330, - 329, 328, 327, 326, 325, 323, 322, 321, 319, 317, - 316, 315, 314, 313, 312, 310, 307, 306, 305, 304, - 303, 302, 301, 300, 299, 298, 297, 293, 291, 290, - 289, 288, 287, 285, 283, 282, 281, 278, 277, 276, - 275, 274, 273, 271, 269, 268, 267, 266, 264, 263, - 262, 261, 260, 259, 258, 257, 256, 255, 254, 252, - 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, - 240, 239, 238, 236, 235, 234, 233, 231, 230, 229, - - 228, 227, 226, 224, 223, 222, 221, 220, 219, 218, - 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, - 206, 205, 204, 203, 202, 200, 199, 198, 197, 195, - 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, - 184, 183, 182, 181, 180, 179, 177, 176, 175, 173, - 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, - 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, - 150, 148, 147, 146, 145, 144, 143, 141, 140, 139, - 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 127, 125, 124, 123, 122, 121, 120, 119, 118, 116, - - 114, 113, 112, 110, 109, 108, 107, 106, 104, 103, - 101, 100, 99, 98, 97, 96, 95, 94, 92, 91, - 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, - 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, - 69, 68, 67, 66, 64, 63, 62, 60, 59, 52, - 51, 50, 49, 43, 38, 37, 36, 35, 34, 22, - 16, 15, 3, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, - - 556, 556, 556, 556, 556, 556, 556, 556, 556 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "lexer.lxx" -#define INITIAL 0 -/* -// Filename: lexer.l -// Created by: drose (16Jan99) -// -//////////////////////////////////////////////////////////////////// -*/ -#line 9 "lexer.lxx" -#include "lexerDefs.h" -#include "parserDefs.h" -#include "config_egg.h" -#include "parser.h" - -#include -#include - -#include -#include - -extern "C" int eggyywrap(void); // declared below. - -static int yyinput(void); // declared by flex. - - -//////////////////////////////////////////////////////////////////// -// Static variables -//////////////////////////////////////////////////////////////////// - -// We'll increment line_number and col_number as we parse the file, so -// that we can report the position of an error. -static int line_number = 0; -static int col_number = 0; - -// current_line holds as much of the current line as will fit. Its -// only purpose is for printing it out to report an error to the user. -static const int max_error_width = 1024; -static char current_line[max_error_width + 1]; - -static int error_count = 0; -static int warning_count = 0; - -// This is the pointer to the current input stream. -static istream *inp = NULL; - -// This is the name of the egg file we're parsing. We keep it so we -// can print it out for error messages. -static string egg_filename; - -// This is the initial token state returned by the lexer. It allows -// the yacc grammar to start from initial points. -static int initial_token; - - -//////////////////////////////////////////////////////////////////// -// Defining the interface to the lexer. -//////////////////////////////////////////////////////////////////// - -void -egg_init_lexer(istream &in, const string &filename) { - inp = ∈ - egg_filename = filename; - line_number = 0; - col_number = 0; - error_count = 0; - warning_count = 0; - initial_token = START_EGG; -} - -void -egg_start_group_body() { - /* Set the initial state to begin within a group_body context, - instead of at the beginning of the egg file. */ - initial_token = START_GROUP_BODY; -} - -void -egg_start_texture_body() { - initial_token = START_TEXTURE_BODY; -} - -void -egg_start_primitive_body() { - initial_token = START_PRIMITIVE_BODY; -} - -int -egg_error_count() { - return error_count; -} - -int -egg_warning_count() { - return warning_count; -} - - -//////////////////////////////////////////////////////////////////// -// Internal support functions. -//////////////////////////////////////////////////////////////////// - -int -eggyywrap(void) { - return 1; -} - -void -eggyyerror(const string &msg) { - if (egg_cat.is_error()) { - ostream &out = egg_cat.error(false); - - out << "\nError"; - if (!egg_filename.empty()) { - out << " in " << egg_filename; - } - out - << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) - << current_line << "\n"; - indent(out, col_number-1) - << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; - } - error_count++; -} - -void -eggyyerror(ostringstream &strm) { - string s = strm.str(); - eggyyerror(s); -} - -void -eggyywarning(const string &msg) { - if (egg_cat.is_warning()) { - ostream &out = egg_cat.warning(false); - - out << "\nWarning"; - if (!egg_filename.empty()) { - out << " in " << egg_filename; - } - out - << " at line " << line_number << ", column " << col_number << ":\n" - << setiosflags(Notify::get_literal_flag()) - << current_line << "\n"; - indent(out, col_number-1) - << "^\n" << msg << "\n\n" - << resetiosflags(Notify::get_literal_flag()) << flush; - } - warning_count++; -} - -void -eggyywarning(ostringstream &strm) { - string s = strm.str(); - eggyywarning(s); -} - -// Now define a function to take input from an istream instead of a -// stdio FILE pointer. This is flex-specific. -static void -input_chars(char *buffer, int &result, int max_size) { - nassertv(inp != NULL); - if (*inp) { - inp->read(buffer, max_size); - result = inp->gcount(); - - if (line_number == 0) { - // This is a special case. If we are reading the very first bit - // from the stream, copy it into the current_line array. This - // is because the \n.* rule below, which fills current_line - // normally, doesn't catch the first line. - int length = min(max_error_width, result); - strncpy(current_line, buffer, length); - current_line[length] = '\0'; - line_number++; - col_number = 0; - - // Truncate it at the newline. - char *end = strchr(current_line, '\n'); - if (end != NULL) { - *end = '\0'; - } - } - - } else { - // End of file or I/O error. - result = 0; - } -} -#undef YY_INPUT -#define YY_INPUT(buffer, result, max_size) input_chars(buffer, result, max_size) - -// read_char reads and returns a single character, incrementing the -// supplied line and column numbers as appropriate. A convenience -// function for the scanning functions below. -static int -read_char(int &line, int &col) { - int c = yyinput(); - if (c == '\n') { - line++; - col = 0; - } else { - col++; - } - return c; -} - -// scan_quoted_string reads a string delimited by quotation marks and -// returns it. -static string -scan_quoted_string() { - string result; - - // We don't touch the current line number and column number during - // scanning, so that if we detect an error while scanning the string - // (e.g. an unterminated string), we'll report the error as - // occurring at the start of the string, not at the end--somewhat - // more convenient for the user. - - // Instead of adjusting the global line_number and col_number - // variables, we'll operate on our own local variables for the - // interim. - int line = line_number; - int col = col_number; - - int c; - c = read_char(line, col); - while (c != '"' && c != EOF) { - result += c; - c = read_char(line, col); - } - - if (c == EOF) { - eggyyerror("This quotation mark is unterminated."); - } - - line_number = line; - col_number = col; - - return result; -} - -// eat_c_comment scans past all characters up until the first */ -// encountered. -static void -eat_c_comment() { - // As above, we'll operate on our own local copies of line_number - // and col_number within this function. - - int line = line_number; - int col = col_number; - - int c, last_c; - - last_c = '\0'; - c = read_char(line, col); - while (c != EOF && !(last_c == '*' && c == '/')) { - if (last_c == '/' && c == '*') { - ostringstream errmsg; - errmsg << "This comment contains a nested /* symbol at line " - << line << ", column " << col-1 << "--possibly unclosed?" - << ends; - eggyywarning(errmsg); - } - last_c = c; - c = read_char(line, col); - } - - if (c == EOF) { - eggyyerror("This comment marker is unclosed."); - } - - line_number = line; - col_number = col; -} - - -// accept() is called below as each piece is pulled off and -// accepted by the lexer; it increments the current column number. -INLINE void accept() { - col_number += yyleng; -} - -#line 1004 "lex.yy.c" - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); -#else -extern int yywrap YY_PROTO(( void )); -#endif -#endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif - -#else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 -#endif - -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ - -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ - { \ - int c = '*', n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -YY_DECL - { - register yy_state_type yy_current_state; - register char *yy_cp = NULL, *yy_bp = NULL; - register int yy_act; - -#line 290 "lexer.lxx" - - - - if (initial_token != 0) { - int t = initial_token; - initial_token = 0; - return t; - } - - -#line 1166 "lex.yy.c" - - if ( yy_init ) - { - yy_init = 0; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yy_start ) - yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_load_buffer_state(); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 557 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 664 ); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - yy_act = yy_accept[yy_current_state]; - } - - YY_DO_BEFORE_ACTION; - - -do_action: /* This label is used only to access EOF actions. */ - - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 300 "lexer.lxx" -{ - // New line. Save a copy of the line so we can print it out for the - // benefit of the user in case we get an error. - - strncpy(current_line, yytext+1, max_error_width); - current_line[max_error_width] = '\0'; - line_number++; - col_number=0; - - // Return the whole line to the lexer, except the newline character, - // which we eat. - yyless(1); -} - YY_BREAK -case 2: -YY_RULE_SETUP -#line 314 "lexer.lxx" -{ - // Eat whitespace. - accept(); -} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 319 "lexer.lxx" -{ - // Eat C++-style comments. - accept(); -} - YY_BREAK -case 4: -YY_RULE_SETUP -#line 324 "lexer.lxx" -{ - // Eat C-style comments. - accept(); - eat_c_comment(); -} - YY_BREAK -case 5: -YY_RULE_SETUP -#line 330 "lexer.lxx" -{ - // Send curly braces as themselves. - accept(); - return eggyytext[0]; -} - YY_BREAK -case 6: -YY_RULE_SETUP -#line 338 "lexer.lxx" -{ - accept(); - return BEZIERCURVE; -} - YY_BREAK -case 7: -YY_RULE_SETUP -#line 342 "lexer.lxx" -{ - accept(); - return BFACE; -} - YY_BREAK -case 8: -YY_RULE_SETUP -#line 346 "lexer.lxx" -{ - accept(); - return BILLBOARD; -} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 350 "lexer.lxx" -{ - accept(); - return BILLBOARDCENTER; -} - YY_BREAK -case 10: -YY_RULE_SETUP -#line 354 "lexer.lxx" -{ - accept(); - return BINORMAL; -} - YY_BREAK -case 11: -YY_RULE_SETUP -#line 358 "lexer.lxx" -{ - accept(); - return BUNDLE; -} - YY_BREAK -case 12: -YY_RULE_SETUP -#line 362 "lexer.lxx" -{ - accept(); - return SCALAR; -} - YY_BREAK -case 13: -YY_RULE_SETUP -#line 366 "lexer.lxx" -{ - accept(); - return CLOSED; -} - YY_BREAK -case 14: -YY_RULE_SETUP -#line 370 "lexer.lxx" -{ - accept(); - return COLLIDE; -} - YY_BREAK -case 15: -YY_RULE_SETUP -#line 374 "lexer.lxx" -{ - accept(); - return COMMENT; -} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 378 "lexer.lxx" -{ - accept(); - return COMPONENT; -} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 382 "lexer.lxx" -{ - accept(); - return COORDSYSTEM; -} - YY_BREAK -case 18: -YY_RULE_SETUP -#line 386 "lexer.lxx" -{ - accept(); - return CV; -} - YY_BREAK -case 19: -YY_RULE_SETUP -#line 390 "lexer.lxx" -{ - accept(); - return DART; -} - YY_BREAK -case 20: -YY_RULE_SETUP -#line 394 "lexer.lxx" -{ - accept(); - return DNORMAL; -} - YY_BREAK -case 21: -YY_RULE_SETUP -#line 398 "lexer.lxx" -{ - accept(); - return DRGBA; -} - YY_BREAK -case 22: -YY_RULE_SETUP -#line 402 "lexer.lxx" -{ - accept(); - return DUV; -} - YY_BREAK -case 23: -YY_RULE_SETUP -#line 406 "lexer.lxx" -{ - accept(); - return DXYZ; -} - YY_BREAK -case 24: -YY_RULE_SETUP -#line 410 "lexer.lxx" -{ - accept(); - return DCS; -} - YY_BREAK -case 25: -YY_RULE_SETUP -#line 414 "lexer.lxx" -{ - accept(); - return DISTANCE; -} - YY_BREAK -case 26: -YY_RULE_SETUP -#line 418 "lexer.lxx" -{ - accept(); - return DTREF; -} - YY_BREAK -case 27: -YY_RULE_SETUP -#line 422 "lexer.lxx" -{ - accept(); - return DYNAMICVERTEXPOOL; -} - YY_BREAK -case 28: -YY_RULE_SETUP -#line 426 "lexer.lxx" -{ - accept(); - return EXTERNAL_FILE; -} - YY_BREAK -case 29: -YY_RULE_SETUP -#line 430 "lexer.lxx" -{ - accept(); - return FLIGHT; -} - YY_BREAK -case 30: -YY_RULE_SETUP -#line 434 "lexer.lxx" -{ - accept(); - return GROUP; -} - YY_BREAK -case 31: -YY_RULE_SETUP -#line 438 "lexer.lxx" -{ - accept(); - return HIP; -} - YY_BREAK -case 32: -YY_RULE_SETUP -#line 442 "lexer.lxx" -{ - accept(); - return INTANGENT; -} - YY_BREAK -case 33: -YY_RULE_SETUP -#line 446 "lexer.lxx" -{ - accept(); - return JOINT; -} - YY_BREAK -case 34: -YY_RULE_SETUP -#line 450 "lexer.lxx" -{ - accept(); - return KNOTS; -} - YY_BREAK -case 35: -YY_RULE_SETUP -#line 454 "lexer.lxx" -{ - accept(); - return INCLUDE; -} - YY_BREAK -case 36: -YY_RULE_SETUP -#line 458 "lexer.lxx" -{ - accept(); - return INSTANCE; -} - YY_BREAK -case 37: -YY_RULE_SETUP -#line 462 "lexer.lxx" -{ - accept(); - return LINE; -} - YY_BREAK -case 38: -YY_RULE_SETUP -#line 466 "lexer.lxx" -{ - accept(); - return LOOP; -} - YY_BREAK -case 39: -YY_RULE_SETUP -#line 470 "lexer.lxx" -{ - accept(); - return MATERIAL; -} - YY_BREAK -case 40: -YY_RULE_SETUP -#line 474 "lexer.lxx" -{ - accept(); - return MATRIX3; -} - YY_BREAK -case 41: -YY_RULE_SETUP -#line 478 "lexer.lxx" -{ - accept(); - return MATRIX4; -} - YY_BREAK -case 42: -YY_RULE_SETUP -#line 482 "lexer.lxx" -{ - accept(); - return MODEL; -} - YY_BREAK -case 43: -YY_RULE_SETUP -#line 486 "lexer.lxx" -{ - accept(); - return MREF; -} - YY_BREAK -case 44: -YY_RULE_SETUP -#line 490 "lexer.lxx" -{ - accept(); - return NORMAL; -} - YY_BREAK -case 45: -YY_RULE_SETUP -#line 494 "lexer.lxx" -{ - accept(); - return NURBSCURVE; -} - YY_BREAK -case 46: -YY_RULE_SETUP -#line 498 "lexer.lxx" -{ - accept(); - return NURBSSURFACE; -} - YY_BREAK -case 47: -YY_RULE_SETUP -#line 502 "lexer.lxx" -{ - accept(); - return OBJECTTYPE; -} - YY_BREAK -case 48: -YY_RULE_SETUP -#line 506 "lexer.lxx" -{ - accept(); - return ORDER; -} - YY_BREAK -case 49: -YY_RULE_SETUP -#line 510 "lexer.lxx" -{ - accept(); - return OUTTANGENT; -} - YY_BREAK -case 50: -YY_RULE_SETUP -#line 514 "lexer.lxx" -{ - accept(); - return POINTLIGHT; -} - YY_BREAK -case 51: -YY_RULE_SETUP -#line 518 "lexer.lxx" -{ - accept(); - return POLYGON; -} - YY_BREAK -case 52: -YY_RULE_SETUP -#line 522 "lexer.lxx" -{ - accept(); - return REF; -} - YY_BREAK -case 53: -YY_RULE_SETUP -#line 526 "lexer.lxx" -{ - accept(); - return RGBA; -} - YY_BREAK -case 54: -YY_RULE_SETUP -#line 530 "lexer.lxx" -{ - accept(); - return ROTATE; -} - YY_BREAK -case 55: -YY_RULE_SETUP -#line 534 "lexer.lxx" -{ - accept(); - return ROTX; -} - YY_BREAK -case 56: -YY_RULE_SETUP -#line 538 "lexer.lxx" -{ - accept(); - return ROTY; -} - YY_BREAK -case 57: -YY_RULE_SETUP -#line 542 "lexer.lxx" -{ - accept(); - return ROTZ; -} - YY_BREAK -case 58: -YY_RULE_SETUP -#line 546 "lexer.lxx" -{ - accept(); - return SANIM; -} - YY_BREAK -case 59: -YY_RULE_SETUP -#line 550 "lexer.lxx" -{ - accept(); - return SCALAR; -} - YY_BREAK -case 60: -YY_RULE_SETUP -#line 554 "lexer.lxx" -{ - accept(); - return SCALE; -} - YY_BREAK -case 61: -YY_RULE_SETUP -#line 558 "lexer.lxx" -{ - accept(); - return SEQUENCE; -} - YY_BREAK -case 62: -YY_RULE_SETUP -#line 562 "lexer.lxx" -{ - accept(); - return SHADING; -} - YY_BREAK -case 63: -YY_RULE_SETUP -#line 566 "lexer.lxx" -{ - accept(); - return SWITCH; -} - YY_BREAK -case 64: -YY_RULE_SETUP -#line 570 "lexer.lxx" -{ - accept(); - return SWITCHCONDITION; -} - YY_BREAK -case 65: -YY_RULE_SETUP -#line 574 "lexer.lxx" -{ - accept(); - return TABLE; -} - YY_BREAK -case 66: -YY_RULE_SETUP -#line 578 "lexer.lxx" -{ - accept(); - return TABLE_V; -} - YY_BREAK -case 67: -YY_RULE_SETUP -#line 582 "lexer.lxx" -{ - accept(); - return TAG; -} - YY_BREAK -case 68: -YY_RULE_SETUP -#line 586 "lexer.lxx" -{ - accept(); - return TANGENT; -} - YY_BREAK -case 69: -YY_RULE_SETUP -#line 590 "lexer.lxx" -{ - accept(); - return TEXLIST; -} - YY_BREAK -case 70: -YY_RULE_SETUP -#line 594 "lexer.lxx" -{ - accept(); - return TEXTURE; -} - YY_BREAK -case 71: -YY_RULE_SETUP -#line 598 "lexer.lxx" -{ - accept(); - return TLENGTHS; -} - YY_BREAK -case 72: -YY_RULE_SETUP -#line 602 "lexer.lxx" -{ - accept(); - return TRANSFORM; -} - YY_BREAK -case 73: -YY_RULE_SETUP -#line 606 "lexer.lxx" -{ - accept(); - return TRANSLATE; -} - YY_BREAK -case 74: -YY_RULE_SETUP -#line 610 "lexer.lxx" -{ - accept(); - return TREF; -} - YY_BREAK -case 75: -YY_RULE_SETUP -#line 614 "lexer.lxx" -{ - accept(); - return TRIANGLEFAN; -} - YY_BREAK -case 76: -YY_RULE_SETUP -#line 618 "lexer.lxx" -{ - accept(); - return TRIANGLESTRIP; -} - YY_BREAK -case 77: -YY_RULE_SETUP -#line 622 "lexer.lxx" -{ - accept(); - return TRIM; -} - YY_BREAK -case 78: -YY_RULE_SETUP -#line 626 "lexer.lxx" -{ - accept(); - return TXT; -} - YY_BREAK -case 79: -YY_RULE_SETUP -#line 630 "lexer.lxx" -{ - accept(); - return UKNOTS; -} - YY_BREAK -case 80: -YY_RULE_SETUP -#line 634 "lexer.lxx" -{ - accept(); - return UKNOTS; -} - YY_BREAK -case 81: -YY_RULE_SETUP -#line 638 "lexer.lxx" -{ - accept(); - return UV; -} - YY_BREAK -case 82: -YY_RULE_SETUP -#line 642 "lexer.lxx" -{ - accept(); - return VKNOTS; -} - YY_BREAK -case 83: -YY_RULE_SETUP -#line 646 "lexer.lxx" -{ - accept(); - return VKNOTS; -} - YY_BREAK -case 84: -YY_RULE_SETUP -#line 650 "lexer.lxx" -{ - accept(); - return VERTEX; -} - YY_BREAK -case 85: -YY_RULE_SETUP -#line 654 "lexer.lxx" -{ - accept(); - return VERTEXANIM; -} - YY_BREAK -case 86: -YY_RULE_SETUP -#line 658 "lexer.lxx" -{ - accept(); - return VERTEXPOOL; -} - YY_BREAK -case 87: -YY_RULE_SETUP -#line 662 "lexer.lxx" -{ - accept(); - return VERTEXREF; -} - YY_BREAK -case 88: -YY_RULE_SETUP -#line 666 "lexer.lxx" -{ - accept(); - return XFMANIM; -} - YY_BREAK -case 89: -YY_RULE_SETUP -#line 670 "lexer.lxx" -{ - accept(); - return XFMSANIM; -} - YY_BREAK -case 90: -YY_RULE_SETUP -#line 677 "lexer.lxx" -{ - // An integer or floating-point number. - accept(); - eggyylval._number = atof(eggyytext); - eggyylval._string = yytext; - return NUMBER; -} - YY_BREAK -case 91: -YY_RULE_SETUP -#line 685 "lexer.lxx" -{ - // A hexadecimal integer number. - accept(); - eggyylval._ulong = strtoul(yytext+2, NULL, 16); - eggyylval._string = yytext; - return ULONG; -} - YY_BREAK -case 92: -YY_RULE_SETUP -#line 693 "lexer.lxx" -{ - // A binary integer number. - accept(); - eggyylval._ulong = strtoul(yytext+2, NULL, 2); - eggyylval._string = yytext; - return ULONG; -} - YY_BREAK -case 93: -YY_RULE_SETUP -#line 701 "lexer.lxx" -{ - // not-a-number. These sometimes show up in egg files accidentally. - accept(); - memset(&eggyylval._number, 0, sizeof(eggyylval._number)); - *(unsigned long *)&eggyylval._number = strtoul(yytext+3, NULL, 0); - eggyylval._string = yytext; - return NUMBER; -} - YY_BREAK -case 94: -YY_RULE_SETUP -#line 710 "lexer.lxx" -{ - // infinity. As above. - accept(); - eggyylval._number = HUGE_VAL; - eggyylval._string = yytext; - return NUMBER; -} - YY_BREAK -case 95: -YY_RULE_SETUP -#line 718 "lexer.lxx" -{ - // minus infinity. As above. - accept(); - eggyylval._number = -HUGE_VAL; - eggyylval._string = yytext; - return NUMBER; -} - YY_BREAK -case 96: -YY_RULE_SETUP -#line 727 "lexer.lxx" -{ - // Quoted string. - accept(); - eggyylval._string = scan_quoted_string(); - return STRING; -} - YY_BREAK -case 97: -YY_RULE_SETUP -#line 734 "lexer.lxx" -{ - // Unquoted string. - accept(); - eggyylval._string = yytext; - return STRING; -} - YY_BREAK -case 98: -YY_RULE_SETUP -#line 740 "lexer.lxx" -ECHO; - YY_BREAK -#line 2064 "lex.yy.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yy_c_buf_p; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer() ) - { - case EOB_ACT_END_OF_FILE: - { - yy_did_buffer_switch_on_eof = 0; - - if ( yywrap() ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; - - yy_current_state = yy_get_previous_state(); - - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of yylex */ - - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; - - else - { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; - - int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = yy_current_buffer->yy_buf_size - - number_to_move - 1; -#endif - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); - - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - if ( yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; - - return ret_val; - } - - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -static yy_state_type yy_get_previous_state() - { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 557 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; - } - - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { - register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 557 ) - 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 == 556); - - return yy_is_jam ? 0 : yy_current_state; - } - - -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; - - /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - { /* need to shift things up to make room */ - /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; - register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; - - while ( source > yy_current_buffer->yy_ch_buf ) - *--dest = *--source; - - yy_cp += (int) (dest - source); - yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; - - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) - YY_FATAL_ERROR( "flex scanner push-back overflow" ); - } - - *--yy_cp = (char) c; - - - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - -#ifdef __cplusplus -static int yyinput() -#else -static int input() -#endif - { - int c; - - *yy_c_buf_p = yy_hold_char; - - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - /* This was really a NUL. */ - *yy_c_buf_p = '\0'; - - else - { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; - - switch ( yy_get_next_buffer() ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /* fall through */ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap() ) - return EOF; - - if ( ! yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - - - return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); - - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); - } - - -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) - return; - - if ( yy_current_buffer ) - { - /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; - } - - yy_current_buffer = new_buffer; - yy_load_buffer_state(); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } - - -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; - } - - -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { - if ( ! b ) - return; - - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } - - - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - - - { - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif - - { - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == yy_current_buffer ) - yy_load_buffer_state(); - } - - -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif - - -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; - - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; - } -#endif - - -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; -#endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); - - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); - - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); - - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } - - yy_start_stack[yy_start_stack_ptr++] = YY_START; - - BEGIN(new_state); - } -#endif - - -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif - - -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) -#else -static void yy_fatal_error( msg ) -char msg[]; -#endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } - - - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) - - -/* Internal utility routines. */ - -#ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; - } -#endif - -#ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; - } -#endif - - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { - return (void *) malloc( size ); - } - -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); - } - -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } - -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif -#line 740 "lexer.lxx" +#define yy_create_buffer eggyy_create_buffer +#define yy_delete_buffer eggyy_delete_buffer +#define yy_scan_buffer eggyy_scan_buffer +#define yy_scan_string eggyy_scan_string +#define yy_scan_bytes eggyy_scan_bytes +#define yy_flex_debug eggyy_flex_debug +#define yy_init_buffer eggyy_init_buffer +#define yy_flush_buffer eggyy_flush_buffer +#define yy_load_buffer_state eggyy_load_buffer_state +#define yy_switch_to_buffer eggyy_switch_to_buffer +#define yyin eggyyin +#define yyleng eggyyleng +#define yylex eggyylex +#define yyout eggyyout +#define yyrestart eggyyrestart +#define yytext eggyytext +#define yywrap eggyywrap + +#line 20 "lex.yy.c" +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header$ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#include + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include +#ifndef _WIN32 +#endif + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 98 +#define YY_END_OF_BUFFER 99 +static yyconst short int yy_accept[557] = + { 0, + 0, 0, 99, 97, 2, 1, 96, 97, 97, 97, + 97, 90, 90, 97, 97, 97, 5, 97, 1, 97, + 90, 97, 90, 4, 3, 90, 92, 97, 91, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 3, 3, 92, 97, 90, 91, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 66, 97, 97, 97, 94, 97, 95, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 18, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 32, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 81, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 24, 97, 97, 97, 97, + + 22, 97, 97, 97, 97, 97, 31, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 52, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 67, 97, 97, 97, + 97, 97, 97, 97, 97, 78, 97, 97, 97, 97, + 97, 97, 93, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 19, 97, 97, 97, 97, 23, + 97, 28, 97, 97, 97, 97, 97, 97, 37, 38, + 97, 97, 97, 43, 97, 97, 97, 97, 97, 97, + 97, 53, 97, 55, 56, 57, 97, 97, 97, 97, + + 97, 97, 97, 97, 97, 97, 97, 97, 74, 97, + 77, 97, 97, 97, 97, 97, 97, 93, 97, 7, + 97, 97, 97, 12, 97, 97, 97, 97, 97, 97, + 97, 21, 26, 97, 97, 30, 97, 97, 33, 34, + 97, 97, 42, 97, 97, 97, 97, 48, 97, 97, + 97, 97, 97, 97, 60, 97, 97, 97, 65, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 11, 13, 97, 97, 97, + 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, + 44, 97, 97, 97, 97, 97, 97, 54, 58, 59, + + 97, 97, 63, 97, 97, 97, 97, 97, 97, 97, + 97, 97, 97, 97, 97, 84, 97, 97, 97, 97, + 97, 97, 97, 14, 15, 97, 97, 97, 20, 97, + 97, 35, 97, 97, 40, 41, 97, 97, 97, 97, + 97, 51, 97, 62, 97, 68, 69, 70, 97, 97, + 97, 97, 79, 80, 82, 83, 97, 97, 97, 97, + 97, 97, 10, 97, 97, 25, 97, 97, 36, 39, + 97, 97, 97, 97, 97, 61, 97, 71, 97, 97, + 97, 97, 97, 97, 97, 88, 97, 97, 8, 97, + 16, 97, 97, 97, 97, 97, 97, 97, 97, 97, + + 72, 73, 97, 97, 97, 97, 87, 97, 97, 97, + 97, 97, 29, 45, 97, 47, 49, 50, 97, 97, + 97, 85, 86, 97, 6, 97, 97, 97, 97, 97, + 75, 97, 89, 97, 97, 97, 46, 97, 97, 97, + 97, 97, 97, 76, 97, 97, 97, 97, 9, 97, + 97, 64, 17, 97, 27, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 4, 1, 5, 1, 1, 1, 1, + 1, 6, 7, 1, 8, 9, 10, 11, 12, 13, + 14, 15, 13, 13, 13, 13, 13, 1, 1, 16, + 1, 17, 1, 1, 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, + 1, 1, 1, 1, 18, 1, 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, 1, 45, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[46] = + { 0, + 1, 2, 3, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2 + } ; + +static yyconst short int yy_base[562] = + { 0, + 0, 44, 663, 0, 664, 0, 664, 8, 81, 22, + 18, 100, 19, 123, 630, 642, 664, 0, 0, 29, + 30, 628, 51, 0, 65, 68, 14, 159, 164, 61, + 91, 170, 43, 623, 631, 625, 623, 623, 70, 68, + 66, 86, 621, 93, 175, 181, 128, 111, 629, 628, + 619, 626, 136, 0, 18, 207, 213, 0, 605, 629, + 45, 615, 627, 612, 102, 627, 607, 605, 604, 607, + 614, 602, 597, 593, 603, 604, 595, 599, 597, 173, + 603, 596, 596, 594, 588, 603, 601, 587, 586, 593, + 598, 581, 100, 594, 597, 578, 596, 595, 578, 593, + + 584, 209, 568, 586, 176, 570, 578, 577, 588, 575, + 0, 574, 566, 570, 0, 589, 0, 572, 577, 567, + 563, 573, 558, 556, 562, 199, 555, 0, 552, 572, + 550, 551, 566, 562, 567, 539, 563, 558, 562, 540, + 561, 0, 547, 538, 543, 536, 550, 538, 146, 548, + 546, 538, 548, 544, 543, 527, 532, 520, 545, 542, + 195, 528, 529, 519, 535, 518, 525, 537, 528, 48, + 520, 519, 526, 174, 532, 516, 515, 0, 514, 513, + 506, 538, 500, 518, 517, 519, 502, 507, 530, 512, + 507, 510, 499, 509, 513, 0, 510, 497, 508, 502, + + 0, 508, 493, 506, 496, 487, 0, 481, 500, 480, + 480, 499, 498, 478, 486, 482, 494, 491, 472, 487, + 471, 487, 467, 479, 0, 486, 464, 484, 483, 482, + 471, 79, 474, 469, 474, 471, 0, 470, 465, 452, + 465, 452, 471, 455, 469, 0, 452, 451, 450, 449, + 458, 461, 231, 443, 461, 444, 445, 452, 457, 451, + 450, 439, 438, 442, 0, 436, 448, 449, 448, 0, + 437, 0, 440, 445, 439, 428, 442, 441, 0, 0, + 430, 414, 438, 0, 424, 194, 415, 435, 419, 420, + 416, 0, 425, 0, 0, 0, 416, 410, 428, 412, + + 411, 416, 424, 408, 402, 402, 399, 134, 0, 411, + 0, 397, 396, 395, 394, 389, 398, 0, 408, 0, + 409, 408, 409, 0, 408, 401, 385, 399, 389, 399, + 389, 0, 0, 397, 398, 0, 393, 394, 0, 0, + 395, 221, 0, 396, 373, 372, 372, 0, 384, 381, + 375, 389, 388, 387, 0, 382, 377, 120, 0, 363, + 362, 376, 372, 364, 377, 365, 357, 356, 355, 354, + 230, 363, 350, 352, 357, 0, 0, 369, 368, 352, + 364, 359, 364, 340, 357, 361, 354, 346, 358, 357, + 0, 337, 336, 328, 347, 344, 351, 0, 0, 0, + + 344, 349, 0, 332, 347, 346, 345, 324, 324, 321, + 335, 340, 339, 338, 337, 0, 321, 319, 328, 319, + 313, 326, 330, 0, 0, 308, 307, 327, 0, 320, + 319, 0, 324, 323, 0, 0, 299, 314, 303, 304, + 309, 0, 317, 0, 301, 0, 0, 0, 315, 300, + 307, 224, 0, 0, 0, 0, 302, 295, 303, 239, + 286, 241, 0, 308, 301, 0, 287, 286, 0, 0, + 298, 301, 296, 280, 279, 0, 294, 0, 298, 297, + 294, 274, 280, 280, 292, 0, 271, 284, 0, 283, + 0, 268, 266, 286, 285, 280, 283, 282, 281, 270, + + 0, 0, 264, 259, 277, 276, 0, 287, 274, 258, + 246, 265, 0, 0, 264, 0, 0, 0, 248, 268, + 257, 0, 0, 266, 0, 244, 244, 238, 262, 251, + 0, 243, 0, 253, 227, 229, 0, 227, 242, 204, + 209, 174, 160, 0, 122, 76, 35, 32, 0, 21, + 1, 0, 0, 1, 0, 664, 266, 0, 269, 271, + 273 + } ; + +static yyconst short int yy_def[562] = + { 0, + 557, 557, 556, 558, 556, 559, 556, 558, 558, 558, + 558, 558, 12, 558, 558, 558, 556, 558, 559, 558, + 12, 558, 558, 558, 560, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 560, 561, 558, 558, 558, 29, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 253, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 558, 558, 558, 558, 558, + 558, 558, 558, 558, 558, 0, 556, 556, 556, 556, + 556 + } ; + +static yyconst short int yy_nxt[710] = + { 0, + 18, 5, 6, 7, 556, 556, 8, 9, 10, 11, + 12, 13, 13, 13, 13, 14, 20, 555, 21, 21, + 21, 21, 21, 24, 55, 55, 15, 25, 55, 55, + 554, 16, 23, 23, 23, 23, 23, 553, 18, 23, + 23, 23, 23, 23, 17, 5, 6, 7, 552, 18, + 8, 9, 10, 11, 12, 13, 13, 13, 13, 14, + 18, 23, 23, 23, 23, 23, 54, 551, 54, 76, + 15, 18, 77, 28, 120, 16, 121, 239, 23, 23, + 23, 23, 23, 59, 60, 240, 85, 61, 17, 20, + 28, 21, 21, 21, 21, 21, 83, 298, 88, 62, + + 86, 299, 84, 87, 89, 90, 550, 22, 26, 54, + 21, 21, 21, 21, 21, 94, 63, 95, 110, 27, + 64, 91, 28, 65, 92, 96, 157, 111, 112, 158, + 66, 125, 126, 113, 127, 107, 403, 54, 549, 54, + 404, 29, 30, 31, 32, 108, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 364, 44, 45, + 46, 47, 48, 365, 49, 56, 56, 109, 214, 57, + 57, 57, 57, 57, 58, 58, 58, 58, 58, 97, + 54, 215, 58, 58, 58, 58, 58, 58, 67, 142, + 68, 548, 244, 143, 172, 98, 69, 99, 173, 102, + + 100, 70, 174, 103, 245, 71, 547, 72, 73, 144, + 104, 74, 75, 227, 345, 101, 105, 57, 57, 57, + 57, 57, 106, 57, 57, 57, 57, 57, 167, 192, + 346, 546, 193, 168, 389, 390, 228, 229, 230, 545, + 169, 318, 318, 318, 318, 318, 416, 481, 417, 318, + 318, 318, 318, 318, 318, 486, 487, 489, 544, 543, + 482, 490, 542, 418, 541, 419, 4, 4, 4, 19, + 19, 53, 53, 54, 54, 540, 539, 538, 537, 536, + 535, 534, 533, 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, 488, 485, 484, 483, 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, 446, 445, 444, 443, 442, 441, 440, + 439, 438, 437, 436, 435, 434, 433, 432, 431, 430, + 429, 428, 427, 426, 425, 424, 423, 422, 421, 420, + 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, + + 405, 402, 401, 400, 399, 398, 397, 396, 395, 394, + 393, 392, 391, 388, 387, 386, 385, 384, 383, 382, + 381, 380, 379, 378, 377, 376, 375, 374, 373, 372, + 371, 370, 369, 368, 367, 366, 363, 362, 361, 360, + 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, + 349, 348, 347, 344, 343, 342, 341, 340, 339, 338, + 337, 336, 335, 334, 333, 332, 331, 330, 329, 328, + 327, 326, 325, 324, 323, 322, 321, 320, 319, 317, + 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, + 306, 305, 304, 303, 302, 301, 300, 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, 263, 262, 261, 260, 259, 258, 257, 256, 255, + 254, 253, 252, 251, 250, 249, 248, 247, 246, 243, + 242, 241, 238, 237, 236, 235, 234, 233, 232, 231, + 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, + 216, 213, 212, 211, 210, 209, 208, 207, 206, 205, + 204, 203, 202, 201, 200, 199, 198, 197, 196, 195, + 194, 191, 190, 189, 188, 187, 186, 185, 184, 183, + + 182, 181, 180, 179, 178, 177, 176, 175, 171, 170, + 166, 165, 164, 163, 162, 161, 160, 159, 156, 155, + 154, 153, 152, 151, 150, 149, 148, 147, 146, 145, + 141, 140, 139, 138, 137, 136, 135, 134, 133, 132, + 131, 130, 129, 128, 124, 123, 122, 119, 118, 117, + 116, 115, 114, 93, 82, 81, 80, 79, 78, 52, + 51, 50, 556, 3, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + + 556, 556, 556, 556, 556, 556, 556, 556, 556 + } ; + +static yyconst short int yy_chk[710] = + { 0, + 558, 1, 1, 1, 0, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 8, 554, 8, 8, + 8, 8, 8, 11, 27, 27, 1, 11, 55, 55, + 551, 1, 10, 10, 10, 10, 10, 550, 13, 20, + 20, 20, 20, 20, 1, 2, 2, 2, 548, 21, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 13, 23, 23, 23, 23, 23, 25, 547, 25, 33, + 2, 21, 33, 23, 61, 2, 61, 170, 26, 26, + 26, 26, 26, 30, 30, 170, 40, 30, 2, 9, + 26, 9, 9, 9, 9, 9, 39, 232, 41, 30, + + 40, 232, 39, 40, 41, 42, 546, 9, 12, 25, + 12, 12, 12, 12, 12, 44, 31, 44, 48, 12, + 31, 42, 12, 31, 42, 44, 93, 48, 48, 93, + 31, 65, 65, 48, 65, 47, 358, 53, 545, 53, + 358, 12, 14, 14, 14, 47, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 308, 14, 14, + 14, 14, 14, 308, 14, 28, 28, 47, 149, 28, + 28, 28, 28, 28, 29, 29, 29, 29, 29, 45, + 53, 149, 29, 29, 29, 29, 29, 29, 32, 80, + 32, 543, 174, 80, 105, 45, 32, 45, 105, 46, + + 45, 32, 105, 46, 174, 32, 542, 32, 32, 80, + 46, 32, 32, 161, 286, 45, 46, 56, 56, 56, + 56, 56, 46, 57, 57, 57, 57, 57, 102, 126, + 286, 541, 126, 102, 342, 342, 161, 161, 161, 540, + 102, 253, 253, 253, 253, 253, 371, 452, 371, 253, + 253, 253, 253, 253, 253, 460, 460, 462, 539, 538, + 452, 462, 536, 371, 535, 371, 557, 557, 557, 559, + 559, 560, 560, 561, 561, 534, 532, 530, 529, 528, + 527, 526, 524, 521, 520, 519, 515, 512, 511, 510, + 509, 508, 506, 505, 504, 503, 500, 499, 498, 497, + + 496, 495, 494, 493, 492, 490, 488, 487, 485, 484, + 483, 482, 481, 480, 479, 477, 475, 474, 473, 472, + 471, 468, 467, 465, 464, 461, 459, 458, 457, 451, + 450, 449, 445, 443, 441, 440, 439, 438, 437, 434, + 433, 431, 430, 428, 427, 426, 423, 422, 421, 420, + 419, 418, 417, 415, 414, 413, 412, 411, 410, 409, + 408, 407, 406, 405, 404, 402, 401, 397, 396, 395, + 394, 393, 392, 390, 389, 388, 387, 386, 385, 384, + 383, 382, 381, 380, 379, 378, 375, 374, 373, 372, + 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, + + 360, 357, 356, 354, 353, 352, 351, 350, 349, 347, + 346, 345, 344, 341, 338, 337, 335, 334, 331, 330, + 329, 328, 327, 326, 325, 323, 322, 321, 319, 317, + 316, 315, 314, 313, 312, 310, 307, 306, 305, 304, + 303, 302, 301, 300, 299, 298, 297, 293, 291, 290, + 289, 288, 287, 285, 283, 282, 281, 278, 277, 276, + 275, 274, 273, 271, 269, 268, 267, 266, 264, 263, + 262, 261, 260, 259, 258, 257, 256, 255, 254, 252, + 251, 250, 249, 248, 247, 245, 244, 243, 242, 241, + 240, 239, 238, 236, 235, 234, 233, 231, 230, 229, + + 228, 227, 226, 224, 223, 222, 221, 220, 219, 218, + 217, 216, 215, 214, 213, 212, 211, 210, 209, 208, + 206, 205, 204, 203, 202, 200, 199, 198, 197, 195, + 194, 193, 192, 191, 190, 189, 188, 187, 186, 185, + 184, 183, 182, 181, 180, 179, 177, 176, 175, 173, + 172, 171, 169, 168, 167, 166, 165, 164, 163, 162, + 160, 159, 158, 157, 156, 155, 154, 153, 152, 151, + 150, 148, 147, 146, 145, 144, 143, 141, 140, 139, + 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, + 127, 125, 124, 123, 122, 121, 120, 119, 118, 116, + + 114, 113, 112, 110, 109, 108, 107, 106, 104, 103, + 101, 100, 99, 98, 97, 96, 95, 94, 92, 91, + 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, + 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, + 69, 68, 67, 66, 64, 63, 62, 60, 59, 52, + 51, 50, 49, 43, 38, 37, 36, 35, 34, 22, + 16, 15, 3, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + + 556, 556, 556, 556, 556, 556, 556, 556, 556 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "lexer.lxx" +#define INITIAL 0 +/* +// Filename: lexer.l +// Created by: drose (16Jan99) +// +//////////////////////////////////////////////////////////////////// +*/ +#line 9 "lexer.lxx" +#include "lexerDefs.h" +#include "parserDefs.h" +#include "config_egg.h" +#include "parser.h" + +#include +#include + +#include +#include + +extern "C" int eggyywrap(void); // declared below. + +static int yyinput(void); // declared by flex. + + +//////////////////////////////////////////////////////////////////// +// Static variables +//////////////////////////////////////////////////////////////////// + +// We'll increment line_number and col_number as we parse the file, so +// that we can report the position of an error. +static int line_number = 0; +static int col_number = 0; + +// current_line holds as much of the current line as will fit. Its +// only purpose is for printing it out to report an error to the user. +static const int max_error_width = 1024; +static char current_line[max_error_width + 1]; + +static int error_count = 0; +static int warning_count = 0; + +// This is the pointer to the current input stream. +static istream *inp = NULL; + +// This is the name of the egg file we're parsing. We keep it so we +// can print it out for error messages. +static string egg_filename; + +// This is the initial token state returned by the lexer. It allows +// the yacc grammar to start from initial points. +static int initial_token; + + +//////////////////////////////////////////////////////////////////// +// Defining the interface to the lexer. +//////////////////////////////////////////////////////////////////// + +void +egg_init_lexer(istream &in, const string &filename) { + inp = ∈ + egg_filename = filename; + line_number = 0; + col_number = 0; + error_count = 0; + warning_count = 0; + initial_token = START_EGG; +} + +void +egg_start_group_body() { + /* Set the initial state to begin within a group_body context, + instead of at the beginning of the egg file. */ + initial_token = START_GROUP_BODY; +} + +void +egg_start_texture_body() { + initial_token = START_TEXTURE_BODY; +} + +void +egg_start_primitive_body() { + initial_token = START_PRIMITIVE_BODY; +} + +int +egg_error_count() { + return error_count; +} + +int +egg_warning_count() { + return warning_count; +} + + +//////////////////////////////////////////////////////////////////// +// Internal support functions. +//////////////////////////////////////////////////////////////////// + +int +eggyywrap(void) { + return 1; +} + +void +eggyyerror(const string &msg) { + if (egg_cat.is_error()) { + ostream &out = egg_cat.error(false); + + out << "\nError"; + if (!egg_filename.empty()) { + out << " in " << egg_filename; + } + out + << " at line " << line_number << ", column " << col_number << ":\n" + << setiosflags(Notify::get_literal_flag()) + << current_line << "\n"; + indent(out, col_number-1) + << "^\n" << msg << "\n\n" + << resetiosflags(Notify::get_literal_flag()) << flush; + } + error_count++; +} + +void +eggyyerror(ostringstream &strm) { + string s = strm.str(); + eggyyerror(s); +} + +void +eggyywarning(const string &msg) { + if (egg_cat.is_warning()) { + ostream &out = egg_cat.warning(false); + + out << "\nWarning"; + if (!egg_filename.empty()) { + out << " in " << egg_filename; + } + out + << " at line " << line_number << ", column " << col_number << ":\n" + << setiosflags(Notify::get_literal_flag()) + << current_line << "\n"; + indent(out, col_number-1) + << "^\n" << msg << "\n\n" + << resetiosflags(Notify::get_literal_flag()) << flush; + } + warning_count++; +} + +void +eggyywarning(ostringstream &strm) { + string s = strm.str(); + eggyywarning(s); +} + +// Now define a function to take input from an istream instead of a +// stdio FILE pointer. This is flex-specific. +static void +input_chars(char *buffer, int &result, int max_size) { + nassertv(inp != NULL); + if (*inp) { + inp->read(buffer, max_size); + result = inp->gcount(); + + if (line_number == 0) { + // This is a special case. If we are reading the very first bit + // from the stream, copy it into the current_line array. This + // is because the \n.* rule below, which fills current_line + // normally, doesn't catch the first line. + int length = min(max_error_width, result); + strncpy(current_line, buffer, length); + current_line[length] = '\0'; + line_number++; + col_number = 0; + + // Truncate it at the newline. + char *end = strchr(current_line, '\n'); + if (end != NULL) { + *end = '\0'; + } + } + + } else { + // End of file or I/O error. + result = 0; + } +} +#undef YY_INPUT +#define YY_INPUT(buffer, result, max_size) input_chars(buffer, result, max_size) + +// read_char reads and returns a single character, incrementing the +// supplied line and column numbers as appropriate. A convenience +// function for the scanning functions below. +static int +read_char(int &line, int &col) { + int c = yyinput(); + if (c == '\n') { + line++; + col = 0; + } else { + col++; + } + return c; +} + +// scan_quoted_string reads a string delimited by quotation marks and +// returns it. +static string +scan_quoted_string() { + string result; + + // We don't touch the current line number and column number during + // scanning, so that if we detect an error while scanning the string + // (e.g. an unterminated string), we'll report the error as + // occurring at the start of the string, not at the end--somewhat + // more convenient for the user. + + // Instead of adjusting the global line_number and col_number + // variables, we'll operate on our own local variables for the + // interim. + int line = line_number; + int col = col_number; + + int c; + c = read_char(line, col); + while (c != '"' && c != EOF) { + result += c; + c = read_char(line, col); + } + + if (c == EOF) { + eggyyerror("This quotation mark is unterminated."); + } + + line_number = line; + col_number = col; + + return result; +} + +// eat_c_comment scans past all characters up until the first */ +// encountered. +static void +eat_c_comment() { + // As above, we'll operate on our own local copies of line_number + // and col_number within this function. + + int line = line_number; + int col = col_number; + + int c, last_c; + + last_c = '\0'; + c = read_char(line, col); + while (c != EOF && !(last_c == '*' && c == '/')) { + if (last_c == '/' && c == '*') { + ostringstream errmsg; + errmsg << "This comment contains a nested /* symbol at line " + << line << ", column " << col-1 << "--possibly unclosed?" + << ends; + eggyywarning(errmsg); + } + last_c = c; + c = read_char(line, col); + } + + if (c == EOF) { + eggyyerror("This comment marker is unclosed."); + } + + line_number = line; + col_number = col; +} + + +// accept() is called below as each piece is pulled off and +// accepted by the lexer; it increments the current column number. +INLINE void accept() { + col_number += yyleng; +} + +#line 1007 "lex.yy.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + } +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + +#line 290 "lexer.lxx" + + + + if (initial_token != 0) { + int t = initial_token; + initial_token = 0; + return t; + } + + +#line 1180 "lex.yy.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 557 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 664 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 300 "lexer.lxx" +{ + // New line. Save a copy of the line so we can print it out for the + // benefit of the user in case we get an error. + + strncpy(current_line, yytext+1, max_error_width); + current_line[max_error_width] = '\0'; + line_number++; + col_number=0; + + // Return the whole line to the lexer, except the newline character, + // which we eat. + yyless(1); +} + YY_BREAK +case 2: +YY_RULE_SETUP +#line 314 "lexer.lxx" +{ + // Eat whitespace. + accept(); +} + YY_BREAK +case 3: +YY_RULE_SETUP +#line 319 "lexer.lxx" +{ + // Eat C++-style comments. + accept(); +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 324 "lexer.lxx" +{ + // Eat C-style comments. + accept(); + eat_c_comment(); +} + YY_BREAK +case 5: +YY_RULE_SETUP +#line 330 "lexer.lxx" +{ + // Send curly braces as themselves. + accept(); + return eggyytext[0]; +} + YY_BREAK +case 6: +YY_RULE_SETUP +#line 338 "lexer.lxx" +{ + accept(); + return BEZIERCURVE; +} + YY_BREAK +case 7: +YY_RULE_SETUP +#line 342 "lexer.lxx" +{ + accept(); + return BFACE; +} + YY_BREAK +case 8: +YY_RULE_SETUP +#line 346 "lexer.lxx" +{ + accept(); + return BILLBOARD; +} + YY_BREAK +case 9: +YY_RULE_SETUP +#line 350 "lexer.lxx" +{ + accept(); + return BILLBOARDCENTER; +} + YY_BREAK +case 10: +YY_RULE_SETUP +#line 354 "lexer.lxx" +{ + accept(); + return BINORMAL; +} + YY_BREAK +case 11: +YY_RULE_SETUP +#line 358 "lexer.lxx" +{ + accept(); + return BUNDLE; +} + YY_BREAK +case 12: +YY_RULE_SETUP +#line 362 "lexer.lxx" +{ + accept(); + return SCALAR; +} + YY_BREAK +case 13: +YY_RULE_SETUP +#line 366 "lexer.lxx" +{ + accept(); + return CLOSED; +} + YY_BREAK +case 14: +YY_RULE_SETUP +#line 370 "lexer.lxx" +{ + accept(); + return COLLIDE; +} + YY_BREAK +case 15: +YY_RULE_SETUP +#line 374 "lexer.lxx" +{ + accept(); + return COMMENT; +} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 378 "lexer.lxx" +{ + accept(); + return COMPONENT; +} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 382 "lexer.lxx" +{ + accept(); + return COORDSYSTEM; +} + YY_BREAK +case 18: +YY_RULE_SETUP +#line 386 "lexer.lxx" +{ + accept(); + return CV; +} + YY_BREAK +case 19: +YY_RULE_SETUP +#line 390 "lexer.lxx" +{ + accept(); + return DART; +} + YY_BREAK +case 20: +YY_RULE_SETUP +#line 394 "lexer.lxx" +{ + accept(); + return DNORMAL; +} + YY_BREAK +case 21: +YY_RULE_SETUP +#line 398 "lexer.lxx" +{ + accept(); + return DRGBA; +} + YY_BREAK +case 22: +YY_RULE_SETUP +#line 402 "lexer.lxx" +{ + accept(); + return DUV; +} + YY_BREAK +case 23: +YY_RULE_SETUP +#line 406 "lexer.lxx" +{ + accept(); + return DXYZ; +} + YY_BREAK +case 24: +YY_RULE_SETUP +#line 410 "lexer.lxx" +{ + accept(); + return DCS; +} + YY_BREAK +case 25: +YY_RULE_SETUP +#line 414 "lexer.lxx" +{ + accept(); + return DISTANCE; +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 418 "lexer.lxx" +{ + accept(); + return DTREF; +} + YY_BREAK +case 27: +YY_RULE_SETUP +#line 422 "lexer.lxx" +{ + accept(); + return DYNAMICVERTEXPOOL; +} + YY_BREAK +case 28: +YY_RULE_SETUP +#line 426 "lexer.lxx" +{ + accept(); + return EXTERNAL_FILE; +} + YY_BREAK +case 29: +YY_RULE_SETUP +#line 430 "lexer.lxx" +{ + accept(); + return FLIGHT; +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 434 "lexer.lxx" +{ + accept(); + return GROUP; +} + YY_BREAK +case 31: +YY_RULE_SETUP +#line 438 "lexer.lxx" +{ + accept(); + return HIP; +} + YY_BREAK +case 32: +YY_RULE_SETUP +#line 442 "lexer.lxx" +{ + accept(); + return INTANGENT; +} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 446 "lexer.lxx" +{ + accept(); + return JOINT; +} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 450 "lexer.lxx" +{ + accept(); + return KNOTS; +} + YY_BREAK +case 35: +YY_RULE_SETUP +#line 454 "lexer.lxx" +{ + accept(); + return INCLUDE; +} + YY_BREAK +case 36: +YY_RULE_SETUP +#line 458 "lexer.lxx" +{ + accept(); + return INSTANCE; +} + YY_BREAK +case 37: +YY_RULE_SETUP +#line 462 "lexer.lxx" +{ + accept(); + return LINE; +} + YY_BREAK +case 38: +YY_RULE_SETUP +#line 466 "lexer.lxx" +{ + accept(); + return LOOP; +} + YY_BREAK +case 39: +YY_RULE_SETUP +#line 470 "lexer.lxx" +{ + accept(); + return MATERIAL; +} + YY_BREAK +case 40: +YY_RULE_SETUP +#line 474 "lexer.lxx" +{ + accept(); + return MATRIX3; +} + YY_BREAK +case 41: +YY_RULE_SETUP +#line 478 "lexer.lxx" +{ + accept(); + return MATRIX4; +} + YY_BREAK +case 42: +YY_RULE_SETUP +#line 482 "lexer.lxx" +{ + accept(); + return MODEL; +} + YY_BREAK +case 43: +YY_RULE_SETUP +#line 486 "lexer.lxx" +{ + accept(); + return MREF; +} + YY_BREAK +case 44: +YY_RULE_SETUP +#line 490 "lexer.lxx" +{ + accept(); + return NORMAL; +} + YY_BREAK +case 45: +YY_RULE_SETUP +#line 494 "lexer.lxx" +{ + accept(); + return NURBSCURVE; +} + YY_BREAK +case 46: +YY_RULE_SETUP +#line 498 "lexer.lxx" +{ + accept(); + return NURBSSURFACE; +} + YY_BREAK +case 47: +YY_RULE_SETUP +#line 502 "lexer.lxx" +{ + accept(); + return OBJECTTYPE; +} + YY_BREAK +case 48: +YY_RULE_SETUP +#line 506 "lexer.lxx" +{ + accept(); + return ORDER; +} + YY_BREAK +case 49: +YY_RULE_SETUP +#line 510 "lexer.lxx" +{ + accept(); + return OUTTANGENT; +} + YY_BREAK +case 50: +YY_RULE_SETUP +#line 514 "lexer.lxx" +{ + accept(); + return POINTLIGHT; +} + YY_BREAK +case 51: +YY_RULE_SETUP +#line 518 "lexer.lxx" +{ + accept(); + return POLYGON; +} + YY_BREAK +case 52: +YY_RULE_SETUP +#line 522 "lexer.lxx" +{ + accept(); + return REF; +} + YY_BREAK +case 53: +YY_RULE_SETUP +#line 526 "lexer.lxx" +{ + accept(); + return RGBA; +} + YY_BREAK +case 54: +YY_RULE_SETUP +#line 530 "lexer.lxx" +{ + accept(); + return ROTATE; +} + YY_BREAK +case 55: +YY_RULE_SETUP +#line 534 "lexer.lxx" +{ + accept(); + return ROTX; +} + YY_BREAK +case 56: +YY_RULE_SETUP +#line 538 "lexer.lxx" +{ + accept(); + return ROTY; +} + YY_BREAK +case 57: +YY_RULE_SETUP +#line 542 "lexer.lxx" +{ + accept(); + return ROTZ; +} + YY_BREAK +case 58: +YY_RULE_SETUP +#line 546 "lexer.lxx" +{ + accept(); + return SANIM; +} + YY_BREAK +case 59: +YY_RULE_SETUP +#line 550 "lexer.lxx" +{ + accept(); + return SCALAR; +} + YY_BREAK +case 60: +YY_RULE_SETUP +#line 554 "lexer.lxx" +{ + accept(); + return SCALE; +} + YY_BREAK +case 61: +YY_RULE_SETUP +#line 558 "lexer.lxx" +{ + accept(); + return SEQUENCE; +} + YY_BREAK +case 62: +YY_RULE_SETUP +#line 562 "lexer.lxx" +{ + accept(); + return SHADING; +} + YY_BREAK +case 63: +YY_RULE_SETUP +#line 566 "lexer.lxx" +{ + accept(); + return SWITCH; +} + YY_BREAK +case 64: +YY_RULE_SETUP +#line 570 "lexer.lxx" +{ + accept(); + return SWITCHCONDITION; +} + YY_BREAK +case 65: +YY_RULE_SETUP +#line 574 "lexer.lxx" +{ + accept(); + return TABLE; +} + YY_BREAK +case 66: +YY_RULE_SETUP +#line 578 "lexer.lxx" +{ + accept(); + return TABLE_V; +} + YY_BREAK +case 67: +YY_RULE_SETUP +#line 582 "lexer.lxx" +{ + accept(); + return TAG; +} + YY_BREAK +case 68: +YY_RULE_SETUP +#line 586 "lexer.lxx" +{ + accept(); + return TANGENT; +} + YY_BREAK +case 69: +YY_RULE_SETUP +#line 590 "lexer.lxx" +{ + accept(); + return TEXLIST; +} + YY_BREAK +case 70: +YY_RULE_SETUP +#line 594 "lexer.lxx" +{ + accept(); + return TEXTURE; +} + YY_BREAK +case 71: +YY_RULE_SETUP +#line 598 "lexer.lxx" +{ + accept(); + return TLENGTHS; +} + YY_BREAK +case 72: +YY_RULE_SETUP +#line 602 "lexer.lxx" +{ + accept(); + return TRANSFORM; +} + YY_BREAK +case 73: +YY_RULE_SETUP +#line 606 "lexer.lxx" +{ + accept(); + return TRANSLATE; +} + YY_BREAK +case 74: +YY_RULE_SETUP +#line 610 "lexer.lxx" +{ + accept(); + return TREF; +} + YY_BREAK +case 75: +YY_RULE_SETUP +#line 614 "lexer.lxx" +{ + accept(); + return TRIANGLEFAN; +} + YY_BREAK +case 76: +YY_RULE_SETUP +#line 618 "lexer.lxx" +{ + accept(); + return TRIANGLESTRIP; +} + YY_BREAK +case 77: +YY_RULE_SETUP +#line 622 "lexer.lxx" +{ + accept(); + return TRIM; +} + YY_BREAK +case 78: +YY_RULE_SETUP +#line 626 "lexer.lxx" +{ + accept(); + return TXT; +} + YY_BREAK +case 79: +YY_RULE_SETUP +#line 630 "lexer.lxx" +{ + accept(); + return UKNOTS; +} + YY_BREAK +case 80: +YY_RULE_SETUP +#line 634 "lexer.lxx" +{ + accept(); + return UKNOTS; +} + YY_BREAK +case 81: +YY_RULE_SETUP +#line 638 "lexer.lxx" +{ + accept(); + return UV; +} + YY_BREAK +case 82: +YY_RULE_SETUP +#line 642 "lexer.lxx" +{ + accept(); + return VKNOTS; +} + YY_BREAK +case 83: +YY_RULE_SETUP +#line 646 "lexer.lxx" +{ + accept(); + return VKNOTS; +} + YY_BREAK +case 84: +YY_RULE_SETUP +#line 650 "lexer.lxx" +{ + accept(); + return VERTEX; +} + YY_BREAK +case 85: +YY_RULE_SETUP +#line 654 "lexer.lxx" +{ + accept(); + return VERTEXANIM; +} + YY_BREAK +case 86: +YY_RULE_SETUP +#line 658 "lexer.lxx" +{ + accept(); + return VERTEXPOOL; +} + YY_BREAK +case 87: +YY_RULE_SETUP +#line 662 "lexer.lxx" +{ + accept(); + return VERTEXREF; +} + YY_BREAK +case 88: +YY_RULE_SETUP +#line 666 "lexer.lxx" +{ + accept(); + return XFMANIM; +} + YY_BREAK +case 89: +YY_RULE_SETUP +#line 670 "lexer.lxx" +{ + accept(); + return XFMSANIM; +} + YY_BREAK +case 90: +YY_RULE_SETUP +#line 677 "lexer.lxx" +{ + // An integer or floating-point number. + accept(); + eggyylval._number = atof(eggyytext); + eggyylval._string = yytext; + return NUMBER; +} + YY_BREAK +case 91: +YY_RULE_SETUP +#line 685 "lexer.lxx" +{ + // A hexadecimal integer number. + accept(); + eggyylval._ulong = strtoul(yytext+2, NULL, 16); + eggyylval._string = yytext; + return ULONG; +} + YY_BREAK +case 92: +YY_RULE_SETUP +#line 693 "lexer.lxx" +{ + // A binary integer number. + accept(); + eggyylval._ulong = strtoul(yytext+2, NULL, 2); + eggyylval._string = yytext; + return ULONG; +} + YY_BREAK +case 93: +YY_RULE_SETUP +#line 701 "lexer.lxx" +{ + // not-a-number. These sometimes show up in egg files accidentally. + accept(); + memset(&eggyylval._number, 0, sizeof(eggyylval._number)); + *(unsigned long *)&eggyylval._number = strtoul(yytext+3, NULL, 0); + eggyylval._string = yytext; + return NUMBER; +} + YY_BREAK +case 94: +YY_RULE_SETUP +#line 710 "lexer.lxx" +{ + // infinity. As above. + accept(); + eggyylval._number = HUGE_VAL; + eggyylval._string = yytext; + return NUMBER; +} + YY_BREAK +case 95: +YY_RULE_SETUP +#line 718 "lexer.lxx" +{ + // minus infinity. As above. + accept(); + eggyylval._number = -HUGE_VAL; + eggyylval._string = yytext; + return NUMBER; +} + YY_BREAK +case 96: +YY_RULE_SETUP +#line 727 "lexer.lxx" +{ + // Quoted string. + accept(); + eggyylval._string = scan_quoted_string(); + return STRING; +} + YY_BREAK +case 97: +YY_RULE_SETUP +#line 734 "lexer.lxx" +{ + // Unquoted string. + accept(); + eggyylval._string = yytext; + return STRING; +} + YY_BREAK +case 98: +YY_RULE_SETUP +#line 740 "lexer.lxx" +ECHO; + YY_BREAK +#line 2078 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 557 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 557 ) + 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 == 556); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef _WIN32 +#else +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 740 "lexer.lxx" diff --git a/panda/src/egg/parser.cxx.prebuilt b/panda/src/egg/parser.cxx.prebuilt index 6cfa7ce364..a4ad6645fe 100644 --- a/panda/src/egg/parser.cxx.prebuilt +++ b/panda/src/egg/parser.cxx.prebuilt @@ -1,104 +1,250 @@ -/* A Bison parser, made from parser.yxx - by GNU bison 1.35. */ +/* A Bison parser, made by GNU Bison 1.875b. */ -#define YYBISON 1 /* Identify Bison output. */ +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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 eggyyparse -#define yylex eggyylex +#define yylex eggyylex #define yyerror eggyyerror -#define yylval eggyylval -#define yychar eggyychar +#define yylval eggyylval +#define yychar eggyychar #define yydebug eggyydebug #define yynerrs eggyynerrs -# define NUMBER 257 -# define ULONG 258 -# define STRING 259 -# define BEZIERCURVE 260 -# define BFACE 261 -# define BILLBOARD 262 -# define BILLBOARDCENTER 263 -# define BINORMAL 264 -# define BUNDLE 265 -# define CLOSED 266 -# define COLLIDE 267 -# define COMMENT 268 -# define COMPONENT 269 -# define COORDSYSTEM 270 -# define CV 271 -# define DART 272 -# define DNORMAL 273 -# define DRGBA 274 -# define DUV 275 -# define DXYZ 276 -# define DCS 277 -# define DISTANCE 278 -# define DTREF 279 -# define DYNAMICVERTEXPOOL 280 -# define EXTERNAL_FILE 281 -# define FLIGHT 282 -# define GROUP 283 -# define HIP 284 -# define INTANGENT 285 -# define JOINT 286 -# define KNOTS 287 -# define INCLUDE 288 -# define INSTANCE 289 -# define LINE 290 -# define LOOP 291 -# define MATERIAL 292 -# define MATRIX3 293 -# define MATRIX4 294 -# define MODEL 295 -# define MREF 296 -# define NORMAL 297 -# define NURBSCURVE 298 -# define NURBSSURFACE 299 -# define OBJECTTYPE 300 -# define ORDER 301 -# define OUTTANGENT 302 -# define POINTLIGHT 303 -# define POLYGON 304 -# define REF 305 -# define RGBA 306 -# define ROTATE 307 -# define ROTX 308 -# define ROTY 309 -# define ROTZ 310 -# define SANIM 311 -# define SCALAR 312 -# define SCALE 313 -# define SEQUENCE 314 -# define SHADING 315 -# define SWITCH 316 -# define SWITCHCONDITION 317 -# define TABLE 318 -# define TABLE_V 319 -# define TAG 320 -# define TANGENT 321 -# define TEXLIST 322 -# define TEXTURE 323 -# define TLENGTHS 324 -# define TRANSFORM 325 -# define TRANSLATE 326 -# define TREF 327 -# define TRIANGLEFAN 328 -# define TRIANGLESTRIP 329 -# define TRIM 330 -# define TXT 331 -# define UKNOTS 332 -# define UV 333 -# define VKNOTS 334 -# define VERTEX 335 -# define VERTEXANIM 336 -# define VERTEXPOOL 337 -# define VERTEXREF 338 -# define XFMANIM 339 -# define XFMSANIM 340 -# define START_EGG 341 -# define START_GROUP_BODY 342 -# define START_TEXTURE_BODY 343 -# define START_PRIMITIVE_BODY 344 + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + NUMBER = 258, + ULONG = 259, + STRING = 260, + BEZIERCURVE = 261, + BFACE = 262, + BILLBOARD = 263, + BILLBOARDCENTER = 264, + BINORMAL = 265, + BUNDLE = 266, + CLOSED = 267, + COLLIDE = 268, + COMMENT = 269, + COMPONENT = 270, + COORDSYSTEM = 271, + CV = 272, + DART = 273, + DNORMAL = 274, + DRGBA = 275, + DUV = 276, + DXYZ = 277, + DCS = 278, + DISTANCE = 279, + DTREF = 280, + DYNAMICVERTEXPOOL = 281, + EXTERNAL_FILE = 282, + FLIGHT = 283, + GROUP = 284, + HIP = 285, + INTANGENT = 286, + JOINT = 287, + KNOTS = 288, + INCLUDE = 289, + INSTANCE = 290, + LINE = 291, + LOOP = 292, + MATERIAL = 293, + MATRIX3 = 294, + MATRIX4 = 295, + MODEL = 296, + MREF = 297, + NORMAL = 298, + NURBSCURVE = 299, + NURBSSURFACE = 300, + OBJECTTYPE = 301, + ORDER = 302, + OUTTANGENT = 303, + POINTLIGHT = 304, + POLYGON = 305, + REF = 306, + RGBA = 307, + ROTATE = 308, + ROTX = 309, + ROTY = 310, + ROTZ = 311, + SANIM = 312, + SCALAR = 313, + SCALE = 314, + SEQUENCE = 315, + SHADING = 316, + SWITCH = 317, + SWITCHCONDITION = 318, + TABLE = 319, + TABLE_V = 320, + TAG = 321, + TANGENT = 322, + TEXLIST = 323, + TEXTURE = 324, + TLENGTHS = 325, + TRANSFORM = 326, + TRANSLATE = 327, + TREF = 328, + TRIANGLEFAN = 329, + TRIANGLESTRIP = 330, + TRIM = 331, + TXT = 332, + UKNOTS = 333, + UV = 334, + VKNOTS = 335, + VERTEX = 336, + VERTEXANIM = 337, + VERTEXPOOL = 338, + VERTEXREF = 339, + XFMANIM = 340, + XFMSANIM = 341, + START_EGG = 342, + START_GROUP_BODY = 343, + START_TEXTURE_BODY = 344, + START_PRIMITIVE_BODY = 345 + }; +#endif +#define NUMBER 258 +#define ULONG 259 +#define STRING 260 +#define BEZIERCURVE 261 +#define BFACE 262 +#define BILLBOARD 263 +#define BILLBOARDCENTER 264 +#define BINORMAL 265 +#define BUNDLE 266 +#define CLOSED 267 +#define COLLIDE 268 +#define COMMENT 269 +#define COMPONENT 270 +#define COORDSYSTEM 271 +#define CV 272 +#define DART 273 +#define DNORMAL 274 +#define DRGBA 275 +#define DUV 276 +#define DXYZ 277 +#define DCS 278 +#define DISTANCE 279 +#define DTREF 280 +#define DYNAMICVERTEXPOOL 281 +#define EXTERNAL_FILE 282 +#define FLIGHT 283 +#define GROUP 284 +#define HIP 285 +#define INTANGENT 286 +#define JOINT 287 +#define KNOTS 288 +#define INCLUDE 289 +#define INSTANCE 290 +#define LINE 291 +#define LOOP 292 +#define MATERIAL 293 +#define MATRIX3 294 +#define MATRIX4 295 +#define MODEL 296 +#define MREF 297 +#define NORMAL 298 +#define NURBSCURVE 299 +#define NURBSSURFACE 300 +#define OBJECTTYPE 301 +#define ORDER 302 +#define OUTTANGENT 303 +#define POINTLIGHT 304 +#define POLYGON 305 +#define REF 306 +#define RGBA 307 +#define ROTATE 308 +#define ROTX 309 +#define ROTY 310 +#define ROTZ 311 +#define SANIM 312 +#define SCALAR 313 +#define SCALE 314 +#define SEQUENCE 315 +#define SHADING 316 +#define SWITCH 317 +#define SWITCHCONDITION 318 +#define TABLE 319 +#define TABLE_V 320 +#define TAG 321 +#define TANGENT 322 +#define TEXLIST 323 +#define TEXTURE 324 +#define TLENGTHS 325 +#define TRANSFORM 326 +#define TRANSLATE 327 +#define TREF 328 +#define TRIANGLEFAN 329 +#define TRIANGLESTRIP 330 +#define TRIM 331 +#define TXT 332 +#define UKNOTS 333 +#define UV 334 +#define VKNOTS 335 +#define VERTEX 336 +#define VERTEXANIM 337 +#define VERTEXPOOL 338 +#define VERTEXREF 339 +#define XFMANIM 340 +#define XFMSANIM 341 +#define START_EGG 342 +#define START_GROUP_BODY 343 +#define START_TEXTURE_BODY 344 +#define START_PRIMITIVE_BODY 345 + + + + +/* Copy the first part of user declarations. */ #line 6 "parser.yxx" @@ -237,865 +383,37 @@ egg_cleanup_parser() { materials.clear(); } + + +/* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif - - -#define YYFINAL 733 -#define YYFLAG -32768 -#define YYNTBASE 93 - -/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */ -#define YYTRANSLATE(x) ((unsigned)(x) <= 344 ? yytranslate[x] : 211) - -/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */ -static const char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 91, 2, 92, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 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, 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 -}; - -#if YYDEBUG -static const short yyprhs[] = -{ - 0, 0, 3, 6, 9, 12, 14, 17, 19, 21, - 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, - 43, 45, 47, 49, 51, 56, 62, 63, 71, 73, - 80, 83, 84, 91, 93, 100, 106, 113, 114, 121, - 123, 126, 127, 133, 134, 141, 143, 146, 150, 155, - 156, 164, 170, 176, 185, 194, 197, 205, 213, 221, - 229, 233, 242, 251, 256, 266, 276, 277, 284, 285, - 292, 293, 300, 302, 309, 315, 323, 331, 337, 343, - 349, 355, 361, 367, 373, 380, 386, 389, 392, 395, - 398, 400, 402, 405, 406, 412, 414, 417, 420, 423, - 426, 429, 432, 435, 442, 447, 452, 457, 465, 472, - 477, 482, 484, 501, 502, 508, 510, 513, 516, 519, - 522, 528, 533, 539, 544, 546, 556, 566, 568, 575, - 580, 592, 605, 606, 613, 614, 621, 622, 629, 630, - 637, 638, 645, 646, 653, 654, 661, 663, 669, 675, - 677, 678, 686, 692, 698, 704, 707, 713, 719, 725, - 732, 734, 740, 746, 752, 755, 761, 767, 773, 779, - 785, 791, 794, 800, 807, 809, 815, 821, 827, 830, - 836, 842, 848, 854, 860, 867, 869, 871, 873, 877, - 886, 895, 900, 910, 920, 922, 931, 934, 936, 938, - 940, 946, 948, 951, 953, 955, 956, 963, 964, 971, - 973, 976, 979, 982, 985, 988, 989, 996, 998, 1005, - 1011, 1012, 1019, 1021, 1028, 1034, 1035, 1042, 1044, 1051, - 1054, 1056, 1059, 1061, 1064, 1066, 1068, 1070, 1072, 1074, - 1076, 1078, 1080, 1082, 1084, 1086, 1088, 1090, 1092, 1094, - 1096, 1099, 1101, 1103, 1105, 1107, 1109, 1111, 1113 -}; -static const short yyrhs[] = -{ - 87, 94, 0, 88, 122, 0, 89, 100, 0, 90, - 163, 0, 210, 0, 94, 95, 0, 96, 0, 97, - 0, 98, 0, 101, 0, 104, 0, 105, 0, 116, - 0, 118, 0, 120, 0, 148, 0, 150, 0, 152, - 0, 154, 0, 156, 0, 158, 0, 160, 0, 181, - 0, 16, 91, 202, 92, 0, 14, 201, 91, 205, - 92, 0, 0, 69, 200, 91, 202, 99, 100, 92, - 0, 210, 0, 100, 58, 200, 91, 208, 92, 0, - 100, 136, 0, 0, 38, 200, 91, 102, 103, 92, - 0, 210, 0, 103, 58, 200, 91, 208, 92, 0, - 27, 201, 91, 202, 92, 0, 204, 27, 201, 91, - 202, 92, 0, 0, 83, 200, 106, 91, 107, 92, - 0, 210, 0, 107, 108, 0, 0, 81, 109, 91, - 111, 92, 0, 0, 81, 209, 110, 91, 111, 92, - 0, 207, 0, 207, 207, 0, 207, 207, 207, 0, - 207, 207, 207, 207, 0, 0, 111, 79, 201, 91, - 112, 113, 92, 0, 111, 43, 91, 114, 92, 0, - 111, 52, 91, 115, 92, 0, 111, 22, 204, 91, - 207, 207, 207, 92, 0, 111, 22, 91, 204, 207, - 207, 207, 92, 0, 207, 207, 0, 113, 67, 91, - 207, 207, 207, 92, 0, 113, 10, 91, 207, 207, - 207, 92, 0, 113, 21, 204, 91, 207, 207, 92, - 0, 113, 21, 91, 204, 207, 207, 92, 0, 207, - 207, 207, 0, 114, 19, 204, 91, 207, 207, 207, - 92, 0, 114, 19, 91, 204, 207, 207, 207, 92, - 0, 207, 207, 207, 207, 0, 115, 20, 204, 91, - 207, 207, 207, 207, 92, 0, 115, 20, 91, 204, - 207, 207, 207, 207, 92, 0, 0, 29, 201, 117, - 91, 122, 92, 0, 0, 32, 201, 119, 91, 122, - 92, 0, 0, 35, 201, 121, 91, 122, 92, 0, - 210, 0, 122, 58, 200, 91, 208, 92, 0, 122, - 8, 91, 204, 92, 0, 122, 9, 91, 207, 207, - 207, 92, 0, 122, 13, 201, 91, 123, 124, 92, - 0, 122, 23, 91, 209, 92, 0, 122, 23, 91, - 5, 92, 0, 122, 18, 91, 209, 92, 0, 122, - 18, 91, 5, 92, 0, 122, 62, 91, 209, 92, - 0, 122, 46, 91, 202, 92, 0, 122, 41, 91, - 209, 92, 0, 122, 66, 201, 91, 205, 92, 0, - 122, 68, 91, 209, 92, 0, 122, 125, 0, 122, - 144, 0, 122, 146, 0, 122, 95, 0, 204, 0, - 210, 0, 124, 204, 0, 0, 71, 126, 91, 127, - 92, 0, 210, 0, 127, 128, 0, 127, 129, 0, - 127, 130, 0, 127, 131, 0, 127, 132, 0, 127, - 133, 0, 127, 134, 0, 72, 91, 207, 207, 207, - 92, 0, 54, 91, 207, 92, 0, 55, 91, 207, - 92, 0, 56, 91, 207, 92, 0, 53, 91, 207, - 207, 207, 207, 92, 0, 59, 91, 207, 207, 207, - 92, 0, 59, 91, 207, 92, 0, 40, 91, 135, - 92, 0, 210, 0, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 0, 0, 71, 137, 91, 138, 92, 0, 210, 0, - 138, 142, 0, 138, 139, 0, 138, 140, 0, 138, - 141, 0, 72, 91, 207, 207, 92, 0, 53, 91, - 207, 92, 0, 59, 91, 207, 207, 92, 0, 39, - 91, 143, 92, 0, 210, 0, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 0, 84, 91, 195, 145, - 51, 91, 199, 92, 92, 0, 210, 0, 145, 58, - 200, 91, 208, 92, 0, 63, 91, 147, 92, 0, - 24, 91, 207, 207, 81, 91, 207, 207, 207, 92, - 92, 0, 24, 91, 207, 207, 207, 81, 91, 207, - 207, 207, 92, 92, 0, 0, 50, 201, 149, 91, - 163, 92, 0, 0, 74, 201, 151, 91, 163, 92, - 0, 0, 75, 201, 153, 91, 163, 92, 0, 0, - 49, 201, 155, 91, 163, 92, 0, 0, 36, 201, - 157, 91, 163, 92, 0, 0, 45, 201, 159, 91, - 165, 92, 0, 0, 44, 201, 161, 91, 166, 92, - 0, 210, 0, 162, 43, 91, 170, 92, 0, 162, - 52, 91, 171, 92, 0, 210, 0, 0, 163, 15, - 209, 91, 164, 162, 92, 0, 163, 73, 91, 167, - 92, 0, 163, 69, 91, 168, 92, 0, 163, 42, - 91, 169, 92, 0, 163, 173, 0, 163, 43, 91, - 170, 92, 0, 163, 52, 91, 171, 92, 0, 163, - 7, 91, 172, 92, 0, 163, 58, 200, 91, 208, - 92, 0, 210, 0, 165, 73, 91, 167, 92, 0, - 165, 69, 91, 168, 92, 0, 165, 42, 91, 169, - 92, 0, 165, 173, 0, 165, 43, 91, 170, 92, - 0, 165, 52, 91, 171, 92, 0, 165, 7, 91, - 172, 92, 0, 165, 47, 91, 174, 92, 0, 165, - 78, 91, 175, 92, 0, 165, 80, 91, 176, 92, - 0, 165, 160, 0, 165, 76, 91, 177, 92, 0, - 165, 58, 200, 91, 208, 92, 0, 210, 0, 166, - 73, 91, 167, 92, 0, 166, 69, 91, 168, 92, - 0, 166, 42, 91, 169, 92, 0, 166, 173, 0, - 166, 43, 91, 170, 92, 0, 166, 52, 91, 171, - 92, 0, 166, 7, 91, 172, 92, 0, 166, 47, - 91, 179, 92, 0, 166, 33, 91, 180, 92, 0, - 166, 58, 200, 91, 208, 92, 0, 197, 0, 200, - 0, 198, 0, 207, 207, 207, 0, 170, 19, 204, - 91, 207, 207, 207, 92, 0, 170, 19, 91, 204, - 207, 207, 207, 92, 0, 207, 207, 207, 207, 0, - 171, 20, 204, 91, 207, 207, 207, 207, 92, 0, - 171, 20, 91, 204, 207, 207, 207, 207, 92, 0, - 209, 0, 84, 91, 195, 51, 91, 199, 92, 92, - 0, 209, 209, 0, 196, 0, 196, 0, 210, 0, - 177, 37, 91, 178, 92, 0, 210, 0, 178, 160, - 0, 209, 0, 196, 0, 0, 64, 201, 182, 91, - 185, 92, 0, 0, 11, 201, 184, 91, 185, 92, - 0, 210, 0, 185, 181, 0, 185, 183, 0, 185, - 186, 0, 185, 189, 0, 185, 192, 0, 0, 57, - 201, 187, 91, 188, 92, 0, 210, 0, 188, 58, - 200, 91, 208, 92, 0, 188, 65, 91, 196, 92, - 0, 0, 85, 201, 190, 91, 191, 92, 0, 210, - 0, 191, 58, 200, 91, 208, 92, 0, 191, 65, - 91, 196, 92, 0, 0, 86, 201, 193, 91, 194, - 92, 0, 210, 0, 194, 58, 200, 91, 208, 92, - 0, 194, 186, 0, 210, 0, 195, 209, 0, 210, - 0, 196, 207, 0, 200, 0, 200, 0, 200, 0, - 210, 0, 204, 0, 203, 0, 210, 0, 204, 0, - 210, 0, 204, 0, 3, 0, 4, 0, 5, 0, - 210, 0, 206, 0, 204, 0, 206, 204, 0, 3, - 0, 4, 0, 3, 0, 4, 0, 5, 0, 3, - 0, 4, 0, 0 -}; - +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 #endif -#if YYDEBUG -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const short yyrline[] = -{ - 0, 215, 217, 218, 219, 229, 231, 246, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 273, 296, 310, 310, 338, 340, - 622, 632, 632, 659, 661, 755, 763, 782, 782, 822, - 824, 834, 834, 846, 846, 891, 896, 900, 904, 908, - 908, 923, 924, 925, 933, 951, 956, 964, 972, 980, - 997, 1002, 1010, 1027, 1032, 1040, 1057, 1057, 1077, 1077, - 1098, 1098, 1119, 1121, 1251, 1263, 1268, 1275, 1281, 1294, - 1301, 1314, 1320, 1326, 1332, 1337, 1343, 1344, 1345, 1346, - 1359, 1389, 1391, 1412, 1412, 1428, 1430, 1431, 1432, 1433, - 1434, 1435, 1436, 1439, 1445, 1451, 1457, 1463, 1469, 1473, - 1479, 1483, 1485, 1506, 1506, 1525, 1527, 1528, 1529, 1530, - 1533, 1539, 1545, 1551, 1554, 1556, 1574, 1607, 1612, 1636, - 1648, 1654, 1670, 1670, 1689, 1689, 1708, 1708, 1727, 1727, - 1746, 1746, 1765, 1765, 1784, 1784, 1804, 1806, 1807, 1817, - 1819, 1819, 1840, 1841, 1842, 1843, 1844, 1845, 1846, 1847, - 1919, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, - 1930, 1931, 1937, 1938, 2001, 2003, 2004, 2005, 2006, 2007, - 2008, 2009, 2010, 2011, 2012, 2080, 2097, 2137, 2154, 2159, - 2167, 2184, 2189, 2197, 2214, 2230, 2261, 2279, 2299, 2319, - 2325, 2335, 2342, 2360, 2376, 2397, 2397, 2419, 2419, 2441, - 2443, 2447, 2451, 2455, 2459, 2473, 2473, 2494, 2496, 2508, - 2521, 2521, 2542, 2544, 2561, 2574, 2574, 2595, 2597, 2612, - 2626, 2631, 2644, 2649, 2662, 2683, 2704, 2730, 2736, 2747, - 2759, 2765, 2775, 2780, 2793, 2798, 2802, 2814, 2819, 2834, - 2839, 2852, 2854, 2868, 2875, 2881, 2897, 2906, 2912 -}; +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 #endif -#if (YYDEBUG) || defined YYERROR_VERBOSE -/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */ -static const char *const yytname[] = -{ - "$", "error", "$undefined.", "NUMBER", "ULONG", "STRING", "BEZIERCURVE", - "BFACE", "BILLBOARD", "BILLBOARDCENTER", "BINORMAL", "BUNDLE", "CLOSED", - "COLLIDE", "COMMENT", "COMPONENT", "COORDSYSTEM", "CV", "DART", - "DNORMAL", "DRGBA", "DUV", "DXYZ", "DCS", "DISTANCE", "DTREF", - "DYNAMICVERTEXPOOL", "EXTERNAL_FILE", "FLIGHT", "GROUP", "HIP", - "INTANGENT", "JOINT", "KNOTS", "INCLUDE", "INSTANCE", "LINE", "LOOP", - "MATERIAL", "MATRIX3", "MATRIX4", "MODEL", "MREF", "NORMAL", - "NURBSCURVE", "NURBSSURFACE", "OBJECTTYPE", "ORDER", "OUTTANGENT", - "POINTLIGHT", "POLYGON", "REF", "RGBA", "ROTATE", "ROTX", "ROTY", - "ROTZ", "SANIM", "SCALAR", "SCALE", "SEQUENCE", "SHADING", "SWITCH", - "SWITCHCONDITION", "TABLE", "TABLE_V", "TAG", "TANGENT", "TEXLIST", - "TEXTURE", "TLENGTHS", "TRANSFORM", "TRANSLATE", "TREF", "TRIANGLEFAN", - "TRIANGLESTRIP", "TRIM", "TXT", "UKNOTS", "UV", "VKNOTS", "VERTEX", - "VERTEXANIM", "VERTEXPOOL", "VERTEXREF", "XFMANIM", "XFMSANIM", - "START_EGG", "START_GROUP_BODY", "START_TEXTURE_BODY", - "START_PRIMITIVE_BODY", "'{'", "'}'", "grammar", "egg", "node", - "coordsystem", "comment", "texture", "@1", "texture_body", "material", - "@2", "material_body", "external_reference", "vertex_pool", "@3", - "vertex_pool_body", "vertex", "@4", "@5", "vertex_body", "@6", - "vertex_uv_body", "vertex_normal_body", "vertex_color_body", "group", - "@7", "joint", "@8", "instance", "@9", "group_body", "cs_type", - "collide_flags", "transform_3d", "@10", "transform_3d_body", - "translate_3d", "rotx_3d", "roty_3d", "rotz_3d", "rotate_3d", - "scale_3d", "matrix4_3d", "matrix4_3d_body", "transform_2d", "@11", - "transform_2d_body", "translate_2d", "rotate_2d", "scale_2d", - "matrix3_2d", "matrix3_2d_body", "group_vertex_ref", - "group_vertex_membership", "switchcondition", "switchcondition_body", - "polygon", "@12", "trianglefan", "@13", "trianglestrip", "@14", - "point_light", "@15", "line", "@16", "nurbs_surface", "@17", - "nurbs_curve", "@18", "primitive_component_body", "primitive_body", - "@19", "nurbs_surface_body", "nurbs_curve_body", "primitive_tref_body", - "primitive_texture_body", "primitive_material_body", - "primitive_normal_body", "primitive_color_body", "primitive_bface_body", - "primitive_vertex_ref", "nurbs_surface_order_body", - "nurbs_surface_uknots_body", "nurbs_surface_vknots_body", - "nurbs_surface_trim_body", "nurbs_surface_trim_loop_body", - "nurbs_curve_order_body", "nurbs_curve_knots_body", "table", "@20", - "bundle", "@21", "table_body", "sanim", "@22", "sanim_body", "xfmanim", - "@23", "xfmanim_body", "xfm_s_anim", "@24", "xfm_s_anim_body", - "integer_list", "real_list", "texture_name", "material_name", - "vertex_pool_name", "required_name", "optional_name", "required_string", - "optional_string", "string", "repeated_string", "repeated_string_body", - "real", "real_or_string", "integer", "empty", 0 -}; -#endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const short yyr1[] = -{ - 0, 93, 93, 93, 93, 94, 94, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 96, 97, 99, 98, 100, 100, - 100, 102, 101, 103, 103, 104, 104, 106, 105, 107, - 107, 109, 108, 110, 108, 111, 111, 111, 111, 112, - 111, 111, 111, 111, 111, 113, 113, 113, 113, 113, - 114, 114, 114, 115, 115, 115, 117, 116, 119, 118, - 121, 120, 122, 122, 122, 122, 122, 122, 122, 122, - 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, - 123, 124, 124, 126, 125, 127, 127, 127, 127, 127, - 127, 127, 127, 128, 129, 130, 131, 132, 133, 133, - 134, 135, 135, 137, 136, 138, 138, 138, 138, 138, - 139, 140, 141, 142, 143, 143, 144, 145, 145, 146, - 147, 147, 149, 148, 151, 150, 153, 152, 155, 154, - 157, 156, 159, 158, 161, 160, 162, 162, 162, 163, - 164, 163, 163, 163, 163, 163, 163, 163, 163, 163, - 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, - 166, 166, 166, 166, 166, 167, 168, 169, 170, 170, - 170, 171, 171, 171, 172, 173, 174, 175, 176, 177, - 177, 178, 178, 179, 180, 182, 181, 184, 183, 185, - 185, 185, 185, 185, 185, 187, 186, 188, 188, 188, - 190, 189, 191, 191, 191, 193, 192, 194, 194, 194, - 195, 195, 196, 196, 197, 198, 199, 200, 200, 201, - 202, 202, 203, 203, 204, 204, 204, 205, 205, 206, - 206, 207, 207, 208, 208, 208, 209, 209, 210 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const short yyr2[] = -{ - 0, 2, 2, 2, 2, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 4, 5, 0, 7, 1, 6, - 2, 0, 6, 1, 6, 5, 6, 0, 6, 1, - 2, 0, 5, 0, 6, 1, 2, 3, 4, 0, - 7, 5, 5, 8, 8, 2, 7, 7, 7, 7, - 3, 8, 8, 4, 9, 9, 0, 6, 0, 6, - 0, 6, 1, 6, 5, 7, 7, 5, 5, 5, - 5, 5, 5, 5, 6, 5, 2, 2, 2, 2, - 1, 1, 2, 0, 5, 1, 2, 2, 2, 2, - 2, 2, 2, 6, 4, 4, 4, 7, 6, 4, - 4, 1, 16, 0, 5, 1, 2, 2, 2, 2, - 5, 4, 5, 4, 1, 9, 9, 1, 6, 4, - 11, 12, 0, 6, 0, 6, 0, 6, 0, 6, - 0, 6, 0, 6, 0, 6, 1, 5, 5, 1, - 0, 7, 5, 5, 5, 2, 5, 5, 5, 6, - 1, 5, 5, 5, 2, 5, 5, 5, 5, 5, - 5, 2, 5, 6, 1, 5, 5, 5, 2, 5, - 5, 5, 5, 5, 6, 1, 1, 1, 3, 8, - 8, 4, 9, 9, 1, 8, 2, 1, 1, 1, - 5, 1, 2, 1, 1, 0, 6, 0, 6, 1, - 2, 2, 2, 2, 2, 0, 6, 1, 6, 5, - 0, 6, 1, 6, 5, 0, 6, 1, 6, 2, - 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 0 -}; - -/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ -static const short yydefact[] = -{ - 0, 258, 258, 258, 258, 1, 5, 2, 72, 3, - 28, 4, 149, 244, 245, 246, 258, 0, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 0, 0, 0, 258, 0, 0, 0, 0, 258, - 0, 0, 258, 0, 93, 0, 89, 86, 87, 88, - 258, 113, 30, 0, 0, 0, 0, 0, 258, 0, - 0, 0, 155, 0, 239, 243, 242, 258, 0, 66, - 68, 70, 140, 0, 238, 237, 144, 142, 138, 132, - 205, 0, 134, 136, 37, 258, 0, 0, 0, 0, - 0, 0, 258, 0, 0, 0, 0, 0, 0, 258, - 0, 0, 0, 256, 257, 0, 258, 0, 0, 0, - 258, 258, 258, 258, 0, 241, 240, 258, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 0, 258, 0, - 0, 0, 0, 0, 251, 252, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 258, 0, - 258, 258, 230, 0, 258, 0, 194, 150, 0, 187, - 235, 0, 0, 0, 0, 0, 0, 186, 0, 185, - 234, 0, 249, 0, 248, 247, 24, 0, 258, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 26, 258, - 258, 258, 258, 74, 0, 258, 90, 80, 79, 78, - 77, 83, 82, 253, 254, 255, 0, 81, 0, 129, - 0, 85, 0, 95, 0, 231, 127, 0, 0, 115, - 158, 258, 154, 0, 156, 0, 0, 157, 0, 0, - 153, 152, 0, 25, 250, 35, 0, 0, 0, 0, - 0, 33, 0, 174, 0, 160, 0, 0, 0, 209, - 258, 0, 0, 0, 39, 0, 0, 0, 91, 73, - 0, 84, 0, 0, 0, 0, 0, 0, 0, 94, - 96, 97, 98, 99, 100, 101, 102, 0, 258, 29, - 0, 0, 0, 0, 114, 117, 118, 119, 116, 0, - 146, 0, 0, 188, 0, 0, 0, 159, 258, 67, - 69, 71, 141, 258, 32, 0, 0, 0, 0, 0, - 0, 258, 0, 0, 145, 178, 0, 0, 0, 0, - 0, 258, 0, 0, 0, 0, 0, 143, 171, 164, - 139, 133, 258, 258, 258, 258, 206, 210, 211, 212, - 213, 214, 0, 135, 137, 41, 38, 40, 36, 75, - 76, 92, 0, 258, 0, 0, 0, 0, 0, 0, - 258, 0, 258, 0, 0, 0, 0, 0, 151, 0, - 0, 0, 0, 191, 0, 236, 0, 0, 258, 258, - 0, 0, 0, 0, 258, 258, 0, 258, 0, 0, - 0, 0, 258, 258, 258, 258, 258, 207, 215, 220, - 225, 27, 0, 43, 0, 0, 0, 0, 111, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 204, 232, 0, 0, 0, 203, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 199, 0, 197, 0, 198, 0, 0, - 0, 0, 0, 0, 0, 0, 110, 0, 0, 104, - 105, 106, 109, 0, 0, 0, 0, 123, 0, 121, - 0, 0, 0, 0, 0, 0, 0, 0, 195, 0, - 181, 183, 233, 177, 179, 182, 180, 0, 176, 175, - 167, 163, 165, 168, 196, 166, 0, 162, 161, 0, - 172, 169, 170, 258, 258, 258, 258, 0, 45, 0, - 0, 0, 0, 0, 0, 0, 126, 128, 0, 122, - 120, 147, 148, 0, 0, 0, 0, 34, 184, 173, - 258, 0, 0, 217, 0, 222, 0, 227, 0, 0, - 0, 258, 42, 46, 0, 0, 0, 0, 0, 108, - 103, 0, 190, 189, 0, 0, 0, 201, 208, 258, - 0, 216, 258, 0, 221, 258, 226, 229, 0, 0, - 0, 0, 0, 47, 44, 0, 0, 0, 107, 0, - 193, 192, 200, 202, 0, 258, 0, 258, 0, 0, - 0, 0, 0, 0, 0, 49, 48, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, - 0, 0, 52, 0, 0, 130, 0, 0, 0, 0, - 219, 0, 224, 0, 0, 0, 0, 0, 60, 0, - 0, 0, 0, 0, 131, 0, 0, 218, 223, 228, - 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, - 50, 55, 0, 125, 54, 53, 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, 62, 61, 0, 0, 0, 0, 0, - 0, 0, 65, 64, 57, 59, 58, 56, 0, 0, - 112, 0, 0, 0 -}; - -static const short yydefgoto[] = -{ - 731, 5, 66, 34, 35, 36, 270, 9, 37, 202, - 260, 38, 39, 151, 273, 367, 422, 483, 537, 644, - 662, 621, 623, 40, 138, 41, 139, 42, 140, 7, - 215, 277, 67, 118, 232, 290, 291, 292, 293, 294, - 295, 296, 426, 72, 121, 238, 305, 306, 307, 308, - 437, 68, 234, 69, 167, 43, 146, 44, 149, 45, - 150, 46, 145, 47, 141, 48, 144, 49, 143, 309, - 11, 241, 264, 262, 188, 186, 178, 181, 183, 175, - 82, 466, 474, 476, 472, 586, 457, 452, 50, 147, - 358, 478, 268, 359, 479, 562, 360, 480, 564, 361, - 481, 566, 171, 453, 189, 179, 394, 180, 83, 134, - 84, 94, 193, 194, 512, 226, 176, 95 -}; - -static const short yypact[] = -{ - 252,-32768,-32768,-32768,-32768, 1028,-32768, 1150,-32768, 132, - -32768, 221,-32768,-32768,-32768,-32768, 317, -79, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768, 92, 51, 104, 317, 129, 134, 141, 148, 317, - 149, 163, 317, 165,-32768, 169,-32768,-32768,-32768,-32768, - 317,-32768,-32768, 174, 119, 177, 179, 183, 317, 184, - 190, 193,-32768, 200,-32768,-32768,-32768, 317, 204,-32768, - -32768,-32768,-32768, 206,-32768,-32768,-32768,-32768,-32768,-32768, - -32768, 207,-32768,-32768,-32768, 317, 317, 196, 209, 349, - 362, 119, 317, 210, 119, 102, 213, 119, 216,-32768, - 217, 225, 119,-32768,-32768, 226, 317, 196, 196, 237, - 317, 317,-32768, 317, 41,-32768,-32768, 317, 238, 241, - 245, 253,-32768, 264, 266, 267, 269, 280, 317, 292, - 298, 299, 309, 44,-32768,-32768, 196, 317, 62, 91, - 153, 197, 218, 232, 365, 251, 310, 313, 317, 314, - -32768, 119,-32768, 365,-32768, 315,-32768,-32768, 316,-32768, - -32768, -9, 196, 21, 196, 365, 319,-32768, 321,-32768, - -32768, 146,-32768, 323, 317,-32768,-32768, 326,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 317,-32768, 196,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 329,-32768, 196,-32768, - 331,-32768, 420,-32768, 66,-32768,-32768, 333, 227,-32768, - -32768,-32768,-32768, 49,-32768, 196, 65,-32768, 196, 334, - -32768,-32768, 318,-32768,-32768,-32768, 748, 929, 1077, 219, - 0,-32768, 175,-32768, 118,-32768, 330, 409, 87,-32768, - -32768, 462, 819, 35,-32768, 338, 340, 4,-32768,-32768, - 196,-32768, 342, 343, 346, 347, 348, 350, 351,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 363, 317,-32768, - 364, 366, 367, 368,-32768,-32768,-32768,-32768,-32768, 63, - -32768, 317, 371,-32768, 317, 372, 196,-32768, 317,-32768, - -32768,-32768,-32768, 317,-32768, 374, 379, 380, 381, 389, - 390, 317, 392, 394,-32768,-32768, 396, 397, 400, 403, - 406, 317, 407, 408, 411, 412, 419,-32768,-32768,-32768, - -32768,-32768, 317, 317, 317, 317,-32768,-32768,-32768,-32768, - -32768,-32768, 117,-32768,-32768, 119,-32768,-32768,-32768,-32768, - -32768,-32768, 99, 196, 196, 196, 196, 196, 196, 196, - 317, 422, 196, 196, 196, 196, 424, 425,-32768, 196, - 196, 196, 196,-32768, 361,-32768, 426, 119,-32768, 317, - 196, 119, 196, 427, 317, 317, 119, 317, 196, 119, - 196, 428, 317, 317,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 430,-32768, 431, 97, 432, 196,-32768, 196, - 433, 434, 435, 39, 196, 436, 365, 437, 196,-32768, - 438, 196, 196, 196, 196, 196, 196, 196, 196, 440, - 365, 441, 442, 196,-32768, 444, 13, 445,-32768, 55, - 365, 446, 447, 455, 456, 43, 457, 119, 74, 365, - 459, 460, 19,-32768, 461, 196, 463, 196, 465, 468, - 469, 470, 196, 471, 196, 473,-32768, 196, 196,-32768, - -32768,-32768,-32768, 196, 196, 475, 476,-32768, 196,-32768, - 477, 478, 46, 77, 196, 196, 196, 196,-32768, 479, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 480,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768, 481,-32768,-32768, 474, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, 233, 196, 196, - 196, 196, 196, 196, 482, 484,-32768,-32768, 196,-32768, - -32768,-32768,-32768, 489, 490, 196, 196,-32768,-32768,-32768, - -32768, 157, 127,-32768, 166,-32768, 154,-32768, 73, 493, - 494, 317,-32768, 196, 235, 196, 196, 196, 495,-32768, - -32768, 196,-32768,-32768, 496, 497, 28,-32768,-32768, 317, - 499,-32768, 317, 500,-32768, 317,-32768,-32768, 317, 501, - 196, 196, 503, 196,-32768, 504, 196, 196,-32768, 196, - -32768,-32768,-32768,-32768, 506,-32768, 507,-32768, 508, 196, - 196, 89, 196, 79, 196,-32768,-32768, 509, 514, 196, - 196, 365, 42, 365, 47, 365, 196, 196, 76,-32768, - 196, 83,-32768, 196, 196,-32768, 520, 196, 196, 521, - -32768, 522,-32768, 523, 196, 196, 317, 525,-32768, 317, - 526, 196, 45, 196,-32768, 196, 196,-32768,-32768,-32768, - 527, 528, 196, 196, 196, 196,-32768, 532, 86, 534, - -32768,-32768, 196,-32768,-32768,-32768, 196, 196, 196, 196, - 196, 317, 536, 196, 196, 196, 196, 196, 196, 196, - 196, 196, 196, 196, 537, 538, 196, 196, 196, 196, - 196, 196, 196,-32768,-32768, 542, 543, 545, 548, 549, - 551, 196,-32768,-32768,-32768,-32768,-32768,-32768, 196, 196, - -32768, 511, 586,-32768 -}; - -static const short yypgoto[] = -{ - -32768,-32768, 451,-32768,-32768,-32768,-32768, 325,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -16,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 198, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768,-32768,-32768,-32768,-32768,-32768, -263,-32768,-32768, - 125,-32768,-32768,-32768, -200, -189, -170, -290, -209, -302, - -105,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -265,-32768, - -32768,-32768, 67, 52,-32768,-32768,-32768,-32768,-32768,-32768, - -32768,-32768, 512, -411,-32768,-32768, 248, 15, 9, -64, - -32768, -5, 485,-32768, 2, -167, -50, 716 -}; +/* Copy the second part of user declarations. */ -#define YYLAST 1333 +/* Line 214 of yacc.c. */ +#line 415 "y.tab.c" - -static const short yytable[] = -{ - 51, 348, 51, 357, 475, 477, 237, 13, 14, 15, - 243, 85, 87, 85, 85, 85, 85, 85, 249, 85, - 85, 85, 85, 85, 125, 85, 85, 88, 89, 90, - 91, 92, 243, 96, 97, 98, 99, 100, 93, 102, - 103, 246, 154, 155, 101, 154, 155, 104, 163, 85, - 154, 155, 13, 14, 15, 677, 529, 85, 323, 159, - 161, 162, 243, 108, 165, 243, 678, 169, 13, 14, - 15, 116, 24, 197, 113, 246, 13, 14, 15, 13, - 14, 15, 135, 244, 208, 120, 13, 14, 15, 13, - 14, 15, 324, 129, 246, 451, 370, 246, 352, 641, - 85, 153, 154, 155, 463, 514, 386, 135, 638, 156, - 456, 530, 679, 247, 152, 387, 365, 297, 465, 105, - 612, 235, 123, 124, 298, 336, 166, 366, 192, 182, - 184, 492, 135, 196, 650, 522, 213, 680, 551, 652, - 311, 235, 106, 135, 353, 187, 190, 516, 275, 123, - 124, 28, 216, 502, 217, 388, 314, 335, 214, 349, - 337, 338, 24, 192, 598, 339, 525, 656, 352, 552, - 340, 642, 354, 355, 659, 70, 341, 691, 485, 356, - 424, 639, 325, 218, 245, 589, 248, 342, 71, 254, - 70, 343, 590, 459, 344, 107, 345, 252, 346, 154, - 155, 468, 81, 71, 632, 462, 634, 135, 326, 421, - 347, 353, 595, 471, 353, 461, 276, 327, 328, 591, - 109, 28, 329, 470, 592, 110, 73, 330, 73, 455, - 280, 593, 111, 331, 74, 503, 74, 464, 312, 112, - 114, 315, 354, 355, 332, 219, 596, 313, 333, 588, - 316, 51, 51, 51, 115, 568, 117, 568, 594, 81, - 119, 75, 76, 75, 76, 122, 300, 334, 126, 496, - 127, 77, 371, 77, 128, 130, 569, 78, 569, 78, - 301, 131, 372, 509, 132, 570, 302, 570, 79, 220, - 79, 133, 80, 517, 80, 137, 357, 142, 148, 303, - 157, 164, 526, 81, 168, 81, 389, 170, 173, 391, - 221, 322, 571, 381, 571, 423, 174, 177, 393, 304, - 13, 14, 15, 613, 222, 572, 259, 604, 185, 198, - 266, 267, 199, 395, 271, 272, 200, 73, 396, 1, - 2, 3, 4, 227, 201, 74, 403, 85, 85, 85, - 85, 458, 123, 124, 158, 203, 411, 204, 205, 467, - 206, 417, 418, 419, 420, 123, 124, 160, 223, 224, - 225, 207, 75, 76, 425, 427, 429, 430, 431, 432, - 433, 434, 77, 209, 438, 440, 441, 442, 78, 210, - 211, 445, 446, 447, 448, 395, 256, 257, 258, 79, - 212, 228, 182, 80, 184, 229, 231, 240, 242, 318, - 182, 250, 184, 251, 81, 253, 73, 524, 255, 187, - 190, 279, 350, 281, 74, 299, 317, 187, 190, 487, - 368, 488, 369, 373, 374, 493, 494, 375, 376, 377, - 498, 378, 379, 500, 501, 182, 184, 504, 505, 506, - 507, 75, 76, 449, 380, 382, 33, 383, 384, 385, - 282, 77, 390, 392, 649, 397, 651, 78, 653, 73, - 398, 399, 400, 283, 284, 285, 286, 74, 79, 287, - 401, 402, 80, 404, 538, 405, 540, 406, 407, 542, - 543, 408, 288, 81, 409, 544, 545, 410, 412, 413, - 548, 351, 414, 415, 75, 76, 553, 554, 555, 556, - 416, 732, 289, 436, 77, 443, 444, 450, 460, 469, - 78, 482, 484, 574, 486, 489, 490, 491, 495, 497, - 499, 79, 508, 510, 511, 80, 513, 515, 518, 519, - 573, 538, 575, 576, 577, 578, 81, 520, 521, 523, - 581, 527, 528, 531, 363, 532, 533, 584, 585, 534, - 535, 536, 539, 599, 541, 560, 85, 546, 547, 549, - 550, 557, 558, 559, 579, 603, 580, 605, 606, 607, - 602, 582, 583, 609, 600, 601, 733, 608, 610, 611, - 615, 617, 620, 619, 625, 362, 627, 631, 633, 635, - 561, 645, 622, 624, 614, 626, 646, 616, 628, 629, - 618, 630, 664, 667, 668, 669, 673, 675, 597, 684, - 685, 636, 637, 690, 640, 693, 643, 701, 435, 713, - 714, 647, 648, 657, 722, 723, 660, 724, 654, 655, - 725, 726, 658, 727, 191, 661, 663, 0, 0, 665, - 666, 672, 0, 230, 674, 0, 670, 671, 0, 0, - 0, 0, 0, 676, 0, 681, 0, 682, 683, 0, - 0, 0, 0, 692, 686, 687, 688, 689, 0, 0, - 0, 0, 0, 0, 694, 0, 700, 0, 695, 696, - 697, 698, 699, 0, 0, 702, 703, 704, 705, 706, - 707, 708, 709, 710, 711, 712, 0, 0, 715, 716, - 717, 718, 719, 720, 721, 0, 0, 6, 8, 10, - 12, 0, 0, 728, 0, 0, 0, 0, 0, 0, - 729, 730, 86, 0, 86, 86, 86, 86, 86, 0, - 86, 86, 86, 86, 86, 0, 86, 86, 0, 0, - 0, 13, 14, 15, 0, 0, 52, 53, 0, 0, - 0, 54, 16, 0, 17, 0, 55, 0, 0, 0, - 86, 56, 0, 0, 0, 18, 0, 19, 86, 0, - 20, 0, 0, 21, 22, 0, 23, 0, 0, 57, - 0, 0, 24, 25, 58, 0, 0, 26, 27, 0, - 0, 0, 0, 136, 0, 0, 59, 0, 0, 0, - 60, 61, 28, 0, 62, 0, 63, 29, 0, 64, - 0, 86, 30, 31, 0, 0, 73, 0, 136, 0, - 0, 32, 65, 0, 74, 172, 0, 0, 0, 0, - 319, 0, 0, 0, 0, 0, 0, 0, 172, 195, - 0, 0, 0, 136, 0, 0, 0, 0, 0, 0, - 0, 75, 76, 0, 136, 0, 0, 0, 0, 0, - 0, 77, 0, 0, 0, 0, 0, 78, 0, 0, - 0, 0, 0, 0, 195, 0, 233, 236, 79, 0, - 239, 0, 80, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, - 0, 364, 0, 0, 8, 8, 8, 12, 261, 263, - 265, 12, 12, 269, 0, 12, 12, 274, 136, 0, - 0, 278, 13, 14, 15, 0, 0, 52, 53, 0, - 0, 0, 54, 16, 0, 17, 0, 55, 0, 0, - 0, 0, 56, 0, 0, 0, 18, 310, 19, 0, - 0, 20, 0, 0, 21, 22, 0, 23, 0, 0, - 57, 0, 0, 24, 25, 58, 0, 0, 26, 27, - 0, 0, 0, 0, 0, 0, 10, 59, 0, 0, - 0, 60, 61, 28, 0, 62, 0, 63, 29, 0, - 64, 0, 0, 30, 31, 0, 0, 0, 0, 0, - 0, 0, 32, 65, 0, 0, 0, 0, 0, 0, - 0, 320, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 14, 15, 0, 0, 0, 0, 0, 0, - 0, 0, 16, 0, 17, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 18, 0, 19, 0, 0, - 20, 0, 0, 21, 22, 0, 23, 0, 86, 86, - 86, 86, 24, 25, 0, 0, 0, 26, 27, 0, - 13, 14, 15, 0, 0, 52, 53, 0, 0, 428, - 54, 16, 28, 17, 0, 55, 0, 29, 439, 0, - 56, 0, 30, 31, 18, 0, 19, 0, 0, 20, - 0, 32, 21, 22, 454, 23, 0, 0, 57, 0, - 0, 24, 25, 58, 0, 0, 26, 27, 0, 0, - 473, 454, 454, 0, 0, 59, 0, 0, 0, 60, - 61, 28, 0, 62, 0, 63, 29, 0, 64, 0, - 0, 30, 31, 13, 14, 15, 0, 0, 52, 53, - 32, 65, 0, 54, 16, 0, 17, 0, 55, 321, - 0, 0, 0, 56, 0, 0, 0, 18, 0, 19, - 0, 0, 20, 0, 0, 21, 22, 0, 23, 0, - 0, 57, 0, 0, 24, 25, 58, 0, 0, 26, - 27, 0, 0, 0, 0, 0, 0, 0, 59, 0, - 0, 0, 60, 61, 28, 0, 62, 0, 63, 29, - 0, 64, 0, 0, 30, 31, 0, 0, 0, 0, - 0, 0, 0, 32, 65, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 269, - 563, 565, 567, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 587, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 86, 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, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 454, 0, 454 -}; - -static const short yycheck[] = -{ - 5, 264, 7, 268, 415, 416, 173, 3, 4, 5, - 19, 16, 91, 18, 19, 20, 21, 22, 185, 24, - 25, 26, 27, 28, 74, 30, 31, 18, 19, 20, - 21, 22, 19, 24, 25, 26, 27, 28, 23, 30, - 31, 20, 3, 4, 29, 3, 4, 32, 112, 54, - 3, 4, 3, 4, 5, 10, 37, 62, 58, 109, - 110, 111, 19, 54, 114, 19, 21, 117, 3, 4, - 5, 62, 44, 137, 59, 20, 3, 4, 5, 3, - 4, 5, 87, 92, 148, 70, 3, 4, 5, 3, - 4, 5, 92, 78, 20, 397, 92, 20, 11, 20, - 105, 106, 3, 4, 406, 92, 43, 112, 19, 107, - 400, 92, 67, 92, 105, 52, 81, 51, 408, 27, - 92, 171, 3, 4, 58, 7, 24, 92, 133, 127, - 128, 92, 137, 92, 92, 92, 92, 92, 92, 92, - 91, 191, 91, 148, 57, 130, 131, 92, 212, 3, - 4, 64, 157, 443, 92, 92, 91, 262, 156, 264, - 42, 43, 44, 168, 91, 47, 92, 91, 11, 92, - 52, 92, 85, 86, 91, 58, 58, 91, 81, 92, - 81, 92, 7, 92, 182, 58, 184, 69, 71, 194, - 58, 73, 65, 402, 76, 91, 78, 51, 80, 3, - 4, 410, 84, 71, 615, 405, 617, 212, 33, 92, - 92, 57, 58, 413, 57, 404, 214, 42, 43, 92, - 91, 64, 47, 412, 58, 91, 7, 52, 7, 399, - 228, 65, 91, 58, 15, 444, 15, 407, 243, 91, - 91, 246, 85, 86, 69, 92, 92, 245, 73, 92, - 248, 256, 257, 258, 91, 22, 91, 22, 92, 84, - 91, 42, 43, 42, 43, 91, 39, 92, 91, 436, - 91, 52, 277, 52, 91, 91, 43, 58, 43, 58, - 53, 91, 280, 450, 91, 52, 59, 52, 69, 92, - 69, 91, 73, 460, 73, 91, 561, 91, 91, 72, - 91, 91, 469, 84, 91, 84, 311, 91, 91, 314, - 92, 92, 79, 298, 79, 365, 91, 91, 316, 92, - 3, 4, 5, 586, 92, 92, 201, 92, 91, 91, - 205, 206, 91, 318, 209, 210, 91, 7, 323, 87, - 88, 89, 90, 92, 91, 15, 331, 352, 353, 354, - 355, 401, 3, 4, 5, 91, 341, 91, 91, 409, - 91, 352, 353, 354, 355, 3, 4, 5, 3, 4, - 5, 91, 42, 43, 372, 373, 374, 375, 376, 377, - 378, 379, 52, 91, 382, 383, 384, 385, 58, 91, - 91, 389, 390, 391, 392, 380, 198, 199, 200, 69, - 91, 91, 400, 73, 402, 92, 92, 92, 92, 91, - 408, 92, 410, 92, 84, 92, 7, 467, 92, 404, - 405, 92, 92, 92, 15, 92, 92, 412, 413, 427, - 92, 429, 92, 91, 91, 433, 434, 91, 91, 91, - 438, 91, 91, 441, 442, 443, 444, 445, 446, 447, - 448, 42, 43, 92, 91, 91, 5, 91, 91, 91, - 40, 52, 91, 91, 631, 91, 633, 58, 635, 7, - 91, 91, 91, 53, 54, 55, 56, 15, 69, 59, - 91, 91, 73, 91, 482, 91, 484, 91, 91, 487, - 488, 91, 72, 84, 91, 493, 494, 91, 91, 91, - 498, 92, 91, 91, 42, 43, 504, 505, 506, 507, - 91, 0, 92, 91, 52, 91, 91, 91, 91, 91, - 58, 91, 91, 539, 92, 92, 92, 92, 92, 92, - 92, 69, 92, 92, 92, 73, 92, 92, 92, 92, - 538, 539, 540, 541, 542, 543, 84, 92, 92, 92, - 548, 92, 92, 92, 92, 92, 91, 555, 556, 91, - 91, 91, 91, 568, 91, 91, 571, 92, 92, 92, - 92, 92, 92, 92, 92, 573, 92, 575, 576, 577, - 571, 92, 92, 581, 91, 91, 0, 92, 92, 92, - 91, 91, 91, 598, 91, 270, 92, 91, 91, 91, - 533, 92, 600, 601, 589, 603, 92, 592, 606, 607, - 595, 609, 92, 92, 92, 92, 91, 91, 566, 92, - 92, 619, 620, 91, 622, 91, 624, 91, 380, 92, - 92, 629, 630, 638, 92, 92, 641, 92, 636, 637, - 92, 92, 640, 92, 132, 643, 644, -1, -1, 647, - 648, 656, -1, 168, 659, -1, 654, 655, -1, -1, - -1, -1, -1, 661, -1, 663, -1, 665, 666, -1, - -1, -1, -1, 678, 672, 673, 674, 675, -1, -1, - -1, -1, -1, -1, 682, -1, 691, -1, 686, 687, - 688, 689, 690, -1, -1, 693, 694, 695, 696, 697, - 698, 699, 700, 701, 702, 703, -1, -1, 706, 707, - 708, 709, 710, 711, 712, -1, -1, 1, 2, 3, - 4, -1, -1, 721, -1, -1, -1, -1, -1, -1, - 728, 729, 16, -1, 18, 19, 20, 21, 22, -1, - 24, 25, 26, 27, 28, -1, 30, 31, -1, -1, - -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, - -1, 13, 14, -1, 16, -1, 18, -1, -1, -1, - 54, 23, -1, -1, -1, 27, -1, 29, 62, -1, - 32, -1, -1, 35, 36, -1, 38, -1, -1, 41, - -1, -1, 44, 45, 46, -1, -1, 49, 50, -1, - -1, -1, -1, 87, -1, -1, 58, -1, -1, -1, - 62, 63, 64, -1, 66, -1, 68, 69, -1, 71, - -1, 105, 74, 75, -1, -1, 7, -1, 112, -1, - -1, 83, 84, -1, 15, 119, -1, -1, -1, -1, - 92, -1, -1, -1, -1, -1, -1, -1, 132, 133, - -1, -1, -1, 137, -1, -1, -1, -1, -1, -1, - -1, 42, 43, -1, 148, -1, -1, -1, -1, -1, - -1, 52, -1, -1, -1, -1, -1, 58, -1, -1, - -1, -1, -1, -1, 168, -1, 170, 171, 69, -1, - 174, -1, 73, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 84, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, -1, 209, 210, 211, 212, -1, - -1, 215, 3, 4, 5, -1, -1, 8, 9, -1, - -1, -1, 13, 14, -1, 16, -1, 18, -1, -1, - -1, -1, 23, -1, -1, -1, 27, 241, 29, -1, - -1, 32, -1, -1, 35, 36, -1, 38, -1, -1, - 41, -1, -1, 44, 45, 46, -1, -1, 49, 50, - -1, -1, -1, -1, -1, -1, 270, 58, -1, -1, - -1, 62, 63, 64, -1, 66, -1, 68, 69, -1, - 71, -1, -1, 74, 75, -1, -1, -1, -1, -1, - -1, -1, 83, 84, -1, -1, -1, -1, -1, -1, - -1, 92, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 3, 4, 5, -1, -1, -1, -1, -1, -1, - -1, -1, 14, -1, 16, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 27, -1, 29, -1, -1, - 32, -1, -1, 35, 36, -1, 38, -1, 352, 353, - 354, 355, 44, 45, -1, -1, -1, 49, 50, -1, - 3, 4, 5, -1, -1, 8, 9, -1, -1, 373, - 13, 14, 64, 16, -1, 18, -1, 69, 382, -1, - 23, -1, 74, 75, 27, -1, 29, -1, -1, 32, - -1, 83, 35, 36, 398, 38, -1, -1, 41, -1, - -1, 44, 45, 46, -1, -1, 49, 50, -1, -1, - 414, 415, 416, -1, -1, 58, -1, -1, -1, 62, - 63, 64, -1, 66, -1, 68, 69, -1, 71, -1, - -1, 74, 75, 3, 4, 5, -1, -1, 8, 9, - 83, 84, -1, 13, 14, -1, 16, -1, 18, 92, - -1, -1, -1, 23, -1, -1, -1, 27, -1, 29, - -1, -1, 32, -1, -1, 35, 36, -1, 38, -1, - -1, 41, -1, -1, 44, 45, 46, -1, -1, 49, - 50, -1, -1, -1, -1, -1, -1, -1, 58, -1, - -1, -1, 62, 63, 64, -1, 66, -1, 68, 69, - -1, 71, -1, -1, 74, 75, -1, -1, -1, -1, - -1, -1, -1, 83, 84, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 533, - 534, 535, 536, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 560, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 571, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 615, -1, 617 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison/bison.simple" - -/* Skeleton output parser for bison, - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software - Foundation, Inc. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -/* This is the parser code that is written into each bison parser when - the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* 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. */ - -#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE) +#if ! defined (yyoverflow) || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -1124,37 +442,28 @@ static const short yycheck[] = # define YYSTACK_ALLOC malloc # define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */ +#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ #if (! defined (yyoverflow) \ && (! defined (__cplusplus) \ - || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { short yyss; YYSTYPE yyvs; -# if YYLSP_NEEDED - YYLTYPE yyls; -# endif -}; + }; /* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1) +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ -# if YYLSP_NEEDED -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAX) -# else -# define YYSTACK_BYTES(N) \ +# define YYSTACK_BYTES(N) \ ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAX) -# endif + + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ @@ -1185,13 +494,949 @@ union yyalloc YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX; \ + 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 yysigned_char; +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 14 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 1334 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 93 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 119 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 259 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 733 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 345 + +#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, 91, 2, 92, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const unsigned short yyprhs[] = +{ + 0, 0, 3, 6, 9, 12, 15, 17, 20, 22, + 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, + 44, 46, 48, 50, 52, 54, 59, 65, 66, 74, + 76, 83, 86, 87, 94, 96, 103, 109, 116, 117, + 124, 126, 129, 130, 136, 137, 144, 146, 149, 153, + 158, 159, 167, 173, 179, 188, 197, 200, 208, 216, + 224, 232, 236, 245, 254, 259, 269, 279, 280, 287, + 288, 295, 296, 303, 305, 312, 318, 326, 334, 340, + 346, 352, 358, 364, 370, 376, 383, 389, 392, 395, + 398, 401, 403, 405, 408, 409, 415, 417, 420, 423, + 426, 429, 432, 435, 438, 445, 450, 455, 460, 468, + 475, 480, 485, 487, 504, 505, 511, 513, 516, 519, + 522, 525, 531, 536, 542, 547, 549, 559, 569, 571, + 578, 583, 595, 608, 609, 616, 617, 624, 625, 632, + 633, 640, 641, 648, 649, 656, 657, 664, 666, 672, + 678, 680, 681, 689, 695, 701, 707, 710, 716, 722, + 728, 735, 737, 743, 749, 755, 758, 764, 770, 776, + 782, 788, 794, 797, 803, 810, 812, 818, 824, 830, + 833, 839, 845, 851, 857, 863, 870, 872, 874, 876, + 880, 889, 898, 903, 913, 923, 925, 934, 937, 939, + 941, 943, 949, 951, 954, 956, 958, 959, 966, 967, + 974, 976, 979, 982, 985, 988, 991, 992, 999, 1001, + 1008, 1014, 1015, 1022, 1024, 1031, 1037, 1038, 1045, 1047, + 1054, 1057, 1059, 1062, 1064, 1067, 1069, 1071, 1073, 1075, + 1077, 1079, 1081, 1083, 1085, 1087, 1089, 1091, 1093, 1095, + 1097, 1099, 1102, 1104, 1106, 1108, 1110, 1112, 1114, 1116 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const short yyrhs[] = +{ + 94, 0, -1, 87, 95, -1, 88, 123, -1, 89, + 101, -1, 90, 164, -1, 211, -1, 95, 96, -1, + 97, -1, 98, -1, 99, -1, 102, -1, 105, -1, + 106, -1, 117, -1, 119, -1, 121, -1, 149, -1, + 151, -1, 153, -1, 155, -1, 157, -1, 159, -1, + 161, -1, 182, -1, 16, 91, 203, 92, -1, 14, + 202, 91, 206, 92, -1, -1, 69, 201, 91, 203, + 100, 101, 92, -1, 211, -1, 101, 58, 201, 91, + 209, 92, -1, 101, 137, -1, -1, 38, 201, 91, + 103, 104, 92, -1, 211, -1, 104, 58, 201, 91, + 209, 92, -1, 27, 202, 91, 203, 92, -1, 205, + 27, 202, 91, 203, 92, -1, -1, 83, 201, 107, + 91, 108, 92, -1, 211, -1, 108, 109, -1, -1, + 81, 110, 91, 112, 92, -1, -1, 81, 210, 111, + 91, 112, 92, -1, 208, -1, 208, 208, -1, 208, + 208, 208, -1, 208, 208, 208, 208, -1, -1, 112, + 79, 202, 91, 113, 114, 92, -1, 112, 43, 91, + 115, 92, -1, 112, 52, 91, 116, 92, -1, 112, + 22, 205, 91, 208, 208, 208, 92, -1, 112, 22, + 91, 205, 208, 208, 208, 92, -1, 208, 208, -1, + 114, 67, 91, 208, 208, 208, 92, -1, 114, 10, + 91, 208, 208, 208, 92, -1, 114, 21, 205, 91, + 208, 208, 92, -1, 114, 21, 91, 205, 208, 208, + 92, -1, 208, 208, 208, -1, 115, 19, 205, 91, + 208, 208, 208, 92, -1, 115, 19, 91, 205, 208, + 208, 208, 92, -1, 208, 208, 208, 208, -1, 116, + 20, 205, 91, 208, 208, 208, 208, 92, -1, 116, + 20, 91, 205, 208, 208, 208, 208, 92, -1, -1, + 29, 202, 118, 91, 123, 92, -1, -1, 32, 202, + 120, 91, 123, 92, -1, -1, 35, 202, 122, 91, + 123, 92, -1, 211, -1, 123, 58, 201, 91, 209, + 92, -1, 123, 8, 91, 205, 92, -1, 123, 9, + 91, 208, 208, 208, 92, -1, 123, 13, 202, 91, + 124, 125, 92, -1, 123, 23, 91, 210, 92, -1, + 123, 23, 91, 5, 92, -1, 123, 18, 91, 210, + 92, -1, 123, 18, 91, 5, 92, -1, 123, 62, + 91, 210, 92, -1, 123, 46, 91, 203, 92, -1, + 123, 41, 91, 210, 92, -1, 123, 66, 202, 91, + 206, 92, -1, 123, 68, 91, 210, 92, -1, 123, + 126, -1, 123, 145, -1, 123, 147, -1, 123, 96, + -1, 205, -1, 211, -1, 125, 205, -1, -1, 71, + 127, 91, 128, 92, -1, 211, -1, 128, 129, -1, + 128, 130, -1, 128, 131, -1, 128, 132, -1, 128, + 133, -1, 128, 134, -1, 128, 135, -1, 72, 91, + 208, 208, 208, 92, -1, 54, 91, 208, 92, -1, + 55, 91, 208, 92, -1, 56, 91, 208, 92, -1, + 53, 91, 208, 208, 208, 208, 92, -1, 59, 91, + 208, 208, 208, 92, -1, 59, 91, 208, 92, -1, + 40, 91, 136, 92, -1, 211, -1, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, -1, -1, 71, 138, 91, 139, 92, + -1, 211, -1, 139, 143, -1, 139, 140, -1, 139, + 141, -1, 139, 142, -1, 72, 91, 208, 208, 92, + -1, 53, 91, 208, 92, -1, 59, 91, 208, 208, + 92, -1, 39, 91, 144, 92, -1, 211, -1, 208, + 208, 208, 208, 208, 208, 208, 208, 208, -1, 84, + 91, 196, 146, 51, 91, 200, 92, 92, -1, 211, + -1, 146, 58, 201, 91, 209, 92, -1, 63, 91, + 148, 92, -1, 24, 91, 208, 208, 81, 91, 208, + 208, 208, 92, 92, -1, 24, 91, 208, 208, 208, + 81, 91, 208, 208, 208, 92, 92, -1, -1, 50, + 202, 150, 91, 164, 92, -1, -1, 74, 202, 152, + 91, 164, 92, -1, -1, 75, 202, 154, 91, 164, + 92, -1, -1, 49, 202, 156, 91, 164, 92, -1, + -1, 36, 202, 158, 91, 164, 92, -1, -1, 45, + 202, 160, 91, 166, 92, -1, -1, 44, 202, 162, + 91, 167, 92, -1, 211, -1, 163, 43, 91, 171, + 92, -1, 163, 52, 91, 172, 92, -1, 211, -1, + -1, 164, 15, 210, 91, 165, 163, 92, -1, 164, + 73, 91, 168, 92, -1, 164, 69, 91, 169, 92, + -1, 164, 42, 91, 170, 92, -1, 164, 174, -1, + 164, 43, 91, 171, 92, -1, 164, 52, 91, 172, + 92, -1, 164, 7, 91, 173, 92, -1, 164, 58, + 201, 91, 209, 92, -1, 211, -1, 166, 73, 91, + 168, 92, -1, 166, 69, 91, 169, 92, -1, 166, + 42, 91, 170, 92, -1, 166, 174, -1, 166, 43, + 91, 171, 92, -1, 166, 52, 91, 172, 92, -1, + 166, 7, 91, 173, 92, -1, 166, 47, 91, 175, + 92, -1, 166, 78, 91, 176, 92, -1, 166, 80, + 91, 177, 92, -1, 166, 161, -1, 166, 76, 91, + 178, 92, -1, 166, 58, 201, 91, 209, 92, -1, + 211, -1, 167, 73, 91, 168, 92, -1, 167, 69, + 91, 169, 92, -1, 167, 42, 91, 170, 92, -1, + 167, 174, -1, 167, 43, 91, 171, 92, -1, 167, + 52, 91, 172, 92, -1, 167, 7, 91, 173, 92, + -1, 167, 47, 91, 180, 92, -1, 167, 33, 91, + 181, 92, -1, 167, 58, 201, 91, 209, 92, -1, + 198, -1, 201, -1, 199, -1, 208, 208, 208, -1, + 171, 19, 205, 91, 208, 208, 208, 92, -1, 171, + 19, 91, 205, 208, 208, 208, 92, -1, 208, 208, + 208, 208, -1, 172, 20, 205, 91, 208, 208, 208, + 208, 92, -1, 172, 20, 91, 205, 208, 208, 208, + 208, 92, -1, 210, -1, 84, 91, 196, 51, 91, + 200, 92, 92, -1, 210, 210, -1, 197, -1, 197, + -1, 211, -1, 178, 37, 91, 179, 92, -1, 211, + -1, 179, 161, -1, 210, -1, 197, -1, -1, 64, + 202, 183, 91, 186, 92, -1, -1, 11, 202, 185, + 91, 186, 92, -1, 211, -1, 186, 182, -1, 186, + 184, -1, 186, 187, -1, 186, 190, -1, 186, 193, + -1, -1, 57, 202, 188, 91, 189, 92, -1, 211, + -1, 189, 58, 201, 91, 209, 92, -1, 189, 65, + 91, 197, 92, -1, -1, 85, 202, 191, 91, 192, + 92, -1, 211, -1, 192, 58, 201, 91, 209, 92, + -1, 192, 65, 91, 197, 92, -1, -1, 86, 202, + 194, 91, 195, 92, -1, 211, -1, 195, 58, 201, + 91, 209, 92, -1, 195, 187, -1, 211, -1, 196, + 210, -1, 211, -1, 197, 208, -1, 201, -1, 201, + -1, 201, -1, 211, -1, 205, -1, 204, -1, 211, + -1, 205, -1, 211, -1, 205, -1, 3, -1, 4, + -1, 5, -1, 211, -1, 207, -1, 205, -1, 207, + 205, -1, 3, -1, 4, -1, 3, -1, 4, -1, + 5, -1, 3, -1, 4, -1, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const unsigned short yyrline[] = +{ + 0, 216, 216, 217, 218, 219, 230, 231, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 274, 297, 312, 311, 339, + 340, 625, 637, 636, 663, 664, 759, 766, 787, 786, + 826, 827, 839, 838, 850, 849, 895, 899, 903, 907, + 912, 911, 926, 927, 928, 936, 955, 959, 967, 975, + 983, 1001, 1005, 1013, 1031, 1035, 1043, 1062, 1061, 1082, + 1081, 1103, 1102, 1123, 1124, 1254, 1266, 1271, 1278, 1284, + 1297, 1304, 1317, 1323, 1329, 1335, 1340, 1346, 1347, 1348, + 1349, 1363, 1393, 1394, 1417, 1416, 1432, 1433, 1434, 1435, + 1436, 1437, 1438, 1439, 1442, 1448, 1454, 1460, 1466, 1472, + 1476, 1483, 1487, 1488, 1511, 1510, 1529, 1530, 1531, 1532, + 1533, 1536, 1542, 1548, 1554, 1558, 1559, 1578, 1611, 1615, + 1640, 1652, 1657, 1675, 1674, 1694, 1693, 1713, 1712, 1732, + 1731, 1751, 1750, 1770, 1769, 1789, 1788, 1808, 1809, 1810, + 1821, 1823, 1822, 1843, 1844, 1845, 1846, 1847, 1848, 1849, + 1850, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, + 1932, 1933, 1934, 1940, 1941, 2005, 2006, 2007, 2008, 2009, + 2010, 2011, 2012, 2013, 2014, 2015, 2084, 2101, 2141, 2158, + 2162, 2170, 2188, 2192, 2200, 2218, 2234, 2265, 2283, 2303, + 2323, 2328, 2339, 2345, 2364, 2380, 2402, 2401, 2424, 2423, + 2445, 2446, 2450, 2454, 2458, 2462, 2478, 2477, 2498, 2499, + 2511, 2526, 2525, 2546, 2547, 2564, 2579, 2578, 2599, 2600, + 2615, 2630, 2634, 2648, 2652, 2666, 2687, 2708, 2734, 2739, + 2751, 2763, 2768, 2779, 2783, 2797, 2801, 2805, 2818, 2822, + 2838, 2842, 2856, 2857, 2872, 2878, 2884, 2901, 2909, 2915 +}; +#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", "NUMBER", "ULONG", "STRING", "BEZIERCURVE", + "BFACE", "BILLBOARD", "BILLBOARDCENTER", "BINORMAL", "BUNDLE", "CLOSED", + "COLLIDE", "COMMENT", "COMPONENT", "COORDSYSTEM", "CV", "DART", + "DNORMAL", "DRGBA", "DUV", "DXYZ", "DCS", "DISTANCE", "DTREF", + "DYNAMICVERTEXPOOL", "EXTERNAL_FILE", "FLIGHT", "GROUP", "HIP", + "INTANGENT", "JOINT", "KNOTS", "INCLUDE", "INSTANCE", "LINE", "LOOP", + "MATERIAL", "MATRIX3", "MATRIX4", "MODEL", "MREF", "NORMAL", + "NURBSCURVE", "NURBSSURFACE", "OBJECTTYPE", "ORDER", "OUTTANGENT", + "POINTLIGHT", "POLYGON", "REF", "RGBA", "ROTATE", "ROTX", "ROTY", + "ROTZ", "SANIM", "SCALAR", "SCALE", "SEQUENCE", "SHADING", "SWITCH", + "SWITCHCONDITION", "TABLE", "TABLE_V", "TAG", "TANGENT", "TEXLIST", + "TEXTURE", "TLENGTHS", "TRANSFORM", "TRANSLATE", "TREF", "TRIANGLEFAN", + "TRIANGLESTRIP", "TRIM", "TXT", "UKNOTS", "UV", "VKNOTS", "VERTEX", + "VERTEXANIM", "VERTEXPOOL", "VERTEXREF", "XFMANIM", "XFMSANIM", + "START_EGG", "START_GROUP_BODY", "START_TEXTURE_BODY", + "START_PRIMITIVE_BODY", "'{'", "'}'", "$accept", "grammar", "egg", + "node", "coordsystem", "comment", "texture", "@1", "texture_body", + "material", "@2", "material_body", "external_reference", "vertex_pool", + "@3", "vertex_pool_body", "vertex", "@4", "@5", "vertex_body", "@6", + "vertex_uv_body", "vertex_normal_body", "vertex_color_body", "group", + "@7", "joint", "@8", "instance", "@9", "group_body", "cs_type", + "collide_flags", "transform_3d", "@10", "transform_3d_body", + "translate_3d", "rotx_3d", "roty_3d", "rotz_3d", "rotate_3d", + "scale_3d", "matrix4_3d", "matrix4_3d_body", "transform_2d", "@11", + "transform_2d_body", "translate_2d", "rotate_2d", "scale_2d", + "matrix3_2d", "matrix3_2d_body", "group_vertex_ref", + "group_vertex_membership", "switchcondition", "switchcondition_body", + "polygon", "@12", "trianglefan", "@13", "trianglestrip", "@14", + "point_light", "@15", "line", "@16", "nurbs_surface", "@17", + "nurbs_curve", "@18", "primitive_component_body", "primitive_body", + "@19", "nurbs_surface_body", "nurbs_curve_body", "primitive_tref_body", + "primitive_texture_body", "primitive_material_body", + "primitive_normal_body", "primitive_color_body", "primitive_bface_body", + "primitive_vertex_ref", "nurbs_surface_order_body", + "nurbs_surface_uknots_body", "nurbs_surface_vknots_body", + "nurbs_surface_trim_body", "nurbs_surface_trim_loop_body", + "nurbs_curve_order_body", "nurbs_curve_knots_body", "table", "@20", + "bundle", "@21", "table_body", "sanim", "@22", "sanim_body", "xfmanim", + "@23", "xfmanim_body", "xfm_s_anim", "@24", "xfm_s_anim_body", + "integer_list", "real_list", "texture_name", "material_name", + "vertex_pool_name", "required_name", "optional_name", "required_string", + "optional_string", "string", "repeated_string", "repeated_string_body", + "real", "real_or_string", "integer", "empty", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const unsigned short 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, 123, 125 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const unsigned char yyr1[] = +{ + 0, 93, 94, 94, 94, 94, 95, 95, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 97, 98, 100, 99, 101, + 101, 101, 103, 102, 104, 104, 105, 105, 107, 106, + 108, 108, 110, 109, 111, 109, 112, 112, 112, 112, + 113, 112, 112, 112, 112, 112, 114, 114, 114, 114, + 114, 115, 115, 115, 116, 116, 116, 118, 117, 120, + 119, 122, 121, 123, 123, 123, 123, 123, 123, 123, + 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, + 123, 124, 125, 125, 127, 126, 128, 128, 128, 128, + 128, 128, 128, 128, 129, 130, 131, 132, 133, 134, + 134, 135, 136, 136, 138, 137, 139, 139, 139, 139, + 139, 140, 141, 142, 143, 144, 144, 145, 146, 146, + 147, 148, 148, 150, 149, 152, 151, 154, 153, 156, + 155, 158, 157, 160, 159, 162, 161, 163, 163, 163, + 164, 165, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 166, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 168, 169, 170, 171, + 171, 171, 172, 172, 172, 173, 174, 175, 176, 177, + 178, 178, 179, 179, 180, 181, 183, 182, 185, 184, + 186, 186, 186, 186, 186, 186, 188, 187, 189, 189, + 189, 191, 190, 192, 192, 192, 194, 193, 195, 195, + 195, 196, 196, 197, 197, 198, 199, 200, 201, 201, + 202, 203, 203, 204, 204, 205, 205, 205, 206, 206, + 207, 207, 208, 208, 209, 209, 209, 210, 210, 211 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const unsigned char yyr2[] = +{ + 0, 2, 2, 2, 2, 2, 1, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 4, 5, 0, 7, 1, + 6, 2, 0, 6, 1, 6, 5, 6, 0, 6, + 1, 2, 0, 5, 0, 6, 1, 2, 3, 4, + 0, 7, 5, 5, 8, 8, 2, 7, 7, 7, + 7, 3, 8, 8, 4, 9, 9, 0, 6, 0, + 6, 0, 6, 1, 6, 5, 7, 7, 5, 5, + 5, 5, 5, 5, 5, 6, 5, 2, 2, 2, + 2, 1, 1, 2, 0, 5, 1, 2, 2, 2, + 2, 2, 2, 2, 6, 4, 4, 4, 7, 6, + 4, 4, 1, 16, 0, 5, 1, 2, 2, 2, + 2, 5, 4, 5, 4, 1, 9, 9, 1, 6, + 4, 11, 12, 0, 6, 0, 6, 0, 6, 0, + 6, 0, 6, 0, 6, 0, 6, 1, 5, 5, + 1, 0, 7, 5, 5, 5, 2, 5, 5, 5, + 6, 1, 5, 5, 5, 2, 5, 5, 5, 5, + 5, 5, 2, 5, 6, 1, 5, 5, 5, 2, + 5, 5, 5, 5, 5, 6, 1, 1, 1, 3, + 8, 8, 4, 9, 9, 1, 8, 2, 1, 1, + 1, 5, 1, 2, 1, 1, 0, 6, 0, 6, + 1, 2, 2, 2, 2, 2, 0, 6, 1, 6, + 5, 0, 6, 1, 6, 5, 0, 6, 1, 6, + 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 0 +}; + +/* 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 short yydefact[] = +{ + 0, 259, 259, 259, 259, 0, 2, 6, 3, 73, + 4, 29, 5, 150, 1, 245, 246, 247, 259, 0, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 259, 259, 259, 259, 259, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 0, 0, 0, 259, 0, 0, 0, + 0, 259, 0, 0, 259, 0, 94, 0, 90, 87, + 88, 89, 259, 114, 31, 0, 0, 0, 0, 0, + 259, 0, 0, 0, 156, 0, 240, 244, 243, 259, + 0, 67, 69, 71, 141, 0, 239, 238, 145, 143, + 139, 133, 206, 0, 135, 137, 38, 259, 0, 0, + 0, 0, 0, 0, 259, 0, 0, 0, 0, 0, + 0, 259, 0, 0, 0, 257, 258, 0, 259, 0, + 0, 0, 259, 259, 259, 259, 0, 242, 241, 259, + 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, + 259, 0, 0, 0, 0, 0, 252, 253, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 259, 0, 259, 259, 231, 0, 259, 0, 195, 151, + 0, 188, 236, 0, 0, 0, 0, 0, 0, 187, + 0, 186, 235, 0, 250, 0, 249, 248, 25, 0, + 259, 259, 259, 259, 259, 259, 259, 259, 259, 259, + 27, 259, 259, 259, 259, 75, 0, 259, 91, 81, + 80, 79, 78, 84, 83, 254, 255, 256, 0, 82, + 0, 130, 0, 86, 0, 96, 0, 232, 128, 0, + 0, 116, 159, 259, 155, 0, 157, 0, 0, 158, + 0, 0, 154, 153, 0, 26, 251, 36, 0, 0, + 0, 0, 0, 34, 0, 175, 0, 161, 0, 0, + 0, 210, 259, 0, 0, 0, 40, 0, 0, 0, + 92, 74, 0, 85, 0, 0, 0, 0, 0, 0, + 0, 95, 97, 98, 99, 100, 101, 102, 103, 0, + 259, 30, 0, 0, 0, 0, 115, 118, 119, 120, + 117, 0, 147, 0, 0, 189, 0, 0, 0, 160, + 259, 68, 70, 72, 142, 259, 33, 0, 0, 0, + 0, 0, 0, 259, 0, 0, 146, 179, 0, 0, + 0, 0, 0, 259, 0, 0, 0, 0, 0, 144, + 172, 165, 140, 134, 259, 259, 259, 259, 207, 211, + 212, 213, 214, 215, 0, 136, 138, 42, 39, 41, + 37, 76, 77, 93, 0, 259, 0, 0, 0, 0, + 0, 0, 259, 0, 259, 0, 0, 0, 0, 0, + 152, 0, 0, 0, 0, 192, 0, 237, 0, 0, + 259, 259, 0, 0, 0, 0, 259, 259, 0, 259, + 0, 0, 0, 0, 259, 259, 259, 259, 259, 208, + 216, 221, 226, 28, 0, 44, 0, 0, 0, 0, + 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 125, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 205, 233, 0, 0, 0, + 204, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 200, 0, 198, 0, 199, + 0, 0, 0, 0, 0, 0, 0, 0, 111, 0, + 0, 105, 106, 107, 110, 0, 0, 0, 0, 124, + 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, + 196, 0, 182, 184, 234, 178, 180, 183, 181, 0, + 177, 176, 168, 164, 166, 169, 197, 167, 0, 163, + 162, 0, 173, 170, 171, 259, 259, 259, 259, 0, + 46, 0, 0, 0, 0, 0, 0, 0, 127, 129, + 0, 123, 121, 148, 149, 0, 0, 0, 0, 35, + 185, 174, 259, 0, 0, 218, 0, 223, 0, 228, + 0, 0, 0, 259, 43, 47, 0, 0, 0, 0, + 0, 109, 104, 0, 191, 190, 0, 0, 0, 202, + 209, 259, 0, 217, 259, 0, 222, 259, 227, 230, + 0, 0, 0, 0, 0, 48, 45, 0, 0, 0, + 108, 0, 194, 193, 201, 203, 0, 259, 0, 259, + 0, 0, 0, 0, 0, 0, 0, 50, 49, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 52, 0, 0, 53, 0, 0, 131, 0, 0, + 0, 0, 220, 0, 225, 0, 0, 0, 0, 0, + 61, 0, 0, 0, 0, 0, 132, 0, 0, 219, + 224, 229, 0, 0, 0, 0, 0, 0, 64, 0, + 0, 0, 51, 56, 0, 126, 55, 54, 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, 63, 62, 0, 0, 0, + 0, 0, 0, 0, 66, 65, 58, 60, 59, 57, + 0, 0, 113 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const short yydefgoto[] = +{ + -1, 5, 6, 68, 36, 37, 38, 272, 10, 39, + 204, 262, 40, 41, 153, 275, 369, 424, 485, 539, + 646, 664, 623, 625, 42, 140, 43, 141, 44, 142, + 8, 217, 279, 69, 120, 234, 292, 293, 294, 295, + 296, 297, 298, 428, 74, 123, 240, 307, 308, 309, + 310, 439, 70, 236, 71, 169, 45, 148, 46, 151, + 47, 152, 48, 147, 49, 143, 50, 146, 51, 145, + 311, 12, 243, 266, 264, 190, 188, 180, 183, 185, + 177, 84, 468, 476, 478, 474, 588, 459, 454, 52, + 149, 360, 480, 270, 361, 481, 564, 362, 482, 566, + 363, 483, 568, 173, 455, 191, 181, 396, 182, 85, + 136, 86, 96, 195, 196, 514, 228, 178, 97 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -411 +static const short yypact[] = +{ + 197, -411, -411, -411, -411, 73, 1029, -411, 1151, -411, + 111, -411, 463, -411, -411, -411, -411, -411, 326, -85, + 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, + 326, 326, 326, 326, 326, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, 58, 52, 59, 326, 76, 107, 122, + 125, 326, 132, 136, 326, 139, -411, 144, -411, -411, + -411, -411, 326, -411, -411, 155, 110, 181, 184, 188, + 326, 190, 191, 209, -411, 211, -411, -411, -411, 326, + 213, -411, -411, -411, -411, 215, -411, -411, -411, -411, + -411, -411, -411, 217, -411, -411, -411, 326, 326, 266, + 221, 350, 363, 110, 326, 222, 110, 167, 224, 110, + 226, -411, 227, 230, 110, -411, -411, 232, 326, 266, + 266, 236, 326, 326, -411, 326, 109, -411, -411, 326, + 241, 242, 245, 265, -411, 267, 268, 270, 281, 293, + 326, 299, 300, 306, 307, 248, -411, -411, 266, 326, + 250, 252, 309, 310, 317, 318, 366, 320, 308, 322, + 326, 324, -411, 110, -411, 366, -411, 327, -411, -411, + 330, -411, -411, 24, 266, -16, 266, 366, 332, -411, + 334, -411, -411, 103, -411, 335, 326, -411, -411, 339, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, 326, -411, 266, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, 341, -411, + 266, -411, 343, -411, 458, -411, 60, -411, -411, 348, + 185, -411, -411, -411, -411, 66, -411, 266, 74, -411, + 266, 362, -411, -411, 364, -411, -411, -411, 749, 930, + 1078, 207, -25, -411, 163, -411, 119, -411, 251, 253, + 63, -411, -411, 331, 410, 31, -411, 365, 368, 6, + -411, -411, 266, -411, 367, 373, 374, 375, 376, 378, + 380, -411, -411, -411, -411, -411, -411, -411, -411, 381, + 326, -411, 382, 383, 384, 385, -411, -411, -411, -411, + -411, 82, -411, 326, 386, -411, 326, 389, 266, -411, + 326, -411, -411, -411, -411, 326, -411, 390, 391, 393, + 395, 397, 398, 326, 401, 402, -411, -411, 404, 408, + 409, 412, 413, 326, 425, 427, 428, 429, 431, -411, + -411, -411, -411, -411, 326, 326, 326, 326, -411, -411, + -411, -411, -411, -411, 170, -411, -411, 110, -411, -411, + -411, -411, -411, -411, 100, 266, 266, 266, 266, 266, + 266, 266, 326, 432, 266, 266, 266, 266, 433, 434, + -411, 266, 266, 266, 266, -411, 435, -411, 437, 110, + -411, 326, 266, 110, 266, 438, 326, 326, 110, 326, + 266, 110, 266, 440, 326, 326, -411, -411, -411, -411, + -411, -411, -411, -411, 442, -411, 443, 208, 445, 266, + -411, 266, 446, 447, 448, 43, 266, 456, 366, 457, + 266, -411, 460, 266, 266, 266, 266, 266, 266, 266, + 266, 461, 366, 462, 464, 266, -411, 465, 40, 468, + -411, 29, 366, 469, 470, 471, 473, 44, 474, 110, + 64, 366, 476, 477, 17, -411, 478, 266, 479, 266, + 444, 481, 482, 483, 266, 484, 266, 486, -411, 266, + 266, -411, -411, -411, -411, 266, 266, 490, 491, -411, + 266, -411, 493, 494, 47, 97, 266, 266, 266, 266, + -411, 495, -411, -411, -411, -411, -411, -411, -411, 496, + -411, -411, -411, -411, -411, -411, -411, -411, 497, -411, + -411, 499, -411, -411, -411, -411, -411, -411, -411, 182, + 266, 266, 266, 266, 266, 266, 500, 501, -411, -411, + 266, -411, -411, -411, -411, 503, 504, 266, 266, -411, + -411, -411, -411, 94, 175, -411, 198, -411, 80, -411, + 77, 506, 507, 326, -411, 266, 249, 266, 266, 266, + 508, -411, -411, 266, -411, -411, 509, 510, 49, -411, + -411, 326, 516, -411, 326, 522, -411, 326, -411, -411, + 326, 523, 266, 266, 524, 266, -411, 525, 266, 266, + -411, 266, -411, -411, -411, -411, 527, -411, 528, -411, + 529, 266, 266, 81, 266, 108, 266, -411, -411, 532, + 534, 266, 266, 366, 48, 366, 53, 366, 266, 266, + 84, -411, 266, 87, -411, 266, 266, -411, 536, 266, + 266, 537, -411, 538, -411, 539, 266, 266, 326, 530, + -411, 326, 544, 266, 32, 266, -411, 266, 266, -411, + -411, -411, 546, 549, 266, 266, 266, 266, -411, 545, + 92, 551, -411, -411, 266, -411, -411, -411, 266, 266, + 266, 266, 266, 326, 553, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 556, 557, 266, 266, + 266, 266, 266, 266, 266, -411, -411, 561, 562, 564, + 567, 568, 569, 266, -411, -411, -411, -411, -411, -411, + 266, 266, -411 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const short yypgoto[] = +{ + -411, -411, -411, 450, -411, -411, -411, -411, 254, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, 50, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + 206, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -411, -411, + -411, -411, -411, -411, -411, -411, -411, -411, -263, -411, + -411, 231, -411, -411, -411, -195, -188, -172, -226, -252, + -206, -21, -411, -411, -411, -411, -411, -411, -411, -265, + -411, -411, -411, 20, 95, -411, -411, -411, -411, -411, + -411, -411, -411, 511, -410, -411, -411, 234, 14, 8, + -95, -411, -6, 492, -411, 1, -174, -51, 715 +}; + +/* 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 short yytable[] = +{ + 53, 239, 53, 350, 248, 359, 89, 477, 479, 15, + 16, 17, 87, 251, 87, 87, 87, 87, 87, 165, + 87, 87, 87, 87, 87, 127, 87, 87, 90, 91, + 92, 93, 94, 325, 98, 99, 100, 101, 102, 95, + 104, 105, 679, 245, 199, 103, 156, 157, 106, 248, + 87, 156, 157, 680, 531, 210, 156, 157, 87, 245, + 161, 163, 164, 245, 110, 167, 245, 326, 171, 15, + 16, 17, 118, 14, 354, 115, 249, 15, 16, 17, + 15, 16, 17, 137, 248, 107, 122, 15, 16, 17, + 15, 16, 17, 26, 131, 15, 16, 17, 372, 681, + 640, 87, 155, 156, 157, 354, 125, 126, 137, 532, + 158, 299, 367, 125, 126, 154, 246, 248, 300, 277, + 355, 518, 237, 368, 682, 388, 338, 30, 643, 194, + 184, 186, 516, 137, 389, 494, 524, 355, 597, 553, + 652, 614, 237, 108, 137, 654, 189, 192, 356, 357, + 109, 355, 461, 218, 254, 358, 527, 313, 30, 216, + 470, 339, 340, 26, 194, 316, 341, 111, 600, 72, + 327, 342, 598, 641, 390, 658, 458, 343, 661, 356, + 357, 426, 73, 693, 467, 247, 590, 250, 344, 554, + 256, 168, 345, 453, 505, 346, 328, 347, 112, 348, + 644, 198, 465, 83, 570, 329, 330, 634, 137, 636, + 331, 349, 464, 113, 75, 332, 114, 278, 463, 504, + 473, 333, 76, 116, 302, 571, 472, 117, 72, 457, + 119, 282, 334, 591, 572, 121, 335, 466, 303, 314, + 592, 73, 317, 337, 304, 351, 124, 83, 315, 77, + 78, 318, 53, 53, 53, 336, 594, 305, 75, 79, + 75, 573, 423, 595, 498, 80, 76, 593, 76, 156, + 157, 570, 128, 373, 574, 129, 81, 306, 511, 130, + 82, 132, 133, 374, 1, 2, 3, 4, 519, 487, + 596, 83, 571, 77, 78, 77, 78, 528, 359, 324, + 134, 572, 135, 79, 139, 79, 144, 391, 150, 80, + 393, 80, 159, 166, 383, 170, 425, 172, 175, 395, + 81, 176, 81, 179, 82, 615, 82, 187, 573, 15, + 16, 17, 200, 201, 397, 83, 202, 83, 75, 398, + 215, 606, 219, 352, 220, 353, 76, 405, 87, 87, + 87, 87, 460, 125, 126, 160, 203, 413, 205, 206, + 469, 207, 419, 420, 421, 422, 125, 126, 162, 225, + 226, 227, 208, 77, 78, 427, 429, 431, 432, 433, + 434, 435, 436, 79, 209, 440, 442, 443, 444, 80, + 211, 212, 447, 448, 449, 450, 397, 213, 214, 230, + 81, 221, 222, 184, 82, 186, 258, 259, 260, 223, + 224, 184, 229, 186, 231, 83, 233, 75, 526, 242, + 189, 192, 244, 365, 252, 76, 253, 255, 189, 192, + 489, 257, 490, 281, 261, 283, 495, 496, 268, 269, + 301, 500, 273, 274, 502, 503, 184, 186, 506, 507, + 508, 509, 77, 78, 319, 320, 35, 370, 375, 651, + 371, 653, 79, 655, 376, 377, 378, 379, 80, 380, + 75, 381, 382, 384, 385, 386, 387, 392, 76, 81, + 394, 399, 400, 82, 401, 540, 402, 542, 403, 404, + 544, 545, 406, 407, 83, 408, 546, 547, 284, 409, + 410, 550, 366, 411, 412, 77, 78, 555, 556, 557, + 558, 285, 286, 287, 288, 79, 414, 289, 415, 416, + 417, 80, 418, 438, 445, 446, 364, 451, 452, 462, + 290, 471, 81, 484, 486, 535, 82, 488, 491, 492, + 493, 575, 540, 577, 578, 579, 580, 83, 497, 499, + 291, 583, 501, 510, 512, 563, 513, 515, 586, 587, + 517, 520, 521, 522, 601, 523, 525, 87, 529, 530, + 533, 534, 536, 537, 538, 541, 605, 543, 607, 608, + 609, 604, 548, 549, 611, 551, 552, 559, 560, 561, + 562, 576, 581, 582, 621, 584, 585, 602, 603, 0, + 610, 612, 613, 624, 626, 616, 628, 617, 618, 630, + 631, 620, 632, 619, 622, 627, 437, 629, 633, 635, + 637, 675, 638, 639, 647, 642, 648, 645, 666, 669, + 670, 671, 649, 650, 659, 677, 692, 662, 686, 656, + 657, 687, 695, 660, 703, 193, 663, 665, 715, 716, + 667, 668, 674, 724, 725, 676, 726, 672, 673, 727, + 728, 729, 232, 599, 678, 0, 683, 0, 684, 685, + 0, 0, 0, 0, 694, 688, 689, 690, 691, 0, + 0, 0, 0, 0, 0, 696, 0, 702, 0, 697, + 698, 699, 700, 701, 0, 0, 704, 705, 706, 707, + 708, 709, 710, 711, 712, 713, 714, 0, 0, 717, + 718, 719, 720, 721, 722, 723, 7, 9, 11, 13, + 0, 0, 0, 0, 730, 0, 0, 0, 0, 0, + 0, 731, 732, 88, 0, 88, 88, 88, 88, 88, + 0, 88, 88, 88, 88, 88, 0, 88, 88, 0, + 0, 0, 15, 16, 17, 0, 0, 54, 55, 0, + 0, 0, 56, 18, 0, 19, 0, 57, 0, 0, + 0, 88, 58, 0, 0, 0, 20, 0, 21, 88, + 0, 22, 0, 0, 23, 24, 0, 25, 0, 0, + 59, 0, 0, 26, 27, 60, 0, 0, 28, 29, + 0, 0, 0, 0, 138, 0, 0, 61, 0, 0, + 0, 62, 63, 30, 0, 64, 0, 65, 31, 0, + 66, 0, 88, 32, 33, 0, 0, 0, 0, 138, + 0, 0, 34, 67, 0, 0, 174, 0, 0, 0, + 0, 321, 0, 0, 0, 0, 0, 0, 0, 174, + 197, 0, 0, 0, 138, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 138, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 197, 0, 235, 238, 0, + 0, 241, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 9, 9, 9, 13, 263, + 265, 267, 13, 13, 271, 0, 13, 13, 276, 138, + 0, 0, 280, 15, 16, 17, 0, 0, 54, 55, + 0, 0, 0, 56, 18, 0, 19, 0, 57, 0, + 0, 0, 0, 58, 0, 0, 0, 20, 312, 21, + 0, 0, 22, 0, 0, 23, 24, 0, 25, 0, + 0, 59, 0, 0, 26, 27, 60, 0, 0, 28, + 29, 0, 0, 0, 0, 0, 0, 11, 61, 0, + 0, 0, 62, 63, 30, 0, 64, 0, 65, 31, + 0, 66, 0, 0, 32, 33, 0, 0, 0, 0, + 0, 0, 0, 34, 67, 0, 0, 0, 0, 0, + 0, 0, 322, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 15, 16, 17, 0, 0, 0, 0, 0, + 0, 0, 0, 18, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 20, 0, 21, 0, + 0, 22, 0, 0, 23, 24, 0, 25, 0, 88, + 88, 88, 88, 26, 27, 0, 0, 0, 28, 29, + 0, 15, 16, 17, 0, 0, 54, 55, 0, 0, + 430, 56, 18, 30, 19, 0, 57, 0, 31, 441, + 0, 58, 0, 32, 33, 20, 0, 21, 0, 0, + 22, 0, 34, 23, 24, 456, 25, 0, 0, 59, + 0, 0, 26, 27, 60, 0, 0, 28, 29, 0, + 0, 475, 456, 456, 0, 0, 61, 0, 0, 0, + 62, 63, 30, 0, 64, 0, 65, 31, 0, 66, + 0, 0, 32, 33, 15, 16, 17, 0, 0, 54, + 55, 34, 67, 0, 56, 18, 0, 19, 0, 57, + 323, 0, 0, 0, 58, 0, 0, 0, 20, 0, + 21, 0, 0, 22, 0, 0, 23, 24, 0, 25, + 0, 0, 59, 0, 0, 26, 27, 60, 0, 0, + 28, 29, 0, 0, 0, 0, 0, 0, 0, 61, + 0, 0, 0, 62, 63, 30, 0, 64, 0, 65, + 31, 0, 66, 0, 0, 32, 33, 0, 0, 0, + 0, 0, 0, 0, 34, 67, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 271, 565, 567, 569, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 589, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 456, 0, 456 +}; + +static const short yycheck[] = +{ + 6, 175, 8, 266, 20, 270, 91, 417, 418, 3, + 4, 5, 18, 187, 20, 21, 22, 23, 24, 114, + 26, 27, 28, 29, 30, 76, 32, 33, 20, 21, + 22, 23, 24, 58, 26, 27, 28, 29, 30, 25, + 32, 33, 10, 19, 139, 31, 3, 4, 34, 20, + 56, 3, 4, 21, 37, 150, 3, 4, 64, 19, + 111, 112, 113, 19, 56, 116, 19, 92, 119, 3, + 4, 5, 64, 0, 11, 61, 92, 3, 4, 5, + 3, 4, 5, 89, 20, 27, 72, 3, 4, 5, + 3, 4, 5, 44, 80, 3, 4, 5, 92, 67, + 19, 107, 108, 3, 4, 11, 3, 4, 114, 92, + 109, 51, 81, 3, 4, 107, 92, 20, 58, 214, + 57, 92, 173, 92, 92, 43, 7, 64, 20, 135, + 129, 130, 92, 139, 52, 92, 92, 57, 58, 92, + 92, 92, 193, 91, 150, 92, 132, 133, 85, 86, + 91, 57, 404, 159, 51, 92, 92, 91, 64, 158, + 412, 42, 43, 44, 170, 91, 47, 91, 91, 58, + 7, 52, 92, 92, 92, 91, 402, 58, 91, 85, + 86, 81, 71, 91, 410, 184, 92, 186, 69, 92, + 196, 24, 73, 399, 446, 76, 33, 78, 91, 80, + 92, 92, 408, 84, 22, 42, 43, 617, 214, 619, + 47, 92, 407, 91, 7, 52, 91, 216, 406, 445, + 415, 58, 15, 91, 39, 43, 414, 91, 58, 401, + 91, 230, 69, 58, 52, 91, 73, 409, 53, 245, + 65, 71, 248, 264, 59, 266, 91, 84, 247, 42, + 43, 250, 258, 259, 260, 92, 58, 72, 7, 52, + 7, 79, 92, 65, 438, 58, 15, 92, 15, 3, + 4, 22, 91, 279, 92, 91, 69, 92, 452, 91, + 73, 91, 91, 282, 87, 88, 89, 90, 462, 81, + 92, 84, 43, 42, 43, 42, 43, 471, 563, 92, + 91, 52, 91, 52, 91, 52, 91, 313, 91, 58, + 316, 58, 91, 91, 300, 91, 367, 91, 91, 318, + 69, 91, 69, 91, 73, 588, 73, 91, 79, 3, + 4, 5, 91, 91, 320, 84, 91, 84, 7, 325, + 92, 92, 92, 92, 92, 92, 15, 333, 354, 355, + 356, 357, 403, 3, 4, 5, 91, 343, 91, 91, + 411, 91, 354, 355, 356, 357, 3, 4, 5, 3, + 4, 5, 91, 42, 43, 374, 375, 376, 377, 378, + 379, 380, 381, 52, 91, 384, 385, 386, 387, 58, + 91, 91, 391, 392, 393, 394, 382, 91, 91, 91, + 69, 92, 92, 402, 73, 404, 200, 201, 202, 92, + 92, 410, 92, 412, 92, 84, 92, 7, 469, 92, + 406, 407, 92, 92, 92, 15, 92, 92, 414, 415, + 429, 92, 431, 92, 203, 92, 435, 436, 207, 208, + 92, 440, 211, 212, 443, 444, 445, 446, 447, 448, + 449, 450, 42, 43, 92, 91, 6, 92, 91, 633, + 92, 635, 52, 637, 91, 91, 91, 91, 58, 91, + 7, 91, 91, 91, 91, 91, 91, 91, 15, 69, + 91, 91, 91, 73, 91, 484, 91, 486, 91, 91, + 489, 490, 91, 91, 84, 91, 495, 496, 40, 91, + 91, 500, 92, 91, 91, 42, 43, 506, 507, 508, + 509, 53, 54, 55, 56, 52, 91, 59, 91, 91, + 91, 58, 91, 91, 91, 91, 272, 92, 91, 91, + 72, 91, 69, 91, 91, 91, 73, 92, 92, 92, + 92, 540, 541, 542, 543, 544, 545, 84, 92, 92, + 92, 550, 92, 92, 92, 535, 92, 92, 557, 558, + 92, 92, 92, 92, 570, 92, 92, 573, 92, 92, + 92, 92, 91, 91, 91, 91, 575, 91, 577, 578, + 579, 573, 92, 92, 583, 92, 92, 92, 92, 92, + 91, 541, 92, 92, 600, 92, 92, 91, 91, -1, + 92, 92, 92, 602, 603, 591, 605, 91, 594, 608, + 609, 597, 611, 91, 91, 91, 382, 92, 91, 91, + 91, 91, 621, 622, 92, 624, 92, 626, 92, 92, + 92, 92, 631, 632, 640, 91, 91, 643, 92, 638, + 639, 92, 91, 642, 91, 134, 645, 646, 92, 92, + 649, 650, 658, 92, 92, 661, 92, 656, 657, 92, + 92, 92, 170, 568, 663, -1, 665, -1, 667, 668, + -1, -1, -1, -1, 680, 674, 675, 676, 677, -1, + -1, -1, -1, -1, -1, 684, -1, 693, -1, 688, + 689, 690, 691, 692, -1, -1, 695, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, -1, -1, 708, + 709, 710, 711, 712, 713, 714, 1, 2, 3, 4, + -1, -1, -1, -1, 723, -1, -1, -1, -1, -1, + -1, 730, 731, 18, -1, 20, 21, 22, 23, 24, + -1, 26, 27, 28, 29, 30, -1, 32, 33, -1, + -1, -1, 3, 4, 5, -1, -1, 8, 9, -1, + -1, -1, 13, 14, -1, 16, -1, 18, -1, -1, + -1, 56, 23, -1, -1, -1, 27, -1, 29, 64, + -1, 32, -1, -1, 35, 36, -1, 38, -1, -1, + 41, -1, -1, 44, 45, 46, -1, -1, 49, 50, + -1, -1, -1, -1, 89, -1, -1, 58, -1, -1, + -1, 62, 63, 64, -1, 66, -1, 68, 69, -1, + 71, -1, 107, 74, 75, -1, -1, -1, -1, 114, + -1, -1, 83, 84, -1, -1, 121, -1, -1, -1, + -1, 92, -1, -1, -1, -1, -1, -1, -1, 134, + 135, -1, -1, -1, 139, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 150, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 170, -1, 172, 173, -1, + -1, 176, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, -1, 211, 212, 213, 214, + -1, -1, 217, 3, 4, 5, -1, -1, 8, 9, + -1, -1, -1, 13, 14, -1, 16, -1, 18, -1, + -1, -1, -1, 23, -1, -1, -1, 27, 243, 29, + -1, -1, 32, -1, -1, 35, 36, -1, 38, -1, + -1, 41, -1, -1, 44, 45, 46, -1, -1, 49, + 50, -1, -1, -1, -1, -1, -1, 272, 58, -1, + -1, -1, 62, 63, 64, -1, 66, -1, 68, 69, + -1, 71, -1, -1, 74, 75, -1, -1, -1, -1, + -1, -1, -1, 83, 84, -1, -1, -1, -1, -1, + -1, -1, 92, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 3, 4, 5, -1, -1, -1, -1, -1, + -1, -1, -1, 14, -1, 16, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 27, -1, 29, -1, + -1, 32, -1, -1, 35, 36, -1, 38, -1, 354, + 355, 356, 357, 44, 45, -1, -1, -1, 49, 50, + -1, 3, 4, 5, -1, -1, 8, 9, -1, -1, + 375, 13, 14, 64, 16, -1, 18, -1, 69, 384, + -1, 23, -1, 74, 75, 27, -1, 29, -1, -1, + 32, -1, 83, 35, 36, 400, 38, -1, -1, 41, + -1, -1, 44, 45, 46, -1, -1, 49, 50, -1, + -1, 416, 417, 418, -1, -1, 58, -1, -1, -1, + 62, 63, 64, -1, 66, -1, 68, 69, -1, 71, + -1, -1, 74, 75, 3, 4, 5, -1, -1, 8, + 9, 83, 84, -1, 13, 14, -1, 16, -1, 18, + 92, -1, -1, -1, 23, -1, -1, -1, 27, -1, + 29, -1, -1, 32, -1, -1, 35, 36, -1, 38, + -1, -1, 41, -1, -1, 44, 45, 46, -1, -1, + 49, 50, -1, -1, -1, -1, -1, -1, -1, 58, + -1, -1, -1, 62, 63, 64, -1, 66, -1, 68, + 69, -1, 71, -1, -1, 74, 75, -1, -1, -1, + -1, -1, -1, -1, 83, 84, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 535, 536, 537, 538, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 562, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 573, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 617, -1, 619 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const unsigned char yystos[] = +{ + 0, 87, 88, 89, 90, 94, 95, 211, 123, 211, + 101, 211, 164, 211, 0, 3, 4, 5, 14, 16, + 27, 29, 32, 35, 36, 38, 44, 45, 49, 50, + 64, 69, 74, 75, 83, 96, 97, 98, 99, 102, + 105, 106, 117, 119, 121, 149, 151, 153, 155, 157, + 159, 161, 182, 205, 8, 9, 13, 18, 23, 41, + 46, 58, 62, 63, 66, 68, 71, 84, 96, 126, + 145, 147, 58, 71, 137, 7, 15, 42, 43, 52, + 58, 69, 73, 84, 174, 202, 204, 205, 211, 91, + 202, 202, 202, 202, 202, 201, 205, 211, 202, 202, + 202, 202, 202, 201, 202, 202, 201, 27, 91, 91, + 202, 91, 91, 91, 91, 201, 91, 91, 202, 91, + 127, 91, 201, 138, 91, 3, 4, 210, 91, 91, + 91, 201, 91, 91, 91, 91, 203, 205, 211, 91, + 118, 120, 122, 158, 91, 162, 160, 156, 150, 183, + 91, 152, 154, 107, 202, 205, 3, 4, 208, 91, + 5, 210, 5, 210, 210, 203, 91, 210, 24, 148, + 91, 210, 91, 196, 211, 91, 91, 173, 210, 91, + 170, 199, 201, 171, 208, 172, 208, 91, 169, 201, + 168, 198, 201, 196, 205, 206, 207, 211, 92, 203, + 91, 91, 91, 91, 103, 91, 91, 91, 91, 91, + 203, 91, 91, 91, 91, 92, 208, 124, 205, 92, + 92, 92, 92, 92, 92, 3, 4, 5, 209, 92, + 91, 92, 206, 92, 128, 211, 146, 210, 211, 209, + 139, 211, 92, 165, 92, 19, 92, 208, 20, 92, + 208, 209, 92, 92, 51, 92, 205, 92, 123, 123, + 123, 164, 104, 211, 167, 211, 166, 211, 164, 164, + 186, 211, 100, 164, 164, 108, 211, 203, 208, 125, + 211, 92, 208, 92, 40, 53, 54, 55, 56, 59, + 72, 92, 129, 130, 131, 132, 133, 134, 135, 51, + 58, 92, 39, 53, 59, 72, 92, 140, 141, 142, + 143, 163, 211, 91, 205, 208, 91, 205, 208, 92, + 91, 92, 92, 92, 92, 58, 92, 7, 33, 42, + 43, 47, 52, 58, 69, 73, 92, 174, 7, 42, + 43, 47, 52, 58, 69, 73, 76, 78, 80, 92, + 161, 174, 92, 92, 11, 57, 85, 86, 92, 182, + 184, 187, 190, 193, 101, 92, 92, 81, 92, 109, + 92, 92, 92, 205, 208, 91, 91, 91, 91, 91, + 91, 91, 91, 201, 91, 91, 91, 91, 43, 52, + 92, 205, 91, 205, 91, 208, 200, 201, 201, 91, + 91, 91, 91, 91, 91, 201, 91, 91, 91, 91, + 91, 91, 91, 201, 91, 91, 91, 91, 91, 202, + 202, 202, 202, 92, 110, 210, 81, 208, 136, 208, + 211, 208, 208, 208, 208, 208, 208, 200, 91, 144, + 208, 211, 208, 208, 208, 91, 91, 208, 208, 208, + 208, 92, 91, 173, 181, 197, 211, 170, 171, 180, + 210, 172, 91, 169, 168, 173, 170, 171, 175, 210, + 172, 91, 169, 168, 178, 211, 176, 197, 177, 197, + 185, 188, 191, 194, 91, 111, 91, 81, 92, 208, + 208, 92, 92, 92, 92, 208, 208, 92, 209, 92, + 208, 92, 208, 208, 171, 172, 208, 208, 208, 208, + 92, 209, 92, 92, 208, 92, 92, 92, 92, 209, + 92, 92, 92, 92, 92, 92, 210, 92, 209, 92, + 92, 37, 92, 92, 92, 91, 91, 91, 91, 112, + 208, 91, 208, 91, 208, 208, 208, 208, 92, 92, + 208, 92, 92, 92, 92, 208, 208, 208, 208, 92, + 92, 92, 91, 186, 189, 211, 192, 211, 195, 211, + 22, 43, 52, 79, 92, 208, 112, 208, 208, 208, + 208, 92, 92, 208, 92, 92, 208, 208, 179, 211, + 92, 58, 65, 92, 58, 65, 92, 58, 92, 187, + 91, 205, 91, 91, 202, 208, 92, 208, 208, 208, + 92, 208, 92, 92, 92, 161, 201, 91, 201, 91, + 201, 205, 91, 115, 208, 116, 208, 91, 208, 92, + 208, 208, 208, 91, 197, 91, 197, 91, 208, 208, + 19, 92, 208, 20, 92, 208, 113, 92, 92, 208, + 208, 209, 92, 209, 92, 209, 208, 208, 91, 205, + 208, 91, 205, 208, 114, 208, 92, 208, 208, 92, + 92, 92, 208, 208, 205, 91, 205, 91, 208, 10, + 21, 67, 92, 208, 208, 208, 92, 92, 208, 208, + 208, 208, 91, 91, 205, 91, 208, 208, 208, 208, + 208, 208, 205, 91, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 92, 92, 208, 208, 208, + 208, 208, 208, 208, 92, 92, 92, 92, 92, 92, + 208, 208, 208 +}; #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) # define YYSIZE_T __SIZE_TYPE__ @@ -1211,29 +1456,35 @@ union yyalloc #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 +#define YYEMPTY (-2) #define YYEOF 0 + #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab +#define YYABORT goto yyabortlab #define YYERROR goto yyerrlab1 + + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ + #define YYFAIL goto yyerrlab + #define YYRECOVERING() (!!yyerrstatus) + #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ - yychar1 = YYTRANSLATE (yychar); \ + yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { \ - yyerror ("syntax error: cannot back up"); \ + yyerror ("syntax error: cannot back up");\ YYERROR; \ } \ while (0) @@ -1241,41 +1492,24 @@ while (0) #define YYTERROR 1 #define YYERRCODE 256 - /* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). - - When YYLLOC_DEFAULT is run, CURRENT is set the location of the - first token. By default, to implement support for ranges, extend - its range to the last symbol. */ + are run). */ #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# 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. */ -#if YYPURE -# if YYLSP_NEEDED -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval, &yylloc) -# endif -# else /* !YYLSP_NEEDED */ -# ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -# else -# define YYLEX yylex (&yylval) -# endif -# endif /* !YYLSP_NEEDED */ -#else /* !YYPURE */ -# define YYLEX yylex () -#endif /* !YYPURE */ - +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1290,13 +1524,93 @@ 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 (cinluded). | +`------------------------------------------------------------------*/ + +#if defined (__STDC__) || defined (__cplusplus) +static void +yy_stack_print (short *bottom, short *top) +#else +static void +yy_stack_print (bottom, top) + short *bottom; + short *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 @@ -1316,8 +1630,10 @@ int yydebug; #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif + -#ifdef YYERROR_VERBOSE + +#if YYERROR_VERBOSE # ifndef yystrlen # if defined (__GLIBC__) && defined (_STRING_H) @@ -1367,86 +1683,134 @@ yystpcpy (yydest, yysrc) } # endif # endif -#endif + +#endif /* !YYERROR_VERBOSE */ + -#line 315 "/usr/share/bison/bison.simple" +#if YYDEBUG +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +#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; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM # if defined (__STDC__) || defined (__cplusplus) -# define YYPARSE_PARAM_ARG void *YYPARSE_PARAM -# define YYPARSE_PARAM_DECL +int yyparse (void *YYPARSE_PARAM); # else -# define YYPARSE_PARAM_ARG YYPARSE_PARAM -# define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +int yyparse (); # endif -#else /* !YYPARSE_PARAM */ -# define YYPARSE_PARAM_ARG -# define YYPARSE_PARAM_DECL -#endif /* !YYPARSE_PARAM */ - -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -# ifdef YYPARSE_PARAM -int yyparse (void *); -# else +#else /* ! YYPARSE_PARAM */ +#if defined (__STDC__) || defined (__cplusplus) int yyparse (void); -# endif +#else +int yyparse (); #endif +#endif /* ! YYPARSE_PARAM */ -/* YY_DECL_VARIABLES -- depending whether we use a pure parser, - variables are global, or local to YYPARSE. */ -#define YY_DECL_NON_LSP_VARIABLES \ -/* The lookahead symbol. */ \ -int yychar; \ - \ -/* The semantic value of the lookahead symbol. */ \ -YYSTYPE yylval; \ - \ -/* Number of parse errors so far. */ \ + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ int yynerrs; -#if YYLSP_NEEDED -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES \ - \ -/* Location data for the lookahead symbol. */ \ -YYLTYPE yylloc; -#else -# define YY_DECL_VARIABLES \ -YY_DECL_NON_LSP_VARIABLES -#endif -/* If nonreentrant, generate the variables here. */ - -#if !YYPURE -YY_DECL_VARIABLES -#endif /* !YYPURE */ +/*----------. +| 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 (YYPARSE_PARAM_ARG) - YYPARSE_PARAM_DECL -{ - /* If reentrant, generate the variables here. */ -#if YYPURE - YY_DECL_VARIABLES -#endif /* !YYPURE */ +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 yychar1 = 0; + int yytoken = 0; /* Three stacks and their tools: `yyss': related to states, @@ -1456,7 +1820,7 @@ yyparse (YYPARSE_PARAM_ARG) Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ - /* The state stack. */ + /* The state stack. */ short yyssa[YYINITDEPTH]; short *yyss = yyssa; register short *yyssp; @@ -1466,31 +1830,19 @@ yyparse (YYPARSE_PARAM_ARG) YYSTYPE *yyvs = yyvsa; register YYSTYPE *yyvsp; -#if YYLSP_NEEDED - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; -#endif -#if YYLSP_NEEDED -# define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -# define YYPOPSTACK (yyvsp--, yyssp--) -#endif + +#define YYPOPSTACK (yyvsp--, yyssp--) YYSIZE_T yystacksize = YYINITDEPTH; - /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; -#if YYLSP_NEEDED - YYLTYPE yyloc; -#endif + /* When reducing, the number of symbols on the RHS of the reduced - rule. */ + rule. */ int yylen; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1507,9 +1859,7 @@ yyparse (YYPARSE_PARAM_ARG) yyssp = yyss; yyvsp = yyvs; -#if YYLSP_NEEDED - yylsp = yyls; -#endif + goto yysetstate; /*------------------------------------------------------------. @@ -1524,7 +1874,7 @@ yyparse (YYPARSE_PARAM_ARG) yysetstate: *yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; @@ -1537,24 +1887,17 @@ yyparse (YYPARSE_PARAM_ARG) YYSTYPE *yyvs1 = yyvs; short *yyss1 = yyss; + /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. */ -# if YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ + 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), - &yyls1, yysize * sizeof (*yylsp), + &yystacksize); - yyls = yyls1; -# else - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); -# endif + yyss = yyss1; yyvs = yyvs1; } @@ -1563,10 +1906,10 @@ yyparse (YYPARSE_PARAM_ARG) goto yyoverflowlab; # else /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) + if (YYMAXDEPTH <= yystacksize) goto yyoverflowlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) + if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { @@ -1577,10 +1920,8 @@ yyparse (YYPARSE_PARAM_ARG) goto yyoverflowlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); -# if YYLSP_NEEDED - YYSTACK_RELOCATE (yyls); -# endif -# undef YYSTACK_RELOCATE + +# undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } @@ -1589,14 +1930,12 @@ yyparse (YYPARSE_PARAM_ARG) yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; -#if YYLSP_NEEDED - yylsp = yyls + yysize - 1; -#endif + YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); - if (yyssp >= yyss + yystacksize - 1) + if (yyss + yystacksize - 1 <= yyssp) YYABORT; } @@ -1604,7 +1943,6 @@ yyparse (YYPARSE_PARAM_ARG) goto yybackup; - /*-----------. | yybackup. | `-----------*/ @@ -1617,88 +1955,55 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYFLAG) + 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 token in external form. */ - + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - + yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE (yychar); - -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables - which are defined only if `YYDEBUG' is set. */ - if (yydebug) - { - YYFPRINTF (stderr, "Next token is %d (%s", - yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise - meaning of a token, for further debugging info. */ -# ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -# endif - YYFPRINTF (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* 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]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) + if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %d (%s), ", - yychar, yytname[yychar1])); + YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif + /* Count tokens shifted since error; after three, turn off error status. */ @@ -1729,49 +2034,28 @@ yyreduce: /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. - Otherwise, the following line sets YYVAL to the semantic value of - the lookahead token. This behavior is undocumented and Bison + 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]; -#if YYLSP_NEEDED - /* Similarly for the default location. Let the user run additional - commands if for instance locations are ranges. */ - yyloc = yylsp[1-yylen]; - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); -#endif -#if YYDEBUG - /* We have to keep this `#if YYDEBUG', since we use variables which - are defined only if `YYDEBUG' is set. */ - if (yydebug) + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int yyi; - - YYFPRINTF (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++) - YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); - YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - switch (yyn) { - -case 6: + case 7: #line 232 "parser.yxx" -{ + { assert(!egg_stack.empty()); DCAST(EggData, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 24: + + case 25: #line 275 "parser.yxx" -{ + { string strval = yyvsp[-1]._string; EggCoordinateSystem *cs = new EggCoordinateSystem; @@ -1784,15 +2068,17 @@ case 24: yyval._egg = cs; } break; -case 25: + + case 26: #line 298 "parser.yxx" -{ + { yyval._egg = new EggComment(yyvsp[-3]._string, yyvsp[-1]._string); } break; -case 26: + + case 27: #line 312 "parser.yxx" -{ + { string tref_name = yyvsp[-2]._string; Filename filename = yyvsp[0]._string; EggTexture *texture = new EggTexture(tref_name, filename); @@ -1805,16 +2091,18 @@ case 26: egg_stack.push_back(texture); } break; -case 27: + + case 28: #line 325 "parser.yxx" -{ + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 29: + + case 30: #line 341 "parser.yxx" -{ + { EggTexture *texture = DCAST(EggTexture, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -1991,6 +2279,9 @@ case 29: texture->set_combine_operand(EggTexture::CC_alpha, 2, co); } + } else if (cmp_nocase_uh(name, "saved_result") == 0) { + texture->set_saved_result(((int)value) != 0); + } else if (cmp_nocase_uh(name, "tex_gen") == 0) { EggTexture::TexGen tex_gen = EggTexture::string_tex_gen(strval); if (tex_gen == EggTexture::TG_unspecified) { @@ -2096,9 +2387,10 @@ case 29: } } break; -case 31: -#line 634 "parser.yxx" -{ + + case 32: +#line 637 "parser.yxx" + { string mref_name = yyvsp[-1]._string; EggMaterial *material = new EggMaterial(mref_name); @@ -2110,16 +2402,18 @@ case 31: egg_stack.push_back(material); } break; -case 32: -#line 646 "parser.yxx" -{ + + case 33: +#line 649 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 34: -#line 662 "parser.yxx" -{ + + case 35: +#line 665 "parser.yxx" + { EggMaterial *material = DCAST(EggMaterial, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -2203,18 +2497,20 @@ case 34: } } break; -case 35: -#line 757 "parser.yxx" -{ + + case 36: +#line 760 "parser.yxx" + { string node_name = yyvsp[-3]._string; Filename filename = yyvsp[-1]._string; EggExternalReference *ref = new EggExternalReference(node_name, filename); yyval._egg = ref; } break; -case 36: -#line 764 "parser.yxx" -{ + + case 37: +#line 767 "parser.yxx" + { if (cmp_nocase_uh(yyvsp[-5]._string, "group") != 0) { eggyyerror("keyword 'group' expected"); } @@ -2224,9 +2520,10 @@ case 36: yyval._egg = ref; } break; -case 37: -#line 784 "parser.yxx" -{ + + case 38: +#line 787 "parser.yxx" + { string name = yyvsp[0]._string; EggVertexPool *pool = NULL; @@ -2250,31 +2547,35 @@ case 37: egg_stack.push_back(pool); } break; -case 38: -#line 808 "parser.yxx" -{ + + case 39: +#line 811 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 41: -#line 836 "parser.yxx" -{ + + case 42: +#line 839 "parser.yxx" + { egg_stack.push_back(new EggVertex); } break; -case 42: -#line 840 "parser.yxx" -{ + + case 43: +#line 843 "parser.yxx" + { PT(EggVertex) vtx = DCAST(EggVertex, egg_stack.back()); egg_stack.pop_back(); DCAST(EggVertexPool, egg_stack.back())->add_vertex(vtx); } break; -case 43: -#line 847 "parser.yxx" -{ + + case 44: +#line 850 "parser.yxx" + { vertex_index = (int)yyvsp[0]._number; EggVertexPool *pool = DCAST(EggVertexPool, egg_stack.back()); @@ -2299,9 +2600,10 @@ case 43: egg_stack.push_back(new EggVertex); } break; -case 44: -#line 872 "parser.yxx" -{ + + case 45: +#line 875 "parser.yxx" + { PT(EggVertex) vtx = DCAST(EggVertex, egg_stack.back()); egg_stack.pop_back(); @@ -2311,33 +2613,38 @@ case 44: } } break; -case 45: -#line 893 "parser.yxx" -{ + + case 46: +#line 896 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_pos(yyvsp[0]._number); } break; -case 46: -#line 897 "parser.yxx" -{ + + case 47: +#line 900 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_pos(LPoint2d(yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 47: -#line 901 "parser.yxx" -{ + + case 48: +#line 904 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_pos(LPoint3d(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 48: -#line 905 "parser.yxx" -{ + + case 49: +#line 908 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_pos(LPoint4d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 49: -#line 909 "parser.yxx" -{ + + case 50: +#line 912 "parser.yxx" + { EggVertex *vertex = DCAST(EggVertex, egg_stack.back()); EggVertexUV *uv = new EggVertexUV(yyvsp[-1]._string, TexCoordd::zero()); egg_stack.push_back(uv); @@ -2348,15 +2655,17 @@ case 49: } } break; -case 50: -#line 920 "parser.yxx" -{ + + case 51: +#line 923 "parser.yxx" + { egg_stack.pop_back(); } break; -case 53: -#line 926 "parser.yxx" -{ + + case 54: +#line 929 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs. insert(EggMorphVertex(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2364,9 +2673,10 @@ case 53: } } break; -case 54: -#line 934 "parser.yxx" -{ + + case 55: +#line 937 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_dxyzs. insert(EggMorphVertex(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2374,15 +2684,17 @@ case 54: } } break; -case 55: -#line 953 "parser.yxx" -{ + + case 56: +#line 956 "parser.yxx" + { DCAST(EggVertexUV, egg_stack.back())->set_uv(TexCoordd(yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 56: -#line 957 "parser.yxx" -{ + + case 57: +#line 960 "parser.yxx" + { if (DCAST(EggVertexUV, egg_stack.back())->has_tangent()) { eggyywarning("Ignoring repeated tangent"); } else { @@ -2390,9 +2702,10 @@ case 56: } } break; -case 57: -#line 965 "parser.yxx" -{ + + case 58: +#line 968 "parser.yxx" + { if (DCAST(EggVertexUV, egg_stack.back())->has_binormal()) { eggyywarning("Ignoring repeated binormal"); } else { @@ -2400,9 +2713,10 @@ case 57: } } break; -case 58: -#line 973 "parser.yxx" -{ + + case 59: +#line 976 "parser.yxx" + { bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs. insert(EggMorphTexCoord(yyvsp[-4]._string, LVector2d(yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2410,9 +2724,10 @@ case 58: } } break; -case 59: -#line 981 "parser.yxx" -{ + + case 60: +#line 984 "parser.yxx" + { bool inserted = DCAST(EggVertexUV, egg_stack.back())->_duvs. insert(EggMorphTexCoord(yyvsp[-3]._string, LVector2d(yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2420,15 +2735,17 @@ case 59: } } break; -case 60: -#line 999 "parser.yxx" -{ + + case 61: +#line 1002 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 61: -#line 1003 "parser.yxx" -{ + + case 62: +#line 1006 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals. insert(EggMorphNormal(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2436,9 +2753,10 @@ case 61: } } break; -case 62: -#line 1011 "parser.yxx" -{ + + case 63: +#line 1014 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_dnormals. insert(EggMorphNormal(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2446,15 +2764,17 @@ case 62: } } break; -case 63: -#line 1029 "parser.yxx" -{ + + case 64: +#line 1032 "parser.yxx" + { DCAST(EggVertex, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 64: -#line 1033 "parser.yxx" -{ + + case 65: +#line 1036 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas. insert(EggMorphColor(yyvsp[-6]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2462,9 +2782,10 @@ case 64: } } break; -case 65: -#line 1041 "parser.yxx" -{ + + case 66: +#line 1044 "parser.yxx" + { bool inserted = DCAST(EggVertex, egg_stack.back())->_drgbas. insert(EggMorphColor(yyvsp[-5]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -2472,53 +2793,60 @@ case 65: } } break; -case 66: -#line 1059 "parser.yxx" -{ + + case 67: +#line 1062 "parser.yxx" + { EggGroup *group = new EggGroup(yyvsp[0]._string); egg_stack.push_back(group); } break; -case 67: -#line 1064 "parser.yxx" -{ + + case 68: +#line 1067 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 68: -#line 1079 "parser.yxx" -{ + + case 69: +#line 1082 "parser.yxx" + { EggGroup *group = new EggGroup(yyvsp[0]._string); group->set_group_type(EggGroup::GT_joint); egg_stack.push_back(group); } break; -case 69: -#line 1085 "parser.yxx" -{ + + case 70: +#line 1088 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 70: -#line 1100 "parser.yxx" -{ + + case 71: +#line 1103 "parser.yxx" + { EggGroup *group = new EggGroup(yyvsp[0]._string); group->set_group_type(EggGroup::GT_instance); egg_stack.push_back(group); } break; -case 71: -#line 1106 "parser.yxx" -{ + + case 72: +#line 1109 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 73: -#line 1122 "parser.yxx" -{ + + case 74: +#line 1125 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -2648,9 +2976,10 @@ case 73: } } break; -case 74: -#line 1252 "parser.yxx" -{ + + case 75: +#line 1255 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string strval = yyvsp[-1]._string; @@ -2662,33 +2991,37 @@ case 74: } } break; -case 75: -#line 1264 "parser.yxx" -{ + + case 76: +#line 1267 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); group->set_billboard_center(LPoint3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number)); } break; -case 76: -#line 1269 "parser.yxx" -{ + + case 77: +#line 1272 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string name = yyvsp[-4]._string; group->set_collision_name(name); } break; -case 77: -#line 1276 "parser.yxx" -{ + + case 78: +#line 1279 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); int value = (int)yyvsp[-1]._number; group->set_dcs_type(value!=0 ? EggGroup::DC_default : EggGroup::DC_none); } break; -case 78: -#line 1282 "parser.yxx" -{ + + case 79: +#line 1285 "parser.yxx" + { // The special flavor of DCS, with { sync } or { nosync }. EggGroup *group = DCAST(EggGroup, egg_stack.back()); string strval = yyvsp[-1]._string; @@ -2701,18 +3034,20 @@ case 78: } } break; -case 79: -#line 1295 "parser.yxx" -{ + + case 80: +#line 1298 "parser.yxx" + { // The traditional flavor of DART, with { 0 } or { 1 }. EggGroup *group = DCAST(EggGroup, egg_stack.back()); int value = (int)yyvsp[-1]._number; group->set_dart_type(value!=0 ? EggGroup::DT_default : EggGroup::DT_none); } break; -case 80: -#line 1302 "parser.yxx" -{ + + case 81: +#line 1305 "parser.yxx" + { // The special flavor of DART, with { sync } or { nosync }. EggGroup *group = DCAST(EggGroup, egg_stack.back()); string strval = yyvsp[-1]._string; @@ -2725,54 +3060,61 @@ case 80: } } break; -case 81: -#line 1315 "parser.yxx" -{ + + case 82: +#line 1318 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); int value = (int)yyvsp[-1]._number; group->set_switch_flag(value!=0); } break; -case 82: -#line 1321 "parser.yxx" -{ + + case 83: +#line 1324 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string type = yyvsp[-1]._string; group->add_object_type(type); } break; -case 83: -#line 1327 "parser.yxx" -{ + + case 84: +#line 1330 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); int value = (int)yyvsp[-1]._number; group->set_model_flag(value!=0); } break; -case 84: -#line 1333 "parser.yxx" -{ + + case 85: +#line 1336 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); group->set_tag(yyvsp[-3]._string, yyvsp[-1]._string); } break; -case 85: -#line 1338 "parser.yxx" -{ + + case 86: +#line 1341 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); int value = (int)yyvsp[-1]._number; group->set_texlist_flag(value!=0); } break; -case 89: -#line 1347 "parser.yxx" -{ + + case 90: +#line 1350 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 90: -#line 1361 "parser.yxx" -{ + + case 91: +#line 1364 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string strval = yyvsp[0]._string; @@ -2792,9 +3134,10 @@ case 90: } } break; -case 92: -#line 1392 "parser.yxx" -{ + + case 93: +#line 1395 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); string strval = yyvsp[0]._string; @@ -2806,57 +3149,66 @@ case 92: } } break; -case 93: -#line 1414 "parser.yxx" -{ + + case 94: +#line 1417 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->clear_transform(); } break; -case 103: -#line 1440 "parser.yxx" -{ + + case 104: +#line 1443 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_translate(LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number)); } break; -case 104: -#line 1446 "parser.yxx" -{ + + case 105: +#line 1449 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_rotx(yyvsp[-1]._number); } break; -case 105: -#line 1452 "parser.yxx" -{ + + case 106: +#line 1455 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_roty(yyvsp[-1]._number); } break; -case 106: -#line 1458 "parser.yxx" -{ + + case 107: +#line 1461 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_rotz(yyvsp[-1]._number); } break; -case 107: -#line 1464 "parser.yxx" -{ + + case 108: +#line 1467 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_rotate(yyvsp[-4]._number, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number)); } break; -case 108: -#line 1470 "parser.yxx" -{ + + case 109: +#line 1473 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_scale(LVecBase3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number)); } break; -case 109: -#line 1474 "parser.yxx" -{ + + case 110: +#line 1477 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_uniform_scale(yyvsp[-1]._number); } break; -case 112: -#line 1489 "parser.yxx" -{ + + case 113: +#line 1492 "parser.yxx" + { DCAST(EggGroup, egg_stack.back())->add_matrix (LMatrix4d(yyvsp[-15]._number, yyvsp[-14]._number, yyvsp[-13]._number, yyvsp[-12]._number, yyvsp[-11]._number, yyvsp[-10]._number, yyvsp[-9]._number, yyvsp[-8]._number, @@ -2864,47 +3216,54 @@ case 112: yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 113: -#line 1508 "parser.yxx" -{ + + case 114: +#line 1511 "parser.yxx" + { matrix_2d = LMatrix3d::ident_mat(); } break; -case 114: -#line 1512 "parser.yxx" -{ + + case 115: +#line 1515 "parser.yxx" + { DCAST(EggTexture, egg_stack.back())->set_transform(matrix_2d); } break; -case 120: -#line 1534 "parser.yxx" -{ + + case 121: +#line 1537 "parser.yxx" + { matrix_2d *= LMatrix3d::translate_mat(yyvsp[-2]._number, yyvsp[-1]._number); } break; -case 121: -#line 1540 "parser.yxx" -{ + + case 122: +#line 1543 "parser.yxx" + { matrix_2d *= LMatrix3d::rotate_mat(yyvsp[-1]._number); } break; -case 122: -#line 1546 "parser.yxx" -{ + + case 123: +#line 1549 "parser.yxx" + { matrix_2d *= LMatrix3d::scale_mat(yyvsp[-2]._number, yyvsp[-1]._number); } break; -case 125: -#line 1559 "parser.yxx" -{ + + case 126: +#line 1562 "parser.yxx" + { matrix_2d *= LMatrix3d(yyvsp[-8]._number, yyvsp[-7]._number, yyvsp[-6]._number, yyvsp[-5]._number, yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number); } break; -case 126: -#line 1576 "parser.yxx" -{ + + case 127: +#line 1579 "parser.yxx" + { if (yyvsp[-2]._egg != (EggVertexPool *)NULL) { EggVertexPool *pool = DCAST(EggVertexPool, yyvsp[-2]._egg); EggGroup *group = DCAST(EggGroup, egg_stack.back()); @@ -2926,15 +3285,17 @@ case 126: } } break; -case 127: -#line 1609 "parser.yxx" -{ + + case 128: +#line 1612 "parser.yxx" + { yyval._number = 1.0; } break; -case 128: -#line 1613 "parser.yxx" -{ + + case 129: +#line 1616 "parser.yxx" + { string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; double result = yyvsp[-5]._number; @@ -2948,114 +3309,131 @@ case 128: yyval._number = result; } break; -case 130: -#line 1650 "parser.yxx" -{ + + case 131: +#line 1653 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); group->set_lod(EggSwitchConditionDistance(yyvsp[-8]._number, yyvsp[-7]._number, LPoint3d(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number))); } break; -case 131: -#line 1655 "parser.yxx" -{ + + case 132: +#line 1658 "parser.yxx" + { EggGroup *group = DCAST(EggGroup, egg_stack.back()); group->set_lod(EggSwitchConditionDistance(yyvsp[-9]._number, yyvsp[-8]._number, LPoint3d(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number), yyvsp[-7]._number)); } break; -case 132: -#line 1672 "parser.yxx" -{ + + case 133: +#line 1675 "parser.yxx" + { egg_stack.push_back(new EggPolygon(yyvsp[0]._string)); } break; -case 133: -#line 1676 "parser.yxx" -{ + + case 134: +#line 1679 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 134: -#line 1691 "parser.yxx" -{ + + case 135: +#line 1694 "parser.yxx" + { egg_stack.push_back(new EggTriangleFan(yyvsp[0]._string)); } break; -case 135: -#line 1695 "parser.yxx" -{ + + case 136: +#line 1698 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 136: -#line 1710 "parser.yxx" -{ + + case 137: +#line 1713 "parser.yxx" + { egg_stack.push_back(new EggTriangleStrip(yyvsp[0]._string)); } break; -case 137: -#line 1714 "parser.yxx" -{ + + case 138: +#line 1717 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 138: -#line 1729 "parser.yxx" -{ + + case 139: +#line 1732 "parser.yxx" + { egg_stack.push_back(new EggPoint(yyvsp[0]._string)); } break; -case 139: -#line 1733 "parser.yxx" -{ + + case 140: +#line 1736 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 140: -#line 1748 "parser.yxx" -{ + + case 141: +#line 1751 "parser.yxx" + { egg_stack.push_back(new EggLine(yyvsp[0]._string)); } break; -case 141: -#line 1752 "parser.yxx" -{ + + case 142: +#line 1755 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 142: -#line 1767 "parser.yxx" -{ + + case 143: +#line 1770 "parser.yxx" + { egg_stack.push_back(new EggNurbsSurface(yyvsp[0]._string)); } break; -case 143: -#line 1771 "parser.yxx" -{ + + case 144: +#line 1774 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 144: -#line 1786 "parser.yxx" -{ + + case 145: +#line 1789 "parser.yxx" + { egg_stack.push_back(new EggNurbsCurve(yyvsp[0]._string)); } break; -case 145: -#line 1790 "parser.yxx" -{ + + case 146: +#line 1793 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 150: -#line 1820 "parser.yxx" -{ + + case 151: +#line 1823 "parser.yxx" + { if (!egg_stack.back()->is_of_type(EggCompositePrimitive::get_class_type())) { eggyyerror("Not a composite primitive; components are not allowed here."); } else { @@ -3069,18 +3447,20 @@ case 150: egg_stack.push_back(new EggPolygon); } break; -case 151: -#line 1834 "parser.yxx" -{ + + case 152: +#line 1837 "parser.yxx" + { PT(EggPrimitive) prim = DCAST(EggPrimitive, egg_stack.back()); egg_stack.pop_back(); PT(EggCompositePrimitive) comp = DCAST(EggCompositePrimitive, egg_stack.back()); comp->set_component((int)yyvsp[-4]._number, prim); } break; -case 159: -#line 1848 "parser.yxx" -{ + + case 160: +#line 1851 "parser.yxx" + { EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3143,17 +3523,19 @@ case 159: } } break; -case 171: -#line 1932 "parser.yxx" -{ + + case 172: +#line 1935 "parser.yxx" + { EggNurbsCurve *curve = DCAST(EggNurbsCurve, yyvsp[0]._egg); EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); nurbs->_curves_on_surface.push_back(curve); } break; -case 173: -#line 1939 "parser.yxx" -{ + + case 174: +#line 1942 "parser.yxx" + { EggNurbsSurface *primitive = DCAST(EggNurbsSurface, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3206,9 +3588,10 @@ case 173: } } break; -case 184: -#line 2013 "parser.yxx" -{ + + case 185: +#line 2016 "parser.yxx" + { EggNurbsCurve *primitive = DCAST(EggNurbsCurve, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3267,18 +3650,20 @@ case 184: } } break; -case 185: -#line 2082 "parser.yxx" -{ + + case 186: +#line 2085 "parser.yxx" + { if (yyvsp[0]._egg != (EggTexture *)NULL) { EggTexture *texture = DCAST(EggTexture, yyvsp[0]._egg); DCAST(EggPrimitive, egg_stack.back())->add_texture(texture); } } break; -case 186: -#line 2099 "parser.yxx" -{ + + case 187: +#line 2102 "parser.yxx" + { EggTexture *texture = NULL; // Defining a texture on-the-fly. @@ -3308,24 +3693,27 @@ case 186: DCAST(EggPrimitive, egg_stack.back())->add_texture(texture); } break; -case 187: -#line 2139 "parser.yxx" -{ + + case 188: +#line 2142 "parser.yxx" + { if (yyvsp[0]._egg != (EggMaterial *)NULL) { EggMaterial *material = DCAST(EggMaterial, yyvsp[0]._egg); DCAST(EggPrimitive, egg_stack.back())->set_material(material); } } break; -case 188: -#line 2156 "parser.yxx" -{ + + case 189: +#line 2159 "parser.yxx" + { DCAST(EggPrimitive, egg_stack.back())->set_normal(Normald(yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 189: -#line 2160 "parser.yxx" -{ + + case 190: +#line 2163 "parser.yxx" + { bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals. insert(EggMorphNormal(yyvsp[-5]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -3333,9 +3721,10 @@ case 189: } } break; -case 190: -#line 2168 "parser.yxx" -{ + + case 191: +#line 2171 "parser.yxx" + { bool inserted = DCAST(EggPrimitive, egg_stack.back())->_dnormals. insert(EggMorphNormal(yyvsp[-4]._string, LVector3d(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -3343,15 +3732,17 @@ case 190: } } break; -case 191: -#line 2186 "parser.yxx" -{ + + case 192: +#line 2189 "parser.yxx" + { DCAST(EggPrimitive, egg_stack.back())->set_color(Colorf(yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number, yyvsp[0]._number)); } break; -case 192: -#line 2190 "parser.yxx" -{ + + case 193: +#line 2193 "parser.yxx" + { bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas. insert(EggMorphColor(yyvsp[-6]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -3359,9 +3750,10 @@ case 192: } } break; -case 193: -#line 2198 "parser.yxx" -{ + + case 194: +#line 2201 "parser.yxx" + { bool inserted = DCAST(EggPrimitive, egg_stack.back())->_drgbas. insert(EggMorphColor(yyvsp[-5]._string, LVector4f(yyvsp[-4]._number, yyvsp[-3]._number, yyvsp[-2]._number, yyvsp[-1]._number))).second; if (!inserted) { @@ -3369,17 +3761,19 @@ case 193: } } break; -case 194: -#line 2216 "parser.yxx" -{ + + case 195: +#line 2219 "parser.yxx" + { EggPrimitive *primitive = DCAST(EggPrimitive, egg_stack.back()); int value = (int)yyvsp[0]._number; primitive->set_bface_flag(value!=0); } break; -case 195: -#line 2232 "parser.yxx" -{ + + case 196: +#line 2235 "parser.yxx" + { if (yyvsp[-2]._egg != (EggVertexPool *)NULL) { EggVertexPool *pool = DCAST(EggVertexPool, yyvsp[-2]._egg); EggPrimitive *prim = DCAST(EggPrimitive, egg_stack.back()); @@ -3400,9 +3794,10 @@ case 195: } } break; -case 196: -#line 2263 "parser.yxx" -{ + + case 197: +#line 2266 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); int u_order = (int)yyvsp[-1]._number; int v_order = (int)yyvsp[0]._number; @@ -3410,9 +3805,10 @@ case 196: nurbs->set_v_order(v_order); } break; -case 197: -#line 2281 "parser.yxx" -{ + + case 198: +#line 2284 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); PTA_double nums = yyvsp[0]._number_list; @@ -3422,9 +3818,10 @@ case 197: } } break; -case 198: -#line 2301 "parser.yxx" -{ + + case 199: +#line 2304 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); PTA_double nums = yyvsp[0]._number_list; @@ -3434,24 +3831,27 @@ case 198: } } break; -case 199: -#line 2321 "parser.yxx" -{ + + case 200: +#line 2324 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); nurbs->_trims.push_back(EggNurbsSurface::Trim()); } break; -case 201: -#line 2337 "parser.yxx" -{ + + case 202: +#line 2340 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); nassertr(!nurbs->_trims.empty(), 0); nurbs->_trims.back().push_back(EggNurbsSurface::Loop()); } break; -case 202: -#line 2343 "parser.yxx" -{ + + case 203: +#line 2346 "parser.yxx" + { EggNurbsSurface *nurbs = DCAST(EggNurbsSurface, egg_stack.back()); nassertr(!nurbs->_trims.empty(), 0); nassertr(!nurbs->_trims.back().empty(), 0); @@ -3459,17 +3859,19 @@ case 202: nurbs->_trims.back().back().push_back(curve); } break; -case 203: -#line 2362 "parser.yxx" -{ + + case 204: +#line 2365 "parser.yxx" + { EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back()); int order = (int)yyvsp[0]._number; nurbs->set_order(order); } break; -case 204: -#line 2378 "parser.yxx" -{ + + case 205: +#line 2381 "parser.yxx" + { EggNurbsCurve *nurbs = DCAST(EggNurbsCurve, egg_stack.back()); PTA_double nums = yyvsp[0]._number_list; @@ -3479,83 +3881,95 @@ case 204: } } break; -case 205: -#line 2399 "parser.yxx" -{ + + case 206: +#line 2402 "parser.yxx" + { EggTable *table = new EggTable(yyvsp[0]._string); table->set_table_type(EggTable::TT_table); egg_stack.push_back(table); } break; -case 206: -#line 2405 "parser.yxx" -{ + + case 207: +#line 2408 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 207: -#line 2421 "parser.yxx" -{ + + case 208: +#line 2424 "parser.yxx" + { EggTable *table = new EggTable(yyvsp[0]._string); table->set_table_type(EggTable::TT_bundle); egg_stack.push_back(table); } break; -case 208: -#line 2427 "parser.yxx" -{ + + case 209: +#line 2430 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 210: -#line 2444 "parser.yxx" -{ + + case 211: +#line 2447 "parser.yxx" + { DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 211: -#line 2448 "parser.yxx" -{ + + case 212: +#line 2451 "parser.yxx" + { DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 212: -#line 2452 "parser.yxx" -{ + + case 213: +#line 2455 "parser.yxx" + { DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 213: -#line 2456 "parser.yxx" -{ + + case 214: +#line 2459 "parser.yxx" + { DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 214: -#line 2460 "parser.yxx" -{ + + case 215: +#line 2463 "parser.yxx" + { DCAST(EggTable, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 215: -#line 2475 "parser.yxx" -{ + + case 216: +#line 2478 "parser.yxx" + { EggSAnimData *anim_data = new EggSAnimData(yyvsp[0]._string); egg_stack.push_back(anim_data); } break; -case 216: -#line 2480 "parser.yxx" -{ + + case 217: +#line 2483 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 218: -#line 2497 "parser.yxx" -{ + + case 219: +#line 2500 "parser.yxx" + { EggSAnimData *anim_data = DCAST(EggSAnimData, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3567,29 +3981,33 @@ case 218: } } break; -case 219: -#line 2509 "parser.yxx" -{ + + case 220: +#line 2512 "parser.yxx" + { DCAST(EggSAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list); } break; -case 220: -#line 2523 "parser.yxx" -{ + + case 221: +#line 2526 "parser.yxx" + { EggXfmAnimData *anim_data = new EggXfmAnimData(yyvsp[0]._string); egg_stack.push_back(anim_data); } break; -case 221: -#line 2528 "parser.yxx" -{ + + case 222: +#line 2531 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 223: -#line 2545 "parser.yxx" -{ + + case 224: +#line 2548 "parser.yxx" + { EggXfmAnimData *anim_data = DCAST(EggXfmAnimData, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3606,29 +4024,33 @@ case 223: } } break; -case 224: -#line 2562 "parser.yxx" -{ + + case 225: +#line 2565 "parser.yxx" + { DCAST(EggXfmAnimData, egg_stack.back())->set_data(yyvsp[-1]._number_list); } break; -case 225: -#line 2576 "parser.yxx" -{ + + case 226: +#line 2579 "parser.yxx" + { EggXfmSAnim *anim_group = new EggXfmSAnim(yyvsp[0]._string); egg_stack.push_back(anim_group); } break; -case 226: -#line 2581 "parser.yxx" -{ + + case 227: +#line 2584 "parser.yxx" + { yyval._egg = egg_stack.back(); egg_stack.pop_back(); } break; -case 228: -#line 2598 "parser.yxx" -{ + + case 229: +#line 2601 "parser.yxx" + { EggXfmSAnim *anim_group = DCAST(EggXfmSAnim, egg_stack.back()); string name = yyvsp[-3]._string; double value = yyvsp[-1]._number; @@ -3643,39 +4065,45 @@ case 228: } } break; -case 229: -#line 2613 "parser.yxx" -{ + + case 230: +#line 2616 "parser.yxx" + { DCAST(EggXfmSAnim, egg_stack.back())->add_child(DCAST(EggNode, yyvsp[0]._egg)); } break; -case 230: -#line 2628 "parser.yxx" -{ + + case 231: +#line 2631 "parser.yxx" + { yyval._number_list = PTA_double::empty_array(0); } break; -case 231: -#line 2632 "parser.yxx" -{ + + case 232: +#line 2635 "parser.yxx" + { yyval._number_list.push_back((double)yyvsp[0]._number); } break; -case 232: -#line 2646 "parser.yxx" -{ + + case 233: +#line 2649 "parser.yxx" + { yyval._number_list = PTA_double::empty_array(0); } break; -case 233: -#line 2650 "parser.yxx" -{ + + case 234: +#line 2653 "parser.yxx" + { yyval._number_list.push_back(yyvsp[0]._number); } break; -case 234: -#line 2664 "parser.yxx" -{ + + case 235: +#line 2667 "parser.yxx" + { string name = yyvsp[0]._string; Textures::iterator vpi = textures.find(name); if (vpi == textures.end()) { @@ -3686,9 +4114,10 @@ case 234: } } break; -case 235: -#line 2685 "parser.yxx" -{ + + case 236: +#line 2688 "parser.yxx" + { string name = yyvsp[0]._string; Materials::iterator vpi = materials.find(name); if (vpi == materials.end()) { @@ -3699,9 +4128,10 @@ case 235: } } break; -case 236: -#line 2706 "parser.yxx" -{ + + case 237: +#line 2709 "parser.yxx" + { string name = yyvsp[0]._string; VertexPools::iterator vpi = vertex_pools.find(name); if (vpi == vertex_pools.end()) { @@ -3716,95 +4146,109 @@ case 236: } } break; -case 237: -#line 2732 "parser.yxx" -{ + + case 238: +#line 2735 "parser.yxx" + { eggyyerror("Name required."); yyval._string = ""; } break; -case 240: -#line 2761 "parser.yxx" -{ + + case 241: +#line 2764 "parser.yxx" + { eggyyerror("String required."); yyval._string = ""; } break; -case 242: -#line 2777 "parser.yxx" -{ + + case 243: +#line 2780 "parser.yxx" + { yyval._string = ""; } break; -case 244: -#line 2795 "parser.yxx" -{ + + case 245: +#line 2798 "parser.yxx" + { yyval._string = yyvsp[0]._string; } break; -case 245: -#line 2799 "parser.yxx" -{ + + case 246: +#line 2802 "parser.yxx" + { yyval._string = yyvsp[0]._string; } break; -case 247: -#line 2816 "parser.yxx" -{ + + case 248: +#line 2819 "parser.yxx" + { yyval._string = ""; } break; -case 248: -#line 2820 "parser.yxx" -{ + + case 249: +#line 2823 "parser.yxx" + { yyval._string = yyvsp[0]._string; } break; -case 249: -#line 2836 "parser.yxx" -{ + + case 250: +#line 2839 "parser.yxx" + { yyval._string = yyvsp[0]._string; } break; -case 250: -#line 2840 "parser.yxx" -{ + + case 251: +#line 2843 "parser.yxx" + { yyval._string = yyvsp[-1]._string + "\n" + yyvsp[0]._string; } break; -case 252: -#line 2855 "parser.yxx" -{ + + case 253: +#line 2858 "parser.yxx" + { yyval._number = yyvsp[0]._ulong; } break; -case 253: -#line 2870 "parser.yxx" -{ + + case 254: +#line 2873 "parser.yxx" + { yyval._number = yyvsp[0]._number; yyval._ulong = (unsigned long)yyvsp[0]._number; yyval._string = yyvsp[0]._string; } break; -case 254: -#line 2876 "parser.yxx" -{ + + case 255: +#line 2879 "parser.yxx" + { yyval._number = yyvsp[0]._ulong; yyval._ulong = yyvsp[0]._ulong; yyval._string = yyvsp[0]._string; } break; -case 255: -#line 2882 "parser.yxx" -{ + + case 256: +#line 2885 "parser.yxx" + { yyval._number = 0.0; yyval._ulong = 0; yyval._string = yyvsp[0]._string; } break; -case 256: -#line 2899 "parser.yxx" -{ + + case 257: +#line 2902 "parser.yxx" + { int i = (int)yyvsp[0]._number; if ((double)i != yyvsp[0]._number) { eggyywarning("Integer expected."); @@ -3812,38 +4256,28 @@ case 256: } } break; -case 257: -#line 2907 "parser.yxx" -{ + + case 258: +#line 2910 "parser.yxx" + { yyval._number = yyvsp[0]._ulong; } break; -} -#line 705 "/usr/share/bison/bison.simple" + } + +/* Line 999 of yacc.c. */ +#line 4272 "y.tab.c" yyvsp -= yylen; yyssp -= yylen; -#if YYLSP_NEEDED - yylsp -= yylen; -#endif -#if YYDEBUG - if (yydebug) - { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); - } -#endif + + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#if YYLSP_NEEDED - *++yylsp = yyloc; -#endif + /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule @@ -3851,11 +4285,11 @@ case 257: yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTBASE]; + yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; @@ -3868,145 +4302,132 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE +#if YYERROR_VERBOSE yyn = yypact[yystate]; - if (yyn > YYFLAG && yyn < YYLAST) + if (YYPACT_NINF < yyn && yyn < YYLAST) { YYSIZE_T yysize = 0; + int yytype = YYTRANSLATE (yychar); + const char* yyprefix; char *yymsg; - int yyx, yycount; + int yyx; - yycount = 0; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("parse error, unexpected ") + 1; - yysize += yystrlen (yytname[YYTRANSLATE (yychar)]); + 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, "parse error, unexpected "); - yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]); + char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); + yyp = yystpcpy (yyp, yytname[yytype]); if (yycount < 5) { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx) + yyprefix = ", expecting "; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); + yyp = yystpcpy (yyp, yyprefix); yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; + yyprefix = " or "; } } yyerror (yymsg); YYSTACK_FREE (yymsg); } else - yyerror ("parse error; also virtual memory exhausted"); + yyerror ("syntax error; also virtual memory exhausted"); } else -#endif /* defined (YYERROR_VERBOSE) */ - yyerror ("parse error"); +#endif /* YYERROR_VERBOSE */ + yyerror ("syntax error"); } - goto yyerrlab1; -/*--------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action | -`--------------------------------------------------*/ -yyerrlab1: + if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ - /* return failure if at end of input */ + /* Return failure if at end of input. */ if (yychar == YYEOF) - YYABORT; - YYDPRINTF ((stderr, "Discarding token %d (%s).\n", - yychar, yytname[yychar1])); + { + /* Pop the error token. */ + YYPOPSTACK; + /* Pop the rest of the stack. */ + while (yyss < yyssp) + { + YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); + yydestruct (yystos[*yyssp], yyvsp); + YYPOPSTACK; + } + YYABORT; + } + + YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); + yydestruct (yytoken, &yylval); yychar = YYEMPTY; + } /* Else will try to reuse lookahead token after shifting the error token. */ - - yyerrstatus = 3; /* Each real token shifted decrements this */ - - goto yyerrhandle; + goto yyerrlab1; -/*-------------------------------------------------------------------. -| yyerrdefault -- current state does not do anything special for the | -| error token. | -`-------------------------------------------------------------------*/ -yyerrdefault: -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ +/*----------------------------------------------------. +| yyerrlab1 -- error raised explicitly by an action. | +`----------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ - /* If its default is to accept any token, ok. Otherwise pop it. */ - yyn = yydefact[yystate]; - if (yyn) - goto yydefault; -#endif - - -/*---------------------------------------------------------------. -| yyerrpop -- pop the current state because it cannot handle the | -| error token | -`---------------------------------------------------------------*/ -yyerrpop: - if (yyssp == yyss) - YYABORT; - yyvsp--; - yystate = *--yyssp; -#if YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG - if (yydebug) + for (;;) { - short *yyssp1 = yyss - 1; - YYFPRINTF (stderr, "Error: state stack now"); - while (yyssp1 != yyssp) - YYFPRINTF (stderr, " %d", *++yyssp1); - YYFPRINTF (stderr, "\n"); + 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); + yyvsp--; + yystate = *--yyssp; + + YY_STACK_PRINT (yyss, yyssp); } -#endif - -/*--------------. -| yyerrhandle. | -`--------------*/ -yyerrhandle: - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; @@ -4014,9 +4435,7 @@ yyerrhandle: YYDPRINTF ((stderr, "Shifting error token, ")); *++yyvsp = yylval; -#if YYLSP_NEEDED - *++yylsp = yylloc; -#endif + yystate = yyn; goto yynewstate; @@ -4036,13 +4455,15 @@ yyabortlab: yyresult = 1; goto yyreturn; -/*---------------------------------------------. -| yyoverflowab -- parser overflow comes here. | -`---------------------------------------------*/ +#ifndef yyoverflow +/*----------------------------------------------. +| yyoverflowlab -- parser overflow comes here. | +`----------------------------------------------*/ yyoverflowlab: yyerror ("parser stack overflow"); yyresult = 2; /* Fall through. */ +#endif yyreturn: #ifndef yyoverflow @@ -4051,4 +4472,6 @@ yyreturn: #endif return yyresult; } -#line 2914 "parser.yxx" + + + diff --git a/panda/src/egg/parser.h.prebuilt b/panda/src/egg/parser.h.prebuilt index fefbea44dc..3723b8cbf2 100644 --- a/panda/src/egg/parser.h.prebuilt +++ b/panda/src/egg/parser.h.prebuilt @@ -1,96 +1,224 @@ -#ifndef BISON_Y_TAB_H -# define BISON_Y_TAB_H +/* A Bison parser, made by GNU Bison 1.875b. */ -# define NUMBER 257 -# define ULONG 258 -# define STRING 259 -# define BEZIERCURVE 260 -# define BFACE 261 -# define BILLBOARD 262 -# define BILLBOARDCENTER 263 -# define BINORMAL 264 -# define BUNDLE 265 -# define CLOSED 266 -# define COLLIDE 267 -# define COMMENT 268 -# define COMPONENT 269 -# define COORDSYSTEM 270 -# define CV 271 -# define DART 272 -# define DNORMAL 273 -# define DRGBA 274 -# define DUV 275 -# define DXYZ 276 -# define DCS 277 -# define DISTANCE 278 -# define DTREF 279 -# define DYNAMICVERTEXPOOL 280 -# define EXTERNAL_FILE 281 -# define FLIGHT 282 -# define GROUP 283 -# define HIP 284 -# define INTANGENT 285 -# define JOINT 286 -# define KNOTS 287 -# define INCLUDE 288 -# define INSTANCE 289 -# define LINE 290 -# define LOOP 291 -# define MATERIAL 292 -# define MATRIX3 293 -# define MATRIX4 294 -# define MODEL 295 -# define MREF 296 -# define NORMAL 297 -# define NURBSCURVE 298 -# define NURBSSURFACE 299 -# define OBJECTTYPE 300 -# define ORDER 301 -# define OUTTANGENT 302 -# define POINTLIGHT 303 -# define POLYGON 304 -# define REF 305 -# define RGBA 306 -# define ROTATE 307 -# define ROTX 308 -# define ROTY 309 -# define ROTZ 310 -# define SANIM 311 -# define SCALAR 312 -# define SCALE 313 -# define SEQUENCE 314 -# define SHADING 315 -# define SWITCH 316 -# define SWITCHCONDITION 317 -# define TABLE 318 -# define TABLE_V 319 -# define TAG 320 -# define TANGENT 321 -# define TEXLIST 322 -# define TEXTURE 323 -# define TLENGTHS 324 -# define TRANSFORM 325 -# define TRANSLATE 326 -# define TREF 327 -# define TRIANGLEFAN 328 -# define TRIANGLESTRIP 329 -# define TRIM 330 -# define TXT 331 -# define UKNOTS 332 -# define UV 333 -# define VKNOTS 334 -# define VERTEX 335 -# define VERTEXANIM 336 -# define VERTEXPOOL 337 -# define VERTEXREF 338 -# define XFMANIM 339 -# define XFMSANIM 340 -# define START_EGG 341 -# define START_GROUP_BODY 342 -# define START_TEXTURE_BODY 343 -# define START_PRIMITIVE_BODY 344 +/* Skeleton parser for Yacc-like parsing with Bison, + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003 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 { + NUMBER = 258, + ULONG = 259, + STRING = 260, + BEZIERCURVE = 261, + BFACE = 262, + BILLBOARD = 263, + BILLBOARDCENTER = 264, + BINORMAL = 265, + BUNDLE = 266, + CLOSED = 267, + COLLIDE = 268, + COMMENT = 269, + COMPONENT = 270, + COORDSYSTEM = 271, + CV = 272, + DART = 273, + DNORMAL = 274, + DRGBA = 275, + DUV = 276, + DXYZ = 277, + DCS = 278, + DISTANCE = 279, + DTREF = 280, + DYNAMICVERTEXPOOL = 281, + EXTERNAL_FILE = 282, + FLIGHT = 283, + GROUP = 284, + HIP = 285, + INTANGENT = 286, + JOINT = 287, + KNOTS = 288, + INCLUDE = 289, + INSTANCE = 290, + LINE = 291, + LOOP = 292, + MATERIAL = 293, + MATRIX3 = 294, + MATRIX4 = 295, + MODEL = 296, + MREF = 297, + NORMAL = 298, + NURBSCURVE = 299, + NURBSSURFACE = 300, + OBJECTTYPE = 301, + ORDER = 302, + OUTTANGENT = 303, + POINTLIGHT = 304, + POLYGON = 305, + REF = 306, + RGBA = 307, + ROTATE = 308, + ROTX = 309, + ROTY = 310, + ROTZ = 311, + SANIM = 312, + SCALAR = 313, + SCALE = 314, + SEQUENCE = 315, + SHADING = 316, + SWITCH = 317, + SWITCHCONDITION = 318, + TABLE = 319, + TABLE_V = 320, + TAG = 321, + TANGENT = 322, + TEXLIST = 323, + TEXTURE = 324, + TLENGTHS = 325, + TRANSFORM = 326, + TRANSLATE = 327, + TREF = 328, + TRIANGLEFAN = 329, + TRIANGLESTRIP = 330, + TRIM = 331, + TXT = 332, + UKNOTS = 333, + UV = 334, + VKNOTS = 335, + VERTEX = 336, + VERTEXANIM = 337, + VERTEXPOOL = 338, + VERTEXREF = 339, + XFMANIM = 340, + XFMSANIM = 341, + START_EGG = 342, + START_GROUP_BODY = 343, + START_TEXTURE_BODY = 344, + START_PRIMITIVE_BODY = 345 + }; +#endif +#define NUMBER 258 +#define ULONG 259 +#define STRING 260 +#define BEZIERCURVE 261 +#define BFACE 262 +#define BILLBOARD 263 +#define BILLBOARDCENTER 264 +#define BINORMAL 265 +#define BUNDLE 266 +#define CLOSED 267 +#define COLLIDE 268 +#define COMMENT 269 +#define COMPONENT 270 +#define COORDSYSTEM 271 +#define CV 272 +#define DART 273 +#define DNORMAL 274 +#define DRGBA 275 +#define DUV 276 +#define DXYZ 277 +#define DCS 278 +#define DISTANCE 279 +#define DTREF 280 +#define DYNAMICVERTEXPOOL 281 +#define EXTERNAL_FILE 282 +#define FLIGHT 283 +#define GROUP 284 +#define HIP 285 +#define INTANGENT 286 +#define JOINT 287 +#define KNOTS 288 +#define INCLUDE 289 +#define INSTANCE 290 +#define LINE 291 +#define LOOP 292 +#define MATERIAL 293 +#define MATRIX3 294 +#define MATRIX4 295 +#define MODEL 296 +#define MREF 297 +#define NORMAL 298 +#define NURBSCURVE 299 +#define NURBSSURFACE 300 +#define OBJECTTYPE 301 +#define ORDER 302 +#define OUTTANGENT 303 +#define POINTLIGHT 304 +#define POLYGON 305 +#define REF 306 +#define RGBA 307 +#define ROTATE 308 +#define ROTX 309 +#define ROTY 310 +#define ROTZ 311 +#define SANIM 312 +#define SCALAR 313 +#define SCALE 314 +#define SEQUENCE 315 +#define SHADING 316 +#define SWITCH 317 +#define SWITCHCONDITION 318 +#define TABLE 319 +#define TABLE_V 320 +#define TAG 321 +#define TANGENT 322 +#define TEXLIST 323 +#define TEXTURE 324 +#define TLENGTHS 325 +#define TRANSFORM 326 +#define TRANSLATE 327 +#define TREF 328 +#define TRIANGLEFAN 329 +#define TRIANGLESTRIP 330 +#define TRIM 331 +#define TXT 332 +#define UKNOTS 333 +#define UV 334 +#define VKNOTS 335 +#define VERTEX 336 +#define VERTEXANIM 337 +#define VERTEXPOOL 338 +#define VERTEXREF 339 +#define XFMANIM 340 +#define XFMSANIM 341 +#define START_EGG 342 +#define START_GROUP_BODY 343 +#define START_TEXTURE_BODY 344 +#define START_PRIMITIVE_BODY 345 + + + + +#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +typedef int YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif extern YYSTYPE eggyylval; -#endif /* not BISON_Y_TAB_H */ + + diff --git a/panda/src/egg/parser.yxx b/panda/src/egg/parser.yxx index cc134aeacc..bf531ab05c 100644 --- a/panda/src/egg/parser.yxx +++ b/panda/src/egg/parser.yxx @@ -515,6 +515,9 @@ texture_body: texture->set_combine_operand(EggTexture::CC_alpha, 2, co); } + } else if (cmp_nocase_uh(name, "saved_result") == 0) { + texture->set_saved_result(((int)value) != 0); + } else if (cmp_nocase_uh(name, "tex_gen") == 0) { EggTexture::TexGen tex_gen = EggTexture::string_tex_gen(strval); if (tex_gen == EggTexture::TG_unspecified) { diff --git a/panda/src/egg2pg/eggLoader.cxx b/panda/src/egg2pg/eggLoader.cxx index 91135de41f..2ea3d70641 100644 --- a/panda/src/egg2pg/eggLoader.cxx +++ b/panda/src/egg2pg/eggLoader.cxx @@ -1198,6 +1198,8 @@ make_texture_stage(const EggTexture *egg_tex) { stage->set_alpha_scale(egg_tex->get_alpha_scale()); } + stage->set_saved_result(egg_tex->get_saved_result()); + stage->set_sort(egg_tex->get_multitexture_sort() * 10); if (egg_tex->has_priority()) { @@ -3155,6 +3157,9 @@ get_combine_source(const EggTexture *egg_tex, case EggTexture::CS_constant_color_scale: return TextureStage::CS_constant_color_scale; + + case EggTexture::CS_last_saved_result: + return TextureStage::CS_last_saved_result; }; return TextureStage::CS_undefined; diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index 0cea0adc1a..8ed156363c 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -518,7 +518,7 @@ reset() { _supports_texture_combine = has_extension("GL_ARB_texture_env_combine") || is_at_least_version(1, 3); - _supports_texture_crossbar = + _supports_texture_saved_result = has_extension("GL_ARB_texture_env_crossbar") || is_at_least_version(1, 4); _supports_texture_dot3 = has_extension("GL_ARB_texture_env_dot3") || is_at_least_version(1, 3); @@ -3556,40 +3556,40 @@ get_texture_combine_type(TextureStage::CombineMode cm) { //////////////////////////////////////////////////////////////////// GLint CLP(GraphicsStateGuardian):: get_texture_src_type(TextureStage::CombineSource cs, - const TextureStage *source_stage, - const TextureAttrib *attrib, int this_stage) const { + int last_stage, int last_saved_result, + int this_stage) const { switch (cs) { case TextureStage::CS_undefined: // fall through case TextureStage::CS_texture: return GL_TEXTURE; case TextureStage::CS_constant: return GL_CONSTANT; case TextureStage::CS_primary_color: return GL_PRIMARY_COLOR; - case TextureStage::CS_previous: return GL_PREVIOUS; case TextureStage::CS_constant_color_scale: return GL_CONSTANT; - case TextureStage::CS_crossbar_stage: - { - int n = attrib->find_on_stage(source_stage); - if (n >= 0) { - if (_supports_texture_crossbar) { - return GL_TEXTURE0 + n; - - } else if (n == this_stage) { - return GL_TEXTURE; - - } else if (n == this_stage - 1) { - return GL_PREVIOUS; - - } else { - GLCAT.warning() - << "Crossbar blending not supported\n"; - return GL_PRIMARY_COLOR; - } - } - GLCAT.warning() - << "TextureStage " << *attrib->get_on_stage(this_stage) - << " sources unused stage: " << *source_stage << "\n"; + case TextureStage::CS_previous: + if (last_stage == this_stage - 1) { + return GL_PREVIOUS; + } else if (last_stage == -1) { return GL_PRIMARY_COLOR; - } + } else if (_supports_texture_saved_result) { + return GL_TEXTURE0 + last_stage; + } else { + GLCAT.warning() + << "Current OpenGL driver does not support texture crossbar blending.\n"; + return GL_PRIMARY_COLOR; + } + + case TextureStage::CS_last_saved_result: + if (last_saved_result == this_stage - 1) { + return GL_PREVIOUS; + } else if (last_saved_result == -1) { + return GL_PRIMARY_COLOR; + } else if (_supports_texture_saved_result) { + return GL_TEXTURE0 + last_saved_result; + } else { + GLCAT.warning() + << "Current OpenGL driver does not support texture crossbar blending.\n"; + return GL_PRIMARY_COLOR; + } } GLCAT.error() @@ -4488,6 +4488,8 @@ do_issue_texture() { _texture_involves_color_scale = false; + int last_saved_result = -1; + int last_stage = -1; int i; for (i = 0; i < num_stages; i++) { TextureStage *stage = new_texture->get_on_stage(i); @@ -4573,8 +4575,7 @@ do_issue_texture() { case 3: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC2_RGB, get_texture_src_type(stage->get_combine_rgb_source2(), - stage->get_combine_rgb_source2_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND2_RGB, get_texture_operand_type(stage->get_combine_rgb_operand2())); // fall through @@ -4582,8 +4583,7 @@ do_issue_texture() { case 2: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC1_RGB, get_texture_src_type(stage->get_combine_rgb_source1(), - stage->get_combine_rgb_source1_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND1_RGB, get_texture_operand_type(stage->get_combine_rgb_operand1())); // fall through @@ -4591,8 +4591,7 @@ do_issue_texture() { case 1: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC0_RGB, get_texture_src_type(stage->get_combine_rgb_source0(), - stage->get_combine_rgb_source0_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND0_RGB, get_texture_operand_type(stage->get_combine_rgb_operand0())); // fall through @@ -4607,8 +4606,7 @@ do_issue_texture() { case 3: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC2_ALPHA, get_texture_src_type(stage->get_combine_alpha_source2(), - stage->get_combine_alpha_source2_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, get_texture_operand_type(stage->get_combine_alpha_operand2())); // fall through @@ -4616,8 +4614,7 @@ do_issue_texture() { case 2: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC1_ALPHA, get_texture_src_type(stage->get_combine_alpha_source1(), - stage->get_combine_alpha_source1_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, get_texture_operand_type(stage->get_combine_alpha_operand1())); // fall through @@ -4625,8 +4622,7 @@ do_issue_texture() { case 1: GLP(TexEnvi)(GL_TEXTURE_ENV, GL_SRC0_ALPHA, get_texture_src_type(stage->get_combine_alpha_source0(), - stage->get_combine_alpha_source0_stage(), - new_texture, i)); + last_stage, last_saved_result, i)); GLP(TexEnvi)(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, get_texture_operand_type(stage->get_combine_alpha_operand0())); // fall through @@ -4647,6 +4643,16 @@ do_issue_texture() { GLP(LoadIdentity)(); } } + + if (stage->get_saved_result()) { + // This texture's result will be "saved" for a future stage's + // input. + last_saved_result = i; + } else { + // This is a regular texture stage; it will be the "previous" + // input for the next stage. + last_stage = i; + } } // Disable the texture stages that are no longer used. diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.h b/panda/src/glstuff/glGraphicsStateGuardian_src.h index ccb91265ed..131ef85429 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.h +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.h @@ -224,8 +224,8 @@ protected: static GLint get_texture_apply_mode_type(TextureStage::Mode am); static GLint get_texture_combine_type(TextureStage::CombineMode cm); GLint get_texture_src_type(TextureStage::CombineSource cs, - const TextureStage *source_stage, - const TextureAttrib *attrib, int this_stage) const; + int last_stage, int last_saved_result, + int this_stage) const; static GLint get_texture_operand_type(TextureStage::CombineOperand co); static GLenum get_fog_mode_type(Fog::Mode m); static GLenum get_blend_equation_type(ColorBlendAttrib::Mode mode); diff --git a/panda/src/gobj/textureStage.I b/panda/src/gobj/textureStage.I index 62578aa7eb..b63e1f25fe 100755 --- a/panda/src/gobj/textureStage.I +++ b/panda/src/gobj/textureStage.I @@ -259,6 +259,41 @@ get_alpha_scale() const { return _alpha_scale; } +//////////////////////////////////////////////////////////////////// +// Function: TextureStage::set_saved_result +// Access: Published +// Description: Sets the saved_result flag. When this is true, the +// output of this stage is not part of the normal +// pipeline--that is, it will not be supplied as the +// "previous" source for the next texture stage--but it +// will instead be supplied as the "last_saved_result" +// source for any future stages, until the next +// TextureStage with a saved_result set true is +// encountered. +// +// This can be used to reuse the results of this texture +// stage as input to more than one stage later in the +// pipeline. +// +// The last texture in the pipeline (the one with the +// highest sort value) should not have this flag set. +//////////////////////////////////////////////////////////////////// +INLINE void TextureStage:: +set_saved_result(bool saved_result) { + _saved_result = saved_result; +} + +//////////////////////////////////////////////////////////////////// +// Function: TextureStage::get_saved_result +// Access: Published +// Description: Returns the current setting of the saved_result flag. +// See set_saved_result(). +//////////////////////////////////////////////////////////////////// +INLINE bool TextureStage:: +get_saved_result() const { + return _saved_result; +} + //////////////////////////////////////////////////////////////////// // Function: TextureStage::set_combine_rgb // Access: Published @@ -284,32 +319,6 @@ set_combine_rgb(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_replace only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0) { - nassertv(get_expected_num_combine_operands(mode) == 1); - nassertv(operand_valid_for_rgb(operand0)); - _mode = M_combine; - _num_combine_rgb_operands = 1; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_undefined; - _combine_rgb_operand1 = CO_undefined; - _combine_rgb_source2 = CS_undefined; - _combine_rgb_operand2 = CO_undefined; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::set_combine_rgb // Access: Published @@ -338,94 +347,6 @@ set_combine_rgb(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - _mode = M_combine; - _num_combine_rgb_operands = 2; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_undefined; - _combine_rgb_operand2 = CO_undefined; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - _mode = M_combine; - _num_combine_rgb_operands = 2; - _combine_rgb_mode = mode; - _combine_rgb_source0 = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_undefined; - _combine_rgb_operand2 = CO_undefined; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - _mode = M_combine; - _num_combine_rgb_operands = 2; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_undefined; - _combine_rgb_operand2 = CO_undefined; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::set_combine_rgb // Access: Published @@ -455,221 +376,6 @@ set_combine_rgb(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_crossbar_stage; - _combine_rgb_source2_stage = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_crossbar_stage; - _combine_rgb_source2_stage = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_crossbar_stage; - _combine_rgb_source2_stage = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_rgb -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_rgb(operand0)); - nassertv(operand_valid_for_rgb(operand1)); - nassertv(operand_valid_for_rgb(operand2)); - _mode = M_combine; - _num_combine_rgb_operands = 3; - _combine_rgb_mode = mode; - _combine_rgb_source0 = CS_crossbar_stage; - _combine_rgb_source0_stage = source0; - _combine_rgb_operand0 = operand0; - _combine_rgb_source1 = CS_crossbar_stage; - _combine_rgb_source1_stage = source1; - _combine_rgb_operand1 = operand1; - _combine_rgb_source2 = CS_crossbar_stage; - _combine_rgb_source2_stage = source2; - _combine_rgb_operand2 = operand2; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_rgb_mode // Access: Published @@ -702,21 +408,6 @@ get_combine_rgb_source0() const { return _combine_rgb_source0; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_rgb_source0_stage -// Access: Published -// Description: Get the TextureStage for source0 of combine_rgb_mode. -// This is valid only when get_combine_rgb_source0() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_rgb_source0_stage() const { - return _combine_rgb_source0_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_rgb_operand0 // Access: Published @@ -737,21 +428,6 @@ get_combine_rgb_source1() const { return _combine_rgb_source1; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_rgb_source1_stage -// Access: Published -// Description: Get the TextureStage for source1 of combine_rgb_mode. -// This is valid only when get_combine_rgb_source1() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_rgb_source1_stage() const { - return _combine_rgb_source1_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_rgb_operand1 // Access: Published @@ -772,21 +448,6 @@ get_combine_rgb_source2() const { return _combine_rgb_source2; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_rgb_source2_stage -// Access: Published -// Description: Get the TextureStage for source2 of combine_rgb_mode. -// This is valid only when get_combine_rgb_source2() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_rgb_source2_stage() const { - return _combine_rgb_source2_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_rgb_operand2 // Access: Published @@ -822,32 +483,6 @@ set_combine_alpha(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_replace only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0) { - nassertv(get_expected_num_combine_operands(mode) == 1); - nassertv(operand_valid_for_alpha(operand0)); - _mode = M_combine; - _num_combine_alpha_operands = 1; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_undefined; - _combine_alpha_operand1 = CO_undefined; - _combine_alpha_source2 = CS_undefined; - _combine_alpha_operand2 = CO_undefined; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::set_combine_alpha // Access: Published @@ -876,94 +511,6 @@ set_combine_alpha(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - _mode = M_combine; - _num_combine_alpha_operands = 2; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_undefined; - _combine_alpha_operand2 = CO_undefined; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - _mode = M_combine; - _num_combine_alpha_operands = 2; - _combine_alpha_mode = mode; - _combine_alpha_source0 = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_undefined; - _combine_alpha_operand2 = CO_undefined; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a two-parameter operation. Specifically, -// this is everything except for CM_replace and -// CM_interpolate. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1) { - nassertv(get_expected_num_combine_operands(mode) == 2); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - _mode = M_combine; - _num_combine_alpha_operands = 2; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_undefined; - _combine_alpha_operand2 = CO_undefined; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::set_combine_alpha // Access: Published @@ -993,221 +540,6 @@ set_combine_alpha(CombineMode mode, update_color_flags(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_crossbar_stage; - _combine_alpha_source2_stage = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_crossbar_stage; - _combine_alpha_source2_stage = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_crossbar_stage; - _combine_alpha_source2_stage = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::set_combine_alpha -// Access: Published -// Description: Specifies any of the CombineMode values that -// represent a one-parameter operation. Specifically, -// this is CM_interpolate only. -//////////////////////////////////////////////////////////////////// -INLINE void TextureStage:: -set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2) { - nassertv(get_expected_num_combine_operands(mode) == 3); - nassertv(operand_valid_for_alpha(operand0)); - nassertv(operand_valid_for_alpha(operand1)); - nassertv(operand_valid_for_alpha(operand2)); - _mode = M_combine; - _num_combine_alpha_operands = 3; - _combine_alpha_mode = mode; - _combine_alpha_source0 = CS_crossbar_stage; - _combine_alpha_source0_stage = source0; - _combine_alpha_operand0 = operand0; - _combine_alpha_source1 = CS_crossbar_stage; - _combine_alpha_source1_stage = source1; - _combine_alpha_operand1 = operand1; - _combine_alpha_source2 = CS_crossbar_stage; - _combine_alpha_source2_stage = source2; - _combine_alpha_operand2 = operand2; - - update_color_flags(); -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_alpha // Access: Published @@ -1240,21 +572,6 @@ get_combine_alpha_source0() const { return _combine_alpha_source0; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_alpha_source0_stage -// Access: Published -// Description: Get the TextureStage for source0 of combine_alpha_mode. -// This is valid only when get_combine_alpha_source0() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_alpha_source0_stage() const { - return _combine_alpha_source0_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_alpha_operand0 // Access: Published @@ -1275,21 +592,6 @@ get_combine_alpha_source1() const { return _combine_alpha_source1; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_alpha_source1_stage -// Access: Published -// Description: Get the TextureStage for source1 of combine_alpha_mode. -// This is valid only when get_combine_alpha_source1() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_alpha_source1_stage() const { - return _combine_alpha_source1_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_alpha_operand1 // Access: Published @@ -1310,21 +612,6 @@ get_combine_alpha_source2() const { return _combine_alpha_source2; } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::get_combine_alpha_source2_stage -// Access: Published -// Description: Get the TextureStage for source2 of combine_alpha_mode. -// This is valid only when get_combine_alpha_source2() -// returns CS_crossbar_stage, indicating that the source -// is from a particular TextureStage (which may or may -// not be the immediately preceding stage in the -// pipeline). -//////////////////////////////////////////////////////////////////// -INLINE const TextureStage *TextureStage:: -get_combine_alpha_source2_stage() const { - return _combine_alpha_source2_stage; -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_combine_alpha_operand2 // Access: Published diff --git a/panda/src/gobj/textureStage.cxx b/panda/src/gobj/textureStage.cxx index 7d99f552cb..11f23a0736 100755 --- a/panda/src/gobj/textureStage.cxx +++ b/panda/src/gobj/textureStage.cxx @@ -39,6 +39,7 @@ TextureStage(const string &name) { _color.set(0.0f, 0.0f, 0.0f, 1.0f); _rgb_scale = 1; _alpha_scale = 1; + _saved_result = false; _combine_rgb_mode = CM_undefined; _num_combine_rgb_operands = 0; _combine_rgb_source0 = CS_undefined; @@ -75,6 +76,7 @@ operator = (const TextureStage &other) { _color = other._color; _rgb_scale = other._rgb_scale; _alpha_scale = other._alpha_scale; + _saved_result = other._saved_result; _combine_rgb_mode = other._combine_rgb_mode; _combine_rgb_source0 = other._combine_rgb_source0; @@ -114,46 +116,41 @@ write(ostream &out) const { out << "TextureStage " << get_name() << ", sort = " << get_sort() << ", priority = " << get_priority() << "\n" << " texcoords = " << get_texcoord_name()->get_name() << ", mode = " << get_mode() << ", color = " << get_color() - << ", scale = " << get_rgb_scale() << ", " << get_alpha_scale() << "\n"; + << ", scale = " << get_rgb_scale() << ", " << get_alpha_scale() + << ", saved_result = " << get_saved_result() << "\n"; if (get_mode() == M_combine) { out << " RGB combine mode = " << get_combine_rgb_mode() << "\n"; if (get_num_combine_rgb_operands() >= 1) { - write_operand(out, 0, get_combine_rgb_source0(), - get_combine_rgb_source0_stage(), - get_combine_rgb_operand0()); + out << " 0: " << get_combine_rgb_source0() << ", " + << get_combine_rgb_operand0() << "\n"; } if (get_num_combine_rgb_operands() >= 2) { - write_operand(out, 1, get_combine_rgb_source1(), - get_combine_rgb_source1_stage(), - get_combine_rgb_operand1()); + out << " 1: " << get_combine_rgb_source1() << ", " + << get_combine_rgb_operand1() << "\n"; } if (get_num_combine_rgb_operands() >= 3) { - write_operand(out, 2, get_combine_rgb_source2(), - get_combine_rgb_source2_stage(), - get_combine_rgb_operand2()); + out << " 2: " << get_combine_rgb_source2() << ", " + << get_combine_rgb_operand2() << "\n"; } out << " alpha combine mode = " << get_combine_alpha_mode() << "\n"; if (get_num_combine_alpha_operands() >= 1) { - write_operand(out, 0, get_combine_alpha_source0(), - get_combine_alpha_source0_stage(), - get_combine_alpha_operand0()); + out << " 0: " << get_combine_alpha_source0() << ", " + << get_combine_alpha_operand0() << "\n"; } if (get_num_combine_alpha_operands() >= 2) { - write_operand(out, 1, get_combine_alpha_source1(), - get_combine_alpha_source1_stage(), - get_combine_alpha_operand1()); + out << " 1: " << get_combine_alpha_source1() << ", " + << get_combine_alpha_operand1() << "\n"; } if (get_num_combine_alpha_operands() >= 3) { - write_operand(out, 2, get_combine_alpha_source2(), - get_combine_alpha_source2_stage(), - get_combine_alpha_operand2()); + out << " 2: " << get_combine_alpha_source2() << ", " + << get_combine_alpha_operand2() << "\n"; } } } //////////////////////////////////////////////////////////////////// -// Function: TextureStage::output +// Function: TextureStage::Destructor // Access: Published // Description: Just a single line output //////////////////////////////////////////////////////////////////// @@ -162,25 +159,6 @@ output(ostream &out) const { out << "TextureStage " << get_name(); } -//////////////////////////////////////////////////////////////////// -// Function: TextureStage::write_operand -// Access: Private, Static -// Description: Used by write() to simply describe a single operand -// of the CM_combine mode (one of up to 3 defined by the -// stage). -//////////////////////////////////////////////////////////////////// -void TextureStage:: -write_operand(ostream &out, int operand_index, CombineSource source, - const TextureStage *source_stage, CombineOperand operand) { - if (source == CS_crossbar_stage) { - out << " " << operand_index << ": " - << *source_stage << ", " << operand << "\n"; - } else { - out << " " << operand_index << ": " - << source << ", " << operand << "\n"; - } -} - //////////////////////////////////////////////////////////////////// // Function: TextureStage::get_expected_num_combine_operands // Access: Private, Static @@ -308,7 +286,11 @@ fillin(DatagramIterator &scan, BamReader *manager) { _rgb_scale = scan.get_uint8(); _alpha_scale = scan.get_uint8(); - + _saved_result = false; + if (manager->get_file_minor_ver() >= 1) { + _saved_result = scan.get_bool(); + } + _combine_rgb_mode = (TextureStage::CombineMode) scan.get_uint8(); _num_combine_rgb_operands = scan.get_uint8(); _combine_rgb_source0 = (TextureStage::CombineSource) scan.get_uint8(); @@ -327,27 +309,6 @@ fillin(DatagramIterator &scan, BamReader *manager) { _combine_alpha_source2 = (TextureStage::CombineSource) scan.get_uint8(); _combine_alpha_operand2 = (TextureStage::CombineOperand) scan.get_uint8(); - // We only read these pointers if the source types indicate they are - // defined. - if (_combine_rgb_source0 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - if (_combine_rgb_source1 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - if (_combine_rgb_source2 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - if (_combine_alpha_source0 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - if (_combine_alpha_source1 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - if (_combine_alpha_source2 == CS_crossbar_stage) { - manager->read_pointer(scan); - } - update_color_flags(); } @@ -364,27 +325,6 @@ complete_pointers(TypedWritable **p_list, BamReader *manager) { _texcoord_name = DCAST(InternalName, p_list[pi++]); - // We only read these pointers if the source types indicate they are - // defined. - if (_combine_rgb_source0 == CS_crossbar_stage) { - _combine_rgb_source0_stage = DCAST(TextureStage, p_list[pi++]); - } - if (_combine_rgb_source1 == CS_crossbar_stage) { - _combine_rgb_source1_stage = DCAST(TextureStage, p_list[pi++]); - } - if (_combine_rgb_source2 == CS_crossbar_stage) { - _combine_rgb_source2_stage = DCAST(TextureStage, p_list[pi++]); - } - if (_combine_alpha_source0 == CS_crossbar_stage) { - _combine_alpha_source0_stage = DCAST(TextureStage, p_list[pi++]); - } - if (_combine_alpha_source1 == CS_crossbar_stage) { - _combine_alpha_source1_stage = DCAST(TextureStage, p_list[pi++]); - } - if (_combine_alpha_source2 == CS_crossbar_stage) { - _combine_alpha_source2_stage = DCAST(TextureStage, p_list[pi++]); - } - return pi; } @@ -411,6 +351,7 @@ write_datagram(BamWriter *manager, Datagram &me) { _color.write_datagram(me); me.add_uint8(_rgb_scale); me.add_uint8(_alpha_scale); + me.add_bool(_saved_result); me.add_uint8(_combine_rgb_mode); me.add_uint8(_num_combine_rgb_operands); @@ -429,27 +370,6 @@ write_datagram(BamWriter *manager, Datagram &me) { me.add_uint8(_combine_alpha_operand1); me.add_uint8(_combine_alpha_source2); me.add_uint8(_combine_alpha_operand2); - - // We only write these pointers if the source types indicate they - // are defined. - if (_combine_rgb_source0 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_rgb_source0_stage); - } - if (_combine_rgb_source1 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_rgb_source1_stage); - } - if (_combine_rgb_source2 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_rgb_source2_stage); - } - if (_combine_alpha_source0 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_alpha_source0_stage); - } - if (_combine_alpha_source1 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_alpha_source1_stage); - } - if (_combine_alpha_source2 == CS_crossbar_stage) { - manager->write_pointer(me, _combine_alpha_source2_stage); - } } } @@ -536,8 +456,8 @@ operator << (ostream &out, TextureStage::CombineSource cs) { case TextureStage::CS_constant_color_scale: return out << "constant_color_scale"; - case TextureStage::CS_crossbar_stage: - return out << "crossbar_stage"; + case TextureStage::CS_last_saved_result: + return out << "last_saved_result"; } return out << "**invalid CombineSource(" << (int)cs << ")**"; diff --git a/panda/src/gobj/textureStage.h b/panda/src/gobj/textureStage.h index 3c08d7706a..ad7f0f8a41 100644 --- a/panda/src/gobj/textureStage.h +++ b/panda/src/gobj/textureStage.h @@ -59,17 +59,17 @@ PUBLISHED: enum CombineMode { CM_undefined, - CM_replace, // 1 operand - CM_modulate, // 2 operands - CM_add, // 2 operands - CM_add_signed, // 2 operands - CM_interpolate, // 3 operands - CM_subtract, // 2 operands + CM_replace, + CM_modulate, + CM_add, + CM_add_signed, + CM_interpolate, + CM_subtract, // The following are valid only for combine_rgb, not // combine_alpha. - CM_dot3_rgb, // 2 operands - CM_dot3_rgba, // 2 operands + CM_dot3_rgb, + CM_dot3_rgba, }; enum CombineSource { @@ -79,7 +79,7 @@ PUBLISHED: CS_primary_color, CS_previous, CS_constant_color_scale, - CS_crossbar_stage, + CS_last_saved_result, }; enum CombineOperand { @@ -117,126 +117,43 @@ PUBLISHED: INLINE void set_alpha_scale(int alpha_scale); INLINE int get_alpha_scale() const; + INLINE void set_saved_result(bool saved_result); + INLINE bool get_saved_result() const; + INLINE void set_combine_rgb(CombineMode mode, CombineSource source0, CombineOperand operand0); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0); INLINE void set_combine_rgb(CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1); - INLINE void set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1); INLINE void set_combine_rgb(CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1, CombineSource source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_rgb(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE CombineMode get_combine_rgb_mode() const; INLINE int get_num_combine_rgb_operands() const; INLINE CombineSource get_combine_rgb_source0() const; - INLINE const TextureStage *get_combine_rgb_source0_stage() const; INLINE CombineOperand get_combine_rgb_operand0() const; INLINE CombineSource get_combine_rgb_source1() const; - INLINE const TextureStage *get_combine_rgb_source1_stage() const; INLINE CombineOperand get_combine_rgb_operand1() const; INLINE CombineSource get_combine_rgb_source2() const; - INLINE const TextureStage *get_combine_rgb_source2_stage() const; INLINE CombineOperand get_combine_rgb_operand2() const; INLINE void set_combine_alpha(CombineMode mode, CombineSource source0, CombineOperand operand0); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0); INLINE void set_combine_alpha(CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1); - INLINE void set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1); INLINE void set_combine_alpha(CombineMode mode, CombineSource source0, CombineOperand operand0, CombineSource source1, CombineOperand operand1, CombineSource source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - CombineSource source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - CombineSource source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - CombineSource source2, CombineOperand operand2); - INLINE void set_combine_alpha(CombineMode mode, - const TextureStage *source0, CombineOperand operand0, - const TextureStage *source1, CombineOperand operand1, - const TextureStage *source2, CombineOperand operand2); - INLINE CombineMode get_combine_alpha_mode() const; INLINE int get_num_combine_alpha_operands() const; INLINE CombineSource get_combine_alpha_source0() const; - INLINE const TextureStage *get_combine_alpha_source0_stage() const; INLINE CombineOperand get_combine_alpha_operand0() const; INLINE CombineSource get_combine_alpha_source1() const; - INLINE const TextureStage *get_combine_alpha_source1_stage() const; INLINE CombineOperand get_combine_alpha_operand1() const; INLINE CombineSource get_combine_alpha_source2() const; - INLINE const TextureStage *get_combine_alpha_source2_stage() const; INLINE CombineOperand get_combine_alpha_operand2() const; INLINE bool uses_color() const; @@ -253,11 +170,6 @@ public: private: INLINE void update_color_flags(); - static void write_operand(ostream &out, int operand_index, - CombineSource source, - const TextureStage *source_stage, - CombineOperand operand); - static int get_expected_num_combine_operands(CombineMode cm); static bool operand_valid_for_rgb(CombineOperand co); static bool operand_valid_for_alpha(CombineOperand co); @@ -270,31 +182,26 @@ private: Colorf _color; int _rgb_scale; int _alpha_scale; + bool _saved_result; bool _uses_color; bool _involves_color_scale; CombineMode _combine_rgb_mode; int _num_combine_rgb_operands; CombineSource _combine_rgb_source0; - CPT(TextureStage) _combine_rgb_source0_stage; CombineOperand _combine_rgb_operand0; CombineSource _combine_rgb_source1; - CPT(TextureStage) _combine_rgb_source1_stage; CombineOperand _combine_rgb_operand1; CombineSource _combine_rgb_source2; - CPT(TextureStage) _combine_rgb_source2_stage; CombineOperand _combine_rgb_operand2; CombineMode _combine_alpha_mode; int _num_combine_alpha_operands; CombineSource _combine_alpha_source0; - CPT(TextureStage) _combine_alpha_source0_stage; CombineOperand _combine_alpha_operand0; CombineSource _combine_alpha_source1; - CPT(TextureStage) _combine_alpha_source1_stage; CombineOperand _combine_alpha_operand1; CombineSource _combine_alpha_source2; - CPT(TextureStage) _combine_alpha_source2_stage; CombineOperand _combine_alpha_operand2; static PT(TextureStage) _default_stage; diff --git a/panda/src/putil/bam.h b/panda/src/putil/bam.h index 7b93b47470..ca001c2e8e 100644 --- a/panda/src/putil/bam.h +++ b/panda/src/putil/bam.h @@ -35,7 +35,8 @@ static const unsigned short _bam_major_ver = 5; // Bumped to major version 4 on 4/10/02 to store new scene graph. // Bumped to major version 5 on 5/6/05 for new Geom implementation. -static const unsigned short _bam_minor_ver = 0; +static const unsigned short _bam_minor_ver = 1; +// Bumped to minor version 1 on 7/14/05 to add TextureStage::_saved_result. #endif