Constraint_y.cpp

Go to the documentation of this file.
00001 
00002   // Constraint_y.cpp,v 1.12 2006/03/14 06:14:35 jtc Exp
00003 // ========================================================================
00004 //
00005 // = LIBRARY
00006 //    orbsvcs
00007 // 
00008 // = FILENAME
00009 //    constraint.y
00010 //
00011 // = AUTHOR
00012 //    Seth Widoff <sbw1@cs.wustl.edu>
00013 //
00014 // ========================================================================
00015 
00016 #include "ace/OS_NS_string.h"
00017 #include "orbsvcs/Trader/Constraint_Interpreter.h"
00018 #include "orbsvcs/Trader/Constraint_Nodes.h"
00019 
00020 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 //#define YYDEBUG 1
00023 # define TAO_GT 257
00024 # define TAO_GE 258
00025 # define TAO_LT 259
00026 # define TAO_LE 260
00027 # define TAO_EQ 261
00028 # define TAO_NE 262
00029 # define TAO_EXIST 263
00030 # define TAO_AND 264
00031 # define TAO_OR 265
00032 # define TAO_NOT 266
00033 # define TAO_IN 267
00034 # define TAO_TWIDDLE 268
00035 # define TAO_BOOLEAN 269
00036 # define TAO_PLUS 270
00037 # define TAO_MINUS 271
00038 # define TAO_MULT 272
00039 # define TAO_DIV 273
00040 # define TAO_UMINUS 274
00041 # define TAO_NUMBER 275
00042 # define TAO_RPAREN 276
00043 # define TAO_LPAREN 277
00044 # define TAO_IDENT 278
00045 # define TAO_STRING 279
00046 # define TAO_UNKNOWN 280
00047 # define TAO_UNSIGNED 281
00048 # define TAO_SIGNED 282
00049 # define TAO_DOUBLE 283
00050 # define TAO_CONSTRAINT 284
00051 # define TAO_SEQUENCE 285
00052 # define TAO_WITH 286
00053 # define TAO_MAX 287
00054 # define TAO_MIN 288
00055 # define TAO_FIRST 289
00056 # define TAO_RANDOM 290
00057 
00058 #ifdef __cplusplus
00059 
00060 #ifndef yyerror
00061         void yyerror(const char *);
00062 #endif
00063 
00064 #ifndef yylex
00065 #ifdef __EXTERN_C__
00066         extern "C" { int yylex(void); }
00067 #else
00068         int yylex(void);
00069 #endif
00070 #endif
00071         int yyparse(void);
00072 
00073 #endif
00074 #define yyclearin yychar = -1
00075 #define yyerrok yyerrflag = 0
00076 extern int yychar;
00077 extern int yyerrflag;
00078 YYSTYPE yylval;
00079 YYSTYPE yyval;
00080 typedef int yytabelem;
00081 #ifndef YYMAXDEPTH
00082 #define YYMAXDEPTH 150
00083 #endif
00084 #if YYMAXDEPTH > 0
00085 int yy_yys[YYMAXDEPTH], *yys = yy_yys;
00086 YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
00087 #else   /* user does initial allocation */
00088 int *yys;
00089 YYSTYPE *yyv;
00090 #endif
00091 static int yymaxdepth = YYMAXDEPTH;
00092 # define YYERRCODE 256
00093 
00094 
00095 
00096 
00097 //extern int yydebug = 1;
00098 yytabelem yyexca[] ={
00099 -1, 1,
00100         0, -1,
00101         -2, 0,
00102         };
00103 # define YYNPROD 38
00104 # define YYLAST 93
00105 yytabelem yyact[]={
00106 
00107     19,    54,    44,    16,    45,    19,    24,    37,    22,    38,
00108     39,    24,    21,    22,    18,    20,    23,    21,    25,    18,
00109     20,    23,    36,     7,     6,     5,     8,     9,    19,    60,
00110     26,    16,    40,    41,    24,    25,    22,    38,    39,    15,
00111     21,    11,    18,    20,    23,    32,    33,    34,    35,    30,
00112     31,    14,    10,    17,    13,    12,     4,     3,     1,     2,
00113      0,     0,     0,     0,     0,    27,    28,    29,     0,     0,
00114     42,     0,    48,    49,    50,    51,    52,    53,    43,    47,
00115     58,    59,    46,     0,     0,     0,     0,     0,     0,     0,
00116     56,    57,    55 };
00117 yytabelem yypact[]={
00118 
00119   -263,-10000000,  -230,-10000000,  -234,  -235,  -235,  -235,-10000000,-10000000,
00120 -10000000,  -212,  -245,  -261,  -240,-10000000,  -258,-10000000,  -235,  -276,
00121 -10000000,-10000000,  -271,-10000000,-10000000,  -235,  -235,  -230,  -230,  -230,
00122   -235,  -235,  -235,  -235,  -235,  -235,  -277,  -235,  -235,  -235,
00123   -235,  -235,-10000000,  -247,-10000000,-10000000,  -234,-10000000,-10000000,-10000000,
00124 -10000000,-10000000,-10000000,-10000000,-10000000,  -233,  -240,  -240,-10000000,-10000000,
00125 -10000000 };
00126 yytabelem yypgo[]={
00127 
00128      0,    58,    57,    59,    56,    52,    41,    55,    54,    51,
00129     39,    53 };
00130 yytabelem yyr1[]={
00131 
00132      0,     1,     1,     2,     2,     2,     2,     2,     3,     3,
00133      4,     4,     5,     5,     5,     5,     5,     5,     5,     6,
00134      6,     7,     7,     8,     8,     8,     9,     9,     9,    10,
00135     10,    11,    11,    11,    11,    11,    11,    11 };
00136 yytabelem yyr2[]={
00137 
00138      0,     3,     3,     5,     5,     5,     3,     3,     7,     3,
00139      7,     3,     7,     7,     7,     7,     7,     7,     3,     7,
00140      3,     7,     3,     7,     7,     3,     7,     7,     3,     5,
00141      3,     7,     5,     3,     3,     5,     3,     3 };
00142 yytabelem yychk[]={
00143 
00144 -10000000,    -1,    -3,    -2,    -4,   288,   287,   286,   289,   290,
00145     -5,    -6,    -7,    -8,    -9,   -10,   266,   -11,   277,   263,
00146    278,   275,   271,   279,   269,   265,   264,    -3,    -3,    -3,
00147    261,   262,   257,   258,   259,   260,   267,   268,   270,   271,
00148    272,   273,   -11,    -3,   278,   275,    -4,    -5,    -6,    -6,
00149     -6,    -6,    -6,    -6,   278,    -8,    -9,    -9,   -10,   -10,
00150    276 };
00151 yytabelem yydef[]={
00152 
00153      0,    -2,     1,     2,     9,     0,     0,     0,     6,     7,
00154     11,    18,    20,    22,    25,    28,     0,    30,     0,     0,
00155     33,    34,     0,    36,    37,     0,     0,     3,     4,     5,
00156      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
00157      0,     0,    29,     0,    32,    35,     8,    10,    12,    13,
00158     14,    15,    16,    17,    19,    21,    23,    24,    26,    27,
00159     31 };
00160 typedef struct
00161 #ifdef __cplusplus
00162         yytoktype
00163 #endif
00164 { char *t_name; int t_val; } yytoktype;
00165 #ifndef YYDEBUG
00166 #       define YYDEBUG  0       /* don't allow debugging */
00167 #endif
00168 
00169 #if YYDEBUG
00170 
00171 yytoktype yytoks[] =
00172 {
00173         "TAO_GT",       257,
00174         "TAO_GE",       258,
00175         "TAO_LT",       259,
00176         "TAO_LE",       260,
00177         "TAO_EQ",       261,
00178         "TAO_NE",       262,
00179         "TAO_EXIST",    263,
00180         "TAO_AND",      264,
00181         "TAO_OR",       265,
00182         "TAO_NOT",      266,
00183         "TAO_IN",       267,
00184         "TAO_TWIDDLE",  268,
00185         "TAO_BOOLEAN",  269,
00186         "TAO_PLUS",     270,
00187         "TAO_MINUS",    271,
00188         "TAO_MULT",     272,
00189         "TAO_DIV",      273,
00190         "TAO_UMINUS",   274,
00191         "TAO_NUMBER",   275,
00192         "TAO_RPAREN",   276,
00193         "TAO_LPAREN",   277,
00194         "TAO_IDENT",    278,
00195         "TAO_STRING",   279,
00196         "TAO_UNKNOWN",  280,
00197         "TAO_UNSIGNED", 281,
00198         "TAO_SIGNED",   282,
00199         "TAO_DOUBLE",   283,
00200         "TAO_CONSTRAINT",       284,
00201         "TAO_SEQUENCE", 285,
00202         "TAO_WITH",     286,
00203         "TAO_MAX",      287,
00204         "TAO_MIN",      288,
00205         "TAO_FIRST",    289,
00206         "TAO_RANDOM",   290,
00207         "-unknown-",    -1      /* ends search */
00208 };
00209 
00210 char * yyreds[] =
00211 {
00212         "-no such reduction-",
00213         "constraint : bool_or",
00214         "constraint : preference",
00215         "preference : TAO_MIN bool_or",
00216         "preference : TAO_MAX bool_or",
00217         "preference : TAO_WITH bool_or",
00218         "preference : TAO_FIRST",
00219         "preference : TAO_RANDOM",
00220         "bool_or : bool_or TAO_OR bool_and",
00221         "bool_or : bool_and",
00222         "bool_and : bool_and TAO_AND bool_compare",
00223         "bool_and : bool_compare",
00224         "bool_compare : expr_in TAO_EQ expr_in",
00225         "bool_compare : expr_in TAO_NE expr_in",
00226         "bool_compare : expr_in TAO_GT expr_in",
00227         "bool_compare : expr_in TAO_GE expr_in",
00228         "bool_compare : expr_in TAO_LT expr_in",
00229         "bool_compare : expr_in TAO_LE expr_in",
00230         "bool_compare : expr_in",
00231         "expr_in : expr_twiddle TAO_IN TAO_IDENT",
00232         "expr_in : expr_twiddle",
00233         "expr_twiddle : expr TAO_TWIDDLE expr",
00234         "expr_twiddle : expr",
00235         "expr : expr TAO_PLUS term",
00236         "expr : expr TAO_MINUS term",
00237         "expr : term",
00238         "term : term TAO_MULT factor_not",
00239         "term : term TAO_DIV factor_not",
00240         "term : factor_not",
00241         "factor_not : TAO_NOT factor",
00242         "factor_not : factor",
00243         "factor : TAO_LPAREN bool_or TAO_RPAREN",
00244         "factor : TAO_EXIST TAO_IDENT",
00245         "factor : TAO_IDENT",
00246         "factor : TAO_NUMBER",
00247         "factor : TAO_MINUS TAO_NUMBER",
00248         "factor : TAO_STRING",
00249         "factor : TAO_BOOLEAN",
00250 };
00251 #endif /* YYDEBUG */
00252 
00253 /*
00254  * Copyright (c) 1993 by Sun Microsystems, Inc.
00255  */
00256 
00257 //#pragma ident "@(#)yaccpar    6.12    93/06/07 SMI"
00258 
00259 /*
00260 ** Skeleton parser driver for yacc output
00261 */
00262 
00263 /*
00264 ** yacc user known macros and defines
00265 */
00266 #define YYERROR         goto yyerrlab
00267 #define YYACCEPT        return(0)
00268 #define YYABORT         return(1)
00269 #define YYBACKUP( newtoken, newvalue )\
00270 {\
00271         if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
00272         {\
00273                 yyerror( "syntax error - cannot backup" );\
00274                 goto yyerrlab;\
00275         }\
00276         yychar = newtoken;\
00277         yystate = *yyps;\
00278         yylval = newvalue;\
00279         goto yynewstate;\
00280 }
00281 #define YYRECOVERING()  (!!yyerrflag)
00282 #define YYNEW(type)     malloc(sizeof(type) * yynewmax)
00283 #define YYCOPY(to, from, type) \
00284         (type *) ACE_OS::memcpy(to, (char *) from, yynewmax * sizeof(type))
00285 #define YYENLARGE( from, type) \
00286         (type *) realloc((char *) from, yynewmax * sizeof(type))
00287 #ifndef YYDEBUG
00288 #       define YYDEBUG  1       /* make debugging available */
00289 #endif
00290 
00291 /*
00292 ** user known globals
00293 */
00294 int yydebug;                    /* set to 1 to get debugging */
00295 
00296 /*
00297 ** driver internal defines
00298 */
00299 #define YYFLAG          (-10000000)
00300 
00301 /*
00302 ** global variables used by the parser
00303 */
00304 YYSTYPE *yypv;                  /* top of value stack */
00305 int *yyps;                      /* top of state stack */
00306 
00307 int yystate;                    /* current state */
00308 int yytmp;                      /* extra var (lasts between blocks) */
00309 
00310 int yynerrs;                    /* number of errors */
00311 int yyerrflag;                  /* error recovery flag */
00312 int yychar;                     /* current input token number */
00313 
00314 
00315 
00316 #ifdef YYNMBCHARS
00317 #define YYLEX()         yycvtok(yylex())
00318 /*
00319 ** yycvtok - return a token if i is a wchar_t value that exceeds 255.
00320 **      If i<255, i itself is the token.  If i>255 but the neither 
00321 **      of the 30th or 31st bit is on, i is already a token.
00322 */
00323 #if defined(__STDC__) || defined(__cplusplus)
00324 int yycvtok(int i)
00325 #else
00326 int yycvtok(i) int i;
00327 #endif
00328 {
00329         int first = 0;
00330         int last = YYNMBCHARS - 1;
00331         int mid;
00332         wchar_t j;
00333 
00334         if(i&0x60000000){/*Must convert to a token. */
00335                 if( yymbchars[last].character < i ){
00336                         return i;/*Giving up*/
00337                 }
00338                 while ((last>=first)&&(first>=0)) {/*Binary search loop*/
00339                         mid = (first+last)/2;
00340                         j = yymbchars[mid].character;
00341                         if( j==i ){/*Found*/ 
00342                                 return yymbchars[mid].tvalue;
00343                         }else if( j<i ){
00344                                 first = mid + 1;
00345                         }else{
00346                                 last = mid -1;
00347                         }
00348                 }
00349                 /*No entry in the table.*/
00350                 return i;/* Giving up.*/
00351         }else{/* i is already a token. */
00352                 return i;
00353         }
00354 }
00355 #else/*!YYNMBCHARS*/
00356 #define YYLEX()         yylex()
00357 #endif/*!YYNMBCHARS*/
00358 
00359 /*
00360 ** yyparse - return 0 if worked, 1 if syntax error not recovered from
00361 */
00362 #if defined(__STDC__) || defined(__cplusplus)
00363 int yyparse(void)
00364 #else
00365 int yyparse()
00366 #endif
00367 {
00368         register YYSTYPE *yypvt = 0;    /* top of value stack for $vars */
00369 
00370 #if defined(__cplusplus) || defined(lint)
00371 /*
00372         hacks to please C++ and lint - goto's inside switch should never be
00373         executed; yypvt is set to 0 to avoid "used before set" warning.
00374 */
00375         static int __yaccpar_lint_hack__ = 0;
00376         switch (__yaccpar_lint_hack__)
00377         {
00378                 case 1: goto yyerrlab;
00379                 case 2: goto yynewstate;
00380         }
00381         yypvt = 0;
00382 #endif
00383 
00384         /*
00385         ** Initialize externals - yyparse may be called more than once
00386         */
00387         yypv = &yyv[-1];
00388         yyps = &yys[-1];
00389         yystate = 0;
00390         yytmp = 0;
00391         yynerrs = 0;
00392         yyerrflag = 0;
00393         yychar = -1;
00394 
00395 #if YYMAXDEPTH <= 0
00396         if (yymaxdepth <= 0)
00397         {
00398                 if ((yymaxdepth = YYEXPAND(0)) <= 0)
00399                 {
00400                         yyerror("yacc initialization error");
00401                         YYABORT;
00402                 }
00403         }
00404 #endif
00405 
00406         {
00407                 register YYSTYPE *yy_pv;        /* top of value stack */
00408                 register int *yy_ps;            /* top of state stack */
00409                 register int yy_state;          /* current state */
00410                 register int  yy_n;             /* internal state number info */
00411         goto yystack;   /* moved from 6 lines above to here to please C++ */
00412 
00413                 /*
00414                 ** get globals into registers.
00415                 ** branch to here only if YYBACKUP was called.
00416                 */
00417         yynewstate:
00418                 yy_pv = yypv;
00419                 yy_ps = yyps;
00420                 yy_state = yystate;
00421                 goto yy_newstate;
00422 
00423                 /*
00424                 ** get globals into registers.
00425                 ** either we just started, or we just finished a reduction
00426                 */
00427         yystack:
00428                 yy_pv = yypv;
00429                 yy_ps = yyps;
00430                 yy_state = yystate;
00431 
00432                 /*
00433                 ** top of for (;;) loop while no reductions done
00434                 */
00435         yy_stack:
00436                 /*
00437                 ** put a state and value onto the stacks
00438                 */
00439 #if YYDEBUG
00440                 /*
00441                 ** if debugging, look up token value in list of value vs.
00442                 ** name pairs.  0 and negative (-1) are special values.
00443                 ** Note: linear search is used since time is not a real
00444                 ** consideration while debugging.
00445                 */
00446                 if ( yydebug )
00447                 {
00448                         register int yy_i;
00449 
00450                         printf( "State %d, token ", yy_state );
00451                         if ( yychar == 0 )
00452                                 printf( "end-of-file\n" );
00453                         else if ( yychar < 0 )
00454                                 printf( "-none-\n" );
00455                         else
00456                         {
00457                                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
00458                                         yy_i++ )
00459                                 {
00460                                         if ( yytoks[yy_i].t_val == yychar )
00461                                                 break;
00462                                 }
00463                                 printf( "%s\n", yytoks[yy_i].t_name );
00464                         }
00465                 }
00466 #endif /* YYDEBUG */
00467                 if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
00468                 {
00469                         /*
00470                         ** reallocate and recover.  Note that pointers
00471                         ** have to be reset, or bad things will happen
00472                         */
00473                         int yyps_index = (yy_ps - yys);
00474                         int yypv_index = (yy_pv - yyv);
00475                         int yypvt_index = (yypvt - yyv);
00476                         int yynewmax;
00477 #ifdef YYEXPAND
00478                         yynewmax = YYEXPAND(yymaxdepth);
00479 #else
00480                         yynewmax = 2 * yymaxdepth;      /* double table size */
00481                         if (yymaxdepth == YYMAXDEPTH)   /* first time growth */
00482                         {
00483                                 char *newyys = (char *)YYNEW(int);
00484                                 char *newyyv = (char *)YYNEW(YYSTYPE);
00485                                 if (newyys != 0 && newyyv != 0)
00486                                 {
00487                                         yys = YYCOPY(newyys, yys, int);
00488                                         yyv = YYCOPY(newyyv, yyv, YYSTYPE);
00489                                 }
00490                                 else
00491                                         yynewmax = 0;   /* failed */
00492                         }
00493                         else                            /* not first time */
00494                         {
00495                                 yys = YYENLARGE(yys, int);
00496                                 yyv = YYENLARGE(yyv, YYSTYPE);
00497                                 if (yys == 0 || yyv == 0)
00498                                         yynewmax = 0;   /* failed */
00499                         }
00500 #endif
00501                         if (yynewmax <= yymaxdepth)     /* tables not expanded */
00502                         {
00503                                 yyerror( "yacc stack overflow" );
00504                                 YYABORT;
00505                         }
00506                         yymaxdepth = yynewmax;
00507 
00508                         yy_ps = yys + yyps_index;
00509                         yy_pv = yyv + yypv_index;
00510                         yypvt = yyv + yypvt_index;
00511                 }
00512                 *yy_ps = yy_state;
00513                 *++yy_pv = yyval;
00514 
00515                 /*
00516                 ** we have a new state - find out what to do
00517                 */
00518         yy_newstate:
00519                 if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
00520                         goto yydefault;         /* simple state */
00521 #if YYDEBUG
00522                 /*
00523                 ** if debugging, need to mark whether new token grabbed
00524                 */
00525                 yytmp = yychar < 0;
00526 #endif
00527                 if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
00528                         yychar = 0;             /* reached EOF */
00529 #if YYDEBUG
00530                 if ( yydebug && yytmp )
00531                 {
00532                         register int yy_i;
00533 
00534                         printf( "Received token " );
00535                         if ( yychar == 0 )
00536                                 printf( "end-of-file\n" );
00537                         else if ( yychar < 0 )
00538                                 printf( "-none-\n" );
00539                         else
00540                         {
00541                                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
00542                                         yy_i++ )
00543                                 {
00544                                         if ( yytoks[yy_i].t_val == yychar )
00545                                                 break;
00546                                 }
00547                                 printf( "%s\n", yytoks[yy_i].t_name );
00548                         }
00549                 }
00550 #endif /* YYDEBUG */
00551                 if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
00552                         goto yydefault;
00553                 if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )  /*valid shift*/
00554                 {
00555                         yychar = -1;
00556                         yyval = yylval;
00557                         yy_state = yy_n;
00558                         if ( yyerrflag > 0 )
00559                                 yyerrflag--;
00560                         goto yy_stack;
00561                 }
00562 
00563         yydefault:
00564                 if ( ( yy_n = yydef[ yy_state ] ) == -2 )
00565                 {
00566 #if YYDEBUG
00567                         yytmp = yychar < 0;
00568 #endif
00569                         if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
00570                                 yychar = 0;             /* reached EOF */
00571 #if YYDEBUG
00572                         if ( yydebug && yytmp )
00573                         {
00574                                 register int yy_i;
00575 
00576                                 printf( "Received token " );
00577                                 if ( yychar == 0 )
00578                                         printf( "end-of-file\n" );
00579                                 else if ( yychar < 0 )
00580                                         printf( "-none-\n" );
00581                                 else
00582                                 {
00583                                         for ( yy_i = 0;
00584                                                 yytoks[yy_i].t_val >= 0;
00585                                                 yy_i++ )
00586                                         {
00587                                                 if ( yytoks[yy_i].t_val
00588                                                         == yychar )
00589                                                 {
00590                                                         break;
00591                                                 }
00592                                         }
00593                                         printf( "%s\n", yytoks[yy_i].t_name );
00594                                 }
00595                         }
00596 #endif /* YYDEBUG */
00597                         /*
00598                         ** look through exception table
00599                         */
00600                         {
00601                                 register int *yyxi = yyexca;
00602 
00603                                 while ( ( *yyxi != -1 ) ||
00604                                         ( yyxi[1] != yy_state ) )
00605                                 {
00606                                         yyxi += 2;
00607                                 }
00608                                 while ( ( *(yyxi += 2) >= 0 ) &&
00609                                         ( *yyxi != yychar ) )
00610                                         ;
00611                                 if ( ( yy_n = yyxi[1] ) < 0 )
00612                                         YYACCEPT;
00613                         }
00614                 }
00615 
00616                 /*
00617                 ** check for syntax error
00618                 */
00619                 if ( yy_n == 0 )        /* have an error */
00620                 {
00621                         /* no worry about speed here! */
00622                         switch ( yyerrflag )
00623                         {
00624                         case 0:         /* new error */
00625                                 yyerror( "syntax error" );
00626                                 goto skip_init;
00627                         yyerrlab:
00628                                 /*
00629                                 ** get globals into registers.
00630                                 ** we have a user generated syntax type error
00631                                 */
00632                                 yy_pv = yypv;
00633                                 yy_ps = yyps;
00634                                 yy_state = yystate;
00635                         skip_init:
00636                                 yynerrs++;
00637                                 /* FALLTHRU */
00638                         case 1:
00639                         case 2:         /* incompletely recovered error */
00640                                         /* try again... */
00641                                 yyerrflag = 3;
00642                                 /*
00643                                 ** find state where "error" is a legal
00644                                 ** shift action
00645                                 */
00646                                 while ( yy_ps >= yys )
00647                                 {
00648                                         yy_n = yypact[ *yy_ps ] + YYERRCODE;
00649                                         if ( yy_n >= 0 && yy_n < YYLAST &&
00650                                                 yychk[yyact[yy_n]] == YYERRCODE)                                        {
00651                                                 /*
00652                                                 ** simulate shift of "error"
00653                                                 */
00654                                                 yy_state = yyact[ yy_n ];
00655                                                 goto yy_stack;
00656                                         }
00657                                         /*
00658                                         ** current state has no shift on
00659                                         ** "error", pop stack
00660                                         */
00661 #if YYDEBUG
00662 #       define _POP_ "Error recovery pops state %d, uncovers state %d\n"
00663                                         if ( yydebug )
00664                                                 printf( _POP_, *yy_ps,
00665                                                         yy_ps[-1] );
00666 #       undef _POP_
00667 #endif
00668                                         yy_ps--;
00669                                         yy_pv--;
00670                                 }
00671                                 /*
00672                                 ** there is no state on stack with "error" as
00673                                 ** a valid shift.  give up.
00674                                 */
00675                                 YYABORT;
00676                         case 3:         /* no shift yet; eat a token */
00677 #if YYDEBUG
00678                                 /*
00679                                 ** if debugging, look up token in list of
00680                                 ** pairs.  0 and negative shouldn't occur,
00681                                 ** but since timing doesn't matter when
00682                                 ** debugging, it doesn't hurt to leave the
00683                                 ** tests here.
00684                                 */
00685                                 if ( yydebug )
00686                                 {
00687                                         register int yy_i;
00688 
00689                                         printf( "Error recovery discards " );
00690                                         if ( yychar == 0 )
00691                                                 printf( "token end-of-file\n" );
00692                                         else if ( yychar < 0 )
00693                                                 printf( "token -none-\n" );
00694                                         else
00695                                         {
00696                                                 for ( yy_i = 0;
00697                                                         yytoks[yy_i].t_val >= 0;
00698                                                         yy_i++ )
00699                                                 {
00700                                                         if ( yytoks[yy_i].t_val
00701                                                                 == yychar )
00702                                                         {
00703                                                                 break;
00704                                                         }
00705                                                 }
00706                                                 printf( "token %s\n",
00707                                                         yytoks[yy_i].t_name );
00708                                         }
00709                                 }
00710 #endif /* YYDEBUG */
00711                                 if ( yychar == 0 )      /* reached EOF. quit */
00712                                         YYABORT;
00713                                 yychar = -1;
00714                                 goto yy_newstate;
00715                         }
00716                 }/* end if ( yy_n == 0 ) */
00717                 /*
00718                 ** reduction by production yy_n
00719                 ** put stack tops, etc. so things right after switch
00720                 */
00721 #if YYDEBUG
00722                 /*
00723                 ** if debugging, print the string that is the user's
00724                 ** specification of the reduction which is just about
00725                 ** to be done.
00726                 */
00727                 if ( yydebug )
00728                         printf( "Reduce by (%d) \"%s\"\n",
00729                                 yy_n, yyreds[ yy_n ] );
00730 #endif
00731                 yytmp = yy_n;                   /* value to switch over */
00732                 yypvt = yy_pv;                  /* $vars top of value stack */
00733                 /*
00734                 ** Look in goto table for next state
00735                 ** Sorry about using yy_state here as temporary
00736                 ** register variable, but why not, if it works...
00737                 ** If yyr2[ yy_n ] doesn't have the low order bit
00738                 ** set, then there is no action to be done for
00739                 ** this reduction.  So, no saving & unsaving of
00740                 ** registers done.  The only difference between the
00741                 ** code just after the if and the body of the if is
00742                 ** the goto yy_stack in the body.  This way the test
00743                 ** can be made before the choice of what to do is needed.
00744                 */
00745                 {
00746                         /* length of production doubled with extra bit */
00747                         register int yy_len = yyr2[ yy_n ];
00748 
00749                         if ( !( yy_len & 01 ) )
00750                         {
00751                                 yy_len >>= 1;
00752                                 yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
00753                                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
00754                                         *( yy_ps -= yy_len ) + 1;
00755                                 if ( yy_state >= YYLAST ||
00756                                         yychk[ yy_state =
00757                                         yyact[ yy_state ] ] != -yy_n )
00758                                 {
00759                                         yy_state = yyact[ yypgo[ yy_n ] ];
00760                                 }
00761                                 goto yy_stack;
00762                         }
00763                         yy_len >>= 1;
00764                         yyval = ( yy_pv -= yy_len )[1]; /* $$ = $1 */
00765                         yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
00766                                 *( yy_ps -= yy_len ) + 1;
00767                         if ( yy_state >= YYLAST ||
00768                                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
00769                         {
00770                                 yy_state = yyact[ yypgo[ yy_n ] ];
00771                         }
00772                 }
00773                                         /* save until reenter driver code */
00774                 yystate = yy_state;
00775                 yyps = yy_ps;
00776                 yypv = yy_pv;
00777         }
00778         /*
00779         ** code supplied by user is placed in this switch
00780         */
00781         switch( yytmp )
00782         {
00783                 
00784 case 1:
00785 
00786 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_CONSTRAINT, yypvt[-0].constraint_); } break;
00787 case 2:
00788 
00789 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00790 case 3:
00791 
00792 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_MIN, yypvt[-0].constraint_); } break;
00793 case 4:
00794 
00795 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_MAX, yypvt[-0].constraint_); } break;
00796 case 5:
00797 
00798 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_WITH, yypvt[-0].constraint_); } break;
00799 case 6:
00800 
00801 { yyval.constraint_ = new TAO_Noop_Constraint(TAO_FIRST); } break;
00802 case 7:
00803 
00804 { yyval.constraint_ = new TAO_Noop_Constraint(TAO_RANDOM); } break;
00805 case 8:
00806 
00807 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_OR, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00808 case 9:
00809 
00810 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00811 case 10:
00812 
00813 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_AND, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00814 case 11:
00815 
00816 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00817 case 12:
00818 
00819 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_EQ, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00820 case 13:
00821 
00822 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_NE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00823 case 14:
00824 
00825 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_GT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00826 case 15:
00827 
00828 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_GE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00829 case 16:
00830 
00831 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_LT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00832 case 17:
00833 
00834 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_LE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00835 case 18:
00836 
00837 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00838 case 19:
00839 
00840 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_IN, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00841 case 20:
00842 
00843 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00844 case 21:
00845 
00846 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_TWIDDLE, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00847 case 22:
00848 
00849 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00850 case 23:
00851 
00852 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_PLUS, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00853 case 24:
00854 
00855 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_MINUS, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00856 case 25:
00857 
00858 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00859 case 26:
00860 
00861 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_MULT, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00862 case 27:
00863 
00864 { yyval.constraint_ = new TAO_Binary_Constraint(TAO_DIV, yypvt[-2].constraint_, yypvt[-0].constraint_); } break;
00865 case 28:
00866 
00867 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00868 case 29:
00869 
00870 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_NOT, yypvt[-0].constraint_); } break;
00871 case 30:
00872 
00873 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00874 case 31:
00875 
00876 { yyval.constraint_ = yypvt[-1].constraint_; } break;
00877 case 32:
00878 
00879 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_EXIST, yypvt[-0].constraint_); } break;
00880 case 33:
00881 
00882 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00883 case 34:
00884 
00885 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00886 case 35:
00887 
00888 { yyval.constraint_ = new TAO_Unary_Constraint(TAO_UMINUS, yypvt[-0].constraint_); } break;
00889 case 36:
00890 
00891 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00892 case 37:
00893 
00894 { yyval.constraint_ = yypvt[-0].constraint_; } break;
00895 
00896         }
00897         goto yystack;           /* reset registers in driver code */
00898 }
00899 
00900 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 13:59:57 2006 for TAO_CosTrader by doxygen 1.3.6