mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
Bug #1738: Compile parsers
This commit is contained in:
parent
f1eaea5662
commit
aacde1b5ff
@ -28,7 +28,7 @@
|
||||
#define FLEX_SCANNER
|
||||
#define YY_FLEX_MAJOR_VERSION 2
|
||||
#define YY_FLEX_MINOR_VERSION 5
|
||||
#define YY_FLEX_SUBMINOR_VERSION 37
|
||||
#define YY_FLEX_SUBMINOR_VERSION 35
|
||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||
#define FLEX_BETA
|
||||
#endif
|
||||
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
|
||||
|
||||
/* Size of default input buffer. */
|
||||
#ifndef YY_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k.
|
||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
||||
* Ditto for the __ia64__ case accordingly.
|
||||
*/
|
||||
#define YY_BUF_SIZE 32768
|
||||
#else
|
||||
#define YY_BUF_SIZE 16384
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
#endif
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
extern yy_size_t template_leng;
|
||||
extern int template_leng;
|
||||
|
||||
extern FILE *template_in, *template_out;
|
||||
|
||||
@ -217,6 +220,11 @@ extern FILE *template_in, *template_out;
|
||||
|
||||
#define unput(c) yyunput( c, (yytext_ptr) )
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
#ifndef YY_STRUCT_YY_BUFFER_STATE
|
||||
#define YY_STRUCT_YY_BUFFER_STATE
|
||||
struct yy_buffer_state
|
||||
@ -234,7 +242,7 @@ struct yy_buffer_state
|
||||
/* Number of characters read into yy_ch_buf, not including EOB
|
||||
* characters.
|
||||
*/
|
||||
yy_size_t yy_n_chars;
|
||||
int yy_n_chars;
|
||||
|
||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||
* and can realloc() it to grow it, and should free() it to
|
||||
@ -304,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
|
||||
|
||||
/* yy_hold_char holds the character lost when template_text is formed. */
|
||||
static char yy_hold_char;
|
||||
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
yy_size_t template_leng;
|
||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
int template_leng;
|
||||
|
||||
/* Points to current character in buffer. */
|
||||
static char *yy_c_buf_p = (char *) 0;
|
||||
@ -333,7 +341,7 @@ static void template__init_buffer (YY_BUFFER_STATE b,FILE *file );
|
||||
|
||||
YY_BUFFER_STATE template__scan_buffer (char *base,yy_size_t size );
|
||||
YY_BUFFER_STATE template__scan_string (yyconst char *yy_str );
|
||||
YY_BUFFER_STATE template__scan_bytes (yyconst char *bytes,yy_size_t len );
|
||||
YY_BUFFER_STATE template__scan_bytes (yyconst char *bytes,int len );
|
||||
|
||||
void *template_alloc (yy_size_t );
|
||||
void *template_realloc (void *,yy_size_t );
|
||||
@ -554,7 +562,7 @@ char *template_text;
|
||||
llocp->first_column = llocp->last_column; \
|
||||
llocp->last_column += template_leng;
|
||||
|
||||
#line 558 "template_parser.c"
|
||||
#line 566 "template_parser.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define VALUE 1
|
||||
@ -594,7 +602,7 @@ FILE *template_get_out (void );
|
||||
|
||||
void template_set_out (FILE * out_str );
|
||||
|
||||
yy_size_t template_get_leng (void );
|
||||
int template_get_leng (void );
|
||||
|
||||
char *template_get_text (void );
|
||||
|
||||
@ -634,7 +642,12 @@ static int input (void );
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k */
|
||||
#define YY_READ_BUF_SIZE 16384
|
||||
#else
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* Copy whatever the last rule matched to the standard output. */
|
||||
@ -741,7 +754,7 @@ YY_DECL
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Comments (lines with an starting #), and empty lines */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
#line 745 "template_parser.c"
|
||||
#line 758 "template_parser.c"
|
||||
|
||||
if ( !(yy_init) )
|
||||
{
|
||||
@ -918,7 +931,7 @@ YY_RULE_SETUP
|
||||
#line 89 "template_parser.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 922 "template_parser.c"
|
||||
#line 935 "template_parser.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(VALUE):
|
||||
yyterminate();
|
||||
@ -1105,21 +1118,21 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{
|
||||
yy_size_t num_to_read =
|
||||
int num_to_read =
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
||||
|
||||
while ( num_to_read <= 0 )
|
||||
{ /* Not enough room in the buffer - grow it. */
|
||||
|
||||
/* just a shorter name for the current buffer */
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||
|
||||
int yy_c_buf_p_offset =
|
||||
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
||||
|
||||
if ( b->yy_is_our_buffer )
|
||||
{
|
||||
yy_size_t new_size = b->yy_buf_size * 2;
|
||||
int new_size = b->yy_buf_size * 2;
|
||||
|
||||
if ( new_size <= 0 )
|
||||
b->yy_buf_size += b->yy_buf_size / 8;
|
||||
@ -1150,7 +1163,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
(yy_n_chars), num_to_read );
|
||||
(yy_n_chars), (size_t) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
||||
}
|
||||
@ -1245,7 +1258,7 @@ static int yy_get_next_buffer (void)
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
yy_is_jam = (yy_current_state == 43);
|
||||
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
}
|
||||
|
||||
#ifndef YY_NO_INPUT
|
||||
@ -1272,7 +1285,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{ /* need more input */
|
||||
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
int offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
++(yy_c_buf_p);
|
||||
|
||||
switch ( yy_get_next_buffer( ) )
|
||||
@ -1437,6 +1450,10 @@ static void template__load_buffer_state (void)
|
||||
template_free((void *) b );
|
||||
}
|
||||
|
||||
#ifndef __cplusplus
|
||||
extern int isatty (int );
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Initializes or reinitializes a buffer.
|
||||
* This function is sometimes called more than once on the same buffer,
|
||||
* such as during a template_restart() or at EOF.
|
||||
@ -1549,7 +1566,7 @@ void template_pop_buffer_state (void)
|
||||
*/
|
||||
static void template_ensure_buffer_stack (void)
|
||||
{
|
||||
yy_size_t num_to_alloc;
|
||||
int num_to_alloc;
|
||||
|
||||
if (!(yy_buffer_stack)) {
|
||||
|
||||
@ -1646,7 +1663,7 @@ YY_BUFFER_STATE template__scan_string (yyconst char * yystr )
|
||||
*
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE template__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
||||
YY_BUFFER_STATE template__scan_bytes (yyconst char * yybytes, int _yybytes_len )
|
||||
{
|
||||
YY_BUFFER_STATE b;
|
||||
char *buf;
|
||||
@ -1733,7 +1750,7 @@ FILE *template_get_out (void)
|
||||
/** Get the length of the current token.
|
||||
*
|
||||
*/
|
||||
yy_size_t template_get_leng (void)
|
||||
int template_get_leng (void)
|
||||
{
|
||||
return template_leng;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
#define FLEX_SCANNER
|
||||
#define YY_FLEX_MAJOR_VERSION 2
|
||||
#define YY_FLEX_MINOR_VERSION 5
|
||||
#define YY_FLEX_SUBMINOR_VERSION 37
|
||||
#define YY_FLEX_SUBMINOR_VERSION 35
|
||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||
#define FLEX_BETA
|
||||
#endif
|
||||
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
|
||||
|
||||
/* Size of default input buffer. */
|
||||
#ifndef YY_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k.
|
||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
||||
* Ditto for the __ia64__ case accordingly.
|
||||
*/
|
||||
#define YY_BUF_SIZE 32768
|
||||
#else
|
||||
#define YY_BUF_SIZE 16384
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
#endif
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
extern yy_size_t vm_var_leng;
|
||||
extern int vm_var_leng;
|
||||
|
||||
extern FILE *vm_var_in, *vm_var_out;
|
||||
|
||||
@ -217,6 +220,11 @@ extern FILE *vm_var_in, *vm_var_out;
|
||||
|
||||
#define unput(c) yyunput( c, (yytext_ptr) )
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
#ifndef YY_STRUCT_YY_BUFFER_STATE
|
||||
#define YY_STRUCT_YY_BUFFER_STATE
|
||||
struct yy_buffer_state
|
||||
@ -234,7 +242,7 @@ struct yy_buffer_state
|
||||
/* Number of characters read into yy_ch_buf, not including EOB
|
||||
* characters.
|
||||
*/
|
||||
yy_size_t yy_n_chars;
|
||||
int yy_n_chars;
|
||||
|
||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||
* and can realloc() it to grow it, and should free() it to
|
||||
@ -304,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
|
||||
|
||||
/* yy_hold_char holds the character lost when vm_var_text is formed. */
|
||||
static char yy_hold_char;
|
||||
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
yy_size_t vm_var_leng;
|
||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
int vm_var_leng;
|
||||
|
||||
/* Points to current character in buffer. */
|
||||
static char *yy_c_buf_p = (char *) 0;
|
||||
@ -333,7 +341,7 @@ static void vm_var__init_buffer (YY_BUFFER_STATE b,FILE *file );
|
||||
|
||||
YY_BUFFER_STATE vm_var__scan_buffer (char *base,yy_size_t size );
|
||||
YY_BUFFER_STATE vm_var__scan_string (yyconst char *yy_str );
|
||||
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char *bytes,yy_size_t len );
|
||||
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char *bytes,int len );
|
||||
|
||||
void *vm_var_alloc (yy_size_t );
|
||||
void *vm_var_realloc (void *,yy_size_t );
|
||||
@ -538,7 +546,7 @@ char *vm_var_text;
|
||||
llocp->last_column += vm_var_leng;
|
||||
|
||||
|
||||
#line 542 "vm_var_parser.c"
|
||||
#line 550 "vm_var_parser.c"
|
||||
|
||||
#define INITIAL 0
|
||||
#define VAR 1
|
||||
@ -579,7 +587,7 @@ FILE *vm_var_get_out (void );
|
||||
|
||||
void vm_var_set_out (FILE * out_str );
|
||||
|
||||
yy_size_t vm_var_get_leng (void );
|
||||
int vm_var_get_leng (void );
|
||||
|
||||
char *vm_var_get_text (void );
|
||||
|
||||
@ -619,7 +627,12 @@ static int input (void );
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k */
|
||||
#define YY_READ_BUF_SIZE 16384
|
||||
#else
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* Copy whatever the last rule matched to the standard output. */
|
||||
@ -731,7 +744,7 @@ YY_DECL
|
||||
/* $NUM.CONTEXT_VARIABLE */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
#line 735 "vm_var_parser.c"
|
||||
#line 748 "vm_var_parser.c"
|
||||
|
||||
if ( !(yy_init) )
|
||||
{
|
||||
@ -907,7 +920,7 @@ YY_RULE_SETUP
|
||||
#line 92 "vm_var_parser.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 911 "vm_var_parser.c"
|
||||
#line 924 "vm_var_parser.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
case YY_STATE_EOF(VALUE):
|
||||
yyterminate();
|
||||
@ -1094,21 +1107,21 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{
|
||||
yy_size_t num_to_read =
|
||||
int num_to_read =
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
||||
|
||||
while ( num_to_read <= 0 )
|
||||
{ /* Not enough room in the buffer - grow it. */
|
||||
|
||||
/* just a shorter name for the current buffer */
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||
|
||||
int yy_c_buf_p_offset =
|
||||
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
||||
|
||||
if ( b->yy_is_our_buffer )
|
||||
{
|
||||
yy_size_t new_size = b->yy_buf_size * 2;
|
||||
int new_size = b->yy_buf_size * 2;
|
||||
|
||||
if ( new_size <= 0 )
|
||||
b->yy_buf_size += b->yy_buf_size / 8;
|
||||
@ -1139,7 +1152,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
(yy_n_chars), num_to_read );
|
||||
(yy_n_chars), (size_t) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
||||
}
|
||||
@ -1234,7 +1247,7 @@ static int yy_get_next_buffer (void)
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
yy_is_jam = (yy_current_state == 33);
|
||||
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
}
|
||||
|
||||
#ifndef YY_NO_INPUT
|
||||
@ -1261,7 +1274,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{ /* need more input */
|
||||
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
int offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
++(yy_c_buf_p);
|
||||
|
||||
switch ( yy_get_next_buffer( ) )
|
||||
@ -1426,6 +1439,10 @@ static void vm_var__load_buffer_state (void)
|
||||
vm_var_free((void *) b );
|
||||
}
|
||||
|
||||
#ifndef __cplusplus
|
||||
extern int isatty (int );
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Initializes or reinitializes a buffer.
|
||||
* This function is sometimes called more than once on the same buffer,
|
||||
* such as during a vm_var_restart() or at EOF.
|
||||
@ -1538,7 +1555,7 @@ void vm_var_pop_buffer_state (void)
|
||||
*/
|
||||
static void vm_var_ensure_buffer_stack (void)
|
||||
{
|
||||
yy_size_t num_to_alloc;
|
||||
int num_to_alloc;
|
||||
|
||||
if (!(yy_buffer_stack)) {
|
||||
|
||||
@ -1635,7 +1652,7 @@ YY_BUFFER_STATE vm_var__scan_string (yyconst char * yystr )
|
||||
*
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
||||
YY_BUFFER_STATE vm_var__scan_bytes (yyconst char * yybytes, int _yybytes_len )
|
||||
{
|
||||
YY_BUFFER_STATE b;
|
||||
char *buf;
|
||||
@ -1722,7 +1739,7 @@ FILE *vm_var_get_out (void)
|
||||
/** Get the length of the current token.
|
||||
*
|
||||
*/
|
||||
yy_size_t vm_var_get_leng (void)
|
||||
int vm_var_get_leng (void)
|
||||
{
|
||||
return vm_var_leng;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* A Bison parser, made by GNU Bison 2.7. */
|
||||
/* A Bison parser, made by GNU Bison 2.5. */
|
||||
|
||||
/* Bison implementation for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -44,7 +44,7 @@
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "2.7"
|
||||
#define YYBISON_VERSION "2.5"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
@ -58,6 +58,8 @@
|
||||
/* Pull parsers. */
|
||||
#define YYPULL 1
|
||||
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED 1
|
||||
|
||||
/* Substitute the variable and function names. */
|
||||
#define yyparse expr_arith__parse
|
||||
@ -70,7 +72,8 @@
|
||||
#define yylloc expr_arith__lloc
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
/* Line 371 of yacc.c */
|
||||
|
||||
/* Line 268 of yacc.c */
|
||||
#line 17 "expr_arith.y"
|
||||
|
||||
#include <iostream>
|
||||
@ -125,16 +128,14 @@ extern "C"
|
||||
}
|
||||
|
||||
|
||||
/* Line 371 of yacc.c */
|
||||
#line 130 "expr_arith.cc"
|
||||
|
||||
# ifndef YY_NULL
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULL nullptr
|
||||
# else
|
||||
# define YY_NULL 0
|
||||
# endif
|
||||
# endif
|
||||
/* Line 268 of yacc.c */
|
||||
#line 134 "expr_arith.cc"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error messages. */
|
||||
#ifdef YYERROR_VERBOSE
|
||||
@ -144,18 +145,12 @@ extern "C"
|
||||
# define YYERROR_VERBOSE 0
|
||||
#endif
|
||||
|
||||
/* In a future release of Bison, this section will be replaced
|
||||
by #include "expr_arith.hh". */
|
||||
#ifndef YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED
|
||||
# define YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int expr_arith__debug;
|
||||
/* Enabling the token table. */
|
||||
#ifndef YYTOKEN_TABLE
|
||||
# define YYTOKEN_TABLE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
@ -169,10 +164,12 @@ extern int expr_arith__debug;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 387 of yacc.c */
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 78 "expr_arith.y"
|
||||
|
||||
char * val_str;
|
||||
@ -180,8 +177,9 @@ typedef union YYSTYPE
|
||||
float val_float;
|
||||
|
||||
|
||||
/* Line 387 of yacc.c */
|
||||
#line 185 "expr_arith.cc"
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 183 "expr_arith.cc"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
@ -202,26 +200,11 @@ typedef struct YYLTYPE
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef YYPARSE_PARAM
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int expr_arith__parse (void *YYPARSE_PARAM);
|
||||
#else
|
||||
int expr_arith__parse ();
|
||||
#endif
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int expr_arith__parse (mem_collector * mc, ObjectXML * oxml, int& result, char ** error_msg);
|
||||
#else
|
||||
int expr_arith__parse ();
|
||||
#endif
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
|
||||
#endif /* !YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED */
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
|
||||
/* Line 390 of yacc.c */
|
||||
#line 225 "expr_arith.cc"
|
||||
|
||||
/* Line 343 of yacc.c */
|
||||
#line 208 "expr_arith.cc"
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@ -274,24 +257,24 @@ typedef short int yytype_int16;
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YY_
|
||||
# define YY_(Msgid) Msgid
|
||||
# define YY_(msgid) msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#if ! defined lint || defined __GNUC__
|
||||
# define YYUSE(E) ((void) (E))
|
||||
# define YYUSE(e) ((void) (e))
|
||||
#else
|
||||
# define YYUSE(E) /* empty */
|
||||
# define YYUSE(e) /* empty */
|
||||
#endif
|
||||
|
||||
/* Identity function, used to suppress warnings about constant conditions. */
|
||||
#ifndef lint
|
||||
# define YYID(N) (N)
|
||||
# define YYID(n) (n)
|
||||
#else
|
||||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
@ -327,7 +310,6 @@ YYID (yyi)
|
||||
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
# endif
|
||||
@ -421,20 +403,20 @@ union yyalloc
|
||||
#endif
|
||||
|
||||
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
|
||||
/* Copy COUNT objects from SRC to DST. The source and destination do
|
||||
/* Copy COUNT objects from FROM to TO. The source and destination do
|
||||
not overlap. */
|
||||
# ifndef YYCOPY
|
||||
# if defined __GNUC__ && 1 < __GNUC__
|
||||
# define YYCOPY(Dst, Src, Count) \
|
||||
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
|
||||
# define YYCOPY(To, From, Count) \
|
||||
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
||||
# else
|
||||
# define YYCOPY(Dst, Src, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(Dst)[yyi] = (Src)[yyi]; \
|
||||
} \
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
# endif
|
||||
# endif
|
||||
@ -514,18 +496,18 @@ static const yytype_int8 yyrhs[] =
|
||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||
static const yytype_uint8 yyrline[] =
|
||||
{
|
||||
0, 100, 100, 101, 104, 136, 137, 138, 139, 140,
|
||||
141, 142, 143
|
||||
0, 100, 100, 101, 104, 124, 125, 126, 127, 128,
|
||||
129, 130, 131
|
||||
};
|
||||
#endif
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE || 0
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
"$end", "error", "$undefined", "'+'", "'-'", "'*'", "'/'", "INTEGER",
|
||||
"STRING", "FLOAT", "'('", "')'", "$accept", "stmt", "expr", YY_NULL
|
||||
"STRING", "FLOAT", "'('", "')'", "$accept", "stmt", "expr", 0
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -594,10 +576,10 @@ static const yytype_uint8 yytable[] =
|
||||
4, 5, 11, 12, 13, 14
|
||||
};
|
||||
|
||||
#define yypact_value_is_default(Yystate) \
|
||||
(!!((Yystate) == (-5)))
|
||||
#define yypact_value_is_default(yystate) \
|
||||
((yystate) == (-5))
|
||||
|
||||
#define yytable_value_is_error(Yytable_value) \
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
YYID (0)
|
||||
|
||||
static const yytype_int8 yycheck[] =
|
||||
@ -642,24 +624,23 @@ static const yytype_uint8 yystos[] =
|
||||
|
||||
#define YYRECOVERING() (!!yyerrstatus)
|
||||
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
YYPOPSTACK (yylen); \
|
||||
yystate = *yyssp; \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error: cannot back up")); \
|
||||
YYERROR; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
/* Error token number */
|
||||
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
|
||||
@ -668,28 +649,27 @@ while (YYID (0))
|
||||
If N is 0, then set CURRENT to the empty location which ends
|
||||
the previous symbol: RHS[0] (always defined). */
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
#endif
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
|
||||
|
||||
/* YY_LOCATION_PRINT -- Print the location on the stream.
|
||||
This macro was not mandated originally: define only if we know
|
||||
@ -697,46 +677,10 @@ while (YYID (0))
|
||||
|
||||
#ifndef YY_LOCATION_PRINT
|
||||
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
|
||||
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
||||
|
||||
__attribute__((__unused__))
|
||||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
static unsigned
|
||||
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
|
||||
#else
|
||||
static unsigned
|
||||
yy_location_print_ (yyo, yylocp)
|
||||
FILE *yyo;
|
||||
YYLTYPE const * const yylocp;
|
||||
#endif
|
||||
{
|
||||
unsigned res = 0;
|
||||
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
|
||||
if (0 <= yylocp->first_line)
|
||||
{
|
||||
res += fprintf (yyo, "%d", yylocp->first_line);
|
||||
if (0 <= yylocp->first_column)
|
||||
res += fprintf (yyo, ".%d", yylocp->first_column);
|
||||
}
|
||||
if (0 <= yylocp->last_line)
|
||||
{
|
||||
if (yylocp->first_line < yylocp->last_line)
|
||||
{
|
||||
res += fprintf (yyo, "-%d", yylocp->last_line);
|
||||
if (0 <= end_col)
|
||||
res += fprintf (yyo, ".%d", end_col);
|
||||
}
|
||||
else if (0 <= end_col && yylocp->first_column < end_col)
|
||||
res += fprintf (yyo, "-%d", end_col);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
yy_location_print_ (File, &(Loc))
|
||||
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# else
|
||||
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
||||
# endif
|
||||
@ -744,6 +688,7 @@ yy_location_print_ (yyo, yylocp)
|
||||
|
||||
|
||||
/* YYLEX -- calling `yylex' with the right arguments. */
|
||||
|
||||
#ifdef YYLEX_PARAM
|
||||
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
|
||||
#else
|
||||
@ -798,8 +743,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, oxml, result
|
||||
char ** error_msg;
|
||||
#endif
|
||||
{
|
||||
FILE *yyo = yyoutput;
|
||||
YYUSE (yyo);
|
||||
if (!yyvaluep)
|
||||
return;
|
||||
YYUSE (yylocationp);
|
||||
@ -816,7 +759,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, oxml, result
|
||||
switch (yytype)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1068,11 +1011,12 @@ static int
|
||||
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
yytype_int16 *yyssp, int yytoken)
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
||||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
YYSIZE_T yysize1;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULL;
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@ -1132,13 +1076,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1158,12 +1100,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
# undef YYCASE_
|
||||
}
|
||||
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
|
||||
if (*yymsg_alloc < yysize)
|
||||
{
|
||||
@ -1233,11 +1173,25 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, oxml, result, error_msg)
|
||||
{
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Prevent warnings from -Wmissing-prototypes. */
|
||||
#ifdef YYPARSE_PARAM
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int yyparse (void *YYPARSE_PARAM);
|
||||
#else
|
||||
int yyparse ();
|
||||
#endif
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int yyparse (mem_collector * mc, ObjectXML * oxml, int& result, char ** error_msg);
|
||||
#else
|
||||
int yyparse ();
|
||||
#endif
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
|
||||
|
||||
/*----------.
|
||||
@ -1272,40 +1226,11 @@ yyparse (mc, oxml, result, error_msg)
|
||||
/* The lookahead symbol. */
|
||||
int yychar;
|
||||
|
||||
|
||||
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
/* Default value used for initialization, for pacifying older GCCs
|
||||
or non-GCC compilers. */
|
||||
static YYSTYPE yyval_default;
|
||||
# define YY_INITIAL_VALUE(Value) = Value
|
||||
#endif
|
||||
static YYLTYPE yyloc_default
|
||||
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
= { 1, 1, 1, 1 }
|
||||
# endif
|
||||
;
|
||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
#endif
|
||||
#ifndef YY_INITIAL_VALUE
|
||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||
#endif
|
||||
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
|
||||
YYSTYPE yylval;
|
||||
|
||||
/* Location data for the lookahead symbol. */
|
||||
YYLTYPE yylloc = yyloc_default;
|
||||
|
||||
YYLTYPE yylloc;
|
||||
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;
|
||||
@ -1319,7 +1244,7 @@ YYLTYPE yylloc = yyloc_default;
|
||||
`yyvs': related to semantic values.
|
||||
`yyls': related to locations.
|
||||
|
||||
Refer to the stacks through separate pointers, to allow yyoverflow
|
||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||
to reallocate them elsewhere. */
|
||||
|
||||
/* The state stack. */
|
||||
@ -1345,7 +1270,7 @@ YYLTYPE yylloc = yyloc_default;
|
||||
int yyn;
|
||||
int yyresult;
|
||||
/* Lookahead token as an internal (translated) token number. */
|
||||
int yytoken = 0;
|
||||
int yytoken;
|
||||
/* The variables used to return semantic value and location from the
|
||||
action routines. */
|
||||
YYSTYPE yyval;
|
||||
@ -1364,9 +1289,10 @@ YYLTYPE yylloc = yyloc_default;
|
||||
Keep to zero when no symbol should be popped. */
|
||||
int yylen = 0;
|
||||
|
||||
yyssp = yyss = yyssa;
|
||||
yyvsp = yyvs = yyvsa;
|
||||
yylsp = yyls = yylsa;
|
||||
yytoken = 0;
|
||||
yyss = yyssa;
|
||||
yyvs = yyvsa;
|
||||
yyls = yylsa;
|
||||
yystacksize = YYINITDEPTH;
|
||||
|
||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||
@ -1375,7 +1301,21 @@ YYLTYPE yylloc = yyloc_default;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
yylsp[0] = yylloc;
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
so that they stay on the same level as the state stack.
|
||||
The wasted elements are never initialized. */
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;
|
||||
yylsp = yyls;
|
||||
|
||||
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
/* Initialize the default location before parsing starts. */
|
||||
yylloc.first_line = yylloc.last_line = 1;
|
||||
yylloc.first_column = yylloc.last_column = 1;
|
||||
#endif
|
||||
|
||||
goto yysetstate;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
@ -1521,9 +1461,7 @@ yybackup:
|
||||
yychar = YYEMPTY;
|
||||
|
||||
yystate = yyn;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
*++yylsp = yylloc;
|
||||
goto yynewstate;
|
||||
|
||||
@ -1561,44 +1499,35 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 2:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 100 "expr_arith.y"
|
||||
{ result = static_cast<int>((yyvsp[(1) - (1)].val_float));}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 101 "expr_arith.y"
|
||||
{ result = 0; }
|
||||
break;
|
||||
|
||||
case 4:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 104 "expr_arith.y"
|
||||
{ float val = 0.0;
|
||||
|
||||
ostringstream xpath_t;
|
||||
ostringstream xpath_s;
|
||||
ostringstream xpath_c;
|
||||
|
||||
vector<string> results;
|
||||
|
||||
xpath_t << "/HOST/TEMPLATE/" << (yyvsp[(1) - (1)].val_str);
|
||||
xpath_s << "/HOST/HOST_SHARE/" << (yyvsp[(1) - (1)].val_str);
|
||||
xpath_c << "/HOST/CLUSTER_TEMPLATE/" << (yyvsp[(1) - (1)].val_str);
|
||||
xpath_t << "/HOST/TEMPLATE/" << (yyvsp[(1) - (1)].val_str)
|
||||
<< "|/HOST/HOST_SHARE/" << (yyvsp[(1) - (1)].val_str)
|
||||
<< "|/HOST/CLUSTER_TEMPLATE/" << (yyvsp[(1) - (1)].val_str);
|
||||
|
||||
results = (*oxml)[xpath_t.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
results = (*oxml)[xpath_s.str().c_str()];
|
||||
}
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
results = (*oxml)[xpath_c.str().c_str()];
|
||||
}
|
||||
|
||||
if (results.size() != 0)
|
||||
{
|
||||
istringstream iss(results[0]);
|
||||
@ -1610,56 +1539,65 @@ yyreduce:
|
||||
break;
|
||||
|
||||
case 5:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 136 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 124 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(1) - (1)].val_float); }
|
||||
break;
|
||||
|
||||
case 6:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 137 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 125 "expr_arith.y"
|
||||
{ (yyval.val_float) = static_cast<float>((yyvsp[(1) - (1)].val_int)); }
|
||||
break;
|
||||
|
||||
case 7:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 138 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 126 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) + (yyvsp[(3) - (3)].val_float);}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 139 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 127 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) - (yyvsp[(3) - (3)].val_float);}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 140 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 128 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) * (yyvsp[(3) - (3)].val_float);}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 141 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 129 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(1) - (3)].val_float) / (yyvsp[(3) - (3)].val_float);}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 142 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 130 "expr_arith.y"
|
||||
{ (yyval.val_float) = - (yyvsp[(2) - (2)].val_float);}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 143 "expr_arith.y"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 131 "expr_arith.y"
|
||||
{ (yyval.val_float) = (yyvsp[(2) - (3)].val_float);}
|
||||
break;
|
||||
|
||||
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 1663 "expr_arith.cc"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 1601 "expr_arith.cc"
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
@ -1824,9 +1762,7 @@ yyerrlab1:
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
}
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
|
||||
yyerror_range[2] = yylloc;
|
||||
/* Using YYLLOC is tempting, but would change the location of
|
||||
@ -1855,7 +1791,7 @@ yyabortlab:
|
||||
yyresult = 1;
|
||||
goto yyreturn;
|
||||
|
||||
#if !defined yyoverflow || YYERROR_VERBOSE
|
||||
#if !defined(yyoverflow) || YYERROR_VERBOSE
|
||||
/*-------------------------------------------------.
|
||||
| yyexhaustedlab -- memory exhaustion comes here. |
|
||||
`-------------------------------------------------*/
|
||||
@ -1897,8 +1833,9 @@ yyreturn:
|
||||
}
|
||||
|
||||
|
||||
/* Line 2055 of yacc.c */
|
||||
#line 146 "expr_arith.y"
|
||||
|
||||
/* Line 2067 of yacc.c */
|
||||
#line 134 "expr_arith.y"
|
||||
|
||||
|
||||
extern "C" void expr_arith__error(
|
||||
@ -1926,3 +1863,4 @@ extern "C" void expr_arith__error(
|
||||
llocp->last_column);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* A Bison parser, made by GNU Bison 2.7. */
|
||||
/* A Bison parser, made by GNU Bison 2.5. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -30,15 +30,6 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED
|
||||
# define YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int expr_arith__debug;
|
||||
#endif
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
@ -53,10 +44,12 @@ extern int expr_arith__debug;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 2058 of yacc.c */
|
||||
|
||||
/* Line 2068 of yacc.c */
|
||||
#line 78 "expr_arith.y"
|
||||
|
||||
char * val_str;
|
||||
@ -64,14 +57,17 @@ typedef union YYSTYPE
|
||||
float val_float;
|
||||
|
||||
|
||||
/* Line 2058 of yacc.c */
|
||||
#line 69 "expr_arith.hh"
|
||||
|
||||
/* Line 2068 of yacc.c */
|
||||
#line 63 "expr_arith.hh"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
@ -85,4 +81,5 @@ typedef struct YYLTYPE
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
#endif /* !YY_EXPR_ARITH_EXPR_ARITH_HH_INCLUDED */
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* A Bison parser, made by GNU Bison 2.7. */
|
||||
/* A Bison parser, made by GNU Bison 2.5. */
|
||||
|
||||
/* Bison implementation for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -44,7 +44,7 @@
|
||||
#define YYBISON 1
|
||||
|
||||
/* Bison version. */
|
||||
#define YYBISON_VERSION "2.7"
|
||||
#define YYBISON_VERSION "2.5"
|
||||
|
||||
/* Skeleton name. */
|
||||
#define YYSKELETON_NAME "yacc.c"
|
||||
@ -58,6 +58,8 @@
|
||||
/* Pull parsers. */
|
||||
#define YYPULL 1
|
||||
|
||||
/* Using locations. */
|
||||
#define YYLSP_NEEDED 1
|
||||
|
||||
/* Substitute the variable and function names. */
|
||||
#define yyparse expr_bool__parse
|
||||
@ -70,7 +72,8 @@
|
||||
#define yylloc expr_bool__lloc
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
/* Line 371 of yacc.c */
|
||||
|
||||
/* Line 268 of yacc.c */
|
||||
#line 17 "expr_bool.y"
|
||||
|
||||
#include <iostream>
|
||||
@ -123,23 +126,21 @@ extern "C"
|
||||
}
|
||||
}
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, int& val);
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, int& val);
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, float& val);
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, float& val);
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val);
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, string& val);
|
||||
|
||||
|
||||
/* Line 371 of yacc.c */
|
||||
#line 135 "expr_bool.cc"
|
||||
|
||||
# ifndef YY_NULL
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
# define YY_NULL nullptr
|
||||
# else
|
||||
# define YY_NULL 0
|
||||
# endif
|
||||
# endif
|
||||
/* Line 268 of yacc.c */
|
||||
#line 139 "expr_bool.cc"
|
||||
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
|
||||
/* Enabling verbose error messages. */
|
||||
#ifdef YYERROR_VERBOSE
|
||||
@ -149,18 +150,12 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val);
|
||||
# define YYERROR_VERBOSE 0
|
||||
#endif
|
||||
|
||||
/* In a future release of Bison, this section will be replaced
|
||||
by #include "expr_bool.hh". */
|
||||
#ifndef YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED
|
||||
# define YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int expr_bool__debug;
|
||||
/* Enabling the token table. */
|
||||
#ifndef YYTOKEN_TABLE
|
||||
# define YYTOKEN_TABLE 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
@ -174,10 +169,12 @@ extern int expr_bool__debug;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 387 of yacc.c */
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 83 "expr_bool.y"
|
||||
|
||||
char * val_str;
|
||||
@ -185,8 +182,9 @@ typedef union YYSTYPE
|
||||
float val_float;
|
||||
|
||||
|
||||
/* Line 387 of yacc.c */
|
||||
#line 190 "expr_bool.cc"
|
||||
|
||||
/* Line 293 of yacc.c */
|
||||
#line 188 "expr_bool.cc"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
@ -207,26 +205,11 @@ typedef struct YYLTYPE
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef YYPARSE_PARAM
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int expr_bool__parse (void *YYPARSE_PARAM);
|
||||
#else
|
||||
int expr_bool__parse ();
|
||||
#endif
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int expr_bool__parse (mem_collector * mc, ObjectXML * oxml, bool& result, char ** error_msg);
|
||||
#else
|
||||
int expr_bool__parse ();
|
||||
#endif
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
|
||||
#endif /* !YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED */
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
|
||||
/* Line 390 of yacc.c */
|
||||
#line 230 "expr_bool.cc"
|
||||
|
||||
/* Line 343 of yacc.c */
|
||||
#line 213 "expr_bool.cc"
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@ -279,24 +262,24 @@ typedef short int yytype_int16;
|
||||
# if defined YYENABLE_NLS && YYENABLE_NLS
|
||||
# if ENABLE_NLS
|
||||
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
|
||||
# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
|
||||
# define YY_(msgid) dgettext ("bison-runtime", msgid)
|
||||
# endif
|
||||
# endif
|
||||
# ifndef YY_
|
||||
# define YY_(Msgid) Msgid
|
||||
# define YY_(msgid) msgid
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Suppress unused-variable warnings by "using" E. */
|
||||
#if ! defined lint || defined __GNUC__
|
||||
# define YYUSE(E) ((void) (E))
|
||||
# define YYUSE(e) ((void) (e))
|
||||
#else
|
||||
# define YYUSE(E) /* empty */
|
||||
# define YYUSE(e) /* empty */
|
||||
#endif
|
||||
|
||||
/* Identity function, used to suppress warnings about constant conditions. */
|
||||
#ifndef lint
|
||||
# define YYID(N) (N)
|
||||
# define YYID(n) (n)
|
||||
#else
|
||||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
@ -332,7 +315,6 @@ YYID (yyi)
|
||||
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
|
||||
/* Use EXIT_SUCCESS as a witness for stdlib.h. */
|
||||
# ifndef EXIT_SUCCESS
|
||||
# define EXIT_SUCCESS 0
|
||||
# endif
|
||||
@ -426,20 +408,20 @@ union yyalloc
|
||||
#endif
|
||||
|
||||
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
|
||||
/* Copy COUNT objects from SRC to DST. The source and destination do
|
||||
/* Copy COUNT objects from FROM to TO. The source and destination do
|
||||
not overlap. */
|
||||
# ifndef YYCOPY
|
||||
# if defined __GNUC__ && 1 < __GNUC__
|
||||
# define YYCOPY(Dst, Src, Count) \
|
||||
__builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
|
||||
# define YYCOPY(To, From, Count) \
|
||||
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
|
||||
# else
|
||||
# define YYCOPY(Dst, Src, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(Dst)[yyi] = (Src)[yyi]; \
|
||||
} \
|
||||
# define YYCOPY(To, From, Count) \
|
||||
do \
|
||||
{ \
|
||||
YYSIZE_T yyi; \
|
||||
for (yyi = 0; yyi < (Count); yyi++) \
|
||||
(To)[yyi] = (From)[yyi]; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
# endif
|
||||
# endif
|
||||
@ -527,13 +509,13 @@ static const yytype_uint8 yyrline[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE || 0
|
||||
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
{
|
||||
"$end", "error", "$undefined", "'!'", "'&'", "'|'", "INTEGER", "STRING",
|
||||
"FLOAT", "'='", "'>'", "'<'", "'('", "')'", "$accept", "stmt", "expr", YY_NULL
|
||||
"FLOAT", "'='", "'>'", "'<'", "'('", "')'", "$accept", "stmt", "expr", 0
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -604,10 +586,10 @@ static const yytype_uint8 yytable[] =
|
||||
16, 17, 18, 26, 27, 28, 19, 21, 20, 22
|
||||
};
|
||||
|
||||
#define yypact_value_is_default(Yystate) \
|
||||
(!!((Yystate) == (-6)))
|
||||
#define yypact_value_is_default(yystate) \
|
||||
((yystate) == (-6))
|
||||
|
||||
#define yytable_value_is_error(Yytable_value) \
|
||||
#define yytable_value_is_error(yytable_value) \
|
||||
YYID (0)
|
||||
|
||||
static const yytype_int8 yycheck[] =
|
||||
@ -653,24 +635,23 @@ static const yytype_uint8 yystos[] =
|
||||
|
||||
#define YYRECOVERING() (!!yyerrstatus)
|
||||
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
YYPOPSTACK (yylen); \
|
||||
yystate = *yyssp; \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
#define YYBACKUP(Token, Value) \
|
||||
do \
|
||||
if (yychar == YYEMPTY && yylen == 1) \
|
||||
{ \
|
||||
yychar = (Token); \
|
||||
yylval = (Value); \
|
||||
YYPOPSTACK (1); \
|
||||
goto yybackup; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
yyerror (&yylloc, mc, oxml, result, error_msg, YY_("syntax error: cannot back up")); \
|
||||
YYERROR; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
|
||||
/* Error token number */
|
||||
|
||||
#define YYTERROR 1
|
||||
#define YYERRCODE 256
|
||||
|
||||
@ -679,28 +660,27 @@ while (YYID (0))
|
||||
If N is 0, then set CURRENT to the empty location which ends
|
||||
the previous symbol: RHS[0] (always defined). */
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
#ifndef YYLLOC_DEFAULT
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
# define YYLLOC_DEFAULT(Current, Rhs, N) \
|
||||
do \
|
||||
if (YYID (N)) \
|
||||
{ \
|
||||
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
|
||||
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
|
||||
(Current).last_line = YYRHSLOC (Rhs, N).last_line; \
|
||||
(Current).last_column = YYRHSLOC (Rhs, N).last_column; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Current).first_line = (Current).last_line = \
|
||||
YYRHSLOC (Rhs, 0).last_line; \
|
||||
(Current).first_column = (Current).last_column = \
|
||||
YYRHSLOC (Rhs, 0).last_column; \
|
||||
} \
|
||||
while (YYID (0))
|
||||
#endif
|
||||
|
||||
#define YYRHSLOC(Rhs, K) ((Rhs)[K])
|
||||
|
||||
|
||||
/* YY_LOCATION_PRINT -- Print the location on the stream.
|
||||
This macro was not mandated originally: define only if we know
|
||||
@ -708,46 +688,10 @@ while (YYID (0))
|
||||
|
||||
#ifndef YY_LOCATION_PRINT
|
||||
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
|
||||
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
|
||||
|
||||
__attribute__((__unused__))
|
||||
#if (defined __STDC__ || defined __C99__FUNC__ \
|
||||
|| defined __cplusplus || defined _MSC_VER)
|
||||
static unsigned
|
||||
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
|
||||
#else
|
||||
static unsigned
|
||||
yy_location_print_ (yyo, yylocp)
|
||||
FILE *yyo;
|
||||
YYLTYPE const * const yylocp;
|
||||
#endif
|
||||
{
|
||||
unsigned res = 0;
|
||||
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
|
||||
if (0 <= yylocp->first_line)
|
||||
{
|
||||
res += fprintf (yyo, "%d", yylocp->first_line);
|
||||
if (0 <= yylocp->first_column)
|
||||
res += fprintf (yyo, ".%d", yylocp->first_column);
|
||||
}
|
||||
if (0 <= yylocp->last_line)
|
||||
{
|
||||
if (yylocp->first_line < yylocp->last_line)
|
||||
{
|
||||
res += fprintf (yyo, "-%d", yylocp->last_line);
|
||||
if (0 <= end_col)
|
||||
res += fprintf (yyo, ".%d", end_col);
|
||||
}
|
||||
else if (0 <= end_col && yylocp->first_column < end_col)
|
||||
res += fprintf (yyo, "-%d", end_col);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
yy_location_print_ (File, &(Loc))
|
||||
|
||||
# define YY_LOCATION_PRINT(File, Loc) \
|
||||
fprintf (File, "%d.%d-%d.%d", \
|
||||
(Loc).first_line, (Loc).first_column, \
|
||||
(Loc).last_line, (Loc).last_column)
|
||||
# else
|
||||
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
|
||||
# endif
|
||||
@ -755,6 +699,7 @@ yy_location_print_ (yyo, yylocp)
|
||||
|
||||
|
||||
/* YYLEX -- calling `yylex' with the right arguments. */
|
||||
|
||||
#ifdef YYLEX_PARAM
|
||||
# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
|
||||
#else
|
||||
@ -809,8 +754,6 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, oxml, result
|
||||
char ** error_msg;
|
||||
#endif
|
||||
{
|
||||
FILE *yyo = yyoutput;
|
||||
YYUSE (yyo);
|
||||
if (!yyvaluep)
|
||||
return;
|
||||
YYUSE (yylocationp);
|
||||
@ -827,7 +770,7 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, mc, oxml, result
|
||||
switch (yytype)
|
||||
{
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1079,11 +1022,12 @@ static int
|
||||
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
yytype_int16 *yyssp, int yytoken)
|
||||
{
|
||||
YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
|
||||
YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
|
||||
YYSIZE_T yysize = yysize0;
|
||||
YYSIZE_T yysize1;
|
||||
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
|
||||
/* Internationalized format string. */
|
||||
const char *yyformat = YY_NULL;
|
||||
const char *yyformat = 0;
|
||||
/* Arguments of yyformat. */
|
||||
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
|
||||
/* Number of reported tokens (one for the "unexpected", one per
|
||||
@ -1143,13 +1087,11 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
break;
|
||||
}
|
||||
yyarg[yycount++] = yytname[yyx];
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
yysize1 = yysize + yytnamerr (0, yytname[yyx]);
|
||||
if (! (yysize <= yysize1
|
||||
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1169,12 +1111,10 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
|
||||
# undef YYCASE_
|
||||
}
|
||||
|
||||
{
|
||||
YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
}
|
||||
yysize1 = yysize + yystrlen (yyformat);
|
||||
if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
|
||||
return 2;
|
||||
yysize = yysize1;
|
||||
|
||||
if (*yymsg_alloc < yysize)
|
||||
{
|
||||
@ -1244,11 +1184,25 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, mc, oxml, result, error_msg)
|
||||
{
|
||||
|
||||
default:
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Prevent warnings from -Wmissing-prototypes. */
|
||||
#ifdef YYPARSE_PARAM
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int yyparse (void *YYPARSE_PARAM);
|
||||
#else
|
||||
int yyparse ();
|
||||
#endif
|
||||
#else /* ! YYPARSE_PARAM */
|
||||
#if defined __STDC__ || defined __cplusplus
|
||||
int yyparse (mem_collector * mc, ObjectXML * oxml, bool& result, char ** error_msg);
|
||||
#else
|
||||
int yyparse ();
|
||||
#endif
|
||||
#endif /* ! YYPARSE_PARAM */
|
||||
|
||||
|
||||
/*----------.
|
||||
@ -1283,40 +1237,11 @@ yyparse (mc, oxml, result, error_msg)
|
||||
/* The lookahead symbol. */
|
||||
int yychar;
|
||||
|
||||
|
||||
#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
|
||||
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
|
||||
_Pragma ("GCC diagnostic push") \
|
||||
_Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
|
||||
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
|
||||
_Pragma ("GCC diagnostic pop")
|
||||
#else
|
||||
/* Default value used for initialization, for pacifying older GCCs
|
||||
or non-GCC compilers. */
|
||||
static YYSTYPE yyval_default;
|
||||
# define YY_INITIAL_VALUE(Value) = Value
|
||||
#endif
|
||||
static YYLTYPE yyloc_default
|
||||
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
= { 1, 1, 1, 1 }
|
||||
# endif
|
||||
;
|
||||
#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
# define YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
#endif
|
||||
#ifndef YY_INITIAL_VALUE
|
||||
# define YY_INITIAL_VALUE(Value) /* Nothing. */
|
||||
#endif
|
||||
|
||||
/* The semantic value of the lookahead symbol. */
|
||||
YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
|
||||
YYSTYPE yylval;
|
||||
|
||||
/* Location data for the lookahead symbol. */
|
||||
YYLTYPE yylloc = yyloc_default;
|
||||
|
||||
YYLTYPE yylloc;
|
||||
|
||||
/* Number of syntax errors so far. */
|
||||
int yynerrs;
|
||||
@ -1330,7 +1255,7 @@ YYLTYPE yylloc = yyloc_default;
|
||||
`yyvs': related to semantic values.
|
||||
`yyls': related to locations.
|
||||
|
||||
Refer to the stacks through separate pointers, to allow yyoverflow
|
||||
Refer to the stacks thru separate pointers, to allow yyoverflow
|
||||
to reallocate them elsewhere. */
|
||||
|
||||
/* The state stack. */
|
||||
@ -1356,7 +1281,7 @@ YYLTYPE yylloc = yyloc_default;
|
||||
int yyn;
|
||||
int yyresult;
|
||||
/* Lookahead token as an internal (translated) token number. */
|
||||
int yytoken = 0;
|
||||
int yytoken;
|
||||
/* The variables used to return semantic value and location from the
|
||||
action routines. */
|
||||
YYSTYPE yyval;
|
||||
@ -1375,9 +1300,10 @@ YYLTYPE yylloc = yyloc_default;
|
||||
Keep to zero when no symbol should be popped. */
|
||||
int yylen = 0;
|
||||
|
||||
yyssp = yyss = yyssa;
|
||||
yyvsp = yyvs = yyvsa;
|
||||
yylsp = yyls = yylsa;
|
||||
yytoken = 0;
|
||||
yyss = yyssa;
|
||||
yyvs = yyvsa;
|
||||
yyls = yylsa;
|
||||
yystacksize = YYINITDEPTH;
|
||||
|
||||
YYDPRINTF ((stderr, "Starting parse\n"));
|
||||
@ -1386,7 +1312,21 @@ YYLTYPE yylloc = yyloc_default;
|
||||
yyerrstatus = 0;
|
||||
yynerrs = 0;
|
||||
yychar = YYEMPTY; /* Cause a token to be read. */
|
||||
yylsp[0] = yylloc;
|
||||
|
||||
/* Initialize stack pointers.
|
||||
Waste one element of value and location stack
|
||||
so that they stay on the same level as the state stack.
|
||||
The wasted elements are never initialized. */
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;
|
||||
yylsp = yyls;
|
||||
|
||||
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
|
||||
/* Initialize the default location before parsing starts. */
|
||||
yylloc.first_line = yylloc.last_line = 1;
|
||||
yylloc.first_column = yylloc.last_column = 1;
|
||||
#endif
|
||||
|
||||
goto yysetstate;
|
||||
|
||||
/*------------------------------------------------------------.
|
||||
@ -1532,9 +1472,7 @@ yybackup:
|
||||
yychar = YYEMPTY;
|
||||
|
||||
yystate = yyn;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
*++yylsp = yylloc;
|
||||
goto yynewstate;
|
||||
|
||||
@ -1572,134 +1510,151 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 2:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 103 "expr_bool.y"
|
||||
{ result=(yyvsp[(1) - (1)].val_int); }
|
||||
break;
|
||||
|
||||
case 3:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 104 "expr_bool.y"
|
||||
{ result=true; }
|
||||
break;
|
||||
|
||||
case 4:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 107 "expr_bool.y"
|
||||
{ int val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val == (yyvsp[(3) - (3)].val_int);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 107 "expr_bool.y"
|
||||
{ int val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val == (yyvsp[(3) - (3)].val_int));}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 112 "expr_bool.y"
|
||||
{ int val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = val != (yyvsp[(4) - (4)].val_int);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 112 "expr_bool.y"
|
||||
{ int val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val != (yyvsp[(4) - (4)].val_int));}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 117 "expr_bool.y"
|
||||
{ int val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val > (yyvsp[(3) - (3)].val_int);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 117 "expr_bool.y"
|
||||
{ int val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val > (yyvsp[(3) - (3)].val_int));}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 122 "expr_bool.y"
|
||||
{ int val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val < (yyvsp[(3) - (3)].val_int);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 122 "expr_bool.y"
|
||||
{ int val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val < (yyvsp[(3) - (3)].val_int));}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 127 "expr_bool.y"
|
||||
{ float val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val == (yyvsp[(3) - (3)].val_float);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 127 "expr_bool.y"
|
||||
{ float val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val == (yyvsp[(3) - (3)].val_float));}
|
||||
break;
|
||||
|
||||
case 9:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 132 "expr_bool.y"
|
||||
{ float val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = val != (yyvsp[(4) - (4)].val_float);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 132 "expr_bool.y"
|
||||
{ float val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val != (yyvsp[(4) - (4)].val_float));}
|
||||
break;
|
||||
|
||||
case 10:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 137 "expr_bool.y"
|
||||
{ float val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val > (yyvsp[(3) - (3)].val_float);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 137 "expr_bool.y"
|
||||
{ float val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val > (yyvsp[(3) - (3)].val_float));}
|
||||
break;
|
||||
|
||||
case 11:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 142 "expr_bool.y"
|
||||
{ float val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = val < (yyvsp[(3) - (3)].val_float);}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 142 "expr_bool.y"
|
||||
{ float val, rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc == 0 && val < (yyvsp[(3) - (3)].val_float));}
|
||||
break;
|
||||
|
||||
case 12:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 147 "expr_bool.y"
|
||||
{ string val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (val.empty() || (yyvsp[(3) - (3)].val_str)==0) ? false : fnmatch((yyvsp[(3) - (3)].val_str),val.c_str(),0)==0;}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 147 "expr_bool.y"
|
||||
{ string val; int rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (3)].val_str),val);
|
||||
(yyval.val_int) = (rc != 0 || (yyvsp[(3) - (3)].val_str)==0) ? false : fnmatch((yyvsp[(3) - (3)].val_str),val.c_str(),0)==0;}
|
||||
break;
|
||||
|
||||
case 13:
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 152 "expr_bool.y"
|
||||
{ string val;
|
||||
|
||||
get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = (val.empty() || (yyvsp[(4) - (4)].val_str)==0) ? false : fnmatch((yyvsp[(4) - (4)].val_str),val.c_str(),0)!=0;}
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 152 "expr_bool.y"
|
||||
{ string val; int rc;
|
||||
|
||||
rc = get_xml_attribute(oxml,(yyvsp[(1) - (4)].val_str),val);
|
||||
(yyval.val_int) = (rc != 0 || (yyvsp[(4) - (4)].val_str)==0) ? false : fnmatch((yyvsp[(4) - (4)].val_str),val.c_str(),0)!=0;}
|
||||
break;
|
||||
|
||||
case 14:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 157 "expr_bool.y"
|
||||
{ (yyval.val_int) = (yyvsp[(1) - (3)].val_int) && (yyvsp[(3) - (3)].val_int); }
|
||||
break;
|
||||
|
||||
case 15:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 158 "expr_bool.y"
|
||||
{ (yyval.val_int) = (yyvsp[(1) - (3)].val_int) || (yyvsp[(3) - (3)].val_int); }
|
||||
break;
|
||||
|
||||
case 16:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 159 "expr_bool.y"
|
||||
{ (yyval.val_int) = ! (yyvsp[(2) - (2)].val_int); }
|
||||
break;
|
||||
|
||||
case 17:
|
||||
/* Line 1792 of yacc.c */
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 160 "expr_bool.y"
|
||||
{ (yyval.val_int) = (yyvsp[(2) - (3)].val_int); }
|
||||
break;
|
||||
|
||||
|
||||
/* Line 1792 of yacc.c */
|
||||
#line 1703 "expr_bool.cc"
|
||||
|
||||
/* Line 1806 of yacc.c */
|
||||
#line 1658 "expr_bool.cc"
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
@ -1864,9 +1819,7 @@ yyerrlab1:
|
||||
YY_STACK_PRINT (yyss, yyssp);
|
||||
}
|
||||
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||
*++yyvsp = yylval;
|
||||
YY_IGNORE_MAYBE_UNINITIALIZED_END
|
||||
|
||||
yyerror_range[2] = yylloc;
|
||||
/* Using YYLLOC is tempting, but would change the location of
|
||||
@ -1895,7 +1848,7 @@ yyabortlab:
|
||||
yyresult = 1;
|
||||
goto yyreturn;
|
||||
|
||||
#if !defined yyoverflow || YYERROR_VERBOSE
|
||||
#if !defined(yyoverflow) || YYERROR_VERBOSE
|
||||
/*-------------------------------------------------.
|
||||
| yyexhaustedlab -- memory exhaustion comes here. |
|
||||
`-------------------------------------------------*/
|
||||
@ -1937,7 +1890,8 @@ yyreturn:
|
||||
}
|
||||
|
||||
|
||||
/* Line 2055 of yacc.c */
|
||||
|
||||
/* Line 2067 of yacc.c */
|
||||
#line 163 "expr_bool.y"
|
||||
|
||||
|
||||
@ -1969,7 +1923,7 @@ extern "C" void expr_bool__error(
|
||||
result = false;
|
||||
}
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, int& val)
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, int& val)
|
||||
{
|
||||
val = 0;
|
||||
|
||||
@ -1977,41 +1931,32 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, int& val)
|
||||
vector<string> results;
|
||||
ostringstream xpath_t;
|
||||
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr;
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr
|
||||
<< "|/HOST/HOST_SHARE/" << attr
|
||||
<< "|/HOST/" << attr
|
||||
<< "|/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
|
||||
results = (*oxml)[xpath_t.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_s;
|
||||
|
||||
xpath_s << "/HOST/HOST_SHARE/" << attr;
|
||||
results = (*oxml)[xpath_s.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_h;
|
||||
|
||||
xpath_h << "/HOST/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
xpath_h.str("");
|
||||
|
||||
xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (results.size() != 0)
|
||||
{
|
||||
istringstream iss(results[0]);
|
||||
iss >> val;
|
||||
|
||||
if (iss.fail())
|
||||
{
|
||||
val = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, float& val)
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, float& val)
|
||||
{
|
||||
val = 0.0;
|
||||
|
||||
@ -2019,41 +1964,32 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, float& val)
|
||||
ostringstream xpath_t;
|
||||
vector<string> results;
|
||||
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr;
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr
|
||||
<< "|/HOST/HOST_SHARE/" << attr
|
||||
<< "|/HOST/" << attr
|
||||
<< "|/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
|
||||
results = (*oxml)[xpath_t.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_s;
|
||||
|
||||
xpath_s << "/HOST/HOST_SHARE/" << attr;
|
||||
results = (*oxml)[xpath_s.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_h;
|
||||
|
||||
xpath_h << "/HOST/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
xpath_h.str("");
|
||||
|
||||
xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (results.size() != 0)
|
||||
{
|
||||
istringstream iss(results[0]);
|
||||
iss >> val;
|
||||
|
||||
if (iss.fail())
|
||||
{
|
||||
val = 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val)
|
||||
int get_xml_attribute(ObjectXML * oxml, const char* attr, string& val)
|
||||
{
|
||||
val = "";
|
||||
|
||||
@ -2061,35 +1997,19 @@ void get_xml_attribute(ObjectXML * oxml, const char* attr, string& val)
|
||||
ostringstream xpath_t;
|
||||
vector<string> results;
|
||||
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr;
|
||||
xpath_t << "/HOST/TEMPLATE/" << attr
|
||||
<< "|/HOST/HOST_SHARE/" << attr
|
||||
<< "|/HOST/" << attr
|
||||
<< "|/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
|
||||
results = (*oxml)[xpath_t.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_s;
|
||||
|
||||
xpath_s << "/HOST/HOST_SHARE/" << attr;
|
||||
results = (*oxml)[xpath_s.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
ostringstream xpath_h;
|
||||
|
||||
xpath_h << "/HOST/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
|
||||
if (results.size() == 0)
|
||||
{
|
||||
xpath_h.str("");
|
||||
|
||||
xpath_h << "/HOST/CLUSTER_TEMPLATE/" << attr;
|
||||
results = (*oxml)[xpath_h.str().c_str()];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (results.size() != 0)
|
||||
{
|
||||
val = results[0];
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* A Bison parser, made by GNU Bison 2.7. */
|
||||
/* A Bison parser, made by GNU Bison 2.5. */
|
||||
|
||||
/* Bison interface for Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -30,15 +30,6 @@
|
||||
This special exception was added by the Free Software Foundation in
|
||||
version 2.2 of Bison. */
|
||||
|
||||
#ifndef YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED
|
||||
# define YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED
|
||||
/* Enabling traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#if YYDEBUG
|
||||
extern int expr_bool__debug;
|
||||
#endif
|
||||
|
||||
/* Tokens. */
|
||||
#ifndef YYTOKENTYPE
|
||||
@ -53,10 +44,12 @@ extern int expr_bool__debug;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
/* Line 2058 of yacc.c */
|
||||
|
||||
/* Line 2068 of yacc.c */
|
||||
#line 83 "expr_bool.y"
|
||||
|
||||
char * val_str;
|
||||
@ -64,14 +57,17 @@ typedef union YYSTYPE
|
||||
float val_float;
|
||||
|
||||
|
||||
/* Line 2058 of yacc.c */
|
||||
#line 69 "expr_bool.hh"
|
||||
|
||||
/* Line 2068 of yacc.c */
|
||||
#line 63 "expr_bool.hh"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
||||
typedef struct YYLTYPE
|
||||
{
|
||||
@ -85,4 +81,5 @@ typedef struct YYLTYPE
|
||||
# define YYLTYPE_IS_TRIVIAL 1
|
||||
#endif
|
||||
|
||||
#endif /* !YY_EXPR_BOOL_EXPR_BOOL_HH_INCLUDED */
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#define FLEX_SCANNER
|
||||
#define YY_FLEX_MAJOR_VERSION 2
|
||||
#define YY_FLEX_MINOR_VERSION 5
|
||||
#define YY_FLEX_SUBMINOR_VERSION 37
|
||||
#define YY_FLEX_SUBMINOR_VERSION 35
|
||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||
#define FLEX_BETA
|
||||
#endif
|
||||
@ -161,7 +161,15 @@ typedef unsigned int flex_uint32_t;
|
||||
|
||||
/* Size of default input buffer. */
|
||||
#ifndef YY_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k.
|
||||
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
|
||||
* Ditto for the __ia64__ case accordingly.
|
||||
*/
|
||||
#define YY_BUF_SIZE 32768
|
||||
#else
|
||||
#define YY_BUF_SIZE 16384
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* The state buf must be large enough to hold one state per character in the main buffer.
|
||||
@ -173,12 +181,7 @@ typedef unsigned int flex_uint32_t;
|
||||
typedef struct yy_buffer_state *YY_BUFFER_STATE;
|
||||
#endif
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
extern yy_size_t expr_leng;
|
||||
extern int expr_leng;
|
||||
|
||||
extern FILE *expr_in, *expr_out;
|
||||
|
||||
@ -217,6 +220,11 @@ extern FILE *expr_in, *expr_out;
|
||||
|
||||
#define unput(c) yyunput( c, (yytext_ptr) )
|
||||
|
||||
#ifndef YY_TYPEDEF_YY_SIZE_T
|
||||
#define YY_TYPEDEF_YY_SIZE_T
|
||||
typedef size_t yy_size_t;
|
||||
#endif
|
||||
|
||||
#ifndef YY_STRUCT_YY_BUFFER_STATE
|
||||
#define YY_STRUCT_YY_BUFFER_STATE
|
||||
struct yy_buffer_state
|
||||
@ -234,7 +242,7 @@ struct yy_buffer_state
|
||||
/* Number of characters read into yy_ch_buf, not including EOB
|
||||
* characters.
|
||||
*/
|
||||
yy_size_t yy_n_chars;
|
||||
int yy_n_chars;
|
||||
|
||||
/* Whether we "own" the buffer - i.e., we know we created it,
|
||||
* and can realloc() it to grow it, and should free() it to
|
||||
@ -304,8 +312,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
|
||||
|
||||
/* yy_hold_char holds the character lost when expr_text is formed. */
|
||||
static char yy_hold_char;
|
||||
static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
yy_size_t expr_leng;
|
||||
static int yy_n_chars; /* number of characters read into yy_ch_buf */
|
||||
int expr_leng;
|
||||
|
||||
/* Points to current character in buffer. */
|
||||
static char *yy_c_buf_p = (char *) 0;
|
||||
@ -333,7 +341,7 @@ static void expr__init_buffer (YY_BUFFER_STATE b,FILE *file );
|
||||
|
||||
YY_BUFFER_STATE expr__scan_buffer (char *base,yy_size_t size );
|
||||
YY_BUFFER_STATE expr__scan_string (yyconst char *yy_str );
|
||||
YY_BUFFER_STATE expr__scan_bytes (yyconst char *bytes,yy_size_t len );
|
||||
YY_BUFFER_STATE expr__scan_bytes (yyconst char *bytes,int len );
|
||||
|
||||
void *expr_alloc (yy_size_t );
|
||||
void *expr_realloc (void *,yy_size_t );
|
||||
@ -525,7 +533,7 @@ char *expr_text;
|
||||
#define YY_USER_ACTION llocp->first_line = expr_lineno; \
|
||||
llocp->first_column = llocp->last_column; \
|
||||
llocp->last_column += expr_leng;
|
||||
#line 529 "expr_parser.c"
|
||||
#line 537 "expr_parser.c"
|
||||
|
||||
#define INITIAL 0
|
||||
|
||||
@ -564,7 +572,7 @@ FILE *expr_get_out (void );
|
||||
|
||||
void expr_set_out (FILE * out_str );
|
||||
|
||||
yy_size_t expr_get_leng (void );
|
||||
int expr_get_leng (void );
|
||||
|
||||
char *expr_get_text (void );
|
||||
|
||||
@ -604,7 +612,12 @@ static int input (void );
|
||||
|
||||
/* Amount of stuff to slurp up with each read. */
|
||||
#ifndef YY_READ_BUF_SIZE
|
||||
#ifdef __ia64__
|
||||
/* On IA-64, the buffer size is 16k, not 8k */
|
||||
#define YY_READ_BUF_SIZE 16384
|
||||
#else
|
||||
#define YY_READ_BUF_SIZE 8192
|
||||
#endif /* __ia64__ */
|
||||
#endif
|
||||
|
||||
/* Copy whatever the last rule matched to the standard output. */
|
||||
@ -709,7 +722,7 @@ YY_DECL
|
||||
|
||||
/* --- Tokens --- */
|
||||
|
||||
#line 713 "expr_parser.c"
|
||||
#line 726 "expr_parser.c"
|
||||
|
||||
if ( !(yy_init) )
|
||||
{
|
||||
@ -852,7 +865,7 @@ YY_RULE_SETUP
|
||||
#line 68 "expr_parser.l"
|
||||
ECHO;
|
||||
YY_BREAK
|
||||
#line 856 "expr_parser.c"
|
||||
#line 869 "expr_parser.c"
|
||||
case YY_STATE_EOF(INITIAL):
|
||||
yyterminate();
|
||||
|
||||
@ -1038,21 +1051,21 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{
|
||||
yy_size_t num_to_read =
|
||||
int num_to_read =
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
|
||||
|
||||
while ( num_to_read <= 0 )
|
||||
{ /* Not enough room in the buffer - grow it. */
|
||||
|
||||
/* just a shorter name for the current buffer */
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||
|
||||
int yy_c_buf_p_offset =
|
||||
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
||||
|
||||
if ( b->yy_is_our_buffer )
|
||||
{
|
||||
yy_size_t new_size = b->yy_buf_size * 2;
|
||||
int new_size = b->yy_buf_size * 2;
|
||||
|
||||
if ( new_size <= 0 )
|
||||
b->yy_buf_size += b->yy_buf_size / 8;
|
||||
@ -1083,7 +1096,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
(yy_n_chars), num_to_read );
|
||||
(yy_n_chars), (size_t) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
|
||||
}
|
||||
@ -1178,7 +1191,7 @@ static int yy_get_next_buffer (void)
|
||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||
yy_is_jam = (yy_current_state == 19);
|
||||
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
return yy_is_jam ? 0 : yy_current_state;
|
||||
}
|
||||
|
||||
#ifndef YY_NO_INPUT
|
||||
@ -1205,7 +1218,7 @@ static int yy_get_next_buffer (void)
|
||||
|
||||
else
|
||||
{ /* need more input */
|
||||
yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
int offset = (yy_c_buf_p) - (yytext_ptr);
|
||||
++(yy_c_buf_p);
|
||||
|
||||
switch ( yy_get_next_buffer( ) )
|
||||
@ -1370,6 +1383,10 @@ static void expr__load_buffer_state (void)
|
||||
expr_free((void *) b );
|
||||
}
|
||||
|
||||
#ifndef __cplusplus
|
||||
extern int isatty (int );
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Initializes or reinitializes a buffer.
|
||||
* This function is sometimes called more than once on the same buffer,
|
||||
* such as during a expr_restart() or at EOF.
|
||||
@ -1482,7 +1499,7 @@ void expr_pop_buffer_state (void)
|
||||
*/
|
||||
static void expr_ensure_buffer_stack (void)
|
||||
{
|
||||
yy_size_t num_to_alloc;
|
||||
int num_to_alloc;
|
||||
|
||||
if (!(yy_buffer_stack)) {
|
||||
|
||||
@ -1579,7 +1596,7 @@ YY_BUFFER_STATE expr__scan_string (yyconst char * yystr )
|
||||
*
|
||||
* @return the newly allocated buffer state object.
|
||||
*/
|
||||
YY_BUFFER_STATE expr__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
|
||||
YY_BUFFER_STATE expr__scan_bytes (yyconst char * yybytes, int _yybytes_len )
|
||||
{
|
||||
YY_BUFFER_STATE b;
|
||||
char *buf;
|
||||
@ -1666,7 +1683,7 @@ FILE *expr_get_out (void)
|
||||
/** Get the length of the current token.
|
||||
*
|
||||
*/
|
||||
yy_size_t expr_get_leng (void)
|
||||
int expr_get_leng (void)
|
||||
{
|
||||
return expr_leng;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user