fix msvs 2010 build issues reported by community member FriarTuck

This commit is contained in:
David Rose 2011-03-22 23:48:31 +00:00
parent cea91656ea
commit dd4df70a28
17 changed files with 15480 additions and 14617 deletions

File diff suppressed because it is too large Load Diff

View File

@ -35,7 +35,7 @@ static int error_count = 0;
static int warning_count = 0;
// This is the pointer to the current input stream.
static istream *inp = NULL;
static istream *input_p = NULL;
// This is the name of the dc file we're parsing. We keep it so we
// can print it out for error messages.
@ -52,7 +52,7 @@ static int initial_token;
void
dc_init_lexer(istream &in, const string &filename) {
inp = ∈
input_p = ∈
dc_filename = filename;
line_number = 0;
col_number = 0;
@ -129,10 +129,10 @@ dcyywarning(const string &msg) {
// 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();
nassertv(input_p != NULL);
if (*input_p) {
input_p->read(buffer, max_size);
result = input_p->gcount();
if (result >= 0 && result < max_size) {
// Truncate at the end of the read.
buffer[result] = '\0';

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,22 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -29,10 +27,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@ -127,11 +126,11 @@
#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 dcyylval;

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@ static int error_count = 0;
static int warning_count = 0;
// This is the pointer to the current input stream.
static istream *inp = NULL;
static istream *input_p = NULL;
// This is the name of the egg file we're parsing. We keep it so we
// can print it out for error messages.
@ -61,7 +61,7 @@ static int initial_token;
void
egg_init_lexer(istream &in, const string &filename) {
inp = &in;
input_p = &in;
egg_filename = filename;
line_number = 0;
col_number = 0;
@ -163,10 +163,10 @@ eggyywarning(ostringstream &strm) {
// 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();
nassertv(input_p != NULL);
if (*input_p) {
input_p->read(buffer, max_size);
result = input_p->gcount();
if (line_number == 0) {
// This is a special case. If we are reading the very first bit

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,22 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -29,10 +27,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@ -221,11 +220,11 @@
#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;

View File

@ -2689,9 +2689,13 @@ static HCURSOR get_cursor(const Filename &filename);
////////////////////////////////////////////////////////////////////
const WinGraphicsWindow::WindowClass &WinGraphicsWindow::
register_window_class(const WindowProperties &props) {
pair<WindowClasses::iterator, bool> found =
_window_classes.insert(WindowClass(props));
WindowClass &wclass = (*found.first);
WindowClass wcreg(props);
ostringstream wclass_name;
wclass_name << "WinGraphicsWindow" << _window_class_index;
wcreg._name = wclass_name.str();
pair<WindowClasses::iterator, bool> found = _window_classes.insert(wcreg);
const WindowClass &wclass = (*found.first);
if (!found.second) {
// We have already created a window class.
@ -2699,10 +2703,7 @@ register_window_class(const WindowProperties &props) {
}
// We have not yet created this window class.
ostringstream wclass_name;
wclass_name << "WinGraphicsWindow" << _window_class_index;
_window_class_index++;
wclass._name = wclass_name.str();
WNDCLASS wc;

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@ static int error_count = 0;
static int warning_count = 0;
// This is the pointer to the current input stream.
static istream *inp = NULL;
static istream *input_p = NULL;
// This is the name of the vrml file we're parsing. We keep it so we
// can print it out for error messages.
@ -77,7 +77,7 @@ static MFArray *mfarray;
void
vrml_init_lexer(istream &in, const string &filename) {
inp = &in;
input_p = &in;
vrml_filename = filename;
line_number = 0;
error_count = 0;
@ -123,10 +123,10 @@ vrmlyywarning(const string &msg) {
// 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();
nassertv(input_p != NULL);
if (*input_p) {
input_p->read(buffer, max_size);
result = input_p->gcount();
if (result >= 0 && result < max_size) {
// Truncate at the end of the read.
buffer[result] = '\0';

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +1,22 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -29,10 +27,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@ -112,22 +111,28 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 116 "vrmlParser.yxx"
{
/* Line 1685 of yacc.c */
#line 116 "vrmlParser.yxx"
char *string;
VrmlFieldValue fv;
VrmlNode *node;
MFArray *mfarray;
SFNodeRef nodeRef;
VrmlScene *scene;
}
/* Line 1529 of yacc.c. */
#line 126 "y.tab.h"
YYSTYPE;
/* Line 1685 of yacc.c */
#line 130 "y.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
extern YYSTYPE vrmlyylval;

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ static int error_count = 0;
static int warning_count = 0;
// This is the pointer to the current input stream.
static istream *inp = NULL;
static istream *input_p = NULL;
// This is the name of the x file we're parsing. We keep it so we
// can print it out for error messages.
@ -47,7 +47,7 @@ static string x_filename;
void
x_init_lexer(istream &in, const string &filename) {
inp = &in;
input_p = &in;
x_filename = filename;
x_line_number = 0;
x_col_number = 0;
@ -115,10 +115,10 @@ xyywarning(const string &msg) {
// 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();
nassertv(input_p != NULL);
if (*input_p) {
input_p->read(buffer, max_size);
result = input_p->gcount();
if (result >= 0 && result < max_size) {
// Truncate at the end of the read.
buffer[result] = '\0';

View File

@ -1,24 +1,22 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -29,7 +27,7 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
@ -47,7 +45,7 @@
#define YYBISON 1
/* Bison version. */
#define YYBISON_VERSION "2.3"
#define YYBISON_VERSION "2.4.2"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@ -55,17 +53,92 @@
/* Pure parsers. */
#define YYPURE 0
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */
#define YYLSP_NEEDED 0
/* Substitute the variable and function names. */
#define yyparse xyyparse
#define yylex xyylex
#define yyerror xyyerror
#define yylval xyylval
#define yychar xyychar
#define yydebug xyydebug
#define yynerrs xyynerrs
#define yyparse xyyparse
#define yylex xyylex
#define yyerror xyyerror
#define yylval xyylval
#define yychar xyychar
#define yydebug xyydebug
#define yynerrs xyynerrs
/* Copy the first part of user declarations. */
/* Line 189 of yacc.c */
#line 12 "xParser.yxx"
#include "xLexerDefs.h"
#include "xParserDefs.h"
#include "xFile.h"
#include "xFileTemplate.h"
#include "xFileDataDef.h"
#include "xFileArrayDef.h"
#include "xFileDataNodeTemplate.h"
#include "xFileDataNodeReference.h"
#include "pointerTo.h"
#include "dcast.h"
// Because our token type contains objects of type string, which
// require correct copy construction (and not simply memcpying), we
// cannot use bison's built-in auto-stack-grow feature. As an easy
// solution, we ensure here that we have enough yacc stack to start
// with, and that it doesn't ever try to grow.
#define YYINITDEPTH 1000
#define YYMAXDEPTH 1000
static XFile *x_file = (XFile *)NULL;
static XFileNode *current_node = (XFileNode *)NULL;
static PT(XFileDataDef) current_data_def = (XFileDataDef *)NULL;
////////////////////////////////////////////////////////////////////
// Defining the interface to the parser.
////////////////////////////////////////////////////////////////////
void
x_init_parser(istream &in, const string &filename, XFile &file) {
x_file = &file;
current_node = &file;
x_init_lexer(in, filename);
}
void
x_cleanup_parser() {
x_file = (XFile *)NULL;
current_node = (XFileNode *)NULL;
}
/* Line 189 of yacc.c */
#line 124 "y.tab.c"
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
/* Tokens. */
@ -143,83 +216,18 @@
/* Copy the first part of user declarations. */
#line 12 "xParser.yxx"
#include "xLexerDefs.h"
#include "xParserDefs.h"
#include "xFile.h"
#include "xFileTemplate.h"
#include "xFileDataDef.h"
#include "xFileArrayDef.h"
#include "xFileDataNodeTemplate.h"
#include "xFileDataNodeReference.h"
#include "pointerTo.h"
#include "dcast.h"
// Because our token type contains objects of type string, which
// require correct copy construction (and not simply memcpying), we
// cannot use bison's built-in auto-stack-grow feature. As an easy
// solution, we ensure here that we have enough yacc stack to start
// with, and that it doesn't ever try to grow.
#define YYINITDEPTH 1000
#define YYMAXDEPTH 1000
static XFile *x_file = (XFile *)NULL;
static XFileNode *current_node = (XFileNode *)NULL;
static PT(XFileDataDef) current_data_def = (XFileDataDef *)NULL;
////////////////////////////////////////////////////////////////////
// Defining the interface to the parser.
////////////////////////////////////////////////////////////////////
void
x_init_parser(istream &in, const string &filename, XFile &file) {
x_file = &file;
current_node = &file;
x_init_lexer(in, filename);
}
void
x_cleanup_parser() {
x_file = (XFile *)NULL;
current_node = (XFileNode *)NULL;
}
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
# undef YYERROR_VERBOSE
# define YYERROR_VERBOSE 1
#else
# define YYERROR_VERBOSE 0
#endif
/* Enabling the token table. */
#ifndef YYTOKEN_TABLE
# define YYTOKEN_TABLE 0
#endif
#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
/* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */
#line 223 "y.tab.c"
/* Line 264 of yacc.c */
#line 231 "y.tab.c"
#ifdef short
# undef short
@ -269,7 +277,7 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
# if YYENABLE_NLS
# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
@ -294,14 +302,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static int
YYID (int i)
YYID (int yyi)
#else
static int
YYID (i)
int i;
YYID (yyi)
int yyi;
#endif
{
return i;
return yyi;
}
#endif
@ -382,9 +390,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
yytype_int16 yyss;
YYSTYPE yyvs;
};
yytype_int16 yyss_alloc;
YYSTYPE yyvs_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@ -418,12 +426,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
# define YYSTACK_RELOCATE(Stack) \
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \
Stack = &yyptr->Stack; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
@ -716,9 +724,18 @@ static const yytype_uint8 yystos[] =
/* 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. */
Once GCC version 2 has supplanted version 1, this can go. However,
YYFAIL appears to be in use. Nevertheless, it is formally deprecated
in Bison 2.4.2's NEWS entry, where a plan to phase it out is
discussed. */
#define YYFAIL goto yyerrlab
#if defined YYFAIL
/* This is here to suppress warnings from the GCC cpp's
-Wunused-macros. Normally we don't worry about that warning, but
some users do, and we want to make it easy for users to remove
YYFAIL uses, which will produce warnings from Bison 2.5. */
#endif
#define YYRECOVERING() (!!yyerrstatus)
@ -775,7 +792,7 @@ while (YYID (0))
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
# if YYLTYPE_IS_TRIVIAL
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
(Loc).first_line, (Loc).first_column, \
@ -886,17 +903,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep)
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else
static void
yy_stack_print (bottom, top)
yytype_int16 *bottom;
yytype_int16 *top;
yy_stack_print (yybottom, yytop)
yytype_int16 *yybottom;
yytype_int16 *yytop;
#endif
{
YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
for (; yybottom <= yytop; yybottom++)
{
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n");
}
@ -930,11 +950,11 @@ yy_reduce_print (yyvsp, yyrule)
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
fprintf (stderr, " $%d = ", yyi + 1);
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
);
fprintf (stderr, "\n");
YYFPRINTF (stderr, "\n");
}
}
@ -1214,10 +1234,8 @@ yydestruct (yymsg, yytype, yyvaluep)
break;
}
}
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
@ -1233,11 +1251,10 @@ int yyparse ();
#endif /* ! YYPARSE_PARAM */
/* The look-ahead symbol. */
/* The lookahead symbol. */
int yychar;
/* The semantic value of the look-ahead symbol. */
/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
/* Number of syntax errors so far. */
@ -1245,9 +1262,9 @@ int yynerrs;
/*----------.
| yyparse. |
`----------*/
/*-------------------------.
| yyparse or yypush_parse. |
`-------------------------*/
#ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \
@ -1271,14 +1288,39 @@ yyparse ()
#endif
#endif
{
int yystate;
int yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* The stacks and their tools:
`yyss': related to states.
`yyvs': related to semantic values.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
YYSIZE_T yystacksize;
int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
/* Lookahead token as an internal (translated) token number. */
int yytoken;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
@ -1286,51 +1328,28 @@ yyparse ()
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
/* Three stacks and their tools:
`yyss': related to states,
`yyvs': related to semantic values,
`yyls': related to locations.
Refer to the stacks thru separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
yytype_int16 yyssa[YYINITDEPTH];
yytype_int16 *yyss = yyssa;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
YYSTYPE *yyvsp;
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
@ -1360,7 +1379,6 @@ yyparse ()
YYSTYPE *yyvs1 = yyvs;
yytype_int16 *yyss1 = yyss;
/* Each stack pointer address is followed by the size of the
data in use in that stack, in bytes. This used to be a
conditional around just the two extra args, but that might
@ -1368,7 +1386,6 @@ yyparse ()
yyoverflow (YY_("memory exhausted"),
&yyss1, yysize * sizeof (*yyssp),
&yyvs1, yysize * sizeof (*yyvsp),
&yystacksize);
yyss = yyss1;
@ -1391,9 +1408,8 @@ yyparse ()
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss);
YYSTACK_RELOCATE (yyvs);
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
@ -1404,7 +1420,6 @@ yyparse ()
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
(unsigned long int) yystacksize));
@ -1414,6 +1429,9 @@ yyparse ()
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
/*-----------.
@ -1422,16 +1440,16 @@ yyparse ()
yybackup:
/* Do appropriate processing given the current state. Read a
look-ahead token if we need one and don't already have one. */
lookahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to look-ahead token. */
/* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
/* Not known => get a look-ahead token if don't already have one. */
/* Not known => get a lookahead token if don't already have one. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
/* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
@ -1463,20 +1481,16 @@ yybackup:
goto yyreduce;
}
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
/* Shift the look-ahead token. */
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
/* Discard the shifted token. */
yychar = YYEMPTY;
yystate = yyn;
*++yyvsp = yylval;
@ -1516,6 +1530,8 @@ yyreduce:
switch (yyn)
{
case 6:
/* Line 1464 of yacc.c */
#line 116 "xParser.yxx"
{
(yyval.u.node) = current_node;
@ -1526,6 +1542,8 @@ yyreduce:
break;
case 7:
/* Line 1464 of yacc.c */
#line 123 "xParser.yxx"
{
(yyval.u.node) = current_node;
@ -1534,6 +1552,8 @@ yyreduce:
break;
case 12:
/* Line 1464 of yacc.c */
#line 141 "xParser.yxx"
{
DCAST(XFileTemplate, current_node)->set_open(true);
@ -1541,6 +1561,8 @@ yyreduce:
break;
case 19:
/* Line 1464 of yacc.c */
#line 160 "xParser.yxx"
{
current_data_def = new XFileDataDef(x_file, (yyvsp[(2) - (3)].str), (yyvsp[(1) - (3)].u.primitive_type));
@ -1549,6 +1571,8 @@ yyreduce:
break;
case 21:
/* Line 1464 of yacc.c */
#line 172 "xParser.yxx"
{
XFileTemplate *xtemplate = x_file->find_template((yyvsp[(1) - (3)].str));
@ -1562,6 +1586,8 @@ yyreduce:
break;
case 22:
/* Line 1464 of yacc.c */
#line 185 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_word;
@ -1569,6 +1595,8 @@ yyreduce:
break;
case 23:
/* Line 1464 of yacc.c */
#line 189 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_dword;
@ -1576,6 +1604,8 @@ yyreduce:
break;
case 24:
/* Line 1464 of yacc.c */
#line 193 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_float;
@ -1583,6 +1613,8 @@ yyreduce:
break;
case 25:
/* Line 1464 of yacc.c */
#line 197 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_double;
@ -1590,6 +1622,8 @@ yyreduce:
break;
case 26:
/* Line 1464 of yacc.c */
#line 201 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_char;
@ -1597,6 +1631,8 @@ yyreduce:
break;
case 27:
/* Line 1464 of yacc.c */
#line 205 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_uchar;
@ -1604,6 +1640,8 @@ yyreduce:
break;
case 28:
/* Line 1464 of yacc.c */
#line 209 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_sword;
@ -1611,6 +1649,8 @@ yyreduce:
break;
case 29:
/* Line 1464 of yacc.c */
#line 213 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_sdword;
@ -1618,6 +1658,8 @@ yyreduce:
break;
case 30:
/* Line 1464 of yacc.c */
#line 217 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_string;
@ -1625,6 +1667,8 @@ yyreduce:
break;
case 31:
/* Line 1464 of yacc.c */
#line 221 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_unicode;
@ -1632,6 +1676,8 @@ yyreduce:
break;
case 32:
/* Line 1464 of yacc.c */
#line 225 "xParser.yxx"
{
(yyval.u.primitive_type) = XFileDataDef::T_cstring;
@ -1639,6 +1685,8 @@ yyreduce:
break;
case 33:
/* Line 1464 of yacc.c */
#line 232 "xParser.yxx"
{
current_data_def = new XFileDataDef(x_file, (yyvsp[(2) - (2)].str), (yyvsp[(1) - (2)].u.primitive_type));
@ -1647,6 +1695,8 @@ yyreduce:
break;
case 34:
/* Line 1464 of yacc.c */
#line 237 "xParser.yxx"
{
XFileTemplate *xtemplate = x_file->find_template((yyvsp[(1) - (2)].str));
@ -1660,6 +1710,8 @@ yyreduce:
break;
case 38:
/* Line 1464 of yacc.c */
#line 259 "xParser.yxx"
{
current_data_def->add_array_def(XFileArrayDef((yyvsp[(1) - (1)].u.number)));
@ -1667,6 +1719,8 @@ yyreduce:
break;
case 39:
/* Line 1464 of yacc.c */
#line 263 "xParser.yxx"
{
XFileNode *data_def = current_node->find_child((yyvsp[(1) - (1)].str));
@ -1679,18 +1733,24 @@ yyreduce:
break;
case 40:
/* Line 1464 of yacc.c */
#line 275 "xParser.yxx"
{
}
break;
case 41:
/* Line 1464 of yacc.c */
#line 278 "xParser.yxx"
{
}
break;
case 42:
/* Line 1464 of yacc.c */
#line 284 "xParser.yxx"
{
XFileTemplate *xtemplate = x_file->find_template((yyvsp[(1) - (1)].str));
@ -1703,6 +1763,8 @@ yyreduce:
break;
case 43:
/* Line 1464 of yacc.c */
#line 293 "xParser.yxx"
{
XFileTemplate *xtemplate = x_file->find_template((yyvsp[(2) - (2)].guid));
@ -1719,6 +1781,8 @@ yyreduce:
break;
case 46:
/* Line 1464 of yacc.c */
#line 314 "xParser.yxx"
{
(yyval.str) = (yyvsp[(1) - (2)].str) + " " + (yyvsp[(2) - (2)].str);
@ -1726,6 +1790,8 @@ yyreduce:
break;
case 47:
/* Line 1464 of yacc.c */
#line 318 "xParser.yxx"
{
(yyval.str) = (yyvsp[(1) - (2)].str) + " " + (yyvsp[(2) - (2)].str);
@ -1733,6 +1799,8 @@ yyreduce:
break;
case 48:
/* Line 1464 of yacc.c */
#line 325 "xParser.yxx"
{
(yyval.str) = string();
@ -1740,6 +1808,8 @@ yyreduce:
break;
case 51:
/* Line 1464 of yacc.c */
#line 337 "xParser.yxx"
{
(yyval.guid) = WindowsGuid();
@ -1747,6 +1817,8 @@ yyreduce:
break;
case 54:
/* Line 1464 of yacc.c */
#line 349 "xParser.yxx"
{
XFileTemplate *xtemplate = x_file->find_template((yyvsp[(1) - (3)].str));
@ -1764,6 +1836,8 @@ yyreduce:
break;
case 55:
/* Line 1464 of yacc.c */
#line 363 "xParser.yxx"
{
if (current_node->is_exact_type(XFileDataNodeTemplate::get_class_type())) {
@ -1778,6 +1852,8 @@ yyreduce:
break;
case 58:
/* Line 1464 of yacc.c */
#line 382 "xParser.yxx"
{
// nested references should be added as children too.
@ -1786,6 +1862,8 @@ yyreduce:
break;
case 59:
/* Line 1464 of yacc.c */
#line 387 "xParser.yxx"
{
// nested objects are just quietly added as children.
@ -1793,6 +1871,8 @@ yyreduce:
break;
case 60:
/* Line 1464 of yacc.c */
#line 391 "xParser.yxx"
{
if (current_node->is_exact_type(XFileDataNodeTemplate::get_class_type())) {
@ -1804,6 +1884,8 @@ yyreduce:
break;
case 61:
/* Line 1464 of yacc.c */
#line 399 "xParser.yxx"
{
if (current_node->is_exact_type(XFileDataNodeTemplate::get_class_type())) {
@ -1815,6 +1897,8 @@ yyreduce:
break;
case 62:
/* Line 1464 of yacc.c */
#line 407 "xParser.yxx"
{
if (current_node->is_exact_type(XFileDataNodeTemplate::get_class_type())) {
@ -1826,12 +1910,16 @@ yyreduce:
break;
case 63:
/* Line 1464 of yacc.c */
#line 415 "xParser.yxx"
{
}
break;
case 69:
/* Line 1464 of yacc.c */
#line 438 "xParser.yxx"
{
XFileDataNodeTemplate *data_object = x_file->find_data_object((yyvsp[(1) - (1)].str));
@ -1844,6 +1932,8 @@ yyreduce:
break;
case 70:
/* Line 1464 of yacc.c */
#line 447 "xParser.yxx"
{
XFileDataNodeTemplate *data_object = x_file->find_data_object((yyvsp[(2) - (2)].guid));
@ -1861,8 +1951,9 @@ yyreduce:
break;
/* Line 1267 of yacc.c. */
#line 1866 "y.tab.c"
/* Line 1464 of yacc.c */
#line 1957 "y.tab.c"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1873,7 +1964,6 @@ yyreduce:
*++yyvsp = yyval;
/* Now `shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@ -1938,7 +2028,7 @@ yyerrlab:
if (yyerrstatus == 3)
{
/* If just tried and failed to reuse look-ahead token after an
/* If just tried and failed to reuse lookahead token after an
error, discard it. */
if (yychar <= YYEOF)
@ -1955,7 +2045,7 @@ yyerrlab:
}
}
/* Else will try to reuse look-ahead token after shifting the error
/* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@ -2012,9 +2102,6 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp);
}
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
@ -2039,7 +2126,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
#ifndef yyoverflow
#if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@ -2050,7 +2137,7 @@ yyexhaustedlab:
#endif
yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY)
if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval);
/* Do not reclaim the symbols of the rule which action triggered

View File

@ -1,24 +1,22 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.2. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 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.
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@ -29,10 +27,11 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
@ -109,11 +108,11 @@
#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 xyylval;