Changeset 642


Ignore:
Timestamp:
07/17/15 13:58:13 (9 years ago)
Author:
rlacroix
Message:

Use the filter infrastructure to handle the expressions

Parse the expressions to get a new tree representation that can be converted to a filter graph based on new arithmetic filters.

Temporal operations are still unsupported.

Location:
XIOS/trunk/src
Files:
8 added
9 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r641 r642  
    1919#include "file_writer_filter.hpp" 
    2020#include "pass_through_filter.hpp" 
     21#include "filter_expr_node.hpp" 
     22#include "lex_parser.hpp" 
    2123 
    2224namespace xios{ 
     
    774776     if (!instantDataFilter) 
    775777     { 
     778       // Check if we have an expression to parse 
     779       if (!content.empty()) 
     780       { 
     781         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0')); 
     782         instantDataFilter = expr->reduce(gc, *this); 
     783       } 
    776784       // Check if we have a reference on another field 
    777        if (!field_ref.isEmpty()) 
     785       else if (!field_ref.isEmpty()) 
    778786       { 
    779787         boost::shared_ptr<CPassThroughFilter> passThroughFilter(new CPassThroughFilter(gc)); 
     
    805813       } 
    806814     } 
     815   } 
     816 
     817   /*! 
     818    * Returns the source filter to handle a self reference in the field's expression. 
     819    * If the needed source filter does not exist, it is created, otherwise it is reused. 
     820    * This method should only be called when building the filter graph corresponding 
     821    * to the field's expression. 
     822    * 
     823    * \param gc the garbage collector to use 
     824    * \return the output pin corresponding to a self reference 
     825    */ 
     826   boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 
     827   { 
     828     if (instantDataFilter || content.empty()) 
     829       ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)", 
     830             "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 
     831 
     832     if (!clientSourceFilter) 
     833       clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid)); 
     834 
     835     return clientSourceFilter; 
    807836   } 
    808837 
     
    11591188    if (content.size() > 0) 
    11601189    { 
    1161       CSimpleNodeExpr* simpleExpr = parseExpr(content+'\0'); 
     1190      CSimpleNodeExpr* simpleExpr;// = parseExpr(content+'\0'); 
    11621191      expression = CFieldNode::newNode(simpleExpr); 
    11631192      delete simpleExpr; 
  • XIOS/trunk/src/node/field.hpp

    r641 r642  
    133133 
    134134         void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); 
     135         boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 
    135136 
    136137//         virtual void fromBinary(StdIStream & is); 
  • XIOS/trunk/src/parse_expr/expr_node.hpp

    r501 r642  
    55#include "simple_node_expr.hpp" 
    66#include "operator_expr.hpp" 
    7 #include "lex_parser.hpp" 
    87 
    98namespace xios 
  • XIOS/trunk/src/parse_expr/lex_parser.cpp

    r501 r642  
    1010#define YY_FLEX_MAJOR_VERSION 2 
    1111#define YY_FLEX_MINOR_VERSION 5 
    12 #define YY_FLEX_SUBMINOR_VERSION 35 
     12#define YY_FLEX_SUBMINOR_VERSION 39 
    1313#if YY_FLEX_SUBMINOR_VERSION > 0 
    1414#define FLEX_BETA 
     
    5555typedef unsigned short int flex_uint16_t; 
    5656typedef unsigned int flex_uint32_t; 
    57 #endif /* ! C99 */ 
    5857 
    5958/* Limits of integral types. */ 
     
    8584#define UINT32_MAX             (4294967295U) 
    8685#endif 
     86 
     87#endif /* ! C99 */ 
    8788 
    8889#endif /* ! FLEXINT_H */ 
     
    142143/* Size of default input buffer. */ 
    143144#ifndef YY_BUF_SIZE 
     145#ifdef __ia64__ 
     146/* On IA-64, the buffer size is 16k, not 8k. 
     147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. 
     148 * Ditto for the __ia64__ case accordingly. 
     149 */ 
     150#define YY_BUF_SIZE 32768 
     151#else 
    144152#define YY_BUF_SIZE 16384 
     153#endif /* __ia64__ */ 
    145154#endif 
    146155 
     
    154163#endif 
    155164 
    156 extern int yyleng; 
     165#ifndef YY_TYPEDEF_YY_SIZE_T 
     166#define YY_TYPEDEF_YY_SIZE_T 
     167typedef size_t yy_size_t; 
     168#endif 
     169 
     170extern yy_size_t yyleng; 
    157171 
    158172extern FILE *yyin, *yyout; 
     
    163177 
    164178    #define YY_LESS_LINENO(n) 
     179    #define YY_LINENO_REWIND_TO(ptr) 
    165180     
    166181/* Return all but the first "n" matched characters back to the input stream. */ 
     
    180195#define unput(c) yyunput( c, (yytext_ptr)  ) 
    181196 
    182 #ifndef YY_TYPEDEF_YY_SIZE_T 
    183 #define YY_TYPEDEF_YY_SIZE_T 
    184 typedef size_t yy_size_t; 
    185 #endif 
    186  
    187197#ifndef YY_STRUCT_YY_BUFFER_STATE 
    188198#define YY_STRUCT_YY_BUFFER_STATE 
     
    202212         * characters. 
    203213         */ 
    204         int yy_n_chars; 
     214        yy_size_t yy_n_chars; 
    205215 
    206216        /* Whether we "own" the buffer - i.e., we know we created it, 
     
    272282/* yy_hold_char holds the character lost when yytext is formed. */ 
    273283static char yy_hold_char; 
    274 static int yy_n_chars;          /* number of characters read into yy_ch_buf */ 
    275 int yyleng; 
     284static yy_size_t yy_n_chars;            /* number of characters read into yy_ch_buf */ 
     285yy_size_t yyleng; 
    276286 
    277287/* Points to current character in buffer. */ 
     
    301311YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  ); 
    302312YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  ); 
    303 YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  ); 
     313YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len  ); 
    304314 
    305315void *yyalloc (yy_size_t  ); 
     
    331341#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) 
    332342 
    333 #define yywrap(n) 1 
     343#define yywrap() 1 
    334344#define YY_SKIP_YYWRAP 
    335345 
     
    346356extern char *yytext; 
    347357#define yytext_ptr yytext 
     358 
    348359static yyconst flex_int16_t yy_nxt[][128] = 
    349360    { 
     
    929940} 
    930941#undef  YY_INPUT 
    931 #define YY_INPUT(b,r,s) readInputForLexer(b,&r,s) 
     942#define YY_INPUT(b, r, s) readInputForLexer(b, &r, s) 
    932943#include <string> 
    933944 
    934 int readInputForLexer( char *buffer, int *numBytesRead, int maxBytesToRead ) ; 
    935  
    936  
    937 #include "simple_node_expr.hpp" 
     945int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead); 
     946 
     947#include "filter_expr_node.hpp" 
    938948#include "yacc_parser.hpp" 
    939949 
    940 #line 941 "lex_parser.cpp" 
     950#line 951 "lex_parser.cpp" 
    941951 
    942952#define INITIAL 0 
     
    977987void yyset_out  (FILE * out_str  ); 
    978988 
    979 int yyget_leng (void ); 
     989yy_size_t yyget_leng (void ); 
    980990 
    981991char *yyget_text (void ); 
     
    10191029/* Amount of stuff to slurp up with each read. */ 
    10201030#ifndef YY_READ_BUF_SIZE 
     1031#ifdef __ia64__ 
     1032/* On IA-64, the buffer size is 16k, not 8k */ 
     1033#define YY_READ_BUF_SIZE 16384 
     1034#else 
    10211035#define YY_READ_BUF_SIZE 8192 
     1036#endif /* __ia64__ */ 
    10221037#endif 
    10231038 
     
    11041119        register int yy_act; 
    11051120     
    1106 #line 29 "lex_parser.lex" 
    1107  
    1108  
    1109 #line 1110 "lex_parser.cpp" 
    1110  
    11111121        if ( !(yy_init) ) 
    11121122                { 
     
    11341144                yy_load_buffer_state( ); 
    11351145                } 
     1146 
     1147        { 
     1148#line 29 "lex_parser.lex" 
     1149 
     1150 
     1151#line 1152 "lex_parser.cpp" 
    11361152 
    11371153        while ( 1 )             /* loops until end-of-file is reached */ 
     
    11871203#line 33 "lex_parser.lex" 
    11881204{ 
    1189           yylval.str=new std::string(yytext); 
    1190           return NUMBER ; 
    1191         } 
     1205            yylval.str = new std::string(yytext); 
     1206            return NUMBER; 
     1207          } 
    11921208        YY_BREAK 
    11931209case 3: 
     
    11951211#line 38 "lex_parser.lex" 
    11961212{ 
    1197                   yylval.str=new std::string(yytext+1) ; 
    1198                   return AVERAGE ; 
    1199                 } 
     1213            yylval.str = new std::string(yytext + 1); 
     1214            return AVERAGE; 
     1215          } 
    12001216        YY_BREAK 
    12011217case 4: 
     
    12031219#line 43 "lex_parser.lex" 
    12041220{ 
    1205                   yylval.str=new std::string(yytext+1) ; 
    1206                   return VAR ; 
    1207                 } 
     1221            yylval.str = new std::string(yytext + 1); 
     1222            return VAR; 
     1223          } 
    12081224        YY_BREAK 
    12091225case 5: 
     
    12111227#line 48 "lex_parser.lex" 
    12121228{ 
    1213                    yylval.str=new std::string(yytext) ; 
    1214                    return ID ; 
    1215                 }                    
     1229            yylval.str = new std::string(yytext); 
     1230            return ID; 
     1231          }                    
    12161232        YY_BREAK 
    12171233case 6: 
    12181234YY_RULE_SETUP 
    12191235#line 54 "lex_parser.lex" 
    1220 return(PLUS); 
     1236return PLUS; 
    12211237        YY_BREAK 
    12221238case 7: 
    12231239YY_RULE_SETUP 
    12241240#line 55 "lex_parser.lex" 
    1225 return(MINUS); 
     1241return MINUS; 
    12261242        YY_BREAK 
    12271243case 8: 
    12281244YY_RULE_SETUP 
    12291245#line 57 "lex_parser.lex" 
    1230 return(TIMES); 
     1246return TIMES; 
    12311247        YY_BREAK 
    12321248case 9: 
    12331249YY_RULE_SETUP 
    12341250#line 58 "lex_parser.lex" 
    1235 return(DIVIDE); 
     1251return DIVIDE; 
    12361252        YY_BREAK 
    12371253case 10: 
    12381254YY_RULE_SETUP 
    12391255#line 60 "lex_parser.lex" 
    1240 return(POWER); 
     1256return POWER; 
    12411257        YY_BREAK 
    12421258case 11: 
    12431259YY_RULE_SETUP 
    12441260#line 62 "lex_parser.lex" 
    1245 return(LEFT_PARENTHESIS); 
     1261return LEFT_PARENTHESIS; 
    12461262        YY_BREAK 
    12471263case 12: 
    12481264YY_RULE_SETUP 
    12491265#line 63 "lex_parser.lex" 
    1250 return(RIGHT_PARENTHESIS); 
     1266return RIGHT_PARENTHESIS; 
    12511267        YY_BREAK 
    12521268case 13: 
    12531269YY_RULE_SETUP 
    12541270#line 65 "lex_parser.lex" 
    1255 { 
    1256        return(END); 
    1257       } 
     1271return END; 
    12581272        YY_BREAK 
    12591273case 14: 
    12601274YY_RULE_SETUP 
    1261 #line 68 "lex_parser.lex" 
     1275#line 66 "lex_parser.lex" 
    12621276ECHO; 
    12631277        YY_BREAK 
    1264 #line 1265 "lex_parser.cpp" 
     1278#line 1279 "lex_parser.cpp" 
    12651279case YY_STATE_EOF(INITIAL): 
    12661280        yyterminate(); 
     
    13931407        } /* end of action switch */ 
    13941408                } /* end of scanning one token */ 
     1409        } /* end of user's declarations */ 
    13951410} /* end of yylex */ 
    13961411 
     
    14481463        else 
    14491464                { 
    1450                         int num_to_read = 
     1465                        yy_size_t num_to_read = 
    14511466                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; 
    14521467 
     
    14551470 
    14561471                        /* just a shorter name for the current buffer */ 
    1457                         YY_BUFFER_STATE b = YY_CURRENT_BUFFER; 
     1472                        YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 
    14581473 
    14591474                        int yy_c_buf_p_offset = 
     
    14621477                        if ( b->yy_is_our_buffer ) 
    14631478                                { 
    1464                                 int new_size = b->yy_buf_size * 2; 
     1479                                yy_size_t new_size = b->yy_buf_size * 2; 
    14651480 
    14661481                                if ( new_size <= 0 ) 
     
    14931508                /* Read in more data. */ 
    14941509                YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 
    1495                         (yy_n_chars), (size_t) num_to_read ); 
     1510                        (yy_n_chars), num_to_read ); 
    14961511 
    14971512                YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); 
     
    15831598                } 
    15841599 
    1585         return yy_is_jam ? 0 : yy_current_state; 
     1600                return yy_is_jam ? 0 : yy_current_state; 
    15861601} 
    15871602 
     
    15981613                { /* need to shift things up to make room */ 
    15991614                /* +2 for EOB chars. */ 
    1600                 register int number_to_move = (yy_n_chars) + 2; 
     1615                register yy_size_t number_to_move = (yy_n_chars) + 2; 
    16011616                register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ 
    16021617                                        YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; 
     
    16471662                else 
    16481663                        { /* need more input */ 
    1649                         int offset = (yy_c_buf_p) - (yytext_ptr); 
     1664                        yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); 
    16501665                        ++(yy_c_buf_p); 
    16511666 
     
    18071822} 
    18081823 
    1809 #ifndef __cplusplus 
    1810 extern int isatty (int ); 
    1811 #endif /* __cplusplus */ 
    1812      
    18131824/* Initializes or reinitializes a buffer. 
    18141825 * This function is sometimes called more than once on the same buffer, 
     
    19231934static void yyensure_buffer_stack (void) 
    19241935{ 
    1925         int num_to_alloc; 
     1936        yy_size_t num_to_alloc; 
    19261937     
    19271938        if (!(yy_buffer_stack)) { 
     
    20152026/** Setup the input buffer state to scan the given bytes. The next call to yylex() will 
    20162027 * scan from a @e copy of @a bytes. 
    2017  * @param bytes the byte buffer to scan 
    2018  * @param len the number of bytes in the buffer pointed to by @a bytes. 
     2028 * @param yybytes the byte buffer to scan 
     2029 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. 
    20192030 *  
    20202031 * @return the newly allocated buffer state object. 
    20212032 */ 
    2022 YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len ) 
     2033YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len ) 
    20232034{ 
    20242035        YY_BUFFER_STATE b; 
    20252036        char *buf; 
    20262037        yy_size_t n; 
    2027         int i; 
     2038        yy_size_t i; 
    20282039     
    20292040        /* Get memory for full buffer, including space for trailing EOB's. */ 
     
    21072118 *  
    21082119 */ 
    2109 int yyget_leng  (void) 
     2120yy_size_t yyget_leng  (void) 
    21102121{ 
    21112122        return yyleng; 
     
    22552266#define YYTABLES_NAME "yytables" 
    22562267 
    2257 #line 68 "lex_parser.lex" 
     2268#line 65 "lex_parser.lex" 
  • XIOS/trunk/src/parse_expr/lex_parser.hpp

    r501 r642  
    55namespace xios 
    66{ 
    7   CSimpleNodeExpr* parseExpr(const std::string& strExpr) ; 
     7  IFilterExprNode* parseExpr(const std::string& strExpr); 
    88} 
    99 
  • XIOS/trunk/src/parse_expr/lex_parser.lex

    r501 r642  
    77} 
    88#undef  YY_INPUT 
    9 #define YY_INPUT(b,r,s) readInputForLexer(b,&r,s) 
     9#define YY_INPUT(b, r, s) readInputForLexer(b, &r, s) 
    1010#include <string> 
    1111 
    12 int readInputForLexer( char *buffer, int *numBytesRead, int maxBytesToRead ) ; 
     12int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead); 
    1313 
    14  
    15 #include "simple_node_expr.hpp" 
     14#include "filter_expr_node.hpp" 
    1615#include "yacc_parser.hpp" 
    1716 
    1817%} 
    1918 
    20 white  [ \t]+ 
     19white    [ \t]+ 
    2120 
    22 digit  [0-9] 
     21digit    [0-9] 
    2322integer  {digit}+ 
    2423exponant [eE][+-]?{integer} 
    25 real  {integer}("."{integer})?{exponant}? 
    26 id              [a-zA-Z][a-zA-Z0-9_]* 
    27 average         @{id} 
    28 var             \${id} 
     24real     {integer}("."{integer})?{exponant}? 
     25id       [a-zA-Z][a-zA-Z0-9_]* 
     26average  @{id} 
     27var      \${id} 
     28 
    2929%% 
    3030 
    31 {white}  { /* We ignore white characters */ } 
     31{white}   { /* We ignore white characters */ } 
    3232 
    33 {real}  { 
    34           yylval.str=new std::string(yytext); 
    35           return NUMBER ; 
    36         } 
     33{real}    { 
     34            yylval.str = new std::string(yytext); 
     35            return NUMBER; 
     36          } 
    3737 
    38 {average}       { 
    39                   yylval.str=new std::string(yytext+1) ; 
    40                   return AVERAGE ; 
    41                 } 
     38{average} { 
     39            yylval.str = new std::string(yytext + 1); 
     40            return AVERAGE; 
     41          } 
    4242 
    43 {var}           { 
    44                   yylval.str=new std::string(yytext+1) ; 
    45                   return VAR ; 
    46                 } 
     43{var}     { 
     44            yylval.str = new std::string(yytext + 1); 
     45            return VAR; 
     46          } 
    4747 
    48 {id}            { 
    49                    yylval.str=new std::string(yytext) ; 
    50                    return ID ; 
    51                 }                    
     48{id}      { 
     49            yylval.str = new std::string(yytext); 
     50            return ID; 
     51          }                    
    5252                  
    5353 
    54 "+"  return(PLUS); 
    55 "-"  return(MINUS); 
     54"+"  return PLUS; 
     55"-"  return MINUS; 
    5656 
    57 "*"  return(TIMES); 
    58 "/"  return(DIVIDE); 
     57"*"  return TIMES; 
     58"/"  return DIVIDE; 
    5959 
    60 "^"  return(POWER); 
     60"^"  return POWER; 
    6161 
    62 "("  return(LEFT_PARENTHESIS); 
    63 ")"  return(RIGHT_PARENTHESIS); 
     62"("  return LEFT_PARENTHESIS; 
     63")"  return RIGHT_PARENTHESIS; 
    6464 
    65 "\0"  { 
    66        return(END); 
    67       } 
     65"\0" return END; 
  • XIOS/trunk/src/parse_expr/yacc_parser.cpp

    r501 r642  
    1  
    2 /* A Bison parser, made by GNU Bison 2.4.1.  */ 
    3  
    4 /* Skeleton implementation for Bison's Yacc-like parsers in C 
    5     
    6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 
    7    Free Software Foundation, Inc. 
    8     
     1/* A Bison parser, made by GNU Bison 3.0.2.  */ 
     2 
     3/* Bison implementation for Yacc-like parsers in C 
     4 
     5   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 
     6 
    97   This program is free software: you can redistribute it and/or modify 
    108   it under the terms of the GNU General Public License as published by 
    119   the Free Software Foundation, either version 3 of the License, or 
    1210   (at your option) any later version. 
    13     
     11 
    1412   This program is distributed in the hope that it will be useful, 
    1513   but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1614   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1715   GNU General Public License for more details. 
    18     
     16 
    1917   You should have received a copy of the GNU General Public License 
    2018   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */ 
     
    2927   Bison output files to be licensed under the GNU General Public 
    3028   License without this special exception. 
    31     
     29 
    3230   This special exception was added by the Free Software Foundation in 
    3331   version 2.2 of Bison.  */ 
     
    4745 
    4846/* Bison version.  */ 
    49 #define YYBISON_VERSION "2.4.1" 
     47#define YYBISON_VERSION "3.0.2" 
    5048 
    5149/* Skeleton name.  */ 
     
    6159#define YYPULL 1 
    6260 
    63 /* Using locations.  */ 
    64 #define YYLSP_NEEDED 0 
    6561 
    6662 
    6763 
    6864/* Copy the first part of user declarations.  */ 
    69  
    70 /* Line 189 of yacc.c  */ 
    71 #line 1 "yacc_parser.yacc" 
    72  
    73 #include "simple_node_expr.hpp" 
     65#line 1 "yacc_parser.yacc" /* yacc.c:339  */ 
     66 
     67#include "filter_expr_node.hpp" 
    7468#include <string> 
    7569#include <iostream> 
    7670#include "exception.hpp" 
    7771 
    78 using namespace std ; 
    79 using namespace xios ; 
     72using namespace std; 
     73using namespace xios; 
    8074 
    8175extern "C" 
     
    8377  int yyparse(void); 
    8478  int yylex(void); 
    85   int yyerror(const char *s) ; 
     79  int yyerror(const char *s); 
    8680} 
    8781 
    88    CSimpleNodeExpr* parsed ; 
    89    std::string globalInputText; 
    90    int globalReadOffset=0; 
    91     
    92    int readInputForLexer( char *buffer, int *numBytesRead, int maxBytesToRead ) 
    93    { 
    94     int numBytesToRead = maxBytesToRead; 
    95     int bytesRemaining = globalInputText.length()-globalReadOffset; 
    96     int i; 
    97     if ( numBytesToRead > bytesRemaining ) numBytesToRead = bytesRemaining; 
    98     for ( i = 0; i < numBytesToRead; i++ ) buffer[i] = globalInputText.c_str()[globalReadOffset+i]; 
     82  IFilterExprNode* parsed; 
     83  std::string globalInputText; 
     84  size_t globalReadOffset = 0; 
     85 
     86  int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) 
     87  { 
     88    size_t numBytesToRead = maxBytesToRead; 
     89    size_t bytesRemaining = globalInputText.length()-globalReadOffset; 
     90    size_t i; 
     91    if (numBytesToRead > bytesRemaining) numBytesToRead = bytesRemaining; 
     92    for (i = 0; i < numBytesToRead; i++) buffer[i] = globalInputText.c_str()[globalReadOffset + i]; 
    9993    *numBytesRead = numBytesToRead; 
    10094    globalReadOffset += numBytesToRead; 
    10195    return 0; 
    102    } 
    103  
    104  
    105  
    106 /* Line 189 of yacc.c  */ 
    107 #line 108 "yacc_parser.cpp" 
    108  
    109 /* Enabling traces.  */ 
    110 #ifndef YYDEBUG 
    111 # define YYDEBUG 0 
    112 #endif 
     96  } 
     97 
     98#line 99 "yacc_parser.cpp" /* yacc.c:339  */ 
     99 
     100# ifndef YY_NULLPTR 
     101#  if defined __cplusplus && 201103L <= __cplusplus 
     102#   define YY_NULLPTR nullptr 
     103#  else 
     104#   define YY_NULLPTR 0 
     105#  endif 
     106# endif 
    113107 
    114108/* Enabling verbose error messages.  */ 
     
    120114#endif 
    121115 
    122 /* Enabling the token table.  */ 
    123 #ifndef YYTOKEN_TABLE 
    124 # define YYTOKEN_TABLE 0 
    125 #endif 
    126  
    127  
    128 /* Tokens.  */ 
     116/* In a future release of Bison, this section will be replaced 
     117   by #include "yacc_parser.hpp".  */ 
     118#ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 
     119# define YY_YY_YACC_PARSER_HPP_INCLUDED 
     120/* Debug traces.  */ 
     121#ifndef YYDEBUG 
     122# define YYDEBUG 0 
     123#endif 
     124#if YYDEBUG 
     125extern int yydebug; 
     126#endif 
     127 
     128/* Token type.  */ 
    129129#ifndef YYTOKENTYPE 
    130130# define YYTOKENTYPE 
    131    /* Put the tokens into the symbol table, so that GDB and other debuggers 
    132       know about them.  */ 
    133    enum yytokentype { 
    134      NUMBER = 258, 
    135      VAR = 259, 
    136      ID = 260, 
    137      AVERAGE = 261, 
    138      PLUS = 262, 
    139      MINUS = 263, 
    140      TIMES = 264, 
    141      DIVIDE = 265, 
    142      POWER = 266, 
    143      LEFT_PARENTHESIS = 267, 
    144      RIGHT_PARENTHESIS = 268, 
    145      END = 269, 
    146      NEG = 270 
    147    }; 
    148 #endif 
    149  
    150  
    151  
     131  enum yytokentype 
     132  { 
     133    NUMBER = 258, 
     134    VAR = 259, 
     135    ID = 260, 
     136    AVERAGE = 261, 
     137    PLUS = 262, 
     138    MINUS = 263, 
     139    TIMES = 264, 
     140    DIVIDE = 265, 
     141    POWER = 266, 
     142    LEFT_PARENTHESIS = 267, 
     143    RIGHT_PARENTHESIS = 268, 
     144    END = 269, 
     145    NEG = 270 
     146  }; 
     147#endif 
     148 
     149/* Value type.  */ 
    152150#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 
    153 typedef union YYSTYPE 
    154 { 
    155  
    156 /* Line 214 of yacc.c  */ 
    157 #line 36 "yacc_parser.yacc" 
    158  
    159     std::string* str ;                /* symbol table index */ 
    160     CSimpleNodeExpr* node ; 
    161  
    162  
    163  
    164 /* Line 214 of yacc.c  */ 
    165 #line 166 "yacc_parser.cpp" 
    166 } YYSTYPE; 
     151typedef union YYSTYPE YYSTYPE; 
     152union YYSTYPE 
     153{ 
     154#line 35 "yacc_parser.yacc" /* yacc.c:355  */ 
     155 
     156  std::string* str;                /* symbol table index */ 
     157  xios::IScalarExprNode* scalarNode; 
     158  xios::IFilterExprNode* filterNode; 
     159 
     160#line 161 "yacc_parser.cpp" /* yacc.c:355  */ 
     161}; 
    167162# define YYSTYPE_IS_TRIVIAL 1 
    168 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 
    169163# define YYSTYPE_IS_DECLARED 1 
    170164#endif 
    171165 
    172166 
     167extern YYSTYPE yylval; 
     168 
     169int yyparse (void); 
     170 
     171#endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */ 
     172 
    173173/* Copy the second part of user declarations.  */ 
    174174 
    175  
    176 /* Line 264 of yacc.c  */ 
    177 #line 178 "yacc_parser.cpp" 
     175#line 176 "yacc_parser.cpp" /* yacc.c:358  */ 
    178176 
    179177#ifdef short 
     
    189187#ifdef YYTYPE_INT8 
    190188typedef YYTYPE_INT8 yytype_int8; 
    191 #elif (defined __STDC__ || defined __C99__FUNC__ \ 
    192      || defined __cplusplus || defined _MSC_VER) 
     189#else 
    193190typedef signed char yytype_int8; 
    194 #else 
    195 typedef short int yytype_int8; 
    196191#endif 
    197192 
     
    213208# elif defined size_t 
    214209#  define YYSIZE_T size_t 
    215 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ 
    216      || defined __cplusplus || defined _MSC_VER) 
     210# elif ! defined YYSIZE_T 
    217211#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */ 
    218212#  define YYSIZE_T size_t 
     
    225219 
    226220#ifndef YY_ 
    227 # if YYENABLE_NLS 
     221# if defined YYENABLE_NLS && YYENABLE_NLS 
    228222#  if ENABLE_NLS 
    229223#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */ 
    230 #   define YY_(msgid) dgettext ("bison-runtime", msgid) 
     224#   define YY_(Msgid) dgettext ("bison-runtime", Msgid) 
    231225#  endif 
    232226# endif 
    233227# ifndef YY_ 
    234 #  define YY_(msgid) msgid 
     228#  define YY_(Msgid) Msgid 
     229# endif 
     230#endif 
     231 
     232#ifndef YY_ATTRIBUTE 
     233# if (defined __GNUC__                                               \ 
     234      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \ 
     235     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C 
     236#  define YY_ATTRIBUTE(Spec) __attribute__(Spec) 
     237# else 
     238#  define YY_ATTRIBUTE(Spec) /* empty */ 
     239# endif 
     240#endif 
     241 
     242#ifndef YY_ATTRIBUTE_PURE 
     243# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__)) 
     244#endif 
     245 
     246#ifndef YY_ATTRIBUTE_UNUSED 
     247# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) 
     248#endif 
     249 
     250#if !defined _Noreturn \ 
     251     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) 
     252# if defined _MSC_VER && 1200 <= _MSC_VER 
     253#  define _Noreturn __declspec (noreturn) 
     254# else 
     255#  define _Noreturn YY_ATTRIBUTE ((__noreturn__)) 
    235256# endif 
    236257#endif 
     
    238259/* Suppress unused-variable warnings by "using" E.  */ 
    239260#if ! defined lint || defined __GNUC__ 
    240 # define YYUSE(e) ((void) (e)) 
     261# define YYUSE(E) ((void) (E)) 
    241262#else 
    242 # define YYUSE(e) /* empty */ 
    243 #endif 
    244  
    245 /* Identity function, used to suppress warnings about constant conditions.  */ 
    246 #ifndef lint 
    247 # define YYID(n) (n) 
     263# define YYUSE(E) /* empty */ 
     264#endif 
     265 
     266#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ 
     267/* Suppress an incorrect diagnostic about yylval being uninitialized.  */ 
     268# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ 
     269    _Pragma ("GCC diagnostic push") \ 
     270    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ 
     271    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") 
     272# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ 
     273    _Pragma ("GCC diagnostic pop") 
    248274#else 
    249 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    250      || defined __cplusplus || defined _MSC_VER) 
    251 static int 
    252 YYID (int yyi) 
    253 #else 
    254 static int 
    255 YYID (yyi) 
    256     int yyi; 
    257 #endif 
    258 { 
    259   return yyi; 
    260 } 
    261 #endif 
     275# define YY_INITIAL_VALUE(Value) Value 
     276#endif 
     277#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     278# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     279# define YY_IGNORE_MAYBE_UNINITIALIZED_END 
     280#endif 
     281#ifndef YY_INITIAL_VALUE 
     282# define YY_INITIAL_VALUE(Value) /* Nothing. */ 
     283#endif 
     284 
    262285 
    263286#if ! defined yyoverflow || YYERROR_VERBOSE 
     
    278301#   else 
    279302#    define YYSTACK_ALLOC alloca 
    280 #    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 
    281      || defined __cplusplus || defined _MSC_VER) 
     303#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS 
    282304#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
    283 #     ifndef _STDLIB_H 
    284 #      define _STDLIB_H 1 
     305      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */ 
     306#     ifndef EXIT_SUCCESS 
     307#      define EXIT_SUCCESS 0 
    285308#     endif 
    286309#    endif 
     
    290313 
    291314# ifdef YYSTACK_ALLOC 
    292    /* Pacify GCC's `empty if-body' warning.  */ 
    293 #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) 
     315   /* Pacify GCC's 'empty if-body' warning.  */ 
     316#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) 
    294317#  ifndef YYSTACK_ALLOC_MAXIMUM 
    295318    /* The OS might guarantee only one guard page at the bottom of the stack, 
     
    305328#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM 
    306329#  endif 
    307 #  if (defined __cplusplus && ! defined _STDLIB_H \ 
     330#  if (defined __cplusplus && ! defined EXIT_SUCCESS \ 
    308331       && ! ((defined YYMALLOC || defined malloc) \ 
    309              && (defined YYFREE || defined free))) 
     332             && (defined YYFREE || defined free))) 
    310333#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ 
    311 #   ifndef _STDLIB_H 
    312 #    define _STDLIB_H 1 
     334#   ifndef EXIT_SUCCESS 
     335#    define EXIT_SUCCESS 0 
    313336#   endif 
    314337#  endif 
    315338#  ifndef YYMALLOC 
    316339#   define YYMALLOC malloc 
    317 #   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 
    318      || defined __cplusplus || defined _MSC_VER) 
     340#   if ! defined malloc && ! defined EXIT_SUCCESS 
    319341void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ 
    320342#   endif 
     
    322344#  ifndef YYFREE 
    323345#   define YYFREE free 
    324 #   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ 
    325      || defined __cplusplus || defined _MSC_VER) 
     346#   if ! defined free && ! defined EXIT_SUCCESS 
    326347void free (void *); /* INFRINGES ON USER NAME SPACE */ 
    327348#   endif 
     
    333354#if (! defined yyoverflow \ 
    334355     && (! defined __cplusplus \ 
    335         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 
     356        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) 
    336357 
    337358/* A type that is properly aligned for any stack member.  */ 
     
    351372      + YYSTACK_GAP_MAXIMUM) 
    352373 
    353 /* Copy COUNT objects from FROM to TO.  The source and destination do 
    354    not overlap.  */ 
    355 # ifndef YYCOPY 
    356 #  if defined __GNUC__ && 1 < __GNUC__ 
    357 #   define YYCOPY(To, From, Count) \ 
    358       __builtin_memcpy (To, From, (Count) * sizeof (*(From))) 
    359 #  else 
    360 #   define YYCOPY(To, From, Count)              \ 
    361       do                                        \ 
    362         {                                       \ 
    363           YYSIZE_T yyi;                         \ 
    364           for (yyi = 0; yyi < (Count); yyi++)   \ 
    365             (To)[yyi] = (From)[yyi];            \ 
    366         }                                       \ 
    367       while (YYID (0)) 
    368 #  endif 
    369 # endif 
     374# define YYCOPY_NEEDED 1 
    370375 
    371376/* Relocate STACK from its old location to the new one.  The 
     
    374379   stack.  Advance YYPTR to a properly aligned location for the next 
    375380   stack.  */ 
    376 # define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \ 
    377     do                                                                  \ 
    378       {                                                                 \ 
    379         YYSIZE_T yynewbytes;                                            \ 
    380         YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \ 
    381         Stack = &yyptr->Stack_alloc;                                    \ 
    382         yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 
    383         yyptr += yynewbytes / sizeof (*yyptr);                          \ 
    384       }                                                                 \ 
    385     while (YYID (0)) 
    386  
    387 #endif 
     381# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \ 
     382    do                                                                  \ 
     383      {                                                                 \ 
     384        YYSIZE_T yynewbytes;                                            \ 
     385        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \ 
     386        Stack = &yyptr->Stack_alloc;                                    \ 
     387        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ 
     388        yyptr += yynewbytes / sizeof (*yyptr);                          \ 
     389      }                                                                 \ 
     390    while (0) 
     391 
     392#endif 
     393 
     394#if defined YYCOPY_NEEDED && YYCOPY_NEEDED 
     395/* Copy COUNT objects from SRC to DST.  The source and destination do 
     396   not overlap.  */ 
     397# ifndef YYCOPY 
     398#  if defined __GNUC__ && 1 < __GNUC__ 
     399#   define YYCOPY(Dst, Src, Count) \ 
     400      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) 
     401#  else 
     402#   define YYCOPY(Dst, Src, Count)              \ 
     403      do                                        \ 
     404        {                                       \ 
     405          YYSIZE_T yyi;                         \ 
     406          for (yyi = 0; yyi < (Count); yyi++)   \ 
     407            (Dst)[yyi] = (Src)[yyi];            \ 
     408        }                                       \ 
     409      while (0) 
     410#  endif 
     411# endif 
     412#endif /* !YYCOPY_NEEDED */ 
    388413 
    389414/* YYFINAL -- State number of the termination state.  */ 
     
    398423/* YYNRULES -- Number of rules.  */ 
    399424#define YYNRULES  32 
    400 /* YYNRULES -- Number of states.  */ 
     425/* YYNSTATES -- Number of states.  */ 
    401426#define YYNSTATES  68 
    402427 
    403 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */ 
     428/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 
     429   by yylex, with out-of-bounds checking.  */ 
    404430#define YYUNDEFTOK  2 
    405431#define YYMAXUTOK   270 
    406432 
    407 #define YYTRANSLATE(YYX)                                                \ 
     433#define YYTRANSLATE(YYX)                                                \ 
    408434  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) 
    409435 
    410 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */ 
     436/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM 
     437   as returned by yylex, without out-of-bounds checking.  */ 
    411438static const yytype_uint8 yytranslate[] = 
    412439{ 
     
    442469 
    443470#if YYDEBUG 
    444 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in 
    445    YYRHS.  */ 
    446 static const yytype_uint8 yyprhs[] = 
    447 { 
    448        0,     0,     3,     5,     8,    10,    12,    16,    20,    24, 
    449       28,    31,    35,    39,    44,    46,    48,    52,    56,    60, 
    450       64,    67,    71,    75,    79,    83,    87,    91,    95,    99, 
    451      103,   107,   111 
     471  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */ 
     472static const yytype_uint8 yyrline[] = 
     473{ 
     474       0,    59,    59,    60,    64,    65,    66,    67,    68,    69, 
     475      70,    71,    72,    73,    77,    78,    79,    80,    81,    82, 
     476      83,    84,    85,    86,    87,    88,    89,    90,    91,    92, 
     477      93,    94,    95 
    452478}; 
    453  
    454 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */ 
    455 static const yytype_int8 yyrhs[] = 
    456 { 
    457       17,     0,    -1,    14,    -1,    19,    14,    -1,     3,    -1, 
    458        4,    -1,    18,     7,    18,    -1,    18,     8,    18,    -1, 
    459       18,     9,    18,    -1,    18,    10,    18,    -1,     8,    18, 
    460       -1,    18,    11,    18,    -1,    12,    18,    13,    -1,     5, 
    461       12,    18,    13,    -1,     5,    -1,     6,    -1,    19,     7, 
    462       19,    -1,    19,     8,    19,    -1,    19,     9,    19,    -1, 
    463       19,    10,    19,    -1,     8,    19,    -1,    19,    11,    19, 
    464       -1,    12,    19,    13,    -1,    19,     7,    18,    -1,    18, 
    465        7,    19,    -1,    19,     8,    18,    -1,    18,     8,    19, 
    466       -1,    19,     9,    18,    -1,    18,     9,    19,    -1,    19, 
    467       10,    18,    -1,    18,    10,    19,    -1,    19,    11,    18, 
    468       -1,     5,    12,    19,    13,    -1 
    469 }; 
    470  
    471 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */ 
    472 static const yytype_uint8 yyrline[] = 
    473 { 
    474        0,    58,    58,    59,    63,    64,    65,    66,    67,    68, 
    475       69,    70,    71,    72,    76,    77,    78,    79,    80,    81, 
    476       82,    83,    84,    85,    86,    87,    88,    89,    90,    91, 
    477       92,    93,    94 
    478 }; 
    479 #endif 
    480  
    481 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE 
     479#endif 
     480 
     481#if YYDEBUG || YYERROR_VERBOSE || 0 
    482482/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. 
    483483   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */ 
     
    487487  "MINUS", "TIMES", "DIVIDE", "POWER", "LEFT_PARENTHESIS", 
    488488  "RIGHT_PARENTHESIS", "END", "NEG", "$accept", "Line", "Expression", 
    489   "Field_expr", 0 
     489  "Field_expr", YY_NULLPTR 
    490490}; 
    491491#endif 
    492492 
    493493# ifdef YYPRINT 
    494 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to 
    495    token YYLEX-NUM.  */ 
     494/* YYTOKNUM[NUM] -- (External) token number corresponding to the 
     495   (internal) symbol number NUM (which must be that of a token).  */ 
    496496static const yytype_uint16 yytoknum[] = 
    497497{ 
     
    501501# endif 
    502502 
    503 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */ 
    504 static const yytype_uint8 yyr1[] = 
    505 { 
    506        0,    16,    17,    17,    18,    18,    18,    18,    18,    18, 
    507       18,    18,    18,    18,    19,    19,    19,    19,    19,    19, 
    508       19,    19,    19,    19,    19,    19,    19,    19,    19,    19, 
    509       19,    19,    19 
     503#define YYPACT_NINF -6 
     504 
     505#define yypact_value_is_default(Yystate) \ 
     506  (!!((Yystate) == (-6))) 
     507 
     508#define YYTABLE_NINF -1 
     509 
     510#define yytable_value_is_error(Yytable_value) \ 
     511  0 
     512 
     513  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
     514     STATE-NUM.  */ 
     515static const yytype_int8 yypact[] = 
     516{ 
     517      55,    -6,    -6,    -4,    -6,    -1,    -1,    -6,     9,   123, 
     518      73,    -1,    14,    20,    81,    88,    -6,    -1,    -1,    -1, 
     519      -1,    67,    -1,    -1,    -1,    -1,    -1,    -6,    95,   102, 
     520      -6,    -6,    13,    19,    13,    19,    14,    20,    14,    20, 
     521      -2,    67,    67,    14,    13,    19,    13,    19,    14,    20, 
     522      14,    20,    14,    20,    -6,    -6,    67,    14,   109,    67, 
     523      67,    67,    67,   116,    24,    24,    14,    14 
    510524}; 
    511525 
    512 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */ 
    513 static const yytype_uint8 yyr2[] = 
    514 { 
    515        0,     2,     1,     2,     1,     1,     3,     3,     3,     3, 
    516        2,     3,     3,     4,     1,     1,     3,     3,     3,     3, 
    517        2,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
    518        3,     3,     4 
    519 }; 
    520  
    521 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state 
    522    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero 
    523    means the default is an error.  */ 
     526  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. 
     527     Performed when YYTABLE does not specify something else to do.  Zero 
     528     means the default is an error.  */ 
    524529static const yytype_uint8 yydefact[] = 
    525530{ 
     
    533538}; 
    534539 
    535 /* YYDEFGOTO[NTERM-NUM].  */ 
     540  /* YYPGOTO[NTERM-NUM].  */ 
     541static const yytype_int8 yypgoto[] = 
     542{ 
     543      -6,    -6,    -5,    21 
     544}; 
     545 
     546  /* YYDEFGOTO[NTERM-NUM].  */ 
    536547static const yytype_int8 yydefgoto[] = 
    537548{ 
     
    539550}; 
    540551 
    541 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing 
    542    STATE-NUM.  */ 
    543 #define YYPACT_NINF -6 
    544 static const yytype_int8 yypact[] = 
    545 { 
    546       55,    -6,    -6,    -4,    -6,    -1,    -1,    -6,     9,   123, 
    547       73,    -1,    14,    20,    81,    88,    -6,    -1,    -1,    -1, 
    548       -1,    67,    -1,    -1,    -1,    -1,    -1,    -6,    95,   102, 
    549       -6,    -6,    13,    19,    13,    19,    14,    20,    14,    20, 
    550       -2,    67,    67,    14,    13,    19,    13,    19,    14,    20, 
    551       14,    20,    14,    20,    -6,    -6,    67,    14,   109,    67, 
    552       67,    67,    67,   116,    24,    24,    14,    14 
    553 }; 
    554  
    555 /* YYPGOTO[NTERM-NUM].  */ 
    556 static const yytype_int8 yypgoto[] = 
    557 { 
    558       -6,    -6,    -5,    21 
    559 }; 
    560  
    561 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If 
    562    positive, shift that token.  If negative, reduce the rule which 
    563    number is the opposite.  If zero, do what YYDEFACT says. 
    564    If YYTABLE_NINF, syntax error.  */ 
    565 #define YYTABLE_NINF -1 
     552  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If 
     553     positive, shift that token.  If negative, reduce the rule whose 
     554     number is the opposite.  If YYTABLE_NINF, syntax error.  */ 
    566555static const yytype_uint8 yytable[] = 
    567556{ 
     
    600589}; 
    601590 
    602 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 
    603    symbol of state STATE-NUM.  */ 
     591  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing 
     592     symbol of state STATE-NUM.  */ 
    604593static const yytype_uint8 yystos[] = 
    605594{ 
     
    613602}; 
    614603 
    615 #define yyerrok         (yyerrstatus = 0) 
    616 #define yyclearin       (yychar = YYEMPTY) 
    617 #define YYEMPTY         (-2) 
    618 #define YYEOF           0 
    619  
    620 #define YYACCEPT        goto yyacceptlab 
    621 #define YYABORT         goto yyabortlab 
    622 #define YYERROR         goto yyerrorlab 
    623  
    624  
    625 /* Like YYERROR except do call yyerror.  This remains here temporarily 
    626    to ease the transition to the new meaning of YYERROR, for GCC. 
    627    Once GCC version 2 has supplanted version 1, this can go.  */ 
    628  
    629 #define YYFAIL          goto yyerrlab 
     604  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */ 
     605static const yytype_uint8 yyr1[] = 
     606{ 
     607       0,    16,    17,    17,    18,    18,    18,    18,    18,    18, 
     608      18,    18,    18,    18,    19,    19,    19,    19,    19,    19, 
     609      19,    19,    19,    19,    19,    19,    19,    19,    19,    19, 
     610      19,    19,    19 
     611}; 
     612 
     613  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */ 
     614static const yytype_uint8 yyr2[] = 
     615{ 
     616       0,     2,     1,     2,     1,     1,     3,     3,     3,     3, 
     617       2,     3,     3,     4,     1,     1,     3,     3,     3,     3, 
     618       2,     3,     3,     3,     3,     3,     3,     3,     3,     3, 
     619       3,     3,     4 
     620}; 
     621 
     622 
     623#define yyerrok         (yyerrstatus = 0) 
     624#define yyclearin       (yychar = YYEMPTY) 
     625#define YYEMPTY         (-2) 
     626#define YYEOF           0 
     627 
     628#define YYACCEPT        goto yyacceptlab 
     629#define YYABORT         goto yyabortlab 
     630#define YYERROR         goto yyerrorlab 
     631 
    630632 
    631633#define YYRECOVERING()  (!!yyerrstatus) 
    632634 
    633 #define YYBACKUP(Token, Value)                                  \ 
    634 do                                                              \ 
    635   if (yychar == YYEMPTY && yylen == 1)                          \ 
    636     {                                                           \ 
    637       yychar = (Token);                                         \ 
    638       yylval = (Value);                                         \ 
    639       yytoken = YYTRANSLATE (yychar);                           \ 
    640       YYPOPSTACK (1);                                           \ 
    641       goto yybackup;                                            \ 
    642     }                                                           \ 
    643   else                                                          \ 
    644     {                                                           \ 
     635#define YYBACKUP(Token, Value)                                  \ 
     636do                                                              \ 
     637  if (yychar == YYEMPTY)                                        \ 
     638    {                                                           \ 
     639      yychar = (Token);                                         \ 
     640      yylval = (Value);                                         \ 
     641      YYPOPSTACK (yylen);                                       \ 
     642      yystate = *yyssp;                                         \ 
     643      goto yybackup;                                            \ 
     644    }                                                           \ 
     645  else                                                          \ 
     646    {                                                           \ 
    645647      yyerror (YY_("syntax error: cannot back up")); \ 
    646       YYERROR;                                                  \ 
    647     }                                                           \ 
    648 while (YYID (0)) 
    649  
    650  
    651 #define YYTERROR        1 
    652 #define YYERRCODE       256 
    653  
    654  
    655 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. 
    656    If N is 0, then set CURRENT to the empty location which ends 
    657    the previous symbol: RHS[0] (always defined).  */ 
    658  
    659 #define YYRHSLOC(Rhs, K) ((Rhs)[K]) 
    660 #ifndef YYLLOC_DEFAULT 
    661 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \ 
    662     do                                                                  \ 
    663       if (YYID (N))                                                    \ 
    664         {                                                               \ 
    665           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \ 
    666           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \ 
    667           (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \ 
    668           (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \ 
    669         }                                                               \ 
    670       else                                                              \ 
    671         {                                                               \ 
    672           (Current).first_line   = (Current).last_line   =              \ 
    673             YYRHSLOC (Rhs, 0).last_line;                                \ 
    674           (Current).first_column = (Current).last_column =              \ 
    675             YYRHSLOC (Rhs, 0).last_column;                              \ 
    676         }                                                               \ 
    677     while (YYID (0)) 
    678 #endif 
    679  
    680  
    681 /* YY_LOCATION_PRINT -- Print the location on the stream. 
    682    This macro was not mandated originally: define only if we know 
    683    we won't break user code: when these are the locations we know.  */ 
    684  
    685 #ifndef YY_LOCATION_PRINT 
    686 # if YYLTYPE_IS_TRIVIAL 
    687 #  define YY_LOCATION_PRINT(File, Loc)                  \ 
    688      fprintf (File, "%d.%d-%d.%d",                      \ 
    689               (Loc).first_line, (Loc).first_column,     \ 
    690               (Loc).last_line,  (Loc).last_column) 
    691 # else 
    692 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0) 
    693 # endif 
    694 #endif 
    695  
    696  
    697 /* YYLEX -- calling `yylex' with the right arguments.  */ 
    698  
    699 #ifdef YYLEX_PARAM 
    700 # define YYLEX yylex (YYLEX_PARAM) 
    701 #else 
    702 # define YYLEX yylex () 
    703 #endif 
     648      YYERROR;                                                  \ 
     649    }                                                           \ 
     650while (0) 
     651 
     652/* Error token number */ 
     653#define YYTERROR        1 
     654#define YYERRCODE       256 
     655 
     656 
    704657 
    705658/* Enable debugging if requested.  */ 
     
    711664# endif 
    712665 
    713 # define YYDPRINTF(Args)                        \ 
    714 do {                                            \ 
    715   if (yydebug)                                  \ 
    716     YYFPRINTF Args;                             \ 
    717 } while (YYID (0)) 
    718  
    719 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \ 
    720 do {                                                                      \ 
    721   if (yydebug)                                                            \ 
    722     {                                                                     \ 
    723       YYFPRINTF (stderr, "%s ", Title);                                   \ 
    724       yy_symbol_print (stderr,                                            \ 
    725                   Type, Value); \ 
    726       YYFPRINTF (stderr, "\n");                                           \ 
    727     }                                                                     \ 
    728 } while (YYID (0)) 
    729  
    730  
    731 /*--------------------------------. 
    732 | Print this symbol on YYOUTPUT.  | 
    733 `--------------------------------*/ 
    734  
    735 /*ARGSUSED*/ 
    736 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    737      || defined __cplusplus || defined _MSC_VER) 
     666# define YYDPRINTF(Args)                        \ 
     667do {                                            \ 
     668  if (yydebug)                                  \ 
     669    YYFPRINTF Args;                             \ 
     670} while (0) 
     671 
     672/* This macro is provided for backward compatibility. */ 
     673#ifndef YY_LOCATION_PRINT 
     674# define YY_LOCATION_PRINT(File, Loc) ((void) 0) 
     675#endif 
     676 
     677 
     678# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \ 
     679do {                                                                      \ 
     680  if (yydebug)                                                            \ 
     681    {                                                                     \ 
     682      YYFPRINTF (stderr, "%s ", Title);                                   \ 
     683      yy_symbol_print (stderr,                                            \ 
     684                  Type, Value); \ 
     685      YYFPRINTF (stderr, "\n");                                           \ 
     686    }                                                                     \ 
     687} while (0) 
     688 
     689 
     690/*----------------------------------------. 
     691| Print this symbol's value on YYOUTPUT.  | 
     692`----------------------------------------*/ 
     693 
    738694static void 
    739695yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 
    740 #else 
    741 static void 
    742 yy_symbol_value_print (yyoutput, yytype, yyvaluep) 
    743     FILE *yyoutput; 
    744     int yytype; 
    745     YYSTYPE const * const yyvaluep; 
    746 #endif 
    747 { 
     696{ 
     697  FILE *yyo = yyoutput; 
     698  YYUSE (yyo); 
    748699  if (!yyvaluep) 
    749700    return; 
     
    751702  if (yytype < YYNTOKENS) 
    752703    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); 
    753 # else 
    754   YYUSE (yyoutput); 
    755704# endif 
    756   switch (yytype) 
    757     { 
    758       default: 
    759         break; 
    760     } 
     705  YYUSE (yytype); 
    761706} 
    762707 
     
    766711`--------------------------------*/ 
    767712 
    768 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    769      || defined __cplusplus || defined _MSC_VER) 
    770713static void 
    771714yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) 
    772 #else 
    773 static void 
    774 yy_symbol_print (yyoutput, yytype, yyvaluep) 
    775     FILE *yyoutput; 
    776     int yytype; 
    777     YYSTYPE const * const yyvaluep; 
    778 #endif 
    779 { 
    780   if (yytype < YYNTOKENS) 
    781     YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); 
    782   else 
    783     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); 
     715{ 
     716  YYFPRINTF (yyoutput, "%s %s (", 
     717             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); 
    784718 
    785719  yy_symbol_value_print (yyoutput, yytype, yyvaluep); 
     
    792726`------------------------------------------------------------------*/ 
    793727 
    794 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    795      || defined __cplusplus || defined _MSC_VER) 
    796728static void 
    797729yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) 
    798 #else 
    799 static void 
    800 yy_stack_print (yybottom, yytop) 
    801     yytype_int16 *yybottom; 
    802     yytype_int16 *yytop; 
    803 #endif 
    804730{ 
    805731  YYFPRINTF (stderr, "Stack now"); 
     
    812738} 
    813739 
    814 # define YY_STACK_PRINT(Bottom, Top)                            \ 
    815 do {                                                            \ 
    816   if (yydebug)                                                  \ 
    817     yy_stack_print ((Bottom), (Top));                           \ 
    818 } while (YYID (0)) 
     740# define YY_STACK_PRINT(Bottom, Top)                            \ 
     741do {                                                            \ 
     742  if (yydebug)                                                  \ 
     743    yy_stack_print ((Bottom), (Top));                           \ 
     744} while (0) 
    819745 
    820746 
     
    823749`------------------------------------------------*/ 
    824750 
    825 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    826      || defined __cplusplus || defined _MSC_VER) 
    827751static void 
    828 yy_reduce_print (YYSTYPE *yyvsp, int yyrule) 
    829 #else 
    830 static void 
    831 yy_reduce_print (yyvsp, yyrule) 
    832     YYSTYPE *yyvsp; 
    833     int yyrule; 
    834 #endif 
    835 { 
     752yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) 
     753{ 
     754  unsigned long int yylno = yyrline[yyrule]; 
    836755  int yynrhs = yyr2[yyrule]; 
    837756  int yyi; 
    838   unsigned long int yylno = yyrline[yyrule]; 
    839757  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", 
    840              yyrule - 1, yylno); 
     758             yyrule - 1, yylno); 
    841759  /* The symbols being reduced.  */ 
    842760  for (yyi = 0; yyi < yynrhs; yyi++) 
    843761    { 
    844762      YYFPRINTF (stderr, "   $%d = ", yyi + 1); 
    845       yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], 
    846                        &(yyvsp[(yyi + 1) - (yynrhs)]) 
    847                                        ); 
     763      yy_symbol_print (stderr, 
     764                       yystos[yyssp[yyi + 1 - yynrhs]], 
     765                       &(yyvsp[(yyi + 1) - (yynrhs)]) 
     766                                              ); 
    848767      YYFPRINTF (stderr, "\n"); 
    849768    } 
    850769} 
    851770 
    852 # define YY_REDUCE_PRINT(Rule)          \ 
    853 do {                                    \ 
    854   if (yydebug)                          \ 
    855     yy_reduce_print (yyvsp, Rule); \ 
    856 } while (YYID (0)) 
     771# define YY_REDUCE_PRINT(Rule)          \ 
     772do {                                    \ 
     773  if (yydebug)                          \ 
     774    yy_reduce_print (yyssp, yyvsp, Rule); \ 
     775} while (0) 
    857776 
    858777/* Nonzero means print parse trace.  It is left uninitialized so that 
     
    868787 
    869788/* YYINITDEPTH -- initial size of the parser's stacks.  */ 
    870 #ifndef YYINITDEPTH 
     789#ifndef YYINITDEPTH 
    871790# define YYINITDEPTH 200 
    872791#endif 
     
    882801# define YYMAXDEPTH 10000 
    883802#endif 
    884  
    885  
    886803 
    887804 
     
    893810#  else 
    894811/* Return the length of YYSTR.  */ 
    895 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    896      || defined __cplusplus || defined _MSC_VER) 
    897812static YYSIZE_T 
    898813yystrlen (const char *yystr) 
    899 #else 
    900 static YYSIZE_T 
    901 yystrlen (yystr) 
    902     const char *yystr; 
    903 #endif 
    904814{ 
    905815  YYSIZE_T yylen; 
     
    917827/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in 
    918828   YYDEST.  */ 
    919 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    920      || defined __cplusplus || defined _MSC_VER) 
    921829static char * 
    922830yystpcpy (char *yydest, const char *yysrc) 
    923 #else 
    924 static char * 
    925 yystpcpy (yydest, yysrc) 
    926     char *yydest; 
    927     const char *yysrc; 
    928 #endif 
    929831{ 
    930832  char *yyd = yydest; 
     
    956858 
    957859      for (;;) 
    958         switch (*++yyp) 
    959           { 
    960           case '\'': 
    961           case ',': 
    962             goto do_not_strip_quotes; 
    963  
    964           case '\\': 
    965             if (*++yyp != '\\') 
    966               goto do_not_strip_quotes; 
    967             /* Fall through.  */ 
    968           default: 
    969             if (yyres) 
    970               yyres[yyn] = *yyp; 
    971             yyn++; 
    972             break; 
    973  
    974           case '"': 
    975             if (yyres) 
    976               yyres[yyn] = '\0'; 
    977             return yyn; 
    978           } 
     860        switch (*++yyp) 
     861          { 
     862          case '\'': 
     863          case ',': 
     864            goto do_not_strip_quotes; 
     865 
     866          case '\\': 
     867            if (*++yyp != '\\') 
     868              goto do_not_strip_quotes; 
     869            /* Fall through.  */ 
     870          default: 
     871            if (yyres) 
     872              yyres[yyn] = *yyp; 
     873            yyn++; 
     874            break; 
     875 
     876          case '"': 
     877            if (yyres) 
     878              yyres[yyn] = '\0'; 
     879            return yyn; 
     880          } 
    979881    do_not_strip_quotes: ; 
    980882    } 
     
    987889# endif 
    988890 
    989 /* Copy into YYRESULT an error message about the unexpected token 
    990    YYCHAR while in state YYSTATE.  Return the number of bytes copied, 
    991    including the terminating null byte.  If YYRESULT is null, do not 
    992    copy anything; just return the number of bytes that would be 
    993    copied.  As a special case, return 0 if an ordinary "syntax error" 
    994    message will do.  Return YYSIZE_MAXIMUM if overflow occurs during 
    995    size calculation.  */ 
    996 static YYSIZE_T 
    997 yysyntax_error (char *yyresult, int yystate, int yychar) 
    998 { 
    999   int yyn = yypact[yystate]; 
    1000  
    1001   if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) 
    1002     return 0; 
    1003   else 
     891/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message 
     892   about the unexpected token YYTOKEN for the state stack whose top is 
     893   YYSSP. 
     894 
     895   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is 
     896   not large enough to hold the message.  In that case, also set 
     897   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the 
     898   required number of bytes is too large to store.  */ 
     899static int 
     900yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, 
     901                yytype_int16 *yyssp, int yytoken) 
     902{ 
     903  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); 
     904  YYSIZE_T yysize = yysize0; 
     905  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 
     906  /* Internationalized format string. */ 
     907  const char *yyformat = YY_NULLPTR; 
     908  /* Arguments of yyformat. */ 
     909  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 
     910  /* Number of reported tokens (one for the "unexpected", one per 
     911     "expected"). */ 
     912  int yycount = 0; 
     913 
     914  /* There are many possibilities here to consider: 
     915     - If this state is a consistent state with a default action, then 
     916       the only way this function was invoked is if the default action 
     917       is an error action.  In that case, don't check for expected 
     918       tokens because there are none. 
     919     - The only way there can be no lookahead present (in yychar) is if 
     920       this state is a consistent state with a default action.  Thus, 
     921       detecting the absence of a lookahead is sufficient to determine 
     922       that there is no unexpected or expected token to report.  In that 
     923       case, just report a simple "syntax error". 
     924     - Don't assume there isn't a lookahead just because this state is a 
     925       consistent state with a default action.  There might have been a 
     926       previous inconsistent state, consistent state with a non-default 
     927       action, or user semantic action that manipulated yychar. 
     928     - Of course, the expected token list depends on states to have 
     929       correct lookahead information, and it depends on the parser not 
     930       to perform extra reductions after fetching a lookahead from the 
     931       scanner and before detecting a syntax error.  Thus, state merging 
     932       (from LALR or IELR) and default reductions corrupt the expected 
     933       token list.  However, the list is correct for canonical LR with 
     934       one exception: it will still contain any token that will not be 
     935       accepted due to an error action in a later state. 
     936  */ 
     937  if (yytoken != YYEMPTY) 
    1004938    { 
    1005       int yytype = YYTRANSLATE (yychar); 
    1006       YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); 
    1007       YYSIZE_T yysize = yysize0; 
    1008       YYSIZE_T yysize1; 
    1009       int yysize_overflow = 0; 
    1010       enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; 
    1011       char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; 
    1012       int yyx; 
    1013  
    1014 # if 0 
    1015       /* This is so xgettext sees the translatable formats that are 
    1016          constructed on the fly.  */ 
    1017       YY_("syntax error, unexpected %s"); 
    1018       YY_("syntax error, unexpected %s, expecting %s"); 
    1019       YY_("syntax error, unexpected %s, expecting %s or %s"); 
    1020       YY_("syntax error, unexpected %s, expecting %s or %s or %s"); 
    1021       YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); 
    1022 # endif 
    1023       char *yyfmt; 
    1024       char const *yyf; 
    1025       static char const yyunexpected[] = "syntax error, unexpected %s"; 
    1026       static char const yyexpecting[] = ", expecting %s"; 
    1027       static char const yyor[] = " or %s"; 
    1028       char yyformat[sizeof yyunexpected 
    1029                     + sizeof yyexpecting - 1 
    1030                     + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) 
    1031                        * (sizeof yyor - 1))]; 
    1032       char const *yyprefix = yyexpecting; 
    1033  
    1034       /* Start YYX at -YYN if negative to avoid negative indexes in 
    1035          YYCHECK.  */ 
    1036       int yyxbegin = yyn < 0 ? -yyn : 0; 
    1037  
    1038       /* Stay within bounds of both yycheck and yytname.  */ 
    1039       int yychecklim = YYLAST - yyn + 1; 
    1040       int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 
    1041       int yycount = 1; 
    1042  
    1043       yyarg[0] = yytname[yytype]; 
    1044       yyfmt = yystpcpy (yyformat, yyunexpected); 
    1045  
    1046       for (yyx = yyxbegin; yyx < yyxend; ++yyx) 
    1047         if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) 
    1048           { 
    1049             if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 
    1050               { 
    1051                 yycount = 1; 
    1052                 yysize = yysize0; 
    1053                 yyformat[sizeof yyunexpected - 1] = '\0'; 
    1054                 break; 
    1055               } 
    1056             yyarg[yycount++] = yytname[yyx]; 
    1057             yysize1 = yysize + yytnamerr (0, yytname[yyx]); 
    1058             yysize_overflow |= (yysize1 < yysize); 
    1059             yysize = yysize1; 
    1060             yyfmt = yystpcpy (yyfmt, yyprefix); 
    1061             yyprefix = yyor; 
    1062           } 
    1063  
    1064       yyf = YY_(yyformat); 
    1065       yysize1 = yysize + yystrlen (yyf); 
    1066       yysize_overflow |= (yysize1 < yysize); 
    1067       yysize = yysize1; 
    1068  
    1069       if (yysize_overflow) 
    1070         return YYSIZE_MAXIMUM; 
    1071  
    1072       if (yyresult) 
    1073         { 
    1074           /* Avoid sprintf, as that infringes on the user's name space. 
    1075              Don't have undefined behavior even if the translation 
    1076              produced a string with the wrong number of "%s"s.  */ 
    1077           char *yyp = yyresult; 
    1078           int yyi = 0; 
    1079           while ((*yyp = *yyf) != '\0') 
    1080             { 
    1081               if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) 
    1082                 { 
    1083                   yyp += yytnamerr (yyp, yyarg[yyi++]); 
    1084                   yyf += 2; 
    1085                 } 
    1086               else 
    1087                 { 
    1088                   yyp++; 
    1089                   yyf++; 
    1090                 } 
    1091             } 
    1092         } 
    1093       return yysize; 
     939      int yyn = yypact[*yyssp]; 
     940      yyarg[yycount++] = yytname[yytoken]; 
     941      if (!yypact_value_is_default (yyn)) 
     942        { 
     943          /* Start YYX at -YYN if negative to avoid negative indexes in 
     944             YYCHECK.  In other words, skip the first -YYN actions for 
     945             this state because they are default actions.  */ 
     946          int yyxbegin = yyn < 0 ? -yyn : 0; 
     947          /* Stay within bounds of both yycheck and yytname.  */ 
     948          int yychecklim = YYLAST - yyn + 1; 
     949          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; 
     950          int yyx; 
     951 
     952          for (yyx = yyxbegin; yyx < yyxend; ++yyx) 
     953            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR 
     954                && !yytable_value_is_error (yytable[yyx + yyn])) 
     955              { 
     956                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) 
     957                  { 
     958                    yycount = 1; 
     959                    yysize = yysize0; 
     960                    break; 
     961                  } 
     962                yyarg[yycount++] = yytname[yyx]; 
     963                { 
     964                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); 
     965                  if (! (yysize <= yysize1 
     966                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 
     967                    return 2; 
     968                  yysize = yysize1; 
     969                } 
     970              } 
     971        } 
    1094972    } 
     973 
     974  switch (yycount) 
     975    { 
     976# define YYCASE_(N, S)                      \ 
     977      case N:                               \ 
     978        yyformat = S;                       \ 
     979      break 
     980      YYCASE_(0, YY_("syntax error")); 
     981      YYCASE_(1, YY_("syntax error, unexpected %s")); 
     982      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); 
     983      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); 
     984      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); 
     985      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); 
     986# undef YYCASE_ 
     987    } 
     988 
     989  { 
     990    YYSIZE_T yysize1 = yysize + yystrlen (yyformat); 
     991    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) 
     992      return 2; 
     993    yysize = yysize1; 
     994  } 
     995 
     996  if (*yymsg_alloc < yysize) 
     997    { 
     998      *yymsg_alloc = 2 * yysize; 
     999      if (! (yysize <= *yymsg_alloc 
     1000             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) 
     1001        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; 
     1002      return 1; 
     1003    } 
     1004 
     1005  /* Avoid sprintf, as that infringes on the user's name space. 
     1006     Don't have undefined behavior even if the translation 
     1007     produced a string with the wrong number of "%s"s.  */ 
     1008  { 
     1009    char *yyp = *yymsg; 
     1010    int yyi = 0; 
     1011    while ((*yyp = *yyformat) != '\0') 
     1012      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) 
     1013        { 
     1014          yyp += yytnamerr (yyp, yyarg[yyi++]); 
     1015          yyformat += 2; 
     1016        } 
     1017      else 
     1018        { 
     1019          yyp++; 
     1020          yyformat++; 
     1021        } 
     1022  } 
     1023  return 0; 
    10951024} 
    10961025#endif /* YYERROR_VERBOSE */ 
    1097  
    1098  
    10991026 
    11001027/*-----------------------------------------------. 
     
    11021029`-----------------------------------------------*/ 
    11031030 
    1104 /*ARGSUSED*/ 
    1105 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1106      || defined __cplusplus || defined _MSC_VER) 
    11071031static void 
    11081032yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) 
    1109 #else 
    1110 static void 
    1111 yydestruct (yymsg, yytype, yyvaluep) 
    1112     const char *yymsg; 
    1113     int yytype; 
    1114     YYSTYPE *yyvaluep; 
    1115 #endif 
    11161033{ 
    11171034  YYUSE (yyvaluep); 
    1118  
    11191035  if (!yymsg) 
    11201036    yymsg = "Deleting"; 
    11211037  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); 
    11221038 
    1123   switch (yytype) 
    1124     { 
    1125  
    1126       default: 
    1127         break; 
    1128     } 
     1039  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
     1040  YYUSE (yytype); 
     1041  YY_IGNORE_MAYBE_UNINITIALIZED_END 
    11291042} 
    11301043 
    1131 /* Prevent warnings from -Wmissing-prototypes.  */ 
    1132 #ifdef YYPARSE_PARAM 
    1133 #if defined __STDC__ || defined __cplusplus 
    1134 int yyparse (void *YYPARSE_PARAM); 
    1135 #else 
    1136 int yyparse (); 
    1137 #endif 
    1138 #else /* ! YYPARSE_PARAM */ 
    1139 #if defined __STDC__ || defined __cplusplus 
    1140 int yyparse (void); 
    1141 #else 
    1142 int yyparse (); 
    1143 #endif 
    1144 #endif /* ! YYPARSE_PARAM */ 
     1044 
    11451045 
    11461046 
     
    11501050/* The semantic value of the lookahead symbol.  */ 
    11511051YYSTYPE yylval; 
    1152  
    11531052/* Number of syntax errors so far.  */ 
    11541053int yynerrs; 
    11551054 
    11561055 
    1157  
    1158 /*-------------------------. 
    1159 | yyparse or yypush_parse.  | 
    1160 `-------------------------*/ 
    1161  
    1162 #ifdef YYPARSE_PARAM 
    1163 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1164      || defined __cplusplus || defined _MSC_VER) 
    1165 int 
    1166 yyparse (void *YYPARSE_PARAM) 
    1167 #else 
    1168 int 
    1169 yyparse (YYPARSE_PARAM) 
    1170     void *YYPARSE_PARAM; 
    1171 #endif 
    1172 #else /* ! YYPARSE_PARAM */ 
    1173 #if (defined __STDC__ || defined __C99__FUNC__ \ 
    1174      || defined __cplusplus || defined _MSC_VER) 
     1056/*----------. 
     1057| yyparse.  | 
     1058`----------*/ 
     1059 
    11751060int 
    11761061yyparse (void) 
    1177 #else 
    1178 int 
    1179 yyparse () 
    1180  
    1181 #endif 
    1182 #endif 
    1183 { 
    1184  
    1185  
     1062{ 
    11861063    int yystate; 
    11871064    /* Number of tokens to shift before error messages enabled.  */ 
     
    11891066 
    11901067    /* The stacks and their tools: 
    1191        `yyss': related to states. 
    1192        `yyvs': related to semantic values. 
    1193  
    1194        Refer to the stacks thru separate pointers, to allow yyoverflow 
     1068       'yyss': related to states. 
     1069       'yyvs': related to semantic values. 
     1070 
     1071       Refer to the stacks through separate pointers, to allow yyoverflow 
    11951072       to reallocate them elsewhere.  */ 
    11961073 
     
    12101087  int yyresult; 
    12111088  /* Lookahead token as an internal (translated) token number.  */ 
    1212   int yytoken; 
     1089  int yytoken = 0; 
    12131090  /* The variables used to return semantic value and location from the 
    12141091     action routines.  */ 
     
    12281105  int yylen = 0; 
    12291106 
    1230   yytoken = 0; 
    1231   yyss = yyssa; 
    1232   yyvs = yyvsa; 
     1107  yyssp = yyss = yyssa; 
     1108  yyvsp = yyvs = yyvsa; 
    12331109  yystacksize = YYINITDEPTH; 
    12341110 
     
    12391115  yynerrs = 0; 
    12401116  yychar = YYEMPTY; /* Cause a token to be read.  */ 
    1241  
    1242   /* Initialize stack pointers. 
    1243      Waste one element of value and location stack 
    1244      so that they stay on the same level as the state stack. 
    1245      The wasted elements are never initialized.  */ 
    1246   yyssp = yyss; 
    1247   yyvsp = yyvs; 
    1248  
    12491117  goto yysetstate; 
    12501118 
     
    12671135#ifdef yyoverflow 
    12681136      { 
    1269         /* Give user a chance to reallocate the stack.  Use copies of 
    1270            these so that the &'s don't force the real ones into 
    1271            memory.  */ 
    1272         YYSTYPE *yyvs1 = yyvs; 
    1273         yytype_int16 *yyss1 = yyss; 
    1274  
    1275         /* Each stack pointer address is followed by the size of the 
    1276            data in use in that stack, in bytes.  This used to be a 
    1277            conditional around just the two extra args, but that might 
    1278            be undefined if yyoverflow is a macro.  */ 
    1279         yyoverflow (YY_("memory exhausted"), 
    1280                     &yyss1, yysize * sizeof (*yyssp), 
    1281                     &yyvs1, yysize * sizeof (*yyvsp), 
    1282                     &yystacksize); 
    1283  
    1284         yyss = yyss1; 
    1285         yyvs = yyvs1; 
     1137        /* Give user a chance to reallocate the stack.  Use copies of 
     1138           these so that the &'s don't force the real ones into 
     1139           memory.  */ 
     1140        YYSTYPE *yyvs1 = yyvs; 
     1141        yytype_int16 *yyss1 = yyss; 
     1142 
     1143        /* Each stack pointer address is followed by the size of the 
     1144           data in use in that stack, in bytes.  This used to be a 
     1145           conditional around just the two extra args, but that might 
     1146           be undefined if yyoverflow is a macro.  */ 
     1147        yyoverflow (YY_("memory exhausted"), 
     1148                    &yyss1, yysize * sizeof (*yyssp), 
     1149                    &yyvs1, yysize * sizeof (*yyvsp), 
     1150                    &yystacksize); 
     1151 
     1152        yyss = yyss1; 
     1153        yyvs = yyvs1; 
    12861154      } 
    12871155#else /* no yyoverflow */ 
     
    12911159      /* Extend the stack our own way.  */ 
    12921160      if (YYMAXDEPTH <= yystacksize) 
    1293         goto yyexhaustedlab; 
     1161        goto yyexhaustedlab; 
    12941162      yystacksize *= 2; 
    12951163      if (YYMAXDEPTH < yystacksize) 
    1296         yystacksize = YYMAXDEPTH; 
     1164        yystacksize = YYMAXDEPTH; 
    12971165 
    12981166      { 
    1299         yytype_int16 *yyss1 = yyss; 
    1300         union yyalloc *yyptr = 
    1301           (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 
    1302         if (! yyptr) 
    1303           goto yyexhaustedlab; 
    1304         YYSTACK_RELOCATE (yyss_alloc, yyss); 
    1305         YYSTACK_RELOCATE (yyvs_alloc, yyvs); 
     1167        yytype_int16 *yyss1 = yyss; 
     1168        union yyalloc *yyptr = 
     1169          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); 
     1170        if (! yyptr) 
     1171          goto yyexhaustedlab; 
     1172        YYSTACK_RELOCATE (yyss_alloc, yyss); 
     1173        YYSTACK_RELOCATE (yyvs_alloc, yyvs); 
    13061174#  undef YYSTACK_RELOCATE 
    1307         if (yyss1 != yyssa) 
    1308           YYSTACK_FREE (yyss1); 
     1175        if (yyss1 != yyssa) 
     1176          YYSTACK_FREE (yyss1); 
    13091177      } 
    13101178# endif 
     
    13151183 
    13161184      YYDPRINTF ((stderr, "Stack size increased to %lu\n", 
    1317                   (unsigned long int) yystacksize)); 
     1185                  (unsigned long int) yystacksize)); 
    13181186 
    13191187      if (yyss + yystacksize - 1 <= yyssp) 
    1320         YYABORT; 
     1188        YYABORT; 
    13211189    } 
    13221190 
     
    13381206  /* First try to decide what to do without reference to lookahead token.  */ 
    13391207  yyn = yypact[yystate]; 
    1340   if (yyn == YYPACT_NINF) 
     1208  if (yypact_value_is_default (yyn)) 
    13411209    goto yydefault; 
    13421210 
     
    13471215    { 
    13481216      YYDPRINTF ((stderr, "Reading a token: ")); 
    1349       yychar = YYLEX; 
     1217      yychar = yylex (); 
    13501218    } 
    13511219 
     
    13691237  if (yyn <= 0) 
    13701238    { 
    1371       if (yyn == 0 || yyn == YYTABLE_NINF) 
    1372         goto yyerrlab; 
     1239      if (yytable_value_is_error (yyn)) 
     1240        goto yyerrlab; 
    13731241      yyn = -yyn; 
    13741242      goto yyreduce; 
     
    13871255 
    13881256  yystate = yyn; 
     1257  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
    13891258  *++yyvsp = yylval; 
     1259  YY_IGNORE_MAYBE_UNINITIALIZED_END 
    13901260 
    13911261  goto yynewstate; 
     
    14101280 
    14111281  /* If YYLEN is nonzero, implement the default value of the action: 
    1412      `$$ = $1'. 
     1282     '$$ = $1'. 
    14131283 
    14141284     Otherwise, the following line sets YYVAL to garbage. 
     
    14241294    { 
    14251295        case 2: 
    1426  
    1427 /* Line 1455 of yacc.c  */ 
    1428 #line 58 "yacc_parser.yacc" 
    1429     {  ;} 
     1296#line 59 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1297    { /* Nothing to do */ } 
     1298#line 1299 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14301299    break; 
    14311300 
    14321301  case 3: 
    1433  
    1434 /* Line 1455 of yacc.c  */ 
    1435 #line 59 "yacc_parser.yacc" 
    1436     {  parsed=(yyvsp[(1) - (2)].node) ;;} 
     1302#line 60 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1303    { parsed = (yyvsp[-1].filterNode); } 
     1304#line 1305 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14371305    break; 
    14381306 
    14391307  case 4: 
    1440  
    1441 /* Line 1455 of yacc.c  */ 
    1442 #line 63 "yacc_parser.yacc" 
    1443     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::scalarDouble,(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str) ;} 
     1308#line 64 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1309    { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1310#line 1311 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14441311    break; 
    14451312 
    14461313  case 5: 
    1447  
    1448 /* Line 1455 of yacc.c  */ 
    1449 #line 64 "yacc_parser.yacc" 
    1450     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::scalarVariable,(yyvsp[(1) - (1)].str)) ; delete (yyvsp[(1) - (1)].str);} 
     1314#line 65 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1315    { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1316#line 1317 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14511317    break; 
    14521318 
    14531319  case 6: 
    1454  
    1455 /* Line 1455 of yacc.c  */ 
    1456 #line 65 "yacc_parser.yacc" 
    1457     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"add") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1320#line 66 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1321    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } 
     1322#line 1323 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14581323    break; 
    14591324 
    14601325  case 7: 
    1461  
    1462 /* Line 1455 of yacc.c  */ 
    1463 #line 66 "yacc_parser.yacc" 
    1464     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"minus") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1326#line 67 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1327    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } 
     1328#line 1329 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14651329    break; 
    14661330 
    14671331  case 8: 
    1468  
    1469 /* Line 1455 of yacc.c  */ 
    1470 #line 67 "yacc_parser.yacc" 
    1471     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"mult") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1332#line 68 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1333    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } 
     1334#line 1335 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14721335    break; 
    14731336 
    14741337  case 9: 
    1475  
    1476 /* Line 1455 of yacc.c  */ 
    1477 #line 68 "yacc_parser.yacc" 
    1478     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"div") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1338#line 69 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1339    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } 
     1340#line 1341 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14791341    break; 
    14801342 
    14811343  case 10: 
    1482  
    1483 /* Line 1455 of yacc.c  */ 
    1484 #line 69 "yacc_parser.yacc" 
    1485     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalar,"neg") ;  (yyval.node)->addChild((yyvsp[(2) - (2)].node)); ;} 
     1344#line 70 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1345    { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } 
     1346#line 1347 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14861347    break; 
    14871348 
    14881349  case 11: 
    1489  
    1490 /* Line 1455 of yacc.c  */ 
    1491 #line 70 "yacc_parser.yacc" 
    1492     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"pow") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1350#line 71 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1351    { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } 
     1352#line 1353 "yacc_parser.cpp" /* yacc.c:1646  */ 
    14931353    break; 
    14941354 
    14951355  case 12: 
    1496  
    1497 /* Line 1455 of yacc.c  */ 
    1498 #line 71 "yacc_parser.yacc" 
    1499     { (yyval.node)=(yyvsp[(2) - (3)].node) ; ;} 
     1356#line 72 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1357    { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } 
     1358#line 1359 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15001359    break; 
    15011360 
    15021361  case 13: 
    1503  
    1504 /* Line 1455 of yacc.c  */ 
    1505 #line 72 "yacc_parser.yacc" 
    1506     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalar,(yyvsp[(1) - (4)].str)) ; (yyval.node)->addChild((yyvsp[(3) - (4)].node)) ; delete (yyvsp[(1) - (4)].str) ;} 
     1362#line 73 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1363    { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } 
     1364#line 1365 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15071365    break; 
    15081366 
    15091367  case 14: 
    1510  
    1511 /* Line 1455 of yacc.c  */ 
    1512 #line 76 "yacc_parser.yacc" 
    1513     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::fieldInstant,(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str);} 
     1368#line 77 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1369    { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1370#line 1371 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15141371    break; 
    15151372 
    15161373  case 15: 
    1517  
    1518 /* Line 1455 of yacc.c  */ 
    1519 #line 77 "yacc_parser.yacc" 
    1520     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::fieldAverage,(yyvsp[(1) - (1)].str)); delete (yyvsp[(1) - (1)].str);} 
     1374#line 78 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1375    { /* TODO: Use temporal operation */ (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 
     1376#line 1377 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15211377    break; 
    15221378 
    15231379  case 16: 
    1524  
    1525 /* Line 1455 of yacc.c  */ 
    1526 #line 78 "yacc_parser.yacc" 
    1527     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"add") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1380#line 79 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1381    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } 
     1382#line 1383 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15281383    break; 
    15291384 
    15301385  case 17: 
    1531  
    1532 /* Line 1455 of yacc.c  */ 
    1533 #line 79 "yacc_parser.yacc" 
    1534     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"minus") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1386#line 80 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1387    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } 
     1388#line 1389 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15351389    break; 
    15361390 
    15371391  case 18: 
    1538  
    1539 /* Line 1455 of yacc.c  */ 
    1540 #line 80 "yacc_parser.yacc" 
    1541     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"mult") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1392#line 81 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1393    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } 
     1394#line 1395 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15421395    break; 
    15431396 
    15441397  case 19: 
    1545  
    1546 /* Line 1455 of yacc.c  */ 
    1547 #line 81 "yacc_parser.yacc" 
    1548     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"div") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1398#line 82 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1399    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } 
     1400#line 1401 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15491401    break; 
    15501402 
    15511403  case 20: 
    1552  
    1553 /* Line 1455 of yacc.c  */ 
    1554 #line 82 "yacc_parser.yacc" 
    1555     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opField,"neg") ; (yyval.node)->addChild((yyvsp[(2) - (2)].node));;} 
     1404#line 83 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1405    { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } 
     1406#line 1407 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15561407    break; 
    15571408 
    15581409  case 21: 
    1559  
    1560 /* Line 1455 of yacc.c  */ 
    1561 #line 83 "yacc_parser.yacc" 
    1562     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"pow") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1410#line 84 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1411    { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } 
     1412#line 1413 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15631413    break; 
    15641414 
    15651415  case 22: 
    1566  
    1567 /* Line 1455 of yacc.c  */ 
    1568 #line 84 "yacc_parser.yacc" 
    1569     { (yyval.node)=(yyvsp[(2) - (3)].node) ;;} 
     1416#line 85 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1417    { (yyval.filterNode) = (yyvsp[-1].filterNode); } 
     1418#line 1419 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15701419    break; 
    15711420 
    15721421  case 23: 
    1573  
    1574 /* Line 1455 of yacc.c  */ 
    1575 #line 85 "yacc_parser.yacc" 
    1576     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"add") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1422#line 86 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1423    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } 
     1424#line 1425 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15771425    break; 
    15781426 
    15791427  case 24: 
    1580  
    1581 /* Line 1455 of yacc.c  */ 
    1582 #line 86 "yacc_parser.yacc" 
    1583     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"add") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1428#line 87 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1429    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } 
     1430#line 1431 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15841431    break; 
    15851432 
    15861433  case 25: 
    1587  
    1588 /* Line 1455 of yacc.c  */ 
    1589 #line 87 "yacc_parser.yacc" 
    1590     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"minus") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1434#line 88 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1435    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } 
     1436#line 1437 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15911437    break; 
    15921438 
    15931439  case 26: 
    1594  
    1595 /* Line 1455 of yacc.c  */ 
    1596 #line 88 "yacc_parser.yacc" 
    1597     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"minus") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1440#line 89 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1441    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } 
     1442#line 1443 "yacc_parser.cpp" /* yacc.c:1646  */ 
    15981443    break; 
    15991444 
    16001445  case 27: 
    1601  
    1602 /* Line 1455 of yacc.c  */ 
    1603 #line 89 "yacc_parser.yacc" 
    1604     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"mult") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1446#line 90 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1447    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } 
     1448#line 1449 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16051449    break; 
    16061450 
    16071451  case 28: 
    1608  
    1609 /* Line 1455 of yacc.c  */ 
    1610 #line 90 "yacc_parser.yacc" 
    1611     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"mult") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1452#line 91 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1453    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } 
     1454#line 1455 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16121455    break; 
    16131456 
    16141457  case 29: 
    1615  
    1616 /* Line 1455 of yacc.c  */ 
    1617 #line 91 "yacc_parser.yacc" 
    1618     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"div") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1458#line 92 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1459    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } 
     1460#line 1461 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16191461    break; 
    16201462 
    16211463  case 30: 
    1622  
    1623 /* Line 1455 of yacc.c  */ 
    1624 #line 92 "yacc_parser.yacc" 
    1625     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"div") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1464#line 93 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1465    { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } 
     1466#line 1467 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16261467    break; 
    16271468 
    16281469  case 31: 
    1629  
    1630 /* Line 1455 of yacc.c  */ 
    1631 #line 93 "yacc_parser.yacc" 
    1632     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"pow") ; (yyval.node)->addChild((yyvsp[(1) - (3)].node)) ; (yyval.node)->addChild((yyvsp[(3) - (3)].node)); ;} 
     1470#line 94 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1471    { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } 
     1472#line 1473 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16331473    break; 
    16341474 
    16351475  case 32: 
    1636  
    1637 /* Line 1455 of yacc.c  */ 
    1638 #line 94 "yacc_parser.yacc" 
    1639     { (yyval.node)=new CSimpleNodeExpr(CSimpleNodeExpr::opField,(yyvsp[(1) - (4)].str)) ;  (yyval.node)->addChild((yyvsp[(3) - (4)].node)) ; delete (yyvsp[(1) - (4)].str);} 
    1640     break; 
    1641  
    1642  
    1643  
    1644 /* Line 1455 of yacc.c  */ 
    1645 #line 1644 "yacc_parser.cpp" 
     1476#line 95 "yacc_parser.yacc" /* yacc.c:1646  */ 
     1477    { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } 
     1478#line 1479 "yacc_parser.cpp" /* yacc.c:1646  */ 
     1479    break; 
     1480 
     1481 
     1482#line 1483 "yacc_parser.cpp" /* yacc.c:1646  */ 
    16461483      default: break; 
    16471484    } 
     1485  /* User semantic actions sometimes alter yychar, and that requires 
     1486     that yytoken be updated with the new translation.  We take the 
     1487     approach of translating immediately before every use of yytoken. 
     1488     One alternative is translating here after every semantic action, 
     1489     but that translation would be missed if the semantic action invokes 
     1490     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or 
     1491     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an 
     1492     incorrect destructor might then be invoked immediately.  In the 
     1493     case of YYERROR or YYBACKUP, subsequent parser actions might lead 
     1494     to an incorrect destructor call or verbose syntax error message 
     1495     before the lookahead is translated.  */ 
    16481496  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); 
    16491497 
     
    16541502  *++yyvsp = yyval; 
    16551503 
    1656   /* Now `shift' the result of the reduction.  Determine what state 
     1504  /* Now 'shift' the result of the reduction.  Determine what state 
    16571505     that goes to, based on the state we popped back to and the rule 
    16581506     number reduced by.  */ 
     
    16691517 
    16701518 
    1671 /*------------------------------------. 
    1672 | yyerrlab -- here on detecting error | 
    1673 `------------------------------------*/ 
     1519/*--------------------------------------. 
     1520| yyerrlab -- here on detecting error. | 
     1521`--------------------------------------*/ 
    16741522yyerrlab: 
     1523  /* Make sure we have latest lookahead translation.  See comments at 
     1524     user semantic actions for why this is necessary.  */ 
     1525  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); 
     1526 
    16751527  /* If not already recovering from an error, report this error.  */ 
    16761528  if (!yyerrstatus) 
     
    16801532      yyerror (YY_("syntax error")); 
    16811533#else 
     1534# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ 
     1535                                        yyssp, yytoken) 
    16821536      { 
    1683         YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); 
    1684         if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) 
    1685           { 
    1686             YYSIZE_T yyalloc = 2 * yysize; 
    1687             if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) 
    1688               yyalloc = YYSTACK_ALLOC_MAXIMUM; 
    1689             if (yymsg != yymsgbuf) 
    1690               YYSTACK_FREE (yymsg); 
    1691             yymsg = (char *) YYSTACK_ALLOC (yyalloc); 
    1692             if (yymsg) 
    1693               yymsg_alloc = yyalloc; 
    1694             else 
    1695               { 
    1696                 yymsg = yymsgbuf; 
    1697                 yymsg_alloc = sizeof yymsgbuf; 
    1698               } 
    1699           } 
    1700  
    1701         if (0 < yysize && yysize <= yymsg_alloc) 
    1702           { 
    1703             (void) yysyntax_error (yymsg, yystate, yychar); 
    1704             yyerror (yymsg); 
    1705           } 
    1706         else 
    1707           { 
    1708             yyerror (YY_("syntax error")); 
    1709             if (yysize != 0) 
    1710               goto yyexhaustedlab; 
    1711           } 
     1537        char const *yymsgp = YY_("syntax error"); 
     1538        int yysyntax_error_status; 
     1539        yysyntax_error_status = YYSYNTAX_ERROR; 
     1540        if (yysyntax_error_status == 0) 
     1541          yymsgp = yymsg; 
     1542        else if (yysyntax_error_status == 1) 
     1543          { 
     1544            if (yymsg != yymsgbuf) 
     1545              YYSTACK_FREE (yymsg); 
     1546            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); 
     1547            if (!yymsg) 
     1548              { 
     1549                yymsg = yymsgbuf; 
     1550                yymsg_alloc = sizeof yymsgbuf; 
     1551                yysyntax_error_status = 2; 
     1552              } 
     1553            else 
     1554              { 
     1555                yysyntax_error_status = YYSYNTAX_ERROR; 
     1556                yymsgp = yymsg; 
     1557              } 
     1558          } 
     1559        yyerror (yymsgp); 
     1560        if (yysyntax_error_status == 2) 
     1561          goto yyexhaustedlab; 
    17121562      } 
     1563# undef YYSYNTAX_ERROR 
    17131564#endif 
    17141565    } 
     
    17191570    { 
    17201571      /* If just tried and failed to reuse lookahead token after an 
    1721         error, discard it.  */ 
     1572        error, discard it.  */ 
    17221573 
    17231574      if (yychar <= YYEOF) 
    1724         { 
    1725           /* Return failure if at end of input.  */ 
    1726           if (yychar == YYEOF) 
    1727             YYABORT; 
    1728         } 
     1575        { 
     1576          /* Return failure if at end of input.  */ 
     1577          if (yychar == YYEOF) 
     1578            YYABORT; 
     1579        } 
    17291580      else 
    1730         { 
    1731           yydestruct ("Error: discarding", 
    1732                       yytoken, &yylval); 
    1733           yychar = YYEMPTY; 
    1734         } 
     1581        { 
     1582          yydestruct ("Error: discarding", 
     1583                      yytoken, &yylval); 
     1584          yychar = YYEMPTY; 
     1585        } 
    17351586    } 
    17361587 
     
    17511602     goto yyerrorlab; 
    17521603 
    1753   /* Do not reclaim the symbols of the rule which action triggered 
     1604  /* Do not reclaim the symbols of the rule whose action triggered 
    17541605     this YYERROR.  */ 
    17551606  YYPOPSTACK (yylen); 
     
    17641615`-------------------------------------------------------------*/ 
    17651616yyerrlab1: 
    1766   yyerrstatus = 3;      /* Each real token shifted decrements this.  */ 
     1617  yyerrstatus = 3;      /* Each real token shifted decrements this.  */ 
    17671618 
    17681619  for (;;) 
    17691620    { 
    17701621      yyn = yypact[yystate]; 
    1771       if (yyn != YYPACT_NINF) 
    1772         { 
    1773           yyn += YYTERROR; 
    1774           if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 
    1775             { 
    1776               yyn = yytable[yyn]; 
    1777               if (0 < yyn) 
    1778                 break; 
    1779             } 
    1780         } 
     1622      if (!yypact_value_is_default (yyn)) 
     1623        { 
     1624          yyn += YYTERROR; 
     1625          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) 
     1626            { 
     1627              yyn = yytable[yyn]; 
     1628              if (0 < yyn) 
     1629                break; 
     1630            } 
     1631        } 
    17811632 
    17821633      /* Pop the current state because it cannot handle the error token.  */ 
    17831634      if (yyssp == yyss) 
    1784         YYABORT; 
     1635        YYABORT; 
    17851636 
    17861637 
    17871638      yydestruct ("Error: popping", 
    1788                   yystos[yystate], yyvsp); 
     1639                  yystos[yystate], yyvsp); 
    17891640      YYPOPSTACK (1); 
    17901641      yystate = *yyssp; 
     
    17921643    } 
    17931644 
     1645  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN 
    17941646  *++yyvsp = yylval; 
     1647  YY_IGNORE_MAYBE_UNINITIALIZED_END 
    17951648 
    17961649 
     
    18161669  goto yyreturn; 
    18171670 
    1818 #if !defined(yyoverflow) || YYERROR_VERBOSE 
     1671#if !defined yyoverflow || YYERROR_VERBOSE 
    18191672/*-------------------------------------------------. 
    18201673| yyexhaustedlab -- memory exhaustion comes here.  | 
     
    18281681yyreturn: 
    18291682  if (yychar != YYEMPTY) 
    1830      yydestruct ("Cleanup: discarding lookahead", 
    1831                  yytoken, &yylval); 
    1832   /* Do not reclaim the symbols of the rule which action triggered 
     1683    { 
     1684      /* Make sure we have latest lookahead translation.  See comments at 
     1685         user semantic actions for why this is necessary.  */ 
     1686      yytoken = YYTRANSLATE (yychar); 
     1687      yydestruct ("Cleanup: discarding lookahead", 
     1688                  yytoken, &yylval); 
     1689    } 
     1690  /* Do not reclaim the symbols of the rule whose action triggered 
    18331691     this YYABORT or YYACCEPT.  */ 
    18341692  YYPOPSTACK (yylen); 
     
    18371695    { 
    18381696      yydestruct ("Cleanup: popping", 
    1839                   yystos[*yyssp], yyvsp); 
     1697                  yystos[*yyssp], yyvsp); 
    18401698      YYPOPSTACK (1); 
    18411699    } 
     
    18481706    YYSTACK_FREE (yymsg); 
    18491707#endif 
    1850   /* Make sure YYID is used.  */ 
    1851   return YYID (yyresult); 
     1708  return yyresult; 
    18521709} 
    1853  
    1854  
    1855  
    1856 /* Line 1675 of yacc.c  */ 
    1857 #line 96 "yacc_parser.yacc" 
     1710#line 97 "yacc_parser.yacc" /* yacc.c:1906  */ 
    18581711 
    18591712 
    18601713extern "C" 
    18611714{ 
    1862   int yyerror(const char *s)  
     1715  int yyerror(const char *s) 
    18631716  { 
    1864     ERROR("int yyerror(const char *s)", <<"Parsing error :"<<s<<endl) ;  
     1717    ERROR("int yyerror(const char *s)", << "Parsing error: " << s << endl); 
    18651718  } 
    18661719} 
     
    18681721namespace xios 
    18691722{ 
    1870   CSimpleNodeExpr* parseExpr(const string& strExpr) 
     1723  IFilterExprNode* parseExpr(const string& strExpr) 
    18711724  { 
    1872     globalInputText=strExpr ; 
    1873     globalReadOffset=0 ; 
     1725    globalInputText = strExpr; 
     1726    globalReadOffset = 0; 
    18741727    yyparse(); 
    1875     return  parsed ; 
     1728    return parsed; 
    18761729  } 
    18771730} 
    18781731 
    18791732 
    1880  
  • XIOS/trunk/src/parse_expr/yacc_parser.hpp

    r501 r642  
     1/* A Bison parser, made by GNU Bison 3.0.2.  */ 
    12 
    2 /* A Bison parser, made by GNU Bison 2.4.1.  */ 
     3/* Bison interface for Yacc-like parsers in C 
    34 
    4 /* Skeleton interface for Bison's Yacc-like parsers in C 
    5     
    6       Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 
    7    Free Software Foundation, Inc. 
    8     
     5   Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 
     6 
    97   This program is free software: you can redistribute it and/or modify 
    108   it under the terms of the GNU General Public License as published by 
    119   the Free Software Foundation, either version 3 of the License, or 
    1210   (at your option) any later version. 
    13     
     11 
    1412   This program is distributed in the hope that it will be useful, 
    1513   but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1614   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1715   GNU General Public License for more details. 
    18     
     16 
    1917   You should have received a copy of the GNU General Public License 
    2018   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */ 
     
    2927   Bison output files to be licensed under the GNU General Public 
    3028   License without this special exception. 
    31     
     29 
    3230   This special exception was added by the Free Software Foundation in 
    3331   version 2.2 of Bison.  */ 
    3432 
     33#ifndef YY_YY_YACC_PARSER_HPP_INCLUDED 
     34# define YY_YY_YACC_PARSER_HPP_INCLUDED 
     35/* Debug traces.  */ 
     36#ifndef YYDEBUG 
     37# define YYDEBUG 0 
     38#endif 
     39#if YYDEBUG 
     40extern int yydebug; 
     41#endif 
    3542 
    36 /* Tokens.  */ 
     43/* Token type.  */ 
    3744#ifndef YYTOKENTYPE 
    3845# define YYTOKENTYPE 
    39    /* Put the tokens into the symbol table, so that GDB and other debuggers 
    40       know about them.  */ 
    41    enum yytokentype { 
    42      NUMBER = 258, 
    43      VAR = 259, 
    44      ID = 260, 
    45      AVERAGE = 261, 
    46      PLUS = 262, 
    47      MINUS = 263, 
    48      TIMES = 264, 
    49      DIVIDE = 265, 
    50      POWER = 266, 
    51      LEFT_PARENTHESIS = 267, 
    52      RIGHT_PARENTHESIS = 268, 
    53      END = 269, 
    54      NEG = 270 
    55    }; 
     46  enum yytokentype 
     47  { 
     48    NUMBER = 258, 
     49    VAR = 259, 
     50    ID = 260, 
     51    AVERAGE = 261, 
     52    PLUS = 262, 
     53    MINUS = 263, 
     54    TIMES = 264, 
     55    DIVIDE = 265, 
     56    POWER = 266, 
     57    LEFT_PARENTHESIS = 267, 
     58    RIGHT_PARENTHESIS = 268, 
     59    END = 269, 
     60    NEG = 270 
     61  }; 
     62#endif 
     63 
     64/* Value type.  */ 
     65#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 
     66typedef union YYSTYPE YYSTYPE; 
     67union YYSTYPE 
     68{ 
     69#line 35 "yacc_parser.yacc" /* yacc.c:1909  */ 
     70 
     71  std::string* str;                /* symbol table index */ 
     72  xios::IScalarExprNode* scalarNode; 
     73  xios::IFilterExprNode* filterNode; 
     74 
     75#line 76 "yacc_parser.hpp" /* yacc.c:1909  */ 
     76}; 
     77# define YYSTYPE_IS_TRIVIAL 1 
     78# define YYSTYPE_IS_DECLARED 1 
    5679#endif 
    5780 
    5881 
    59  
    60 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED 
    61 typedef union YYSTYPE 
    62 { 
    63  
    64 /* Line 1676 of yacc.c  */ 
    65 #line 36 "yacc_parser.yacc" 
    66  
    67     std::string* str ;                /* symbol table index */ 
    68     CSimpleNodeExpr* node ; 
    69  
    70  
    71  
    72 /* Line 1676 of yacc.c  */ 
    73 #line 74 "yacc_parser.hpp" 
    74 } YYSTYPE; 
    75 # define YYSTYPE_IS_TRIVIAL 1 
    76 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ 
    77 # define YYSTYPE_IS_DECLARED 1 
    78 #endif 
    79  
    8082extern YYSTYPE yylval; 
    8183 
     84int yyparse (void); 
    8285 
     86#endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */ 
  • XIOS/trunk/src/parse_expr/yacc_parser.yacc

    r501 r642  
    11%{ 
    2 #include "simple_node_expr.hpp" 
     2#include "filter_expr_node.hpp" 
    33#include <string> 
    44#include <iostream> 
    55#include "exception.hpp" 
    66 
    7 using namespace std ; 
    8 using namespace xios ; 
     7using namespace std; 
     8using namespace xios; 
    99 
    1010extern "C" 
     
    1212  int yyparse(void); 
    1313  int yylex(void); 
    14   int yyerror(const char *s) ; 
     14  int yyerror(const char *s); 
    1515} 
    1616 
    17    CSimpleNodeExpr* parsed ; 
    18    std::string globalInputText; 
    19    int globalReadOffset=0; 
    20     
    21    int readInputForLexer( char *buffer, int *numBytesRead, int maxBytesToRead ) 
    22    { 
    23     int numBytesToRead = maxBytesToRead; 
    24     int bytesRemaining = globalInputText.length()-globalReadOffset; 
    25     int i; 
    26     if ( numBytesToRead > bytesRemaining ) numBytesToRead = bytesRemaining; 
    27     for ( i = 0; i < numBytesToRead; i++ ) buffer[i] = globalInputText.c_str()[globalReadOffset+i]; 
     17  IFilterExprNode* parsed; 
     18  std::string globalInputText; 
     19  size_t globalReadOffset = 0; 
     20 
     21  int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) 
     22  { 
     23    size_t numBytesToRead = maxBytesToRead; 
     24    size_t bytesRemaining = globalInputText.length()-globalReadOffset; 
     25    size_t i; 
     26    if (numBytesToRead > bytesRemaining) numBytesToRead = bytesRemaining; 
     27    for (i = 0; i < numBytesToRead; i++) buffer[i] = globalInputText.c_str()[globalReadOffset + i]; 
    2828    *numBytesRead = numBytesToRead; 
    2929    globalReadOffset += numBytesToRead; 
    3030    return 0; 
    31    } 
    32  
     31  } 
    3332%} 
    3433 
    3534%union 
    3635{ 
    37     std::string* str ;                /* symbol table index */ 
    38     CSimpleNodeExpr* node ; 
     36  std::string* str;                /* symbol table index */ 
     37  xios::IScalarExprNode* scalarNode; 
     38  xios::IFilterExprNode* filterNode; 
    3939}; 
    4040 
    4141%token <str> NUMBER 
    42 %token <str>  VAR ID AVERAGE 
     42%token <str> VAR ID AVERAGE 
    4343%token PLUS MINUS TIMES DIVIDE POWER 
    4444%token LEFT_PARENTHESIS RIGHT_PARENTHESIS 
     
    5050%right POWER 
    5151 
    52 %type <node> Line Expression Field_expr 
     52%type <scalarNode> Expression 
     53%type <filterNode> Line Field_expr 
    5354%start Line 
    5455%% 
     
    5657 
    5758Line: 
    58      END                           { } 
    59    | Field_expr END {  parsed=$1 ;} 
    60    ; 
     59     END            { /* Nothing to do */ } 
     60   | Field_expr END { parsed = $1; } 
     61  ; 
    6162 
    6263Expression: 
    63             NUMBER { $$=new CSimpleNodeExpr(CSimpleNodeExpr::scalarDouble,$1); delete $1 } 
    64           | VAR    { $$=new CSimpleNodeExpr(CSimpleNodeExpr::scalarVariable,$1) ; delete $1} 
    65           | Expression PLUS Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"add") ; $$->addChild($1) ; $$->addChild($3); } 
    66           | Expression MINUS Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"minus") ; $$->addChild($1) ; $$->addChild($3); } 
    67           | Expression TIMES Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"mult") ; $$->addChild($1) ; $$->addChild($3); } 
    68           | Expression DIVIDE Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"div") ; $$->addChild($1) ; $$->addChild($3); } 
    69           | MINUS Expression %prec NEG { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalar,"neg") ;  $$->addChild($2); } 
    70           | Expression POWER Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarScalar,"pow") ; $$->addChild($1) ; $$->addChild($3); } 
    71           | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$=$2 ; } 
    72           | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalar,$1) ; $$->addChild($3) ; delete $1 } 
     64            NUMBER { $$ = new CScalarValExprNode(*$1); delete $1; } 
     65          | VAR    { $$ = new CScalarVarExprNode(*$1); delete $1; } 
     66          | Expression PLUS Expression   { $$ = new CScalarBinaryOpExprNode($1, "add", $3); } 
     67          | Expression MINUS Expression  { $$ = new CScalarBinaryOpExprNode($1, "minus", $3); } 
     68          | Expression TIMES Expression  { $$ = new CScalarBinaryOpExprNode($1, "mult", $3); } 
     69          | Expression DIVIDE Expression { $$ = new CScalarBinaryOpExprNode($1, "div", $3); } 
     70          | MINUS Expression %prec NEG   { $$ = new CScalarUnaryOpExprNode("neg", $2); } 
     71          | Expression POWER Expression  { $$ = new CScalarBinaryOpExprNode($1, "pow", $3); } 
     72          | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS    { $$ = $2; } 
     73          | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; } 
    7374          ; 
    7475 
    7576Field_expr: 
    76             ID    { $$=new CSimpleNodeExpr(CSimpleNodeExpr::fieldInstant,$1); delete $1} 
    77           | AVERAGE  { $$=new CSimpleNodeExpr(CSimpleNodeExpr::fieldAverage,$1); delete $1} 
    78           | Field_expr PLUS Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"add") ; $$->addChild($1) ; $$->addChild($3); } 
    79           | Field_expr MINUS Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"minus") ; $$->addChild($1) ; $$->addChild($3); } 
    80           | Field_expr TIMES Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"mult") ; $$->addChild($1) ; $$->addChild($3); } 
    81           | Field_expr DIVIDE Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"div") ; $$->addChild($1) ; $$->addChild($3); } 
    82           | MINUS Field_expr %prec NEG { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opField,"neg") ; $$->addChild($2);} 
    83           | Field_expr POWER Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldField,"pow") ; $$->addChild($1) ; $$->addChild($3); } 
    84           | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS       { $$=$2 ;} 
    85           | Field_expr PLUS Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"add") ; $$->addChild($1) ; $$->addChild($3); } 
    86           | Expression PLUS Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"add") ; $$->addChild($1) ; $$->addChild($3); } 
    87           | Field_expr MINUS Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"minus") ; $$->addChild($1) ; $$->addChild($3); } 
    88           | Expression MINUS Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"minus") ; $$->addChild($1) ; $$->addChild($3); } 
    89           | Field_expr TIMES Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"mult") ; $$->addChild($1) ; $$->addChild($3); } 
    90           | Expression TIMES Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"mult") ; $$->addChild($1) ; $$->addChild($3); } 
    91           | Field_expr DIVIDE Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"div") ; $$->addChild($1) ; $$->addChild($3); } 
    92           | Expression DIVIDE Field_expr { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opScalarField,"div") ; $$->addChild($1) ; $$->addChild($3); } 
    93           | Field_expr POWER Expression { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opFieldScalar,"pow") ; $$->addChild($1) ; $$->addChild($3); } 
    94           | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$=new CSimpleNodeExpr(CSimpleNodeExpr::opField,$1) ;  $$->addChild($3) ; delete $1} 
     77            ID      { $$ = new CFilterFieldExprNode(*$1); delete $1; } 
     78          | AVERAGE { /* TODO: Use temporal operation */ $$ = new CFilterFieldExprNode(*$1); delete $1; } 
     79          | Field_expr PLUS Field_expr   { $$ = new CFilterFieldFieldOpExprNode($1, "add", $3); } 
     80          | Field_expr MINUS Field_expr  { $$ = new CFilterFieldFieldOpExprNode($1, "minus", $3); } 
     81          | Field_expr TIMES Field_expr  { $$ = new CFilterFieldFieldOpExprNode($1, "mult", $3); } 
     82          | Field_expr DIVIDE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "div", $3); } 
     83          | MINUS Field_expr %prec NEG   { $$ = new CFilterUnaryOpExprNode("neg", $2); } 
     84          | Field_expr POWER Field_expr  { $$ = new CFilterFieldFieldOpExprNode($1, "pow", $3); } 
     85          | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS       { $$ = $2; } 
     86          | Field_expr PLUS Expression   { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); } 
     87          | Expression PLUS Field_expr   { $$ = new CFilterScalarFieldOpExprNode($1, "add", $3); } 
     88          | Field_expr MINUS Expression  { $$ = new CFilterFieldScalarOpExprNode($1, "minus", $3); } 
     89          | Expression MINUS Field_expr  { $$ = new CFilterScalarFieldOpExprNode($1, "minus", $3); } 
     90          | Field_expr TIMES Expression  { $$ = new CFilterFieldScalarOpExprNode($1, "mult", $3); } 
     91          | Expression TIMES Field_expr  { $$ = new CFilterScalarFieldOpExprNode($1, "mult", $3); } 
     92          | Field_expr DIVIDE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "div", $3); } 
     93          | Expression DIVIDE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "div", $3); } 
     94          | Field_expr POWER Expression  { $$ = new CFilterFieldScalarOpExprNode($1, "pow", $3); } 
     95          | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; } 
    9596          ; 
    9697%% 
     
    9899extern "C" 
    99100{ 
    100   int yyerror(const char *s)  
     101  int yyerror(const char *s) 
    101102  { 
    102     ERROR("int yyerror(const char *s)", <<"Parsing error :"<<s<<endl) ;  
     103    ERROR("int yyerror(const char *s)", << "Parsing error: " << s << endl); 
    103104  } 
    104105} 
     
    106107namespace xios 
    107108{ 
    108   CSimpleNodeExpr* parseExpr(const string& strExpr) 
     109  IFilterExprNode* parseExpr(const string& strExpr) 
    109110  { 
    110     globalInputText=strExpr ; 
    111     globalReadOffset=0 ; 
     111    globalInputText = strExpr; 
     112    globalReadOffset = 0; 
    112113    yyparse(); 
    113     return  parsed ; 
     114    return parsed; 
    114115  } 
    115116} 
Note: See TracChangeset for help on using the changeset viewer.