aseFile.tab.cpp

Go to the documentation of this file.
00001 
00002 /*  A Bison parser, made from g:\\cxx\\scorched\\3dsparse\\aseFile.y
00003  by  GNU Bison version 1.25
00004   */
00005 
00006 #define YYBISON 1  /* Identify Bison output.  */
00007 
00008 #if !defined(__FreeBSD__) && !defined(__DARWIN__) && !defined(_WIN32)
00009 #define alloca 
00010 #endif //!defined(__FreeBSD__) && !defined(__DARWIN__)
00011 
00012 #define yyparse aseparse
00013 #define yylex aselex
00014 #define yyerror aseerror
00015 #define yylval aselval
00016 #define yychar asechar
00017 #define yydebug asedebug
00018 #define yynerrs asenerrs
00019 #define MAX_DIGIT       258
00020 #define MAX_FLOAT       259
00021 #define MAX_STRING      260
00022 #define MAX_LBRACKET    261
00023 #define MAX_RBRACKET    262
00024 #define MAX_ASCIIEXPORT_SYM     263
00025 #define MAX_COMMENT     264
00026 #define MAX_MESH_FACE_ID        265
00027 #define MAX_SCENE       266
00028 #define MAX_SCENE_TOKEN 267
00029 #define MAX_MATERIAL_LIST       268
00030 #define MAX_MATERIAL_LIST_TOKEN 269
00031 #define MAX_GEOMOBJECT  270
00032 #define MAX_NODE_NAME   271
00033 #define MAX_NODE_TM     272
00034 #define MAX_NODE_TM_TOKEN       273
00035 #define MAX_MESH        274
00036 #define MAX_TIMEVALUE   275
00037 #define MAX_MESH_NUMVERTEX      276
00038 #define MAX_MESH_NUMFACES       277
00039 #define MAX_MESH_VERTEX_LIST    278
00040 #define MAX_MESH_VERTEX 279
00041 #define MAX_MESH_FACE_LIST      280
00042 #define MAX_MESH_FACE   281
00043 #define MAX_MESH_SMOOTHING      282
00044 #define MAX_MESH_MTLID  283
00045 #define MAX_MESH_NUMTVERTEX     284
00046 #define MAX_MESH_NORMALS        285
00047 #define MAX_MESH_FACENORMAL     286
00048 #define MAX_MESH_VERTEXNORMAL   287
00049 #define MAX_PROP_MOTIONBLUR     288
00050 #define MAX_PROP_CASTSHADOW     289
00051 #define MAX_PROP_RECVSHADOW     290
00052 #define MAX_WIREFRAME_COLOR     291
00053 #define MAX_TM_ROW0     292
00054 #define MAX_TM_ROW1     293
00055 #define MAX_TM_ROW2     294
00056 #define MAX_TM_ROW3     295
00057 
00058 #include <common/Defines.h>
00059 #include <3dsparse/ASEModelFactory.h>
00060 
00061 static Vector tmRow[3];
00062 
00063 Face aseFace;
00064 int aseFaceNo;
00065 
00066 extern Vector aseVector;
00067 extern char aseString[1024];
00068 extern float aseFloat;
00069 extern int aseDigit;
00070 extern int aselex();
00071 
00072 int aseerror(const char *errmsg);
00073 int asewarning(const char *warningmsg);
00074 int asedebug(const char *debugmsg);
00075 
00076 extern char *asetext;
00077 extern int aselineno;
00078 
00079 #ifndef YYSTYPE
00080 #define YYSTYPE int
00081 #endif
00082 #include <stdio.h>
00083 
00084 #ifndef __cplusplus
00085 #ifndef __STDC__
00086 #define const
00087 #endif
00088 #endif
00089 
00090 
00091 
00092 #define YYFINAL         166
00093 #define YYFLAG          32768
00094 #define YYNTBASE        41
00095 
00096 #define YYTRANSLATE(x) ((unsigned)(x) <= 295 ? yytranslate[x] : 70)
00097 
00098 static const char yytranslate[] = {     0,
00099      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00100      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00101      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00102      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00103      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00104      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00105      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00106      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00107      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00108      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00109      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00110      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00111      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00112      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00113      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00114      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00115      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00116      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00117      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00118      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00119      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00120      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00121      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00122      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00123      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
00124      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
00125      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
00126     16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
00127     26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
00128     36,    37,    38,    39,    40
00129 };
00130 
00131 #if YYDEBUG != 0
00132 static const short yyprhs[] = {     0,
00133      0,     6,     9,    12,    30,    36,    38,    41,    55,    58,
00134     61,    96,    99,   102,   105,   129,   131,   134,   138,   140,
00135    143,   159,   162,   165,   168,   170,   173,   178,   182,   186,
00136    190,   194,   196
00137 };
00138 
00139 static const short yyrhs[] = {    42,
00140     43,    44,    45,    46,     0,     8,     3,     0,     9,    68,
00141      0,    11,     6,    12,     5,    12,     3,    12,     3,    12,
00142      3,    12,     3,    12,    69,    12,    69,     7,     0,    13,
00143      6,    14,     3,     7,     0,    47,     0,    46,    47,     0,
00144     15,     6,    49,    50,    54,    33,     3,    34,     3,    35,
00145      3,    48,     7,     0,    36,    69,     0,    16,    68,     0,
00146     17,     6,    16,     5,    18,     3,     3,     3,    18,     3,
00147      3,     3,    18,     3,     3,     3,    51,    52,    53,    40,
00148     69,    18,    69,    18,    69,    18,     4,    18,    69,    18,
00149     69,    18,     4,     7,     0,    37,    69,     0,    38,    69,
00150      0,    39,    69,     0,    19,     6,    20,     3,    21,     3,
00151     22,     3,    23,     6,    55,     7,    25,     6,    57,     7,
00152     29,     3,    30,     6,    62,     7,     7,     0,    56,     0,
00153     55,    56,     0,    24,     3,    69,     0,    58,     0,    57,
00154     58,     0,    26,    10,    59,    60,    61,    10,     3,    10,
00155      3,    10,     3,    27,     3,    28,     3,     0,    10,     3,
00156      0,    10,     3,     0,    10,     3,     0,    63,     0,    62,
00157     63,     0,    64,    65,    66,    67,     0,    31,     3,    69,
00158      0,    32,     3,    69,     0,    32,     3,    69,     0,    32,
00159      3,    69,     0,     5,     0,     4,     4,     4,     0
00160 };
00161 
00162 #endif
00163 
00164 #if YYDEBUG != 0
00165 static const short yyrline[] = { 0,
00166     44,    52,    56,    60,    72,    78,    79,    83,    95,   100,
00167    105,   124,   129,   134,   139,   151,   152,   156,   161,   162,
00168    166,   178,   183,   188,   196,   197,   201,   208,   213,   218,
00169    223,   228,   232
00170 };
00171 #endif
00172 
00173 
00174 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
00175 
00176 static const char * const yytname[] = {   "$","error","$undefined.","MAX_DIGIT",
00177 "MAX_FLOAT","MAX_STRING","MAX_LBRACKET","MAX_RBRACKET","MAX_ASCIIEXPORT_SYM",
00178 "MAX_COMMENT","MAX_MESH_FACE_ID","MAX_SCENE","MAX_SCENE_TOKEN","MAX_MATERIAL_LIST",
00179 "MAX_MATERIAL_LIST_TOKEN","MAX_GEOMOBJECT","MAX_NODE_NAME","MAX_NODE_TM","MAX_NODE_TM_TOKEN",
00180 "MAX_MESH","MAX_TIMEVALUE","MAX_MESH_NUMVERTEX","MAX_MESH_NUMFACES","MAX_MESH_VERTEX_LIST",
00181 "MAX_MESH_VERTEX","MAX_MESH_FACE_LIST","MAX_MESH_FACE","MAX_MESH_SMOOTHING",
00182 "MAX_MESH_MTLID","MAX_MESH_NUMTVERTEX","MAX_MESH_NORMALS","MAX_MESH_FACENORMAL",
00183 "MAX_MESH_VERTEXNORMAL","MAX_PROP_MOTIONBLUR","MAX_PROP_CASTSHADOW","MAX_PROP_RECVSHADOW",
00184 "MAX_WIREFRAME_COLOR","MAX_TM_ROW0","MAX_TM_ROW1","MAX_TM_ROW2","MAX_TM_ROW3",
00185 "MaxFile","MaxExport","MaxComment","MaxScene","MaxMaterialList","MaxGeomObjectList",
00186 "MaxGeomObject","MaxColor","MaxGeomObjectInit","MaxNodeTm","MaxNodeTmRow0","MaxNodeTmRow1",
00187 "MaxNodeTmRow2","MaxMesh","MaxVertexList","MaxVertex","MaxFaceList","MaxFace",
00188 "MaxFaceA","MaxFaceB","MaxFaceC","MaxNormalList","MaxNormal","MaxFaceNormal",
00189 "MaxVertexNormal0","MaxVertexNormal1","MaxVertexNormal2","MaxString","MaxVector", NULL
00190 };
00191 #endif
00192 
00193 static const short yyr1[] = {     0,
00194     41,    42,    43,    44,    45,    46,    46,    47,    48,    49,
00195     50,    51,    52,    53,    54,    55,    55,    56,    57,    57,
00196     58,    59,    60,    61,    62,    62,    63,    64,    65,    66,
00197     67,    68,    69
00198 };
00199 
00200 static const short yyr2[] = {     0,
00201      5,     2,     2,    17,     5,     1,     2,    13,     2,     2,
00202     34,     2,     2,     2,    23,     1,     2,     3,     1,     2,
00203     15,     2,     2,     2,     1,     2,     4,     3,     3,     3,
00204      3,     1,     3
00205 };
00206 
00207 static const short yydefact[] = {     0,
00208      0,     0,     2,     0,     0,    32,     3,     0,     0,     0,
00209      0,     0,     0,     0,     0,     1,     6,     0,     0,     0,
00210      7,     0,     0,     0,     0,     0,     5,    10,     0,     0,
00211      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00212      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00213      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00214      0,     0,     0,     0,     0,     0,     0,     0,     9,     8,
00215     33,     0,     0,     0,     4,     0,     0,     0,    16,     0,
00216      0,     0,    17,     0,    18,     0,     0,     0,     0,     0,
00217      0,    19,     0,     0,     0,     0,    20,    12,     0,     0,
00218      0,     0,     0,    13,     0,     0,    22,     0,     0,     0,
00219     14,     0,    23,     0,     0,     0,     0,    24,     0,     0,
00220      0,     0,     0,     0,    25,     0,     0,     0,     0,     0,
00221     26,     0,     0,     0,     0,    28,    15,     0,     0,     0,
00222      0,     0,    29,     0,     0,    27,     0,     0,    30,     0,
00223      0,     0,    31,     0,     0,     0,     0,     0,    21,     0,
00224      0,     0,    11,     0,     0,     0
00225 };
00226 
00227 static const short yydefgoto[] = {   164,
00228      2,     5,     9,    12,    16,    17,    64,    25,    30,    94,
00229    100,   106,    34,    78,    79,    91,    92,   102,   109,   115,
00230    124,   125,   126,   133,   140,   146,     7,    60
00231 };
00232 
00233 static const short yypact[] = {    -4,
00234      3,    -1,-32768,     2,     0,-32768,-32768,     4,     1,    -3,
00235      6,     5,     8,     9,    10,     5,-32768,     7,    12,    11,
00236 -32768,    14,    17,     2,    15,    16,-32768,-32768,    20,    18,
00237     26,    19,    25,    13,    21,    29,    23,    35,    36,    22,
00238     38,    27,    32,    42,    30,    44,    45,    47,    49,    24,
00239     41,    51,    33,    53,    56,    39,    59,    28,    61,    55,
00240     60,    46,    56,    63,    64,    56,    69,    67,-32768,-32768,
00241 -32768,    70,    71,    52,-32768,    62,    75,    -2,-32768,    76,
00242     56,    57,-32768,    80,-32768,    78,    82,    66,    65,    79,
00243     -5,-32768,    56,    48,    83,    68,-32768,-32768,    56,    72,
00244     85,    84,    87,-32768,    56,    58,-32768,    93,    89,    73,
00245 -32768,    56,-32768,    97,    91,    98,    88,-32768,   102,    77,
00246     56,    99,   104,    -6,-32768,    81,    92,   109,    56,   107,
00247 -32768,   112,    86,    56,   106,-32768,-32768,    56,   114,    90,
00248    101,   117,-32768,    56,   118,-32768,   119,   100,-32768,    56,
00249    108,   121,-32768,    56,   103,   110,   122,    56,-32768,   111,
00250    126,   125,-32768,   133,   134,-32768
00251 };
00252 
00253 static const short yypgoto[] = {-32768,
00254 -32768,-32768,-32768,-32768,-32768,   120,-32768,-32768,-32768,-32768,
00255 -32768,-32768,-32768,-32768,    74,-32768,    50,-32768,-32768,-32768,
00256 -32768,    31,-32768,-32768,-32768,-32768,   113,   -63
00257 };
00258 
00259 
00260 #define YYLAST          155
00261 
00262 
00263 static const short yytable[] = {    69,
00264    130,    96,    72,     1,    82,     3,     6,     4,    13,    10,
00265      8,    14,    18,    11,    23,    20,    26,    85,    22,    15,
00266     90,    77,    19,    27,   123,    32,    24,    31,    35,    98,
00267     37,    29,    39,    40,    36,   104,    33,    42,    43,    44,
00268     45,   111,    41,    47,    48,    38,    50,    51,   117,    52,
00269     49,    53,    55,    56,    57,    58,    61,   127,    54,    59,
00270     46,    62,    67,    63,    65,   136,    66,    71,    68,    70,
00271    141,    73,    74,    76,   143,    77,    75,    81,    84,    80,
00272    149,    86,    87,    88,    89,    99,   153,   107,    95,   110,
00273    156,    90,   101,   108,   160,   113,   103,   112,   114,   118,
00274    119,    93,   116,   120,   122,   121,   129,   123,   128,   134,
00275    105,   135,   132,   137,   138,   142,   144,   139,   147,   148,
00276    150,   145,   151,   155,   159,   154,   152,   158,   161,   162,
00277    157,   163,   165,   166,     0,    21,    28,     0,     0,     0,
00278     97,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00279      0,    83,     0,     0,   131
00280 };
00281 
00282 static const short yycheck[] = {    63,
00283      7,     7,    66,     8,     7,     3,     5,     9,    12,     6,
00284     11,     6,     5,    13,     3,     6,     3,    81,    12,    15,
00285     26,    24,    14,     7,    31,     6,    16,    12,     3,    93,
00286      6,    17,    12,     5,    16,    99,    19,     3,     3,    18,
00287      3,   105,    20,    12,     3,    33,     3,     3,   112,     3,
00288     21,     3,    12,     3,    22,     3,    18,   121,    35,     4,
00289     34,     3,     3,    36,     4,   129,    12,     4,    23,     7,
00290    134,     3,     6,     3,   138,    24,     7,     3,     3,    18,
00291    144,    25,     3,     6,     3,    38,   150,     3,    10,     3,
00292    154,    26,    10,    10,   158,     3,    29,    40,    10,     3,
00293     10,    37,    30,     6,     3,    18,     3,    31,    10,    18,
00294     39,     3,    32,     7,     3,    10,     3,    32,    18,     3,
00295      3,    32,     4,     3,     3,    18,    27,    18,    18,     4,
00296     28,     7,     0,     0,    -1,    16,    24,    -1,    -1,    -1,
00297     91,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
00298     -1,    78,    -1,    -1,   124
00299 };
00300 /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
00301 
00302 /* Skeleton output parser for bison,
00303    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
00304 
00305    This program is free software; you can redistribute it and/or modify
00306    it under the terms of the GNU General Public License as published by
00307    the Free Software Foundation; either version 2, or (at your option)
00308    any later version.
00309 
00310    This program is distributed in the hope that it will be useful,
00311    but WITHOUT ANY WARRANTY; without even the implied warranty of
00312    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00313    GNU General Public License for more details.
00314 
00315    You should have received a copy of the GNU General Public License
00316    along with this program; if not, write to the Free Software
00317    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
00318 
00319 /* As a special exception, when this file is copied by Bison into a
00320    Bison output file, you may use that output file without restriction.
00321    This special exception was added by the Free Software Foundation
00322    in version 1.24 of Bison.  */
00323 
00324 #ifndef alloca
00325 #ifdef __GNUC__
00326 #define alloca __builtin_alloca
00327 #else /* not GNU C.  */
00328 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
00329 #include <alloca.h>
00330 #else /* not sparc */
00331 #if defined (MSDOS) && !defined (__TURBOC__)
00332 #include <malloc.h>
00333 #else /* not MSDOS, or __TURBOC__ */
00334 #if defined(_AIX)
00335 #include <malloc.h>
00336  #pragma alloca
00337 #else /* not MSDOS, __TURBOC__, or _AIX */
00338 #ifdef __hpux
00339 #ifdef __cplusplus
00340 extern "C" {
00341 void *alloca (unsigned int);
00342 };
00343 #else /* not __cplusplus */
00344 void *alloca ();
00345 #endif /* not __cplusplus */
00346 #endif /* __hpux */
00347 #endif /* not _AIX */
00348 #endif /* not MSDOS, or __TURBOC__ */
00349 #endif /* not sparc.  */
00350 #endif /* not GNU C.  */
00351 #endif /* alloca not defined.  */
00352 
00353 /* This is the parser code that is written into each bison parser
00354   when the %semantic_parser declaration is not specified in the grammar.
00355   It was written by Richard Stallman by simplifying the hairy parser
00356   used when %semantic_parser is specified.  */
00357 
00358 /* Note: there must be only one dollar sign in this file.
00359    It is replaced by the list of actions, each action
00360    as one case of the switch.  */
00361 
00362 #define yyerrok         (yyerrstatus = 0)
00363 #define yyclearin       (yychar = YYEMPTY)
00364 #define YYEMPTY         -2
00365 #define YYEOF           0
00366 #define YYACCEPT        return(0)
00367 #define YYABORT         return(1)
00368 #define YYERROR         goto yyerrlab1
00369 /* Like YYERROR except do call yyerror.
00370    This remains here temporarily to ease the
00371    transition to the new meaning of YYERROR, for GCC.
00372    Once GCC version 2 has supplanted version 1, this can go.  */
00373 #define YYFAIL          goto yyerrlab
00374 #define YYRECOVERING()  (!!yyerrstatus)
00375 #define YYBACKUP(token, value) \
00376 do                                                              \
00377   if (yychar == YYEMPTY && yylen == 1)                          \
00378     { yychar = (token), yylval = (value);                       \
00379       yychar1 = YYTRANSLATE (yychar);                           \
00380       YYPOPSTACK;                                               \
00381       goto yybackup;                                            \
00382     }                                                           \
00383   else                                                          \
00384     { yyerror ("syntax error: cannot back up"); YYERROR; }      \
00385 while (0)
00386 
00387 #define YYTERROR        1
00388 #define YYERRCODE       256
00389 
00390 #ifndef YYPURE
00391 #define YYLEX           yylex()
00392 #endif
00393 
00394 #ifdef YYPURE
00395 #ifdef YYLSP_NEEDED
00396 #ifdef YYLEX_PARAM
00397 #define YYLEX           yylex(&yylval, &yylloc, YYLEX_PARAM)
00398 #else
00399 #define YYLEX           yylex(&yylval, &yylloc)
00400 #endif
00401 #else /* not YYLSP_NEEDED */
00402 #ifdef YYLEX_PARAM
00403 #define YYLEX           yylex(&yylval, YYLEX_PARAM)
00404 #else
00405 #define YYLEX           yylex(&yylval)
00406 #endif
00407 #endif /* not YYLSP_NEEDED */
00408 #endif
00409 
00410 /* If nonreentrant, generate the variables here */
00411 
00412 #ifndef YYPURE
00413 
00414 int     yychar;                 /*  the lookahead symbol                */
00415 YYSTYPE yylval;                 /*  the semantic value of the           */
00416                                 /*  lookahead symbol                    */
00417 
00418 #ifdef YYLSP_NEEDED
00419 YYLTYPE yylloc;                 /*  location data for the lookahead     */
00420                                 /*  symbol                              */
00421 #endif
00422 
00423 int yynerrs;                    /*  number of parse errors so far       */
00424 #endif  /* not YYPURE */
00425 
00426 #if YYDEBUG != 0
00427 int yydebug;                    /*  nonzero means print parse trace     */
00428 /* Since this is uninitialized, it does not stop multiple parsers
00429    from coexisting.  */
00430 #endif
00431 
00432 /*  YYINITDEPTH indicates the initial size of the parser's stacks       */
00433 
00434 #ifndef YYINITDEPTH
00435 #define YYINITDEPTH 200
00436 #endif
00437 
00438 /*  YYMAXDEPTH is the maximum size the stacks can grow to
00439     (effective only if the built-in stack extension method is used).  */
00440 
00441 #if YYMAXDEPTH == 0
00442 #undef YYMAXDEPTH
00443 #endif
00444 
00445 #ifndef YYMAXDEPTH
00446 #define YYMAXDEPTH 10000
00447 #endif
00448 
00449 /* Prevent warning if -Wstrict-prototypes.  */
00450 #ifdef __GNUC__
00451 int yyparse (void);
00452 #endif
00453 #if __GNUC__ > 1                /* GNU C and GNU C++ define this.  */
00454 #define __yy_memcpy(TO,FROM,COUNT)      __builtin_memcpy(TO,FROM,COUNT)
00455 #else                           /* not GNU C or C++ */
00456 #ifndef __cplusplus
00457 
00458 /* This is the most reliable way to avoid incompatibilities
00459    in available built-in functions on various systems.  */
00460 static void
00461 __yy_memcpy (to, from, count)
00462      char *to;
00463      char *from;
00464      int count;
00465 {
00466   register char *f = from;
00467   register char *t = to;
00468   register int i = count;
00469 
00470   while (i-- > 0)
00471     *t++ = *f++;
00472 }
00473 
00474 #else /* __cplusplus */
00475 
00476 /* This is the most reliable way to avoid incompatibilities
00477    in available built-in functions on various systems.  */
00478 static void
00479 __yy_memcpy (char *to, char *from, int count)
00480 {
00481   register char *f = from;
00482   register char *t = to;
00483   register int i = count;
00484 
00485   while (i-- > 0)
00486     *t++ = *f++;
00487 }
00488 
00489 #endif
00490 #endif
00491 
00492 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
00493    into yyparse.  The argument should have type void *.
00494    It should actually point to an object.
00495    Grammar actions can access the variable by casting it
00496    to the proper pointer type.  */
00497 
00498 #ifdef YYPARSE_PARAM
00499 #ifdef __cplusplus
00500 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
00501 #define YYPARSE_PARAM_DECL
00502 #else /* not __cplusplus */
00503 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
00504 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
00505 #endif /* not __cplusplus */
00506 #else /* not YYPARSE_PARAM */
00507 #define YYPARSE_PARAM_ARG
00508 #define YYPARSE_PARAM_DECL
00509 #endif /* not YYPARSE_PARAM */
00510 
00511 int
00512 yyparse(YYPARSE_PARAM_ARG)
00513      YYPARSE_PARAM_DECL
00514 {
00515   register int yystate;
00516   register int yyn;
00517   register short *yyssp;
00518   register YYSTYPE *yyvsp;
00519   int yyerrstatus;      /*  number of tokens to shift before error messages enabled */
00520   int yychar1 = 0;              /*  lookahead token as an internal (translated) token number */
00521 
00522   short yyssa[YYINITDEPTH];     /*  the state stack                     */
00523   YYSTYPE yyvsa[YYINITDEPTH];   /*  the semantic value stack            */
00524 
00525   short *yyss = yyssa;          /*  refer to the stacks thru separate pointers */
00526   YYSTYPE *yyvs = yyvsa;        /*  to allow yyoverflow to reallocate them elsewhere */
00527 
00528 #ifdef YYLSP_NEEDED
00529   YYLTYPE yylsa[YYINITDEPTH];   /*  the location stack                  */
00530   YYLTYPE *yyls = yylsa;
00531   YYLTYPE *yylsp;
00532 
00533 #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
00534 #else
00535 #define YYPOPSTACK   (yyvsp--, yyssp--)
00536 #endif
00537 
00538   int yystacksize = YYINITDEPTH;
00539 
00540 #ifdef YYPURE
00541   int yychar;
00542   YYSTYPE yylval;
00543   int yynerrs;
00544 #ifdef YYLSP_NEEDED
00545   YYLTYPE yylloc;
00546 #endif
00547 #endif
00548 
00549   YYSTYPE yyval;                /*  the variable used to return         */
00550                                 /*  semantic values from the action     */
00551                                 /*  routines                            */
00552 
00553   int yylen;
00554 
00555 #if YYDEBUG != 0
00556   if (yydebug)
00557     fprintf(stderr, "Starting parse\n");
00558 #endif
00559 
00560   yystate = 0;
00561   yyerrstatus = 0;
00562   yynerrs = 0;
00563   yychar = YYEMPTY;             /* Cause a token to be read.  */
00564 
00565   /* Initialize stack pointers.
00566      Waste one element of value and location stack
00567      so that they stay on the same level as the state stack.
00568      The wasted elements are never initialized.  */
00569 
00570   yyssp = yyss - 1;
00571   yyvsp = yyvs;
00572 #ifdef YYLSP_NEEDED
00573   yylsp = yyls;
00574 #endif
00575 
00576 /* Push a new state, which is found in  yystate  .  */
00577 /* In all cases, when you get here, the value and location stacks
00578    have just been pushed. so pushing a state here evens the stacks.  */
00579 yynewstate:
00580 
00581   *++yyssp = (short) yystate;
00582 
00583   if (yyssp >= yyss + yystacksize - 1)
00584     {
00585       /* Give user a chance to reallocate the stack */
00586       /* Use copies of these so that the &'s don't force the real ones into memory. */
00587       YYSTYPE *yyvs1 = yyvs;
00588       short *yyss1 = yyss;
00589 #ifdef YYLSP_NEEDED
00590       YYLTYPE *yyls1 = yyls;
00591 #endif
00592 
00593       /* Get the current used size of the three stacks, in elements.  */
00594       int size = yyssp - yyss + 1;
00595 
00596 #ifdef yyoverflow
00597       /* Each stack pointer address is followed by the size of
00598          the data in use in that stack, in bytes.  */
00599 #ifdef YYLSP_NEEDED
00600       /* This used to be a conditional around just the two extra args,
00601          but that might be undefined if yyoverflow is a macro.  */
00602       yyoverflow("parser stack overflow",
00603                  &yyss1, size * sizeof (*yyssp),
00604                  &yyvs1, size * sizeof (*yyvsp),
00605                  &yyls1, size * sizeof (*yylsp),
00606                  &yystacksize);
00607 #else
00608       yyoverflow("parser stack overflow",
00609                  &yyss1, size * sizeof (*yyssp),
00610                  &yyvs1, size * sizeof (*yyvsp),
00611                  &yystacksize);
00612 #endif
00613 
00614       yyss = yyss1; yyvs = yyvs1;
00615 #ifdef YYLSP_NEEDED
00616       yyls = yyls1;
00617 #endif
00618 #else /* no yyoverflow */
00619       /* Extend the stack our own way.  */
00620       if (yystacksize >= YYMAXDEPTH)
00621         {
00622           yyerror("parser stack overflow");
00623           return 2;
00624         }
00625       yystacksize *= 2;
00626       if (yystacksize > YYMAXDEPTH)
00627         yystacksize = YYMAXDEPTH;
00628       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
00629       __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
00630       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
00631       __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
00632 #ifdef YYLSP_NEEDED
00633       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
00634       __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
00635 #endif
00636 #endif /* no yyoverflow */
00637 
00638       yyssp = yyss + size - 1;
00639       yyvsp = yyvs + size - 1;
00640 #ifdef YYLSP_NEEDED
00641       yylsp = yyls + size - 1;
00642 #endif
00643 
00644 #if YYDEBUG != 0
00645       if (yydebug)
00646         fprintf(stderr, "Stack size increased to %d\n", yystacksize);
00647 #endif
00648 
00649       if (yyssp >= yyss + yystacksize - 1)
00650         YYABORT;
00651     }
00652 
00653 #if YYDEBUG != 0
00654   if (yydebug)
00655     fprintf(stderr, "Entering state %d\n", yystate);
00656 #endif
00657 
00658   goto yybackup;
00659  yybackup:
00660 
00661 /* Do appropriate processing given the current state.  */
00662 /* Read a lookahead token if we need one and don't already have one.  */
00663 /* yyresume: */
00664 
00665   /* First try to decide what to do without reference to lookahead token.  */
00666 
00667   yyn = yypact[yystate];
00668   if (yyn == YYFLAG)
00669     goto yydefault;
00670 
00671   /* Not known => get a lookahead token if don't already have one.  */
00672 
00673   /* yychar is either YYEMPTY or YYEOF
00674      or a valid token in external form.  */
00675 
00676   if (yychar == YYEMPTY)
00677     {
00678 #if YYDEBUG != 0
00679       if (yydebug)
00680         fprintf(stderr, "Reading a token: ");
00681 #endif
00682       yychar = YYLEX;
00683     }
00684 
00685   /* Convert token to internal form (in yychar1) for indexing tables with */
00686 
00687   if (yychar <= 0)              /* This means end of input. */
00688     {
00689       yychar1 = 0;
00690       yychar = YYEOF;           /* Don't call YYLEX any more */
00691 
00692 #if YYDEBUG != 0
00693       if (yydebug)
00694         fprintf(stderr, "Now at end of input.\n");
00695 #endif
00696     }
00697   else
00698     {
00699       yychar1 = YYTRANSLATE(yychar);
00700 
00701 #if YYDEBUG != 0
00702       if (yydebug)
00703         {
00704           fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
00705           /* Give the individual parser a way to print the precise meaning
00706              of a token, for further debugging info.  */
00707 #ifdef YYPRINT
00708           YYPRINT (stderr, yychar, yylval);
00709 #endif
00710           fprintf (stderr, ")\n");
00711         }
00712 #endif
00713     }
00714 
00715   yyn += yychar1;
00716   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
00717     goto yydefault;
00718 
00719   yyn = yytable[yyn];
00720 
00721   /* yyn is what to do for this token type in this state.
00722      Negative => reduce, -yyn is rule number.
00723      Positive => shift, yyn is new state.
00724        New state is final state => don't bother to shift,
00725        just return success.
00726      0, or most negative number => error.  */
00727 
00728   if (yyn < 0)
00729     {
00730       if (yyn == YYFLAG)
00731         goto yyerrlab;
00732       yyn = -yyn;
00733       goto yyreduce;
00734     }
00735   else if (yyn == 0)
00736     goto yyerrlab;
00737 
00738   if (yyn == YYFINAL)
00739     YYACCEPT;
00740 
00741   /* Shift the lookahead token.  */
00742 
00743 #if YYDEBUG != 0
00744   if (yydebug)
00745     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
00746 #endif
00747 
00748   /* Discard the token being shifted unless it is eof.  */
00749   if (yychar != YYEOF)
00750     yychar = YYEMPTY;
00751 
00752   *++yyvsp = yylval;
00753 #ifdef YYLSP_NEEDED
00754   *++yylsp = yylloc;
00755 #endif
00756 
00757   /* count tokens shifted since error; after three, turn off error status.  */
00758   if (yyerrstatus) yyerrstatus--;
00759 
00760   yystate = yyn;
00761   goto yynewstate;
00762 
00763 /* Do the default action for the current state.  */
00764 yydefault:
00765 
00766   yyn = yydefact[yystate];
00767   if (yyn == 0)
00768     goto yyerrlab;
00769 
00770 /* Do a reduction.  yyn is the number of a rule to reduce with.  */
00771 yyreduce:
00772   yylen = yyr2[yyn];
00773   if (yylen > 0)
00774     yyval = yyvsp[1-yylen]; /* implement default value of the action */
00775 
00776 #if YYDEBUG != 0
00777   if (yydebug)
00778     {
00779       int i;
00780 
00781       fprintf (stderr, "Reducing via rule %d (line %d), ",
00782                yyn, yyrline[yyn]);
00783 
00784       /* Print the symbols being reduced, and their result.  */
00785       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
00786         fprintf (stderr, "%s ", yytname[yyrhs[i]]);
00787       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
00788     }
00789 #endif
00790 
00791 
00792   switch (yyn) {
00793 
00794 case 9:
00795 { 
00796         Vector4 ambientColor(0.6f, 0.6f, 0.6f, 1.0f);
00797         Vector4 diffuseColor(0.8f, 0.8f, 0.8f, 1.0f);
00798         ASEModelFactory::getCurrent()->getCurrentMesh()->getAmbientColor() = ambientColor;
00799         ASEModelFactory::getCurrent()->getCurrentMesh()->getDiffuseColor() = diffuseColor;
00800         ASEModelFactory::getCurrent()->getCurrentMesh()->getEmissiveColor() = Vector::getNullVector();
00801         ASEModelFactory::getCurrent()->getCurrentMesh()->getSpecularColor() = Vector::getNullVector();
00802 
00803         Vector ambientNoTexColor = aseVector * 0.6f;
00804         Vector diffuseNoTexColor = aseVector * 0.8f;
00805         ASEModelFactory::getCurrent()->getCurrentMesh()->getAmbientNoTexColor() = ambientNoTexColor;
00806         ASEModelFactory::getCurrent()->getCurrentMesh()->getDiffuseNoTexColor() = diffuseNoTexColor;
00807         ASEModelFactory::getCurrent()->getCurrentMesh()->getEmissiveNoTexColor() = Vector::getNullVector();
00808         ASEModelFactory::getCurrent()->getCurrentMesh()->getSpecularNoTexColor() = Vector::getNullVector();
00809 
00810         ASEModelFactory::getCurrent()->getCurrentMesh()->getShininessColor() = 0.0f;
00811 
00812         break;
00813 }
00814 case 10:
00815 { ASEModelFactory::getCurrent()->addMesh(aseString); ;
00816     break;}
00817 case 12:
00818 { tmRow[0] = aseVector.Normalize(); 
00819     break;}
00820 case 13:
00821 { tmRow[1] = aseVector.Normalize(); 
00822     break;}
00823 case 14:
00824 { tmRow[2] = aseVector.Normalize(); 
00825     break;}
00826 case 18:
00827 { 
00828         Vertex vertex;
00829         vertex.position = aseVector;
00830         vertex.boneIndex = -1;
00831         ASEModelFactory::getCurrent()->getCurrentMesh()->insertVertex(vertex); ;
00832     break;}
00833 case 22:
00834 { aseFace.v[0] = aseDigit; ;
00835     break;}
00836 case 23:
00837 { aseFace.v[1] = aseDigit; ;
00838     break;}
00839 case 24:
00840 { 
00841                 aseFace.v[2] = aseDigit;
00842                 ASEModelFactory::getCurrent()->getCurrentMesh()->insertFace(aseFace);   
00843         ;
00844     break;}
00845 case 28:
00846 { aseFaceNo = aseDigit; ;
00847     break;}
00848 case 29:
00849 { 
00850         Vector n(
00851                 aseVector[0] * tmRow[0][0] + aseVector[1] * tmRow[1][0] + aseVector[2] * tmRow[2][0],
00852                 aseVector[0] * tmRow[0][1] + aseVector[1] * tmRow[1][1] + aseVector[2] * tmRow[2][1],
00853                 aseVector[0] * tmRow[0][2] + aseVector[1] * tmRow[1][2] + aseVector[2] * tmRow[2][2]);
00854 
00855         ASEModelFactory::getCurrent()->getCurrentMesh()->setFaceNormal(n, aseFaceNo, 0);
00856     break;}
00857 case 30:
00858 { 
00859         Vector n(
00860                 aseVector[0] * tmRow[0][0] + aseVector[1] * tmRow[1][0] + aseVector[2] * tmRow[2][0],
00861                 aseVector[0] * tmRow[0][1] + aseVector[1] * tmRow[1][1] + aseVector[2] * tmRow[2][1],
00862                 aseVector[0] * tmRow[0][2] + aseVector[1] * tmRow[1][2] + aseVector[2] * tmRow[2][2]);
00863 
00864         ASEModelFactory::getCurrent()->getCurrentMesh()->setFaceNormal(n, aseFaceNo, 1);
00865     break;}
00866 case 31:
00867 { 
00868         Vector n(
00869                 aseVector[0] * tmRow[0][0] + aseVector[1] * tmRow[1][0] + aseVector[2] * tmRow[2][0],
00870                 aseVector[0] * tmRow[0][1] + aseVector[1] * tmRow[1][1] + aseVector[2] * tmRow[2][1],
00871                 aseVector[0] * tmRow[0][2] + aseVector[1] * tmRow[1][2] + aseVector[2] * tmRow[2][2]);
00872 
00873         ASEModelFactory::getCurrent()->getCurrentMesh()->setFaceNormal(n, aseFaceNo, 2);
00874     break;}
00875 }
00876    /* the action file gets copied in in place of this dollarsign */
00877 
00878   yyvsp -= yylen;
00879   yyssp -= yylen;
00880 #ifdef YYLSP_NEEDED
00881   yylsp -= yylen;
00882 #endif
00883 
00884 #if YYDEBUG != 0
00885   if (yydebug)
00886     {
00887       short *ssp1 = yyss - 1;
00888       fprintf (stderr, "state stack now");
00889       while (ssp1 != yyssp)
00890         fprintf (stderr, " %d", *++ssp1);
00891       fprintf (stderr, "\n");
00892     }
00893 #endif
00894 
00895   *++yyvsp = yyval;
00896 
00897 #ifdef YYLSP_NEEDED
00898   yylsp++;
00899   if (yylen == 0)
00900     {
00901       yylsp->first_line = yylloc.first_line;
00902       yylsp->first_column = yylloc.first_column;
00903       yylsp->last_line = (yylsp-1)->last_line;
00904       yylsp->last_column = (yylsp-1)->last_column;
00905       yylsp->text = 0;
00906     }
00907   else
00908     {
00909       yylsp->last_line = (yylsp+yylen-1)->last_line;
00910       yylsp->last_column = (yylsp+yylen-1)->last_column;
00911     }
00912 #endif
00913 
00914   /* Now "shift" the result of the reduction.
00915      Determine what state that goes to,
00916      based on the state we popped back to
00917      and the rule number reduced by.  */
00918 
00919   yyn = yyr1[yyn];
00920 
00921   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
00922   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
00923     yystate = yytable[yystate];
00924   else
00925     yystate = yydefgoto[yyn - YYNTBASE];
00926 
00927   goto yynewstate;
00928 
00929 yyerrlab:   /* here on detecting error */
00930 
00931   if (! yyerrstatus)
00932     /* If not already recovering from an error, report this error.  */
00933     {
00934       ++yynerrs;
00935 
00936 #ifdef YYERROR_VERBOSE
00937       yyn = yypact[yystate];
00938 
00939       if (yyn > YYFLAG && yyn < YYLAST)
00940         {
00941           int size = 0;
00942           char *msg;
00943           int x, count;
00944 
00945           count = 0;
00946           /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
00947           for (x = (yyn < 0 ? -yyn : 0);
00948                x < (sizeof(yytname) / sizeof(char *)); x++)
00949             if (yycheck[x + yyn] == x)
00950               size += strlen(yytname[x]) + 15, count++;
00951           msg = (char *) malloc(size + 15);
00952           if (msg != 0)
00953             {
00954               strcpy(msg, "parse error");
00955 
00956               if (count < 5)
00957                 {
00958                   count = 0;
00959                   for (x = (yyn < 0 ? -yyn : 0);
00960                        x < (sizeof(yytname) / sizeof(char *)); x++)
00961                     if (yycheck[x + yyn] == x)
00962                       {
00963                         strcat(msg, count == 0 ? ", expecting `" : " or `");
00964                         strcat(msg, yytname[x]);
00965                         strcat(msg, "'");
00966                         count++;
00967                       }
00968                 }
00969               yyerror(msg);
00970               free(msg);
00971             }
00972           else
00973             yyerror ("parse error; also virtual memory exceeded");
00974         }
00975       else
00976 #endif /* YYERROR_VERBOSE */
00977         yyerror("parse error");
00978     }
00979 
00980   goto yyerrlab1;
00981 yyerrlab1:   /* here on error raised explicitly by an action */
00982 
00983   if (yyerrstatus == 3)
00984     {
00985       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
00986 
00987       /* return failure if at end of input */
00988       if (yychar == YYEOF)
00989         YYABORT;
00990 
00991 #if YYDEBUG != 0
00992       if (yydebug)
00993         fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
00994 #endif
00995 
00996       yychar = YYEMPTY;
00997     }
00998 
00999   /* Else will try to reuse lookahead token
01000      after shifting the error token.  */
01001 
01002   yyerrstatus = 3;              /* Each real token shifted decrements this */
01003 
01004   goto yyerrhandle;
01005 
01006 yyerrdefault:  /* current state does not do anything special for the error token. */
01007 
01008 #if 0
01009   /* This is wrong; only states that explicitly want error tokens
01010      should shift them.  */
01011   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
01012   if (yyn) goto yydefault;
01013 #endif
01014 
01015 yyerrpop:   /* pop the current state because it cannot handle the error token */
01016 
01017   if (yyssp == yyss) YYABORT;
01018   yyvsp--;
01019   yystate = *--yyssp;
01020 #ifdef YYLSP_NEEDED
01021   yylsp--;
01022 #endif
01023 
01024 #if YYDEBUG != 0
01025   if (yydebug)
01026     {
01027       short *ssp1 = yyss - 1;
01028       fprintf (stderr, "Error: state stack now");
01029       while (ssp1 != yyssp)
01030         fprintf (stderr, " %d", *++ssp1);
01031       fprintf (stderr, "\n");
01032     }
01033 #endif
01034 
01035 yyerrhandle:
01036 
01037   yyn = yypact[yystate];
01038   if (yyn == YYFLAG)
01039     goto yyerrdefault;
01040 
01041   yyn += YYTERROR;
01042   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
01043     goto yyerrdefault;
01044 
01045   yyn = yytable[yyn];
01046   if (yyn < 0)
01047     {
01048       if (yyn == YYFLAG)
01049         goto yyerrpop;
01050       yyn = -yyn;
01051       goto yyreduce;
01052     }
01053   else if (yyn == 0)
01054     goto yyerrpop;
01055 
01056   if (yyn == YYFINAL)
01057     YYACCEPT;
01058 
01059 #if YYDEBUG != 0
01060   if (yydebug)
01061     fprintf(stderr, "Shifting error token, ");
01062 #endif
01063 
01064   *++yyvsp = yylval;
01065 #ifdef YYLSP_NEEDED
01066   *++yylsp = yylloc;
01067 #endif
01068 
01069   yystate = yyn;
01070   goto yynewstate;
01071 }
01072 
01073 int aseerror(const char *errmsg)
01074 {
01075         char buffer[1024];
01076         snprintf(buffer, 1024, "%i:%s\n", aselineno, errmsg);
01077         S3D::dialogMessage("Lexer", buffer);
01078     return 0;
01079 }
01080 
01081 int asewarning(const char *warningmsg)
01082 {
01083         char buffer[1024];
01084         snprintf(buffer, 1024, "%i:%s\n", aselineno, warningmsg);
01085         S3D::dialogMessage("Lexer", buffer);
01086     return 0;
01087 }
01088 
01089 int asedebug(const char *debugmsg)
01090 {
01091         char buffer[1024];
01092         snprintf(buffer, 1024, "%i:%s\n", aselineno, debugmsg);
01093         S3D::dialogMessage("Lexer", buffer);
01094     return 0;
01095 }

Generated on Mon Feb 16 15:14:48 2009 for Scorched3D by  doxygen 1.5.3