1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-11 05:17:41 +03:00

bug #196: Added parsing of share variables, it includes RUNNING_VMS, USED_CPU, USED_MEMORY...

(cherry picked from commit b59616d00a)
This commit is contained in:
Ruben S. Montero 2010-03-08 00:11:45 +01:00
parent 28dee90b5a
commit 61d7079cc2
13 changed files with 1177 additions and 825 deletions

View File

@ -283,7 +283,11 @@ public:
* *
* *
*/ */
int get_share_running_vms()
{
return host_share.running_vms;
}
int get_share_disk_usage() int get_share_disk_usage()
{ {
return host_share.disk_usage; return host_share.disk_usage;

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -211,13 +211,6 @@ extern FILE *host_in, *host_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #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).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T #ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t; typedef size_t yy_size_t;
@ -516,7 +509,7 @@ char *host_text;
/* See the License for the specific language governing permissions and */ /* See the License for the specific language governing permissions and */
/* limitations under the License. */ /* limitations under the License. */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
#line 19 "host_parser.l" #line 18 "host_parser.l"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -530,7 +523,7 @@ char *host_text;
#define YY_USER_ACTION llocp->first_line = host_lineno; \ #define YY_USER_ACTION llocp->first_line = host_lineno; \
llocp->first_column = llocp->last_column; \ llocp->first_column = llocp->last_column; \
llocp->last_column += host_leng; llocp->last_column += host_leng;
#line 535 "host_parser.c" #line 527 "host_parser.c"
#define INITIAL 0 #define INITIAL 0
@ -548,6 +541,35 @@ char *host_text;
static int yy_init_globals (void ); static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int host_lex_destroy (void );
int host_get_debug (void );
void host_set_debug (int debug_flag );
YY_EXTRA_TYPE host_get_extra (void );
void host_set_extra (YY_EXTRA_TYPE user_defined );
FILE *host_get_in (void );
void host_set_in (FILE * in_str );
FILE *host_get_out (void );
void host_set_out (FILE * out_str );
int host_get_leng (void );
char *host_get_text (void );
int host_get_lineno (void );
void host_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
*/ */
@ -681,11 +703,11 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 39 "host_parser.l" #line 38 "host_parser.l"
/* --- Tokens --- */ /* --- Tokens --- */
#line 690 "host_parser.c" #line 711 "host_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
@ -780,26 +802,26 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
YY_RULE_SETUP YY_RULE_SETUP
#line 42 "host_parser.l" #line 41 "host_parser.l"
{ return *host_text;} { return *host_text;}
YY_BREAK YY_BREAK
/* --- Strings, also quoted form --- */ /* --- Strings, also quoted form --- */
case 2: case 2:
YY_RULE_SETUP YY_RULE_SETUP
#line 46 "host_parser.l" #line 45 "host_parser.l"
{ lvalp->val_str = strdup(host_text); { lvalp->val_str = strdup(host_text);
return STRING;} return STRING;}
YY_BREAK YY_BREAK
case 3: case 3:
YY_RULE_SETUP YY_RULE_SETUP
#line 49 "host_parser.l" #line 48 "host_parser.l"
{ lvalp->val_str = NULL; { lvalp->val_str = NULL;
return STRING;} return STRING;}
YY_BREAK YY_BREAK
case 4: case 4:
/* rule 4 can match eol */ /* rule 4 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 52 "host_parser.l" #line 51 "host_parser.l"
{ lvalp->val_str = strdup(host_text+1); { lvalp->val_str = strdup(host_text+1);
lvalp->val_str[host_leng-2] = '\0'; lvalp->val_str[host_leng-2] = '\0';
return STRING;} return STRING;}
@ -807,28 +829,28 @@ YY_RULE_SETUP
/* --- Numbers --- */ /* --- Numbers --- */
case 5: case 5:
YY_RULE_SETUP YY_RULE_SETUP
#line 57 "host_parser.l" #line 56 "host_parser.l"
{ lvalp->val_int = atoi(host_text); { lvalp->val_int = atoi(host_text);
return INTEGER;} return INTEGER;}
YY_BREAK YY_BREAK
case 6: case 6:
YY_RULE_SETUP YY_RULE_SETUP
#line 60 "host_parser.l" #line 59 "host_parser.l"
{ lvalp->val_float = atof(host_text); { lvalp->val_float = atof(host_text);
return FLOAT;} return FLOAT;}
YY_BREAK YY_BREAK
/* --- blanks --- */ /* --- blanks --- */
case 7: case 7:
YY_RULE_SETUP YY_RULE_SETUP
#line 64 "host_parser.l" #line 63 "host_parser.l"
YY_BREAK YY_BREAK
case 8: case 8:
YY_RULE_SETUP YY_RULE_SETUP
#line 66 "host_parser.l" #line 65 "host_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 833 "host_parser.c" #line 854 "host_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@ -1797,7 +1819,7 @@ void host_free (void * ptr )
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 66 "host_parser.l" #line 65 "host_parser.l"

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,7 +28,7 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -55,40 +54,29 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 1 #define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 1 #define YYLSP_NEEDED 1
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse host_rank_parse #define yyparse host_rank_parse
#define yylex host_rank_lex #define yylex host_rank_lex
#define yyerror host_rank_error #define yyerror host_rank_error
#define yylval host_rank_lval #define yylval host_rank_lval
#define yychar host_rank_char #define yychar host_rank_char
#define yydebug host_rank_debug #define yydebug host_rank_debug
#define yynerrs host_rank_nerrs #define yynerrs host_rank_nerrs
#define yylloc host_rank_lloc #define yylloc host_rank_lloc
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
INTEGER = 258,
STRING = 259,
FLOAT = 260
};
#endif
/* Tokens. */
#define INTEGER 258
#define STRING 259
#define FLOAT 260
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
#line 18 "host_rank.y"
/* Line 189 of yacc.c */
#line 17 "host_rank.y"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -122,6 +110,9 @@ int host_rank_parse(Host * host, int& result, char ** errmsg);
/* Line 189 of yacc.c */
#line 115 "host_rank.cc"
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -140,20 +131,40 @@ int host_rank_parse(Host * host, int& result, char ** errmsg);
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
INTEGER = 258,
STRING = 259,
FLOAT = 260
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 55 "host_rank.y"
{ {
/* Line 214 of yacc.c */
#line 54 "host_rank.y"
char * val_str; char * val_str;
int val_int; int val_int;
float val_float; float val_float;
}
/* Line 187 of yacc.c. */
#line 153 "host_rank.cc"
YYSTYPE; /* Line 214 of yacc.c */
#line 164 "host_rank.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
@ -173,8 +184,8 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Line 264 of yacc.c */
#line 178 "host_rank.cc" #line 189 "host_rank.cc"
#ifdef short #ifdef short
# undef short # undef short
@ -249,14 +260,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
@ -338,9 +349,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
YYLTYPE yyls; YYLTYPE yyls_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
@ -375,12 +386,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
@ -462,8 +473,8 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 77, 77, 78, 81, 85, 86, 87, 88, 89, 0, 76, 76, 77, 80, 156, 157, 158, 159, 160,
90, 91, 92 161, 162, 163
}; };
#endif #endif
@ -754,17 +765,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, host, result, error_ms
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
@ -802,11 +816,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, host, result, error_msg)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
, &(yylsp[(yyi + 1) - (yynrhs)]) , host, result, error_msg); , &(yylsp[(yyi + 1) - (yynrhs)]) , host, result, error_msg);
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
@ -1094,10 +1108,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, host, result, error_msg)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
@ -1116,10 +1128,9 @@ int yyparse ();
/*-------------------------.
/*----------. | yyparse or yypush_parse. |
| yyparse. | `-------------------------*/
`----------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
@ -1145,24 +1156,59 @@ yyparse (host, result, error_msg)
#endif #endif
#endif #endif
{ {
/* The look-ahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Location data for the lookahead symbol. */
int yynerrs;
/* Location data for the look-ahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc;
int yystate; /* Number of syntax errors so far. */
int yynerrs;
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.
`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;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize;
int yyn; int yyn;
int yyresult; int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Lookahead token as an internal (translated) token number. */
int yyerrstatus; int yytoken;
/* Look-ahead token as an internal (translated) token number. */ /* The variables used to return semantic value and location from the
int yytoken = 0; action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */ /* Buffer for error messages, and its allocated size. */
char yymsgbuf[128]; char yymsgbuf[128];
@ -1170,63 +1216,37 @@ YYLTYPE yylloc;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif #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;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yyls = yylsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers. /* Initialize stack pointers.
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL #if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */ /* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1; yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 0; yylloc.first_column = yylloc.last_column = 1;
#endif #endif
goto yysetstate; goto yysetstate;
@ -1265,6 +1285,7 @@ YYLTYPE yylloc;
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp), &yyls1, yysize * sizeof (*yylsp),
&yystacksize); &yystacksize);
yyls = yyls1; yyls = yyls1;
yyss = yyss1; yyss = yyss1;
yyvs = yyvs1; yyvs = yyvs1;
@ -1286,9 +1307,9 @@ YYLTYPE yylloc;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls); YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
@ -1309,6 +1330,9 @@ YYLTYPE yylloc;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
@ -1317,16 +1341,16 @@ YYLTYPE yylloc;
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* 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]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
@ -1358,20 +1382,16 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF) yychar = YYEMPTY;
yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
@ -1412,66 +1432,161 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
#line 77 "host_rank.y"
/* Line 1455 of yacc.c */
#line 76 "host_rank.y"
{ result = static_cast<int>((yyvsp[(1) - (1)].val_float));;} { result = static_cast<int>((yyvsp[(1) - (1)].val_float));;}
break; break;
case 3: case 3:
#line 78 "host_rank.y"
/* Line 1455 of yacc.c */
#line 77 "host_rank.y"
{ result = 0; ;} { result = 0; ;}
break; break;
case 4: case 4:
#line 81 "host_rank.y"
/* Line 1455 of yacc.c */
#line 80 "host_rank.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (1)].val_str),val); string attr((yyvsp[(1) - (1)].val_str));
(yyval.val_float) = val.empty() ? 0.0 : atof(val.c_str());
free((yyvsp[(1) - (1)].val_str)); ;} if (attr == "RUNNING_VMS")
{
(yyval.val_float) = static_cast<float>
(host->get_share_running_vms());
}
else if (attr == "ALLOCATED_MEMORY")
{
(yyval.val_float) = static_cast<float>
(host->get_share_mem_usage());
}
else if (attr == "ALLOCATED_CPU")
{
(yyval.val_float) = static_cast<float>
(host->get_share_cpu_usage());
}
else if (attr == "ALLOCATED_DISK")
{
(yyval.val_float) = static_cast<float>
(host->get_share_disk_usage());
}
else if (attr == "USED_MEMORY")
{
(yyval.val_float) = static_cast<float>
(host->get_share_used_mem());
}
else if (attr == "USED_CPU")
{
(yyval.val_float) = static_cast<float>
(host->get_share_used_cpu());
}
else if (attr == "USED_DISK")
{
(yyval.val_float) = static_cast<float>
(host->get_share_used_disk());
}
else if (attr == "FREE_MEMORY")
{
(yyval.val_float) = static_cast<float>
(host->get_share_free_mem());
}
else if (attr == "FREE_CPU")
{
(yyval.val_float) = static_cast<float>
(host->get_share_free_cpu());
}
else if (attr == "FREE_DISK")
{
(yyval.val_float) = static_cast<float>
(host->get_share_free_disk());
}
else if (attr == "MAX_MEMORY")
{
(yyval.val_float) = static_cast<float>
(host->get_share_max_mem());
}
else if (attr == "MAX_CPU")
{
(yyval.val_float) = static_cast<float>
(host->get_share_max_cpu());
}
else if (attr == "MAX_DISK")
{
(yyval.val_float) = static_cast<float>
(host->get_share_max_disk());
}
else
{
host->get_template_attribute((yyvsp[(1) - (1)].val_str),val);
(yyval.val_float) = val.empty() ? 0.0 : atof(val.c_str());
}
free((yyvsp[(1) - (1)].val_str));
;}
break; break;
case 5: case 5:
#line 85 "host_rank.y"
/* Line 1455 of yacc.c */
#line 156 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(1) - (1)].val_float); ;} { (yyval.val_float) = (yyvsp[(1) - (1)].val_float); ;}
break; break;
case 6: case 6:
#line 86 "host_rank.y"
/* Line 1455 of yacc.c */
#line 157 "host_rank.y"
{ (yyval.val_float) = static_cast<float>((yyvsp[(1) - (1)].val_int)); ;} { (yyval.val_float) = static_cast<float>((yyvsp[(1) - (1)].val_int)); ;}
break; break;
case 7: case 7:
#line 87 "host_rank.y"
/* Line 1455 of yacc.c */
#line 158 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) + (yyvsp[(3) - (3)].val_float);;} { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) + (yyvsp[(3) - (3)].val_float);;}
break; break;
case 8: case 8:
#line 88 "host_rank.y"
/* Line 1455 of yacc.c */
#line 159 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) - (yyvsp[(3) - (3)].val_float);;} { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) - (yyvsp[(3) - (3)].val_float);;}
break; break;
case 9: case 9:
#line 89 "host_rank.y"
/* Line 1455 of yacc.c */
#line 160 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) * (yyvsp[(3) - (3)].val_float);;} { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) * (yyvsp[(3) - (3)].val_float);;}
break; break;
case 10: case 10:
#line 90 "host_rank.y"
/* Line 1455 of yacc.c */
#line 161 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) / (yyvsp[(3) - (3)].val_float);;} { (yyval.val_float) = (yyvsp[(1) - (3)].val_float) / (yyvsp[(3) - (3)].val_float);;}
break; break;
case 11: case 11:
#line 91 "host_rank.y"
/* Line 1455 of yacc.c */
#line 162 "host_rank.y"
{ (yyval.val_float) = - (yyvsp[(2) - (2)].val_float);;} { (yyval.val_float) = - (yyvsp[(2) - (2)].val_float);;}
break; break;
case 12: case 12:
#line 92 "host_rank.y"
/* Line 1455 of yacc.c */
#line 163 "host_rank.y"
{ (yyval.val_float) = (yyvsp[(2) - (3)].val_float);;} { (yyval.val_float) = (yyvsp[(2) - (3)].val_float);;}
break; break;
/* Line 1267 of yacc.c. */
#line 1475 "host_rank.cc" /* Line 1455 of yacc.c */
#line 1590 "host_rank.cc"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1547,7 +1662,7 @@ yyerrlab:
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
@ -1564,7 +1679,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. */ token. */
goto yyerrlab1; goto yyerrlab1;
@ -1622,14 +1737,11 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
yyerror_range[1] = yylloc; yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of /* Using YYLLOC is tempting, but would change the location of
the look-ahead. YYLOC is available though. */ the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc; *++yylsp = yyloc;
@ -1654,7 +1766,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
@ -1665,7 +1777,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc, host, result, error_msg); yytoken, &yylval, &yylloc, host, result, error_msg);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
@ -1691,7 +1803,9 @@ yyreturn:
} }
#line 95 "host_rank.y"
/* Line 1675 of yacc.c */
#line 166 "host_rank.y"
extern "C" void host_rank_error( extern "C" void host_rank_error(

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,10 +28,11 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
@ -44,28 +44,28 @@
FLOAT = 260 FLOAT = 260
}; };
#endif #endif
/* Tokens. */
#define INTEGER 258
#define STRING 259
#define FLOAT 260
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 55 "host_rank.y"
{ {
/* Line 1676 of yacc.c */
#line 54 "host_rank.y"
char * val_str; char * val_str;
int val_int; int val_int;
float val_float; float val_float;
}
/* Line 1489 of yacc.c. */
/* Line 1676 of yacc.c */
#line 65 "host_rank.hh" #line 65 "host_rank.hh"
YYSTYPE; } YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
@ -84,3 +84,4 @@ typedef struct YYLTYPE
#endif #endif

View File

@ -78,9 +78,81 @@ stmt: expr { result = static_cast<int>($1);}
; ;
expr: STRING { string val; expr: STRING { string val;
host->get_template_attribute($1,val); string attr($1);
$$ = val.empty() ? 0.0 : atof(val.c_str());
free($1); } if (attr == "RUNNING_VMS")
{
$$ = static_cast<float>
(host->get_share_running_vms());
}
else if (attr == "ALLOCATED_MEMORY")
{
$$ = static_cast<float>
(host->get_share_mem_usage());
}
else if (attr == "ALLOCATED_CPU")
{
$$ = static_cast<float>
(host->get_share_cpu_usage());
}
else if (attr == "ALLOCATED_DISK")
{
$$ = static_cast<float>
(host->get_share_disk_usage());
}
else if (attr == "USED_MEMORY")
{
$$ = static_cast<float>
(host->get_share_used_mem());
}
else if (attr == "USED_CPU")
{
$$ = static_cast<float>
(host->get_share_used_cpu());
}
else if (attr == "USED_DISK")
{
$$ = static_cast<float>
(host->get_share_used_disk());
}
else if (attr == "FREE_MEMORY")
{
$$ = static_cast<float>
(host->get_share_free_mem());
}
else if (attr == "FREE_CPU")
{
$$ = static_cast<float>
(host->get_share_free_cpu());
}
else if (attr == "FREE_DISK")
{
$$ = static_cast<float>
(host->get_share_free_disk());
}
else if (attr == "MAX_MEMORY")
{
$$ = static_cast<float>
(host->get_share_max_mem());
}
else if (attr == "MAX_CPU")
{
$$ = static_cast<float>
(host->get_share_max_cpu());
}
else if (attr == "MAX_DISK")
{
$$ = static_cast<float>
(host->get_share_max_disk());
}
else
{
host->get_template_attribute($1,val);
$$ = val.empty() ? 0.0 : atof(val.c_str());
}
free($1);
}
| FLOAT { $$ = $1; } | FLOAT { $$ = $1; }
| INTEGER { $$ = static_cast<float>($1); } | INTEGER { $$ = static_cast<float>($1); }
| expr '+' expr { $$ = $1 + $3;} | expr '+' expr { $$ = $1 + $3;}

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,7 +28,7 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -55,40 +54,29 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 1 #define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 1 #define YYLSP_NEEDED 1
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse host_requirements_parse #define yyparse host_requirements_parse
#define yylex host_requirements_lex #define yylex host_requirements_lex
#define yyerror host_requirements_error #define yyerror host_requirements_error
#define yylval host_requirements_lval #define yylval host_requirements_lval
#define yychar host_requirements_char #define yychar host_requirements_char
#define yydebug host_requirements_debug #define yydebug host_requirements_debug
#define yynerrs host_requirements_nerrs #define yynerrs host_requirements_nerrs
#define yylloc host_requirements_lloc #define yylloc host_requirements_lloc
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
INTEGER = 258,
STRING = 259,
FLOAT = 260
};
#endif
/* Tokens. */
#define INTEGER 258
#define STRING 259
#define FLOAT 260
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
#line 18 "host_requirements.y"
/* Line 189 of yacc.c */
#line 17 "host_requirements.y"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -122,6 +110,9 @@ int host_requirements_parse(Host * host, bool& result, char ** errmsg);
/* Line 189 of yacc.c */
#line 115 "host_requirements.cc"
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -140,20 +131,40 @@ int host_requirements_parse(Host * host, bool& result, char ** errmsg);
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
INTEGER = 258,
STRING = 259,
FLOAT = 260
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 55 "host_requirements.y"
{ {
/* Line 214 of yacc.c */
#line 54 "host_requirements.y"
char * val_str; char * val_str;
int val_int; int val_int;
float val_float; float val_float;
}
/* Line 187 of yacc.c. */
#line 153 "host_requirements.cc"
YYSTYPE; /* Line 214 of yacc.c */
#line 164 "host_requirements.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
@ -173,8 +184,8 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Line 264 of yacc.c */
#line 178 "host_requirements.cc" #line 189 "host_requirements.cc"
#ifdef short #ifdef short
# undef short # undef short
@ -249,14 +260,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
@ -338,9 +349,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
YYLTYPE yyls; YYLTYPE yyls_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
@ -375,12 +386,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
@ -465,8 +476,8 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 75, 75, 76, 79, 86, 93, 100, 107, 114, 0, 74, 74, 75, 78, 85, 92, 99, 106, 113,
121, 128, 135, 143, 151, 152, 153, 154 120, 127, 134, 142, 150, 151, 152, 153
}; };
#endif #endif
@ -760,17 +771,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, host, result, error_ms
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
@ -808,11 +822,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, host, result, error_msg)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
, &(yylsp[(yyi + 1) - (yynrhs)]) , host, result, error_msg); , &(yylsp[(yyi + 1) - (yynrhs)]) , host, result, error_msg);
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
@ -1100,10 +1114,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, host, result, error_msg)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
@ -1122,10 +1134,9 @@ int yyparse ();
/*-------------------------.
/*----------. | yyparse or yypush_parse. |
| yyparse. | `-------------------------*/
`----------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
@ -1151,24 +1162,59 @@ yyparse (host, result, error_msg)
#endif #endif
#endif #endif
{ {
/* The look-ahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Location data for the lookahead symbol. */
int yynerrs;
/* Location data for the look-ahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc;
int yystate; /* Number of syntax errors so far. */
int yynerrs;
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.
`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;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize;
int yyn; int yyn;
int yyresult; int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Lookahead token as an internal (translated) token number. */
int yyerrstatus; int yytoken;
/* Look-ahead token as an internal (translated) token number. */ /* The variables used to return semantic value and location from the
int yytoken = 0; action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */ /* Buffer for error messages, and its allocated size. */
char yymsgbuf[128]; char yymsgbuf[128];
@ -1176,63 +1222,37 @@ YYLTYPE yylloc;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif #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;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yyls = yylsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers. /* Initialize stack pointers.
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL #if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */ /* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1; yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 0; yylloc.first_column = yylloc.last_column = 1;
#endif #endif
goto yysetstate; goto yysetstate;
@ -1271,6 +1291,7 @@ YYLTYPE yylloc;
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp), &yyls1, yysize * sizeof (*yylsp),
&yystacksize); &yystacksize);
yyls = yyls1; yyls = yyls1;
yyss = yyss1; yyss = yyss1;
yyvs = yyvs1; yyvs = yyvs1;
@ -1292,9 +1313,9 @@ YYLTYPE yylloc;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls); YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
@ -1315,6 +1336,9 @@ YYLTYPE yylloc;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
@ -1323,16 +1347,16 @@ YYLTYPE yylloc;
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* 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]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
@ -1364,20 +1388,16 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF) yychar = YYEMPTY;
yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
@ -1418,17 +1438,23 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 2: case 2:
#line 75 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 74 "host_requirements.y"
{ result=(yyvsp[(1) - (1)].val_int); ;} { result=(yyvsp[(1) - (1)].val_int); ;}
break; break;
case 3: case 3:
#line 76 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 75 "host_requirements.y"
{ result=true; ;} { result=true; ;}
break; break;
case 4: case 4:
#line 79 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 78 "host_requirements.y"
{ int val; { int val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1438,7 +1464,9 @@ yyreduce:
break; break;
case 5: case 5:
#line 86 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 85 "host_requirements.y"
{ int val; { int val;
host->get_template_attribute((yyvsp[(1) - (4)].val_str),val); host->get_template_attribute((yyvsp[(1) - (4)].val_str),val);
@ -1448,7 +1476,9 @@ yyreduce:
break; break;
case 6: case 6:
#line 93 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 92 "host_requirements.y"
{ int val; { int val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1458,7 +1488,9 @@ yyreduce:
break; break;
case 7: case 7:
#line 100 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 99 "host_requirements.y"
{ int val; { int val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1468,7 +1500,9 @@ yyreduce:
break; break;
case 8: case 8:
#line 107 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 106 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1478,7 +1512,9 @@ yyreduce:
break; break;
case 9: case 9:
#line 114 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 113 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (4)].val_str),val); host->get_template_attribute((yyvsp[(1) - (4)].val_str),val);
@ -1488,7 +1524,9 @@ yyreduce:
break; break;
case 10: case 10:
#line 121 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 120 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1498,7 +1536,9 @@ yyreduce:
break; break;
case 11: case 11:
#line 128 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 127 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1508,7 +1548,9 @@ yyreduce:
break; break;
case 12: case 12:
#line 135 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 134 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (3)].val_str),val); host->get_template_attribute((yyvsp[(1) - (3)].val_str),val);
@ -1519,7 +1561,9 @@ yyreduce:
break; break;
case 13: case 13:
#line 143 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 142 "host_requirements.y"
{ string val; { string val;
host->get_template_attribute((yyvsp[(1) - (4)].val_str),val); host->get_template_attribute((yyvsp[(1) - (4)].val_str),val);
@ -1530,28 +1574,37 @@ yyreduce:
break; break;
case 14: case 14:
#line 151 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 150 "host_requirements.y"
{ (yyval.val_int) = (yyvsp[(1) - (3)].val_int) && (yyvsp[(3) - (3)].val_int); ;} { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) && (yyvsp[(3) - (3)].val_int); ;}
break; break;
case 15: case 15:
#line 152 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 151 "host_requirements.y"
{ (yyval.val_int) = (yyvsp[(1) - (3)].val_int) || (yyvsp[(3) - (3)].val_int); ;} { (yyval.val_int) = (yyvsp[(1) - (3)].val_int) || (yyvsp[(3) - (3)].val_int); ;}
break; break;
case 16: case 16:
#line 153 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 152 "host_requirements.y"
{ (yyval.val_int) = ! (yyvsp[(2) - (2)].val_int); ;} { (yyval.val_int) = ! (yyvsp[(2) - (2)].val_int); ;}
break; break;
case 17: case 17:
#line 154 "host_requirements.y"
/* Line 1455 of yacc.c */
#line 153 "host_requirements.y"
{ (yyval.val_int) = (yyvsp[(2) - (3)].val_int); ;} { (yyval.val_int) = (yyvsp[(2) - (3)].val_int); ;}
break; break;
/* Line 1267 of yacc.c. */
#line 1555 "host_requirements.cc" /* Line 1455 of yacc.c */
#line 1608 "host_requirements.cc"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1627,7 +1680,7 @@ yyerrlab:
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
@ -1644,7 +1697,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. */ token. */
goto yyerrlab1; goto yyerrlab1;
@ -1702,14 +1755,11 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
yyerror_range[1] = yylloc; yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of /* Using YYLLOC is tempting, but would change the location of
the look-ahead. YYLOC is available though. */ the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc; *++yylsp = yyloc;
@ -1734,7 +1784,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
@ -1745,7 +1795,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc, host, result, error_msg); yytoken, &yylval, &yylloc, host, result, error_msg);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
@ -1771,7 +1821,9 @@ yyreturn:
} }
#line 157 "host_requirements.y"
/* Line 1675 of yacc.c */
#line 156 "host_requirements.y"
extern "C" void host_requirements_error( extern "C" void host_requirements_error(

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,10 +28,11 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
@ -44,28 +44,28 @@
FLOAT = 260 FLOAT = 260
}; };
#endif #endif
/* Tokens. */
#define INTEGER 258
#define STRING 259
#define FLOAT 260
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 55 "host_requirements.y"
{ {
/* Line 1676 of yacc.c */
#line 54 "host_requirements.y"
char * val_str; char * val_str;
int val_int; int val_int;
float val_float; float val_float;
}
/* Line 1489 of yacc.c. */
/* Line 1676 of yacc.c */
#line 65 "host_requirements.hh" #line 65 "host_requirements.hh"
YYSTYPE; } YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
@ -84,3 +84,4 @@ typedef struct YYLTYPE
#endif #endif

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -211,13 +211,6 @@ extern FILE *template_in, *template_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #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).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T #ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t; typedef size_t yy_size_t;
@ -542,7 +535,7 @@ char *template_text;
/* See the License for the specific language governing permissions and */ /* See the License for the specific language governing permissions and */
/* limitations under the License. */ /* limitations under the License. */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
#line 19 "template_parser.l" #line 18 "template_parser.l"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -556,7 +549,7 @@ char *template_text;
llocp->first_column = llocp->last_column; \ llocp->first_column = llocp->last_column; \
llocp->last_column += template_leng; llocp->last_column += template_leng;
#line 561 "template_parser.c" #line 553 "template_parser.c"
#define INITIAL 0 #define INITIAL 0
#define VALUE 1 #define VALUE 1
@ -575,6 +568,35 @@ char *template_text;
static int yy_init_globals (void ); static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int template_lex_destroy (void );
int template_get_debug (void );
void template_set_debug (int debug_flag );
YY_EXTRA_TYPE template_get_extra (void );
void template_set_extra (YY_EXTRA_TYPE user_defined );
FILE *template_get_in (void );
void template_set_in (FILE * in_str );
FILE *template_get_out (void );
void template_set_out (FILE * out_str );
int template_get_leng (void );
char *template_get_text (void );
int template_get_lineno (void );
void template_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
*/ */
@ -708,13 +730,13 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 41 "template_parser.l" #line 40 "template_parser.l"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/* Comments (lines with an starting #), and empty lines */ /* Comments (lines with an starting #), and empty lines */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#line 719 "template_parser.c" #line 740 "template_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
@ -810,13 +832,13 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
/* rule 1 can match eol */ /* rule 1 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 46 "template_parser.l" #line 45 "template_parser.l"
; ;
YY_BREAK YY_BREAK
case 2: case 2:
/* rule 2 can match eol */ /* rule 2 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 47 "template_parser.l" #line 46 "template_parser.l"
; ;
YY_BREAK YY_BREAK
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
@ -824,7 +846,7 @@ YY_RULE_SETUP
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
case 3: case 3:
YY_RULE_SETUP YY_RULE_SETUP
#line 52 "template_parser.l" #line 51 "template_parser.l"
{ lvalp->val_str = strdup(template_text); return VARIABLE;} { lvalp->val_str = strdup(template_text); return VARIABLE;}
YY_BREAK YY_BREAK
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
@ -834,31 +856,31 @@ YY_RULE_SETUP
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
case 4: case 4:
YY_RULE_SETUP YY_RULE_SETUP
#line 59 "template_parser.l" #line 58 "template_parser.l"
{ BEGIN VALUE; return EQUAL;} { BEGIN VALUE; return EQUAL;}
YY_BREAK YY_BREAK
case 5: case 5:
/* rule 5 can match eol */ /* rule 5 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 61 "template_parser.l" #line 60 "template_parser.l"
{ return EQUAL_EMPTY;} { return EQUAL_EMPTY;}
YY_BREAK YY_BREAK
case 6: case 6:
/* rule 6 can match eol */ /* rule 6 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 63 "template_parser.l" #line 62 "template_parser.l"
{ return COMMA;} { return COMMA;}
YY_BREAK YY_BREAK
case 7: case 7:
/* rule 7 can match eol */ /* rule 7 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 65 "template_parser.l" #line 64 "template_parser.l"
{ return CBRACKET;} { return CBRACKET;}
YY_BREAK YY_BREAK
case 8: case 8:
/* rule 8 can match eol */ /* rule 8 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 67 "template_parser.l" #line 66 "template_parser.l"
{ BEGIN(INITIAL); return OBRACKET;} { BEGIN(INITIAL); return OBRACKET;}
YY_BREAK YY_BREAK
/* ------------------------------------------------------------------------ */ /* ------------------------------------------------------------------------ */
@ -869,7 +891,7 @@ YY_RULE_SETUP
case 9: case 9:
/* rule 9 can match eol */ /* rule 9 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 74 "template_parser.l" #line 73 "template_parser.l"
{ lvalp->val_str = strdup(template_text+1); { lvalp->val_str = strdup(template_text+1);
lvalp->val_str[template_leng-2] = '\0'; lvalp->val_str[template_leng-2] = '\0';
BEGIN(INITIAL); return STRING; } BEGIN(INITIAL); return STRING; }
@ -881,16 +903,16 @@ YY_RULE_SETUP
*/ */
case 10: case 10:
YY_RULE_SETUP YY_RULE_SETUP
#line 83 "template_parser.l" #line 82 "template_parser.l"
{ lvalp->val_str = strdup(template_text); { lvalp->val_str = strdup(template_text);
BEGIN(INITIAL); return STRING;} BEGIN(INITIAL); return STRING;}
YY_BREAK YY_BREAK
case 11: case 11:
YY_RULE_SETUP YY_RULE_SETUP
#line 85 "template_parser.l" #line 84 "template_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 895 "template_parser.c" #line 916 "template_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(VALUE): case YY_STATE_EOF(VALUE):
yyterminate(); yyterminate();
@ -1860,7 +1882,7 @@ void template_free (void * ptr )
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 85 "template_parser.l" #line 84 "template_parser.l"

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,7 +28,7 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -55,48 +54,29 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 1 #define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 1 #define YYLSP_NEEDED 1
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse template_parse #define yyparse template_parse
#define yylex template_lex #define yylex template_lex
#define yyerror template_error #define yyerror template_error
#define yylval template_lval #define yylval template_lval
#define yychar template_char #define yychar template_char
#define yydebug template_debug #define yydebug template_debug
#define yynerrs template_nerrs #define yynerrs template_nerrs
#define yylloc template_lloc #define yylloc template_lloc
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
EQUAL = 258,
COMMA = 259,
OBRACKET = 260,
CBRACKET = 261,
EQUAL_EMPTY = 262,
STRING = 263,
VARIABLE = 264
};
#endif
/* Tokens. */
#define EQUAL 258
#define COMMA 259
#define OBRACKET 260
#define CBRACKET 261
#define EQUAL_EMPTY 262
#define STRING 263
#define VARIABLE 264
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
#line 18 "template_syntax.y"
/* Line 189 of yacc.c */
#line 17 "template_syntax.y"
#include <iostream> #include <iostream>
#include <string> #include <string>
@ -128,6 +108,9 @@ int template_parse(Template * tmpl, char ** errmsg);
static string& unescape (string &str); static string& unescape (string &str);
/* Line 189 of yacc.c */
#line 113 "template_syntax.cc"
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -146,19 +129,43 @@ static string& unescape (string &str);
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
EQUAL = 258,
COMMA = 259,
OBRACKET = 260,
CBRACKET = 261,
EQUAL_EMPTY = 262,
STRING = 263,
VARIABLE = 264
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 52 "template_syntax.y"
{ {
/* Line 214 of yacc.c */
#line 51 "template_syntax.y"
char * val_str; char * val_str;
void * val_attr; void * val_attr;
}
/* Line 187 of yacc.c. */
#line 158 "template_syntax.cc"
YYSTYPE; /* Line 214 of yacc.c */
#line 165 "template_syntax.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
@ -178,8 +185,8 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Line 264 of yacc.c */
#line 183 "template_syntax.cc" #line 190 "template_syntax.cc"
#ifdef short #ifdef short
# undef short # undef short
@ -254,14 +261,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
@ -343,9 +350,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
YYLTYPE yyls; YYLTYPE yyls_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
@ -380,12 +387,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
@ -466,7 +473,7 @@ static const yytype_int8 yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint8 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 72, 72, 73, 76, 89, 103, 117, 133 0, 71, 71, 72, 75, 88, 102, 116, 132
}; };
#endif #endif
@ -750,17 +757,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, tmpl, error_msg)
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
@ -797,11 +807,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, tmpl, error_msg)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
, &(yylsp[(yyi + 1) - (yynrhs)]) , tmpl, error_msg); , &(yylsp[(yyi + 1) - (yynrhs)]) , tmpl, error_msg);
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
@ -1087,10 +1097,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, tmpl, error_msg)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
@ -1109,10 +1117,9 @@ int yyparse ();
/*-------------------------.
/*----------. | yyparse or yypush_parse. |
| yyparse. | `-------------------------*/
`----------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
@ -1137,24 +1144,59 @@ yyparse (tmpl, error_msg)
#endif #endif
#endif #endif
{ {
/* The look-ahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Location data for the lookahead symbol. */
int yynerrs;
/* Location data for the look-ahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc;
int yystate; /* Number of syntax errors so far. */
int yynerrs;
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.
`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;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize;
int yyn; int yyn;
int yyresult; int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Lookahead token as an internal (translated) token number. */
int yyerrstatus; int yytoken;
/* Look-ahead token as an internal (translated) token number. */ /* The variables used to return semantic value and location from the
int yytoken = 0; action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */ /* Buffer for error messages, and its allocated size. */
char yymsgbuf[128]; char yymsgbuf[128];
@ -1162,63 +1204,37 @@ YYLTYPE yylloc;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif #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;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yyls = yylsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers. /* Initialize stack pointers.
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL #if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */ /* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1; yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 0; yylloc.first_column = yylloc.last_column = 1;
#endif #endif
goto yysetstate; goto yysetstate;
@ -1257,6 +1273,7 @@ YYLTYPE yylloc;
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp), &yyls1, yysize * sizeof (*yylsp),
&yystacksize); &yystacksize);
yyls = yyls1; yyls = yyls1;
yyss = yyss1; yyss = yyss1;
yyvs = yyvs1; yyvs = yyvs1;
@ -1278,9 +1295,9 @@ YYLTYPE yylloc;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls); YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
@ -1301,6 +1318,9 @@ YYLTYPE yylloc;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
@ -1309,16 +1329,16 @@ YYLTYPE yylloc;
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* 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]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
@ -1350,20 +1370,16 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF) yychar = YYEMPTY;
yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
@ -1404,7 +1420,9 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 4: case 4:
#line 77 "template_syntax.y"
/* Line 1455 of yacc.c */
#line 76 "template_syntax.y"
{ {
Attribute * pattr; Attribute * pattr;
string name((yyvsp[(1) - (3)].val_str)); string name((yyvsp[(1) - (3)].val_str));
@ -1420,7 +1438,9 @@ yyreduce:
break; break;
case 5: case 5:
#line 90 "template_syntax.y"
/* Line 1455 of yacc.c */
#line 89 "template_syntax.y"
{ {
Attribute * pattr; Attribute * pattr;
string name((yyvsp[(1) - (5)].val_str)); string name((yyvsp[(1) - (5)].val_str));
@ -1437,7 +1457,9 @@ yyreduce:
break; break;
case 6: case 6:
#line 104 "template_syntax.y"
/* Line 1455 of yacc.c */
#line 103 "template_syntax.y"
{ {
Attribute * pattr; Attribute * pattr;
string name((yyvsp[(1) - (2)].val_str)); string name((yyvsp[(1) - (2)].val_str));
@ -1452,7 +1474,9 @@ yyreduce:
break; break;
case 7: case 7:
#line 118 "template_syntax.y"
/* Line 1455 of yacc.c */
#line 117 "template_syntax.y"
{ {
map<string,string>* vattr; map<string,string>* vattr;
string name((yyvsp[(1) - (3)].val_str)); string name((yyvsp[(1) - (3)].val_str));
@ -1471,7 +1495,9 @@ yyreduce:
break; break;
case 8: case 8:
#line 134 "template_syntax.y"
/* Line 1455 of yacc.c */
#line 133 "template_syntax.y"
{ {
string name((yyvsp[(3) - (5)].val_str)); string name((yyvsp[(3) - (5)].val_str));
string value((yyvsp[(5) - (5)].val_str)); string value((yyvsp[(5) - (5)].val_str));
@ -1490,8 +1516,9 @@ yyreduce:
break; break;
/* Line 1267 of yacc.c. */
#line 1495 "template_syntax.cc" /* Line 1455 of yacc.c */
#line 1522 "template_syntax.cc"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1567,7 +1594,7 @@ yyerrlab:
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
@ -1584,7 +1611,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. */ token. */
goto yyerrlab1; goto yyerrlab1;
@ -1642,14 +1669,11 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
yyerror_range[1] = yylloc; yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of /* Using YYLLOC is tempting, but would change the location of
the look-ahead. YYLOC is available though. */ the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc; *++yylsp = yyloc;
@ -1674,7 +1698,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
@ -1685,7 +1709,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc, tmpl, error_msg); yytoken, &yylval, &yylloc, tmpl, error_msg);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
@ -1711,7 +1735,9 @@ yyreturn:
} }
#line 150 "template_syntax.y"
/* Line 1675 of yacc.c */
#line 149 "template_syntax.y"
string& unescape (string &str) string& unescape (string &str)

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,10 +28,11 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
@ -48,31 +48,27 @@
VARIABLE = 264 VARIABLE = 264
}; };
#endif #endif
/* Tokens. */
#define EQUAL 258
#define COMMA 259
#define OBRACKET 260
#define CBRACKET 261
#define EQUAL_EMPTY 262
#define STRING 263
#define VARIABLE 264
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 52 "template_syntax.y"
{ {
/* Line 1676 of yacc.c */
#line 51 "template_syntax.y"
char * val_str; char * val_str;
void * val_attr; void * val_attr;
}
/* Line 1489 of yacc.c. */
#line 72 "template_syntax.hh"
YYSTYPE; /* Line 1676 of yacc.c */
#line 68 "template_syntax.hh"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
@ -91,3 +87,4 @@ typedef struct YYLTYPE
#endif #endif

View File

@ -28,7 +28,7 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 34 #define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -211,13 +211,6 @@ extern FILE *vm_var_in, *vm_var_out;
#define unput(c) yyunput( c, (yytext_ptr) ) #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).
* Given that the standard has decreed that size_t exists since 1989,
* I guess we can afford to depend on it. Manoj.
*/
#ifndef YY_TYPEDEF_YY_SIZE_T #ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t; typedef size_t yy_size_t;
@ -525,7 +518,7 @@ char *vm_var_text;
/* See the License for the specific language governing permissions and */ /* See the License for the specific language governing permissions and */
/* limitations under the License. */ /* limitations under the License. */
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
#line 19 "vm_var_parser.l" #line 18 "vm_var_parser.l"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -539,7 +532,7 @@ char *vm_var_text;
llocp->first_column = llocp->last_column; \ llocp->first_column = llocp->last_column; \
llocp->last_column += vm_var_leng; llocp->last_column += vm_var_leng;
#line 544 "vm_var_parser.c" #line 536 "vm_var_parser.c"
#define INITIAL 0 #define INITIAL 0
#define VAR 1 #define VAR 1
@ -558,6 +551,35 @@ char *vm_var_text;
static int yy_init_globals (void ); static int yy_init_globals (void );
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
int vm_var_lex_destroy (void );
int vm_var_get_debug (void );
void vm_var_set_debug (int debug_flag );
YY_EXTRA_TYPE vm_var_get_extra (void );
void vm_var_set_extra (YY_EXTRA_TYPE user_defined );
FILE *vm_var_get_in (void );
void vm_var_set_in (FILE * in_str );
FILE *vm_var_get_out (void );
void vm_var_set_out (FILE * out_str );
int vm_var_get_leng (void );
char *vm_var_get_text (void );
int vm_var_get_lineno (void );
void vm_var_set_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
*/ */
@ -691,7 +713,7 @@ YY_DECL
register char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
register int yy_act; register int yy_act;
#line 39 "vm_var_parser.l" #line 38 "vm_var_parser.l"
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
@ -702,7 +724,7 @@ YY_DECL
/* $NUM.CONTEXT_VARIABLE */ /* $NUM.CONTEXT_VARIABLE */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
#line 707 "vm_var_parser.c" #line 728 "vm_var_parser.c"
if ( !(yy_init) ) if ( !(yy_init) )
{ {
@ -797,65 +819,65 @@ do_action: /* This label is used only to access EOF actions. */
case 1: case 1:
YY_RULE_SETUP YY_RULE_SETUP
#line 49 "vm_var_parser.l" #line 48 "vm_var_parser.l"
{ BEGIN VAR;} { BEGIN VAR;}
YY_BREAK YY_BREAK
case 2: case 2:
YY_RULE_SETUP YY_RULE_SETUP
#line 51 "vm_var_parser.l" #line 50 "vm_var_parser.l"
{ return EQUAL;} { return EQUAL;}
YY_BREAK YY_BREAK
case 3: case 3:
YY_RULE_SETUP YY_RULE_SETUP
#line 52 "vm_var_parser.l" #line 51 "vm_var_parser.l"
{ return COMMA;} { return COMMA;}
YY_BREAK YY_BREAK
case 4: case 4:
YY_RULE_SETUP YY_RULE_SETUP
#line 53 "vm_var_parser.l" #line 52 "vm_var_parser.l"
{ return OBRACKET;} { return OBRACKET;}
YY_BREAK YY_BREAK
case 5: case 5:
YY_RULE_SETUP YY_RULE_SETUP
#line 54 "vm_var_parser.l" #line 53 "vm_var_parser.l"
{ return CBRACKET;} { return CBRACKET;}
YY_BREAK YY_BREAK
case 6: case 6:
YY_RULE_SETUP YY_RULE_SETUP
#line 56 "vm_var_parser.l" #line 55 "vm_var_parser.l"
{ vm_var_text[vm_var_leng-1] = '\0'; { vm_var_text[vm_var_leng-1] = '\0';
lvalp->val_int = atoi(vm_var_text); lvalp->val_int = atoi(vm_var_text);
return INTEGER;} return INTEGER;}
YY_BREAK YY_BREAK
case 7: case 7:
YY_RULE_SETUP YY_RULE_SETUP
#line 59 "vm_var_parser.l" #line 58 "vm_var_parser.l"
{ lvalp->val_str = strdup(vm_var_text); { lvalp->val_str = strdup(vm_var_text);
return VARIABLE;} return VARIABLE;}
YY_BREAK YY_BREAK
case 8: case 8:
/* rule 8 can match eol */ /* rule 8 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 61 "vm_var_parser.l" #line 60 "vm_var_parser.l"
{ lvalp->val_str = strdup(vm_var_text+1); { lvalp->val_str = strdup(vm_var_text+1);
lvalp->val_str[vm_var_leng-2] = '\0'; lvalp->val_str[vm_var_leng-2] = '\0';
return STRING;} return STRING;}
YY_BREAK YY_BREAK
case 9: case 9:
YY_RULE_SETUP YY_RULE_SETUP
#line 65 "vm_var_parser.l" #line 64 "vm_var_parser.l"
{ lvalp->val_char = '\0'; { lvalp->val_char = '\0';
return EOA;} return EOA;}
YY_BREAK YY_BREAK
case 10: case 10:
YY_RULE_SETUP YY_RULE_SETUP
#line 67 "vm_var_parser.l" #line 66 "vm_var_parser.l"
{ lvalp->val_char = *vm_var_text; { lvalp->val_char = *vm_var_text;
BEGIN(INITIAL); BEGIN(INITIAL);
return EOA;} return EOA;}
YY_BREAK YY_BREAK
case YY_STATE_EOF(VAR): case YY_STATE_EOF(VAR):
#line 70 "vm_var_parser.l" #line 69 "vm_var_parser.l"
{ lvalp->val_char = '\0'; { lvalp->val_char = '\0';
BEGIN(INITIAL); BEGIN(INITIAL);
return EOA;} return EOA;}
@ -866,15 +888,15 @@ case YY_STATE_EOF(VAR):
case 11: case 11:
/* rule 11 can match eol */ /* rule 11 can match eol */
YY_RULE_SETUP YY_RULE_SETUP
#line 78 "vm_var_parser.l" #line 77 "vm_var_parser.l"
{ lvalp->val_str = strdup(vm_var_text); return RSTRING;} { lvalp->val_str = strdup(vm_var_text); return RSTRING;}
YY_BREAK YY_BREAK
case 12: case 12:
YY_RULE_SETUP YY_RULE_SETUP
#line 80 "vm_var_parser.l" #line 79 "vm_var_parser.l"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 879 "vm_var_parser.c" #line 900 "vm_var_parser.c"
case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(INITIAL):
yyterminate(); yyterminate();
@ -1843,7 +1865,7 @@ void vm_var_free (void * ptr )
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"
#line 80 "vm_var_parser.l" #line 79 "vm_var_parser.l"

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C /* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,7 +28,7 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
@ -47,7 +46,7 @@
#define YYBISON 1 #define YYBISON 1
/* Bison version. */ /* Bison version. */
#define YYBISON_VERSION "2.3" #define YYBISON_VERSION "2.4.1"
/* Skeleton name. */ /* Skeleton name. */
#define YYSKELETON_NAME "yacc.c" #define YYSKELETON_NAME "yacc.c"
@ -55,52 +54,29 @@
/* Pure parsers. */ /* Pure parsers. */
#define YYPURE 1 #define YYPURE 1
/* Push parsers. */
#define YYPUSH 0
/* Pull parsers. */
#define YYPULL 1
/* Using locations. */ /* Using locations. */
#define YYLSP_NEEDED 1 #define YYLSP_NEEDED 1
/* Substitute the variable and function names. */ /* Substitute the variable and function names. */
#define yyparse vm_var_parse #define yyparse vm_var_parse
#define yylex vm_var_lex #define yylex vm_var_lex
#define yyerror vm_var_error #define yyerror vm_var_error
#define yylval vm_var_lval #define yylval vm_var_lval
#define yychar vm_var_char #define yychar vm_var_char
#define yydebug vm_var_debug #define yydebug vm_var_debug
#define yynerrs vm_var_nerrs #define yynerrs vm_var_nerrs
#define yylloc vm_var_lloc #define yylloc vm_var_lloc
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
EQUAL = 258,
COMMA = 259,
OBRACKET = 260,
CBRACKET = 261,
EOA = 262,
STRING = 263,
VARIABLE = 264,
RSTRING = 265,
INTEGER = 266
};
#endif
/* Tokens. */
#define EQUAL 258
#define COMMA 259
#define OBRACKET 260
#define CBRACKET 261
#define EOA 262
#define STRING 263
#define VARIABLE 264
#define RSTRING 265
#define INTEGER 266
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
#line 18 "vm_var_syntax.y"
/* Line 189 of yacc.c */
#line 17 "vm_var_syntax.y"
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -245,6 +221,9 @@ error_name:
/* Line 189 of yacc.c */
#line 226 "vm_var_syntax.cc"
/* Enabling traces. */ /* Enabling traces. */
#ifndef YYDEBUG #ifndef YYDEBUG
# define YYDEBUG 0 # define YYDEBUG 0
@ -263,20 +242,46 @@ error_name:
# define YYTOKEN_TABLE 0 # define YYTOKEN_TABLE 0
#endif #endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
EQUAL = 258,
COMMA = 259,
OBRACKET = 260,
CBRACKET = 261,
EOA = 262,
STRING = 263,
VARIABLE = 264,
RSTRING = 265,
INTEGER = 266
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 167 "vm_var_syntax.y"
{ {
/* Line 214 of yacc.c */
#line 166 "vm_var_syntax.y"
char * val_str; char * val_str;
int val_int; int val_int;
char val_char; char val_char;
}
/* Line 187 of yacc.c. */
#line 276 "vm_var_syntax.cc"
YYSTYPE; /* Line 214 of yacc.c */
#line 281 "vm_var_syntax.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
@ -296,8 +301,8 @@ typedef struct YYLTYPE
/* Copy the second part of user declarations. */ /* Copy the second part of user declarations. */
/* Line 216 of yacc.c. */ /* Line 264 of yacc.c */
#line 301 "vm_var_syntax.cc" #line 306 "vm_var_syntax.cc"
#ifdef short #ifdef short
# undef short # undef short
@ -372,14 +377,14 @@ typedef short int yytype_int16;
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static int static int
YYID (int i) YYID (int yyi)
#else #else
static int static int
YYID (i) YYID (yyi)
int i; int yyi;
#endif #endif
{ {
return i; return yyi;
} }
#endif #endif
@ -461,9 +466,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */ /* A type that is properly aligned for any stack member. */
union yyalloc union yyalloc
{ {
yytype_int16 yyss; yytype_int16 yyss_alloc;
YYSTYPE yyvs; YYSTYPE yyvs_alloc;
YYLTYPE yyls; YYLTYPE yyls_alloc;
}; };
/* The size of the maximum gap between one aligned stack and the next. */ /* The size of the maximum gap between one aligned stack and the next. */
@ -498,12 +503,12 @@ union yyalloc
elements in the stack, and YYPTR gives the new location of the elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next stack. Advance YYPTR to a properly aligned location for the next
stack. */ stack. */
# define YYSTACK_RELOCATE(Stack) \ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \ do \
{ \ { \
YYSIZE_T yynewbytes; \ YYSIZE_T yynewbytes; \
YYCOPY (&yyptr->Stack, Stack, yysize); \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack; \ Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \ yyptr += yynewbytes / sizeof (*yyptr); \
} \ } \
@ -582,9 +587,9 @@ static const yytype_int8 yyrhs[] =
}; };
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] = static const yytype_uint8 yyrline[] =
{ {
0, 191, 191, 192, 195, 200, 215, 233, 256 0, 190, 190, 191, 194, 199, 214, 232, 255
}; };
#endif #endif
@ -880,17 +885,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, vm, vm_id, parsed, err
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER) || defined __cplusplus || defined _MSC_VER)
static void static void
yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
#else #else
static void static void
yy_stack_print (bottom, top) yy_stack_print (yybottom, yytop)
yytype_int16 *bottom; yytype_int16 *yybottom;
yytype_int16 *top; yytype_int16 *yytop;
#endif #endif
{ {
YYFPRINTF (stderr, "Stack now"); YYFPRINTF (stderr, "Stack now");
for (; bottom <= top; ++bottom) for (; yybottom <= yytop; yybottom++)
YYFPRINTF (stderr, " %d", *bottom); {
int yybot = *yybottom;
YYFPRINTF (stderr, " %d", yybot);
}
YYFPRINTF (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
@ -929,11 +937,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, vm, vm_id, parsed, errmsg)
/* The symbols being reduced. */ /* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++) for (yyi = 0; yyi < yynrhs; yyi++)
{ {
fprintf (stderr, " $%d = ", yyi + 1); YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)]) &(yyvsp[(yyi + 1) - (yynrhs)])
, &(yylsp[(yyi + 1) - (yynrhs)]) , vm, vm_id, parsed, errmsg); , &(yylsp[(yyi + 1) - (yynrhs)]) , vm, vm_id, parsed, errmsg);
fprintf (stderr, "\n"); YYFPRINTF (stderr, "\n");
} }
} }
@ -1223,10 +1231,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, vm, vm_id, parsed, errmsg)
break; break;
} }
} }
/* Prevent warnings from -Wmissing-prototypes. */ /* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus #if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM); int yyparse (void *YYPARSE_PARAM);
@ -1245,10 +1251,9 @@ int yyparse ();
/*-------------------------.
/*----------. | yyparse or yypush_parse. |
| yyparse. | `-------------------------*/
`----------*/
#ifdef YYPARSE_PARAM #ifdef YYPARSE_PARAM
#if (defined __STDC__ || defined __C99__FUNC__ \ #if (defined __STDC__ || defined __C99__FUNC__ \
@ -1275,24 +1280,59 @@ yyparse (vm, vm_id, parsed, errmsg)
#endif #endif
#endif #endif
{ {
/* The look-ahead symbol. */ /* The lookahead symbol. */
int yychar; int yychar;
/* The semantic value of the look-ahead symbol. */ /* The semantic value of the lookahead symbol. */
YYSTYPE yylval; YYSTYPE yylval;
/* Number of syntax errors so far. */ /* Location data for the lookahead symbol. */
int yynerrs;
/* Location data for the look-ahead symbol. */
YYLTYPE yylloc; YYLTYPE yylloc;
int yystate; /* Number of syntax errors so far. */
int yynerrs;
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.
`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;
yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs;
YYSTYPE *yyvsp;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
YYSIZE_T yystacksize;
int yyn; int yyn;
int yyresult; int yyresult;
/* Number of tokens to shift before error messages enabled. */ /* Lookahead token as an internal (translated) token number. */
int yyerrstatus; int yytoken;
/* Look-ahead token as an internal (translated) token number. */ /* The variables used to return semantic value and location from the
int yytoken = 0; action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
#if YYERROR_VERBOSE #if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */ /* Buffer for error messages, and its allocated size. */
char yymsgbuf[128]; char yymsgbuf[128];
@ -1300,63 +1340,37 @@ YYLTYPE yylloc;
YYSIZE_T yymsg_alloc = sizeof yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif #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;
/* The location stack. */
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
/* The variables used to return semantic value and location from the
action routines. */
YYSTYPE yyval;
YYLTYPE yyloc;
/* The number of symbols on the RHS of the reduced rule. /* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */ Keep to zero when no symbol should be popped. */
int yylen = 0; int yylen = 0;
yytoken = 0;
yyss = yyssa;
yyvs = yyvsa;
yyls = yylsa;
yystacksize = YYINITDEPTH;
YYDPRINTF ((stderr, "Starting parse\n")); YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0; yystate = 0;
yyerrstatus = 0; yyerrstatus = 0;
yynerrs = 0; yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */ yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers. /* Initialize stack pointers.
Waste one element of value and location stack Waste one element of value and location stack
so that they stay on the same level as the state stack. so that they stay on the same level as the state stack.
The wasted elements are never initialized. */ The wasted elements are never initialized. */
yyssp = yyss; yyssp = yyss;
yyvsp = yyvs; yyvsp = yyvs;
yylsp = yyls; yylsp = yyls;
#if YYLTYPE_IS_TRIVIAL #if YYLTYPE_IS_TRIVIAL
/* Initialize the default location before parsing starts. */ /* Initialize the default location before parsing starts. */
yylloc.first_line = yylloc.last_line = 1; yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 0; yylloc.first_column = yylloc.last_column = 1;
#endif #endif
goto yysetstate; goto yysetstate;
@ -1395,6 +1409,7 @@ YYLTYPE yylloc;
&yyvs1, yysize * sizeof (*yyvsp), &yyvs1, yysize * sizeof (*yyvsp),
&yyls1, yysize * sizeof (*yylsp), &yyls1, yysize * sizeof (*yylsp),
&yystacksize); &yystacksize);
yyls = yyls1; yyls = yyls1;
yyss = yyss1; yyss = yyss1;
yyvs = yyvs1; yyvs = yyvs1;
@ -1416,9 +1431,9 @@ YYLTYPE yylloc;
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr) if (! yyptr)
goto yyexhaustedlab; goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs); YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls); YYSTACK_RELOCATE (yyls_alloc, yyls);
# undef YYSTACK_RELOCATE # undef YYSTACK_RELOCATE
if (yyss1 != yyssa) if (yyss1 != yyssa)
YYSTACK_FREE (yyss1); YYSTACK_FREE (yyss1);
@ -1439,6 +1454,9 @@ YYLTYPE yylloc;
YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YYDPRINTF ((stderr, "Entering state %d\n", yystate));
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup; goto yybackup;
/*-----------. /*-----------.
@ -1447,16 +1465,16 @@ YYLTYPE yylloc;
yybackup: yybackup:
/* Do appropriate processing given the current state. Read a /* 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]; yyn = yypact[yystate];
if (yyn == YYPACT_NINF) if (yyn == YYPACT_NINF)
goto yydefault; 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) if (yychar == YYEMPTY)
{ {
YYDPRINTF ((stderr, "Reading a token: ")); YYDPRINTF ((stderr, "Reading a token: "));
@ -1488,20 +1506,16 @@ yybackup:
goto yyreduce; goto yyreduce;
} }
if (yyn == YYFINAL)
YYACCEPT;
/* Count tokens shifted since error; after three, turn off error /* Count tokens shifted since error; after three, turn off error
status. */ status. */
if (yyerrstatus) if (yyerrstatus)
yyerrstatus--; yyerrstatus--;
/* Shift the look-ahead token. */ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
/* Discard the shifted token unless it is eof. */ /* Discard the shifted token. */
if (yychar != YYEOF) yychar = YYEMPTY;
yychar = YYEMPTY;
yystate = yyn; yystate = yyn;
*++yyvsp = yylval; *++yyvsp = yylval;
@ -1542,7 +1556,9 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 4: case 4:
#line 196 "vm_var_syntax.y"
/* Line 1455 of yacc.c */
#line 195 "vm_var_syntax.y"
{ {
(*parsed) << (yyvsp[(1) - (1)].val_str); (*parsed) << (yyvsp[(1) - (1)].val_str);
free((yyvsp[(1) - (1)].val_str)); free((yyvsp[(1) - (1)].val_str));
@ -1550,7 +1566,9 @@ yyreduce:
break; break;
case 5: case 5:
#line 201 "vm_var_syntax.y"
/* Line 1455 of yacc.c */
#line 200 "vm_var_syntax.y"
{ {
string name((yyvsp[(1) - (2)].val_str)); string name((yyvsp[(1) - (2)].val_str));
@ -1568,7 +1586,9 @@ yyreduce:
break; break;
case 6: case 6:
#line 216 "vm_var_syntax.y"
/* Line 1455 of yacc.c */
#line 215 "vm_var_syntax.y"
{ {
string name((yyvsp[(1) - (5)].val_str)); string name((yyvsp[(1) - (5)].val_str));
string vname((yyvsp[(3) - (5)].val_str)); string vname((yyvsp[(3) - (5)].val_str));
@ -1589,7 +1609,9 @@ yyreduce:
break; break;
case 7: case 7:
#line 234 "vm_var_syntax.y"
/* Line 1455 of yacc.c */
#line 233 "vm_var_syntax.y"
{ {
string name((yyvsp[(1) - (9)].val_str)); string name((yyvsp[(1) - (9)].val_str));
string vname((yyvsp[(3) - (9)].val_str)); string vname((yyvsp[(3) - (9)].val_str));
@ -1615,7 +1637,9 @@ yyreduce:
break; break;
case 8: case 8:
#line 257 "vm_var_syntax.y"
/* Line 1455 of yacc.c */
#line 256 "vm_var_syntax.y"
{ {
string name("CONTEXT"); string name("CONTEXT");
string vname((yyvsp[(2) - (3)].val_str)); string vname((yyvsp[(2) - (3)].val_str));
@ -1634,8 +1658,9 @@ yyreduce:
break; break;
/* Line 1267 of yacc.c. */
#line 1639 "vm_var_syntax.cc" /* Line 1455 of yacc.c */
#line 1664 "vm_var_syntax.cc"
default: break; default: break;
} }
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@ -1711,7 +1736,7 @@ yyerrlab:
if (yyerrstatus == 3) 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. */ error, discard it. */
if (yychar <= YYEOF) if (yychar <= YYEOF)
@ -1728,7 +1753,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. */ token. */
goto yyerrlab1; goto yyerrlab1;
@ -1786,14 +1811,11 @@ yyerrlab1:
YY_STACK_PRINT (yyss, yyssp); YY_STACK_PRINT (yyss, yyssp);
} }
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval; *++yyvsp = yylval;
yyerror_range[1] = yylloc; yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of /* Using YYLLOC is tempting, but would change the location of
the look-ahead. YYLOC is available though. */ the lookahead. YYLOC is available though. */
YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc; *++yylsp = yyloc;
@ -1818,7 +1840,7 @@ yyabortlab:
yyresult = 1; yyresult = 1;
goto yyreturn; goto yyreturn;
#ifndef yyoverflow #if !defined(yyoverflow) || YYERROR_VERBOSE
/*-------------------------------------------------. /*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. | | yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/ `-------------------------------------------------*/
@ -1829,7 +1851,7 @@ yyexhaustedlab:
#endif #endif
yyreturn: yyreturn:
if (yychar != YYEOF && yychar != YYEMPTY) if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead", yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc, vm, vm_id, parsed, errmsg); yytoken, &yylval, &yylloc, vm, vm_id, parsed, errmsg);
/* Do not reclaim the symbols of the rule which action triggered /* Do not reclaim the symbols of the rule which action triggered
@ -1855,7 +1877,9 @@ yyreturn:
} }
#line 273 "vm_var_syntax.y"
/* Line 1675 of yacc.c */
#line 272 "vm_var_syntax.y"
extern "C" void vm_var_error( extern "C" void vm_var_error(

View File

@ -1,24 +1,23 @@
/* A Bison parser, made by GNU Bison 2.3. */
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc. Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option) the Free Software Foundation, either version 3 of the License, or
any later version. (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program. If not, see <http://www.gnu.org/licenses/>. */
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains /* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work part or all of the Bison parser skeleton and distribute that work
@ -29,10 +28,11 @@
special exception, which will cause the skeleton and the resulting special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public Bison output files to be licensed under the GNU General Public
License without this special exception. License without this special exception.
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
/* Tokens. */ /* Tokens. */
#ifndef YYTOKENTYPE #ifndef YYTOKENTYPE
# define YYTOKENTYPE # define YYTOKENTYPE
@ -50,34 +50,28 @@
INTEGER = 266 INTEGER = 266
}; };
#endif #endif
/* Tokens. */
#define EQUAL 258
#define COMMA 259
#define OBRACKET 260
#define CBRACKET 261
#define EOA 262
#define STRING 263
#define VARIABLE 264
#define RSTRING 265
#define INTEGER 266
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
#line 167 "vm_var_syntax.y"
{ {
/* Line 1676 of yacc.c */
#line 166 "vm_var_syntax.y"
char * val_str; char * val_str;
int val_int; int val_int;
char val_char; char val_char;
}
/* Line 1489 of yacc.c. */
#line 77 "vm_var_syntax.hh"
YYSTYPE; /* Line 1676 of yacc.c */
#line 71 "vm_var_syntax.hh"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif #endif
@ -96,3 +90,4 @@ typedef struct YYLTYPE
#endif #endif