(file) Return to CQLLEX.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / CQL

   1 karl  1.23 /* To be inserted in other files to bypass the chksrc tests */
   2 dave.sudlik 1.18 /* NOCHKSRC */
   3 karl        1.23 
   4                  
   5                  #line 3 "lex.CQL_.c"
   6                  
   7                  #define  YY_INT_ALIGNED short int
   8                  
   9                  /* A lexical scanner generated by flex */
  10                  
  11 chuck       1.2  #define yy_create_buffer CQL__create_buffer
  12                  #define yy_delete_buffer CQL__delete_buffer
  13                  #define yy_flex_debug CQL__flex_debug
  14                  #define yy_init_buffer CQL__init_buffer
  15                  #define yy_flush_buffer CQL__flush_buffer
  16                  #define yy_load_buffer_state CQL__load_buffer_state
  17                  #define yy_switch_to_buffer CQL__switch_to_buffer
  18                  #define yyin CQL_in
  19                  #define yyleng CQL_leng
  20                  #define yylex CQL_lex
  21 karl        1.23 #define yylineno CQL_lineno
  22 chuck       1.2  #define yyout CQL_out
  23                  #define yyrestart CQL_restart
  24                  #define yytext CQL_text
  25                  #define yywrap CQL_wrap
  26 karl        1.23 #define yyalloc CQL_alloc
  27                  #define yyrealloc CQL_realloc
  28                  #define yyfree CQL_free
  29 chuck       1.2  
  30                  #define FLEX_SCANNER
  31                  #define YY_FLEX_MAJOR_VERSION 2
  32                  #define YY_FLEX_MINOR_VERSION 5
  33 karl        1.23 #define YY_FLEX_SUBMINOR_VERSION 34
  34                  #if YY_FLEX_SUBMINOR_VERSION > 0
  35                  #define FLEX_BETA
  36                  #endif
  37                  
  38                  /* First, we deal with  platform-specific or compiler-specific issues. */
  39 chuck       1.2  
  40 karl        1.23 /* begin standard C headers. */
  41 chuck       1.2  #include <stdio.h>
  42 karl        1.23 #include <string.h>
  43                  #include <errno.h>
  44                  #include <stdlib.h>
  45                  
  46                  /* end standard C headers. */
  47                  
  48                  /* flex integer type definitions */
  49                  
  50                  #ifndef FLEXINT_H
  51                  #define FLEXINT_H
  52                  
  53                  /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
  54                  
  55                  #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  56                  
  57                  /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  58 kumpf       1.24  * if you want the limit (max/min) macros for int types.
  59 karl        1.23  */
  60                  #ifndef __STDC_LIMIT_MACROS
  61                  #define __STDC_LIMIT_MACROS 1
  62                  #endif
  63 chuck       1.2  
  64 karl        1.23 #include <inttypes.h>
  65                  typedef int8_t flex_int8_t;
  66                  typedef uint8_t flex_uint8_t;
  67                  typedef int16_t flex_int16_t;
  68                  typedef uint16_t flex_uint16_t;
  69                  typedef int32_t flex_int32_t;
  70                  typedef uint32_t flex_uint32_t;
  71                  #else
  72                  typedef signed char flex_int8_t;
  73                  typedef short int flex_int16_t;
  74                  typedef int flex_int32_t;
  75 kumpf       1.24 typedef unsigned char flex_uint8_t;
  76 karl        1.23 typedef unsigned short int flex_uint16_t;
  77                  typedef unsigned int flex_uint32_t;
  78                  #endif /* ! C99 */
  79 chuck       1.2  
  80 karl        1.23 /* Limits of integral types. */
  81                  #ifndef INT8_MIN
  82                  #define INT8_MIN               (-128)
  83                  #endif
  84                  #ifndef INT16_MIN
  85                  #define INT16_MIN              (-32767-1)
  86                  #endif
  87                  #ifndef INT32_MIN
  88                  #define INT32_MIN              (-2147483647-1)
  89                  #endif
  90                  #ifndef INT8_MAX
  91                  #define INT8_MAX               (127)
  92                  #endif
  93                  #ifndef INT16_MAX
  94                  #define INT16_MAX              (32767)
  95 chuck       1.2  #endif
  96 karl        1.23 #ifndef INT32_MAX
  97                  #define INT32_MAX              (2147483647)
  98                  #endif
  99                  #ifndef UINT8_MAX
 100                  #define UINT8_MAX              (255U)
 101                  #endif
 102                  #ifndef UINT16_MAX
 103                  #define UINT16_MAX             (65535U)
 104                  #endif
 105                  #ifndef UINT32_MAX
 106                  #define UINT32_MAX             (4294967295U)
 107 chuck       1.2  #endif
 108                  
 109 karl        1.23 #endif /* ! FLEXINT_H */
 110 chuck       1.2  
 111                  #ifdef __cplusplus
 112                  
 113                  /* The "const" storage-class-modifier is valid. */
 114                  #define YY_USE_CONST
 115                  
 116 karl        1.17 #else	/* ! __cplusplus */
 117 chuck       1.2  
 118 karl        1.23 /* C99 requires __STDC__ to be defined as 1. */
 119                  #if defined (__STDC__)
 120 chuck       1.2  
 121                  #define YY_USE_CONST
 122                  
 123 karl        1.23 #endif	/* defined (__STDC__) */
 124 karl        1.17 #endif	/* ! __cplusplus */
 125 chuck       1.2  
 126                  #ifdef YY_USE_CONST
 127                  #define yyconst const
 128                  #else
 129                  #define yyconst
 130                  #endif
 131                  
 132                  /* Returned upon end-of-file. */
 133                  #define YY_NULL 0
 134                  
 135                  /* Promotes a possibly negative, possibly signed char to an unsigned
 136                   * integer for use as an array index.  If the signed char is negative,
 137                   * we want to instead treat it as an 8-bit unsigned char, hence the
 138                   * double cast.
 139                   */
 140                  #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
 141                  
 142                  /* Enter a start condition.  This macro really ought to take a parameter,
 143                   * but we do it the disgusting crufty way forced on us by the ()-less
 144                   * definition of BEGIN.
 145                   */
 146 karl        1.23 #define BEGIN (yy_start) = 1 + 2 *
 147 chuck       1.2  
 148                  /* Translate the current start state into a value that can be later handed
 149                   * to BEGIN to return to the state.  The YYSTATE alias is for lex
 150                   * compatibility.
 151                   */
 152 karl        1.23 #define YY_START (((yy_start) - 1) / 2)
 153 chuck       1.2  #define YYSTATE YY_START
 154                  
 155                  /* Action number for EOF rule of a given start state. */
 156                  #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
 157                  
 158                  /* Special action meaning "start processing a new file". */
 159 karl        1.23 #define YY_NEW_FILE CQL_restart(CQL_in  )
 160 chuck       1.2  
 161                  #define YY_END_OF_BUFFER_CHAR 0
 162                  
 163                  /* Size of default input buffer. */
 164 karl        1.23 #ifndef YY_BUF_SIZE
 165 chuck       1.2  #define YY_BUF_SIZE 16384
 166 karl        1.23 #endif
 167                  
 168                  /* The state buf must be large enough to hold one state per character in the main buffer.
 169                   */
 170                  #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 171 chuck       1.2  
 172 karl        1.23 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 173                  #define YY_TYPEDEF_YY_BUFFER_STATE
 174 chuck       1.2  typedef struct yy_buffer_state *YY_BUFFER_STATE;
 175 karl        1.23 #endif
 176                  
 177                  extern int CQL_leng;
 178 chuck       1.2  
 179 karl        1.23 extern FILE *CQL_in, *CQL_out;
 180 chuck       1.2  
 181                  #define EOB_ACT_CONTINUE_SCAN 0
 182                  #define EOB_ACT_END_OF_FILE 1
 183                  #define EOB_ACT_LAST_MATCH 2
 184                  
 185 karl        1.23     #define YY_LESS_LINENO(n)
 186 kumpf       1.24 
 187 karl        1.23 /* Return all but the first "n" matched characters back to the input stream. */
 188 chuck       1.2  #define yyless(n) \
 189 karl        1.17 	do \
 190                  		{ \
 191 karl        1.23 		/* Undo effects of setting up CQL_text. */ \
 192                          int yyless_macro_arg = (n); \
 193                          YY_LESS_LINENO(yyless_macro_arg);\
 194                  		*yy_cp = (yy_hold_char); \
 195 karl        1.17 		YY_RESTORE_YY_MORE_OFFSET \
 196 karl        1.23 		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 197                  		YY_DO_BEFORE_ACTION; /* set up CQL_text again */ \
 198 karl        1.17 		} \
 199                  	while ( 0 )
 200 chuck       1.2  
 201 karl        1.23 #define unput(c) yyunput( c, (yytext_ptr)  )
 202 karl        1.16 
 203 chuck       1.2  /* The following is because we cannot portably get our hands on size_t
 204                   * (without autoconf's help, which isn't available because we want
 205                   * flex-generated scanners to compile on their own).
 206 karl        1.23  * Given that the standard has decreed that size_t exists since 1989,
 207                   * I guess we can afford to depend on it. Manoj.
 208 chuck       1.2   */
 209                  
 210 karl        1.23 #ifndef YY_TYPEDEF_YY_SIZE_T
 211                  #define YY_TYPEDEF_YY_SIZE_T
 212                  typedef size_t yy_size_t;
 213                  #endif
 214 chuck       1.2  
 215 karl        1.23 #ifndef YY_STRUCT_YY_BUFFER_STATE
 216                  #define YY_STRUCT_YY_BUFFER_STATE
 217 chuck       1.2  struct yy_buffer_state
 218 karl        1.17 	{
 219                  	FILE *yy_input_file;
 220 chuck       1.2  
 221 karl        1.17 	char *yy_ch_buf;		/* input buffer */
 222                  	char *yy_buf_pos;		/* current position in input buffer */
 223 chuck       1.2  
 224 karl        1.17 	/* Size of input buffer in bytes, not including room for EOB
 225                  	 * characters.
 226                  	 */
 227                  	yy_size_t yy_buf_size;
 228                  
 229                  	/* Number of characters read into yy_ch_buf, not including EOB
 230                  	 * characters.
 231                  	 */
 232                  	int yy_n_chars;
 233                  
 234                  	/* Whether we "own" the buffer - i.e., we know we created it,
 235                  	 * and can realloc() it to grow it, and should free() it to
 236                  	 * delete it.
 237                  	 */
 238                  	int yy_is_our_buffer;
 239                  
 240                  	/* Whether this is an "interactive" input source; if so, and
 241                  	 * if we're using stdio for input, then we want to use getc()
 242                  	 * instead of fread(), to make sure we stop fetching input after
 243                  	 * each newline.
 244                  	 */
 245 karl        1.17 	int yy_is_interactive;
 246                  
 247                  	/* Whether we're considered to be at the beginning of a line.
 248                  	 * If so, '^' rules will be active on the next match, otherwise
 249                  	 * not.
 250                  	 */
 251                  	int yy_at_bol;
 252                  
 253 karl        1.23     int yy_bs_lineno; /**< The line count. */
 254                      int yy_bs_column; /**< The column count. */
 255 kumpf       1.24 
 256 karl        1.17 	/* Whether to try to fill the input buffer when we reach the
 257                  	 * end of it.
 258                  	 */
 259                  	int yy_fill_buffer;
 260 chuck       1.2  
 261 karl        1.17 	int yy_buffer_status;
 262 karl        1.23 
 263 chuck       1.2  #define YY_BUFFER_NEW 0
 264                  #define YY_BUFFER_NORMAL 1
 265 karl        1.17 	/* When an EOF's been seen but there's still some text to process
 266                  	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
 267                  	 * shouldn't try reading from the input source any more.  We might
 268                  	 * still have a bunch of tokens to match, though, because of
 269                  	 * possible backing-up.
 270                  	 *
 271                  	 * When we actually see the EOF, we change the status to "new"
 272 karl        1.23 	 * (via CQL_restart()), so that the user can continue scanning by
 273                  	 * just pointing CQL_in at a new input file.
 274 karl        1.17 	 */
 275 chuck       1.2  #define YY_BUFFER_EOF_PENDING 2
 276 karl        1.23 
 277 karl        1.17 	};
 278 karl        1.23 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
 279 chuck       1.2  
 280 karl        1.23 /* Stack of input buffers. */
 281                  static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
 282                  static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
 283                  static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
 284 chuck       1.2  
 285                  /* We provide macros for accessing buffer states in case in the
 286                   * future we want to put the buffer states in a more general
 287                   * "scanner state".
 288 karl        1.23  *
 289                   * Returns the top of the stack, or NULL.
 290 chuck       1.2   */
 291 karl        1.23 #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
 292                                            ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
 293                                            : NULL)
 294 chuck       1.2  
 295 karl        1.23 /* Same as previous macro, but useful when we know that the buffer stack is not
 296                   * NULL or when we need an lvalue. For internal use only.
 297                   */
 298                  #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
 299 chuck       1.2  
 300 karl        1.23 /* yy_hold_char holds the character lost when CQL_text is formed. */
 301 chuck       1.2  static char yy_hold_char;
 302 karl        1.17 static int yy_n_chars;		/* number of characters read into yy_ch_buf */
 303 karl        1.23 int CQL_leng;
 304 chuck       1.2  
 305                  /* Points to current character in buffer. */
 306                  static char *yy_c_buf_p = (char *) 0;
 307 karl        1.23 static int yy_init = 0;		/* whether we need to initialize */
 308 karl        1.17 static int yy_start = 0;	/* start state number */
 309 chuck       1.2  
 310 karl        1.23 /* Flag which is used to allow CQL_wrap()'s to do buffer switches
 311                   * instead of setting up a fresh CQL_in.  A bit of a hack ...
 312 chuck       1.2   */
 313                  static int yy_did_buffer_switch_on_eof;
 314                  
 315 karl        1.23 void CQL_restart (FILE *input_file  );
 316                  void CQL__switch_to_buffer (YY_BUFFER_STATE new_buffer  );
 317                  YY_BUFFER_STATE CQL__create_buffer (FILE *file,int size  );
 318                  void CQL__delete_buffer (YY_BUFFER_STATE b  );
 319                  void CQL__flush_buffer (YY_BUFFER_STATE b  );
 320                  void CQL_push_buffer_state (YY_BUFFER_STATE new_buffer  );
 321                  void CQL_pop_buffer_state (void );
 322                  
 323                  static void CQL_ensure_buffer_stack (void );
 324                  static void CQL__load_buffer_state (void );
 325                  static void CQL__init_buffer (YY_BUFFER_STATE b,FILE *file  );
 326                  
 327                  #define YY_FLUSH_BUFFER CQL__flush_buffer(YY_CURRENT_BUFFER )
 328                  
 329                  YY_BUFFER_STATE CQL__scan_buffer (char *base,yy_size_t size  );
 330                  YY_BUFFER_STATE CQL__scan_string (yyconst char *yy_str  );
 331                  YY_BUFFER_STATE CQL__scan_bytes (yyconst char *bytes,int len  );
 332                  
 333                  void *CQL_alloc (yy_size_t  );
 334                  void *CQL_realloc (void *,yy_size_t  );
 335                  void CQL_free (void *  );
 336 chuck       1.2  
 337 karl        1.23 #define yy_new_buffer CQL__create_buffer
 338 chuck       1.2  
 339                  #define yy_set_interactive(is_interactive) \
 340 karl        1.17 	{ \
 341 karl        1.23 	if ( ! YY_CURRENT_BUFFER ){ \
 342                          CQL_ensure_buffer_stack (); \
 343                  		YY_CURRENT_BUFFER_LVALUE =    \
 344                              CQL__create_buffer(CQL_in,YY_BUF_SIZE ); \
 345                  	} \
 346                  	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
 347 karl        1.17 	}
 348 chuck       1.2  
 349                  #define yy_set_bol(at_bol) \
 350 karl        1.17 	{ \
 351 karl        1.23 	if ( ! YY_CURRENT_BUFFER ){\
 352                          CQL_ensure_buffer_stack (); \
 353                  		YY_CURRENT_BUFFER_LVALUE =    \
 354                              CQL__create_buffer(CQL_in,YY_BUF_SIZE ); \
 355                  	} \
 356                  	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
 357 karl        1.17 	}
 358 chuck       1.2  
 359 karl        1.23 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
 360                  
 361                  /* Begin user sect3 */
 362 chuck       1.2  
 363                  typedef unsigned char YY_CHAR;
 364 karl        1.23 
 365                  FILE *CQL_in = (FILE *) 0, *CQL_out = (FILE *) 0;
 366                  
 367 chuck       1.2  typedef int yy_state_type;
 368                  
 369 karl        1.23 extern int CQL_lineno;
 370                  
 371                  int CQL_lineno = 1;
 372                  
 373                  extern char *CQL_text;
 374                  #define yytext_ptr CQL_text
 375                  
 376                  static yy_state_type yy_get_previous_state (void );
 377                  static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
 378                  static int yy_get_next_buffer (void );
 379                  static void yy_fatal_error (yyconst char msg[]  );
 380 chuck       1.2  
 381                  /* Done after the current pattern has been matched and before the
 382 karl        1.23  * corresponding action - sets up CQL_text.
 383 chuck       1.2   */
 384                  #define YY_DO_BEFORE_ACTION \
 385 karl        1.23 	(yytext_ptr) = yy_bp; \
 386                  	CQL_leng = (size_t) (yy_cp - yy_bp); \
 387                  	(yy_hold_char) = *yy_cp; \
 388 karl        1.17 	*yy_cp = '\0'; \
 389 karl        1.23 	(yy_c_buf_p) = yy_cp;
 390 chuck       1.2  
 391 humberto    1.11 #define YY_NUM_RULES 59
 392                  #define YY_END_OF_BUFFER 60
 393 karl        1.23 /* This struct is not used in this scanner,
 394                     but its presence is necessary. */
 395                  struct yy_trans_info
 396                  	{
 397                  	flex_int32_t yy_verify;
 398                  	flex_int32_t yy_nxt;
 399                  	};
 400                  static yyconst flex_int16_t yy_accept[170] =
 401 chuck       1.2      {   0,
 402 humberto    1.11         0,    0,   60,   58,   56,   57,   41,   58,   45,   46,
 403                         35,   37,   39,   38,   42,   36,   30,   30,   30,   52,
 404                         49,   54,   55,   55,   55,   55,   55,   55,   55,   55,
 405                         55,   55,   55,   55,   55,   43,   44,   48,   58,   56,
 406                          0,   34,   33,    0,    0,    0,   30,   30,   30,    0,
 407                          0,   29,   29,   40,   32,   32,   30,   28,    0,   51,
 408                         50,   53,   55,    0,   55,    5,    7,   55,   55,   55,
 409                         55,   55,   55,   12,   13,   55,   55,   55,   23,   55,
 410                         55,   55,   55,   47,    0,    0,   34,   31,    0,    0,
 411                         27,    0,   29,   29,    0,   32,    0,   26,    0,   22,
 412                  
 413                          4,    6,   55,   55,   55,   55,   55,   55,   14,   55,
 414                         21,   55,   55,   55,   55,   55,   55,    0,   25,    0,
 415                         32,    0,    0,   32,   26,   24,    8,   55,   55,   55,
 416                         55,    2,   15,   20,   55,   55,   55,   18,   55,    0,
 417                         31,   25,    0,   32,    0,   24,    0,   55,   10,   19,
 418                         11,   16,   55,   55,    3,    0,    0,   24,   55,   55,
 419                          1,    0,   24,   55,   55,    9,   55,   17,    0
 420 chuck       1.2      } ;
 421                  
 422 karl        1.23 static yyconst flex_int32_t yy_ec[256] =
 423 chuck       1.2      {   0,
 424                          1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
 425                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 426                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 427 humberto    1.9          1,    2,    1,    1,    4,    1,    1,    1,    5,    6,
 428                          7,    8,    9,   10,   11,   12,   13,   14,   15,   16,
 429                         16,   16,   16,   16,   16,   16,   16,   17,    1,   18,
 430                         19,   20,    1,    1,   21,   22,   23,   24,   25,   26,
 431                         27,   28,   29,   27,   30,   31,   32,   33,   34,   27,
 432                         27,   35,   36,   37,   38,   39,   40,   41,   42,   27,
 433                         43,   44,   45,    1,   46,    1,   21,   22,   23,   24,
 434                  
 435                         25,   26,   27,   28,   29,   27,   30,   31,   32,   33,
 436                         34,   27,   27,   35,   36,   37,   38,   39,   40,   41,
 437 humberto    1.11        42,   27,    1,   47,    1,    1,    1,   27,   27,   27,
 438                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 439                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 440                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 441                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 442                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 443                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 444                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 445                  
 446                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 447                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 448                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 449                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 450                         27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
 451                         27,   27,   27,   27,   27
 452 chuck       1.2      } ;
 453                  
 454 karl        1.23 static yyconst flex_int32_t yy_meta[48] =
 455 chuck       1.2      {   0,
 456 humberto    1.11         1,    1,    2,    3,    4,    5,    5,    1,    1,    1,
 457                          1,    1,    1,    6,    6,    6,    7,    1,    1,    1,
 458                          8,    8,    8,    8,    8,    8,    9,    9,    9,    9,
 459                          9,    9,    9,    9,    9,    9,    9,    9,    9,    9,
 460                          9,    9,    3,    1,    1,    9,    1
 461 chuck       1.2      } ;
 462                  
 463 karl        1.23 static yyconst flex_int16_t yy_base[182] =
 464 chuck       1.2      {   0,
 465 humberto    1.11         0,    0,  438,  439,  435,  439,  439,   45,  439,  439,
 466                        439,   41,  439,   46,   51,  439,   56,   61,   70,   60,
 467                        439,  417,   57,   52,  418,   70,   42,   71,   74,   79,
 468                         81,   85,   84,   86,   94,  439,  439,  417,  386,  430,
 469                        111,   99,  439,  421,  120,  112,  117,  122,  133,  126,
 470                        138,  147,  156,  439,  151,  159,  166,  439,    0,  439,
 471                        439,  439,  398,  394,  166,  107,  392,  160,  168,  169,
 472                        170,  172,  175,  391,  174,  176,  180,  181,  186,  182,
 473                        183,  118,  188,  439,  107,  197,  439,  206,  211,  220,
 474                        439,    0,  228,  233,  242,  214,  250,    0,    0,  388,
 475                  
 476                        383,  380,  201,  235,  220,  237,  243,   32,  377,  221,
 477                        370,  245,  246,  251,  250,  252,  253,  275,    0,  267,
 478                        278,  286,  289,  292,    0,  270,  362,  270,  268,  292,
 479                        261,  343,  341,  340,  279,  294,  295,  337,  298,  305,
 480                        310,    0,  313,  317,  348,  312,  307,  305,  334,  333,
 481                        330,  329,  317,  319,  328,  339,  171,  170,  318,  320,
 482                        194,  152,  141,  322,  323,   96,  325,   37,  439,  361,
 483                        365,  374,  383,  387,  390,  393,  394,  398,  404,  413,
 484                        422
 485 chuck       1.2      } ;
 486                  
 487 karl        1.23 static yyconst flex_int16_t yy_def[182] =
 488 chuck       1.2      {   0,
 489 humberto    1.9        169,    1,  169,  169,  169,  169,  169,  170,  169,  169,
 490 humberto    1.11       169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 491                        169,  169,  171,  171,  171,  171,  171,  171,  171,  171,
 492                        171,  171,  171,  171,  171,  169,  169,  171,  169,  169,
 493                        170,  172,  169,  173,  173,  169,  169,  169,  169,  169,
 494                        169,  169,  169,  169,  169,  169,  169,  169,  174,  169,
 495                        169,  169,  171,  169,  171,  171,  171,  171,  171,  171,
 496                        171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
 497                        171,  171,  171,  169,  172,  169,  169,  169,  169,  169,
 498                        169,  175,  169,  169,  169,  169,  169,  176,  177,  171,
 499                  
 500                        171,  171,  171,  171,  171,  171,  171,  171,  171,  171,
 501                        171,  171,  171,  171,  171,  171,  171,  169,  178,  169,
 502                        169,  169,  169,  169,  176,  179,  171,  171,  171,  171,
 503                        171,  171,  171,  171,  171,  171,  171,  171,  171,  169,
 504                        169,  178,  169,  169,  169,  179,  180,  171,  171,  171,
 505                        171,  171,  171,  171,  171,  181,  180,  180,  171,  171,
 506                        171,  181,  181,  171,  171,  171,  171,  171,    0,  169,
 507                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 508                        169
 509 chuck       1.2      } ;
 510                  
 511 karl        1.23 static yyconst flex_int16_t yy_nxt[487] =
 512 chuck       1.2      {   0,
 513                          4,    5,    6,    7,    8,    9,   10,   11,   12,   13,
 514 humberto    1.11        14,   15,   16,   17,   18,   19,    4,   20,   21,   22,
 515                         23,   24,   25,   26,   27,   28,   25,   25,   29,   25,
 516                         30,   25,   31,   32,   25,   33,   34,   25,   25,   35,
 517                         25,   25,   36,    4,   37,   38,   39,   42,   64,   43,
 518                         44,   44,   46,   64,   47,   48,   49,   50,   64,   51,
 519                         52,   53,   54,  132,   55,   55,   55,   56,   64,   57,
 520                         57,   49,   56,   64,   57,   57,   49,   58,   60,   61,
 521                         70,   56,   58,   49,   49,   49,   64,   64,   45,   65,
 522                         64,   71,   66,   67,   68,   64,   59,   64,   69,   72,
 523                  
 524                         64,   64,   64,   43,   80,   73,   74,   76,   81,   75,
 525                         64,   43,   64,   42,   77,   43,   44,   44,   78,   79,
 526                         82,   83,   87,   64,   85,   55,   55,   55,   56,  102,
 527                         57,   57,   49,   56,   64,   57,   57,   49,   58,   88,
 528                         88,   88,   86,   58,   56,  163,   49,   49,   49,   50,
 529                         86,   89,   89,   90,   45,  116,  163,   59,   50,   91,
 530                         93,   93,   94,   41,   55,   55,   55,   50,   91,   94,
 531                         94,   94,   96,   96,   96,   95,   64,   56,   92,   57,
 532                         57,   49,   64,   97,   64,   64,   64,   58,   64,  100,
 533                         64,   64,   64,  105,  109,  103,   64,   64,   64,   64,
 534                  
 535 humberto    1.11       106,   85,   64,  104,   64,  110,  107,  101,  108,  113,
 536                         64,  112,  117,  115,  158,  158,  111,   64,  114,   88,
 537                         88,   88,   50,  127,   89,   89,   90,   96,   96,   96,
 538                        118,   50,   91,   90,   90,   90,   64,   64,  122,   50,
 539                         85,   93,   93,   94,   50,  133,   94,   94,   94,   91,
 540                        120,   64,  120,   64,  129,  121,  121,  121,  123,   64,
 541                        123,   64,   64,  124,  124,  124,   64,   64,   64,   64,
 542                        135,  128,  130,  145,  137,  134,  138,   64,  131,  136,
 543                        121,  121,  121,  140,   64,  140,   64,  139,  141,  141,
 544                        141,  121,  121,  121,  143,   64,  143,  151,  148,  144,
 545                  
 546                        144,  144,  124,  124,  124,  124,  124,  124,   64,  149,
 547                         64,   64,  147,  152,   64,  145,  150,  154,  141,  141,
 548                        141,   64,  155,  141,  141,  141,  144,  144,  144,  153,
 549                        144,  144,  144,   64,   64,   64,   64,  159,   64,   64,
 550                        164,   64,  160,  163,   64,   64,   64,  167,  165,   64,
 551                         64,  158,  156,   64,  147,  161,   64,   64,  166,   64,
 552                        168,   41,   41,   41,   41,   41,   41,   41,   41,   41,
 553                         63,   63,   63,   63,   85,   85,   85,   85,   64,   85,
 554                         85,   85,   85,   44,   44,   44,   64,   44,   44,   44,
 555                         44,   44,   98,   64,   98,  119,   64,  119,  125,   64,
 556 humberto    1.11 
 557                        125,  126,  126,  142,   64,  142,  146,   64,   64,  146,
 558                         99,  146,  146,  157,   64,  157,  157,  157,  157,  157,
 559                        157,  157,  162,   87,  162,  162,  162,  162,  162,  162,
 560                        162,   40,   84,   64,   64,   62,   40,  169,    3,  169,
 561 humberto    1.9        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 562                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 563                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 564                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 565                        169,  169,  169,  169,  169,  169
 566 chuck       1.2      } ;
 567                  
 568 karl        1.23 static yyconst flex_int16_t yy_chk[487] =
 569 chuck       1.2      {   0,
 570                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 571                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 572                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 573                          1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
 574 humberto    1.11         1,    1,    1,    1,    1,    1,    1,    8,  108,    8,
 575                          8,    8,   12,  168,   12,   12,   12,   14,   27,   14,
 576                         14,   14,   15,  108,   15,   15,   15,   17,   24,   17,
 577                         17,   17,   18,   23,   18,   18,   18,   17,   20,   20,
 578                         27,   19,   18,   19,   19,   19,   26,   28,    8,   23,
 579                         29,   28,   23,   24,   26,   30,   17,   31,   26,   28,
 580                  
 581                         33,   32,   34,   42,   33,   28,   29,   30,   33,   29,
 582                         35,   85,  166,   41,   31,   41,   41,   41,   31,   32,
 583                         34,   35,   45,   66,   45,   46,   46,   46,   47,   66,
 584                         47,   47,   47,   48,   82,   48,   48,   48,   47,   50,
 585                         50,   50,   42,   48,   49,  163,   49,   49,   49,   51,
 586                         85,   51,   51,   51,   41,   82,  162,   47,   52,   51,
 587                         52,   52,   52,   45,   55,   55,   55,   53,   52,   53,
 588                         53,   53,   56,   56,   56,   55,   68,   57,   51,   57,
 589                         57,   57,   65,   56,   69,   70,   71,   57,   72,   65,
 590                         75,   73,   76,   70,   75,   68,   77,   78,   80,   81,
 591                  
 592                         71,   86,   79,   69,   83,   76,   72,   65,   73,   79,
 593                        161,   78,   83,   81,  158,  157,   77,  103,   80,   88,
 594                         88,   88,   89,  103,   89,   89,   89,   96,   96,   96,
 595 humberto    1.11        88,   90,   89,   90,   90,   90,  105,  110,   96,   93,
 596                         86,   93,   93,   93,   94,  110,   94,   94,   94,   93,
 597                         95,  104,   95,  106,  105,   95,   95,   95,   97,  107,
 598                         97,  112,  113,   97,   97,   97,  115,  114,  116,  117,
 599                        113,  104,  106,  126,  115,  112,  116,  131,  107,  114,
 600                        120,  120,  120,  118,  129,  118,  128,  117,  118,  118,
 601                        118,  121,  121,  121,  122,  135,  122,  131,  128,  122,
 602                  
 603                        122,  122,  123,  123,  123,  124,  124,  124,  130,  129,
 604                        136,  137,  126,  135,  139,  146,  130,  137,  140,  140,
 605                        140,  148,  139,  141,  141,  141,  143,  143,  143,  136,
 606                        144,  144,  144,  153,  159,  154,  160,  148,  164,  165,
 607                        159,  167,  153,  156,  155,  152,  151,  165,  160,  150,
 608                        149,  147,  145,  138,  146,  154,  134,  133,  164,  132,
 609                        167,  170,  170,  170,  170,  170,  170,  170,  170,  170,
 610                        171,  171,  171,  171,  172,  172,  172,  172,  127,  172,
 611                        172,  172,  172,  173,  173,  173,  111,  173,  173,  173,
 612                        173,  173,  174,  109,  174,  175,  102,  175,  176,  101,
 613                  
 614                        176,  177,  177,  178,  100,  178,  179,   74,   67,  179,
 615                         64,  179,  179,  180,   63,  180,  180,  180,  180,  180,
 616 humberto    1.11       180,  180,  181,   44,  181,  181,  181,  181,  181,  181,
 617                        181,   40,   39,   38,   25,   22,    5,    3,  169,  169,
 618 humberto    1.9        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 619                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 620                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 621                        169,  169,  169,  169,  169,  169,  169,  169,  169,  169,
 622                        169,  169,  169,  169,  169,  169
 623 chuck       1.2      } ;
 624                  
 625                  static yy_state_type yy_last_accepting_state;
 626                  static char *yy_last_accepting_cpos;
 627                  
 628 karl        1.23 extern int CQL__flex_debug;
 629                  int CQL__flex_debug = 0;
 630                  
 631 chuck       1.2  /* The intent behind this definition is that it'll catch
 632                   * any uses of REJECT which flex missed.
 633                   */
 634                  #define REJECT reject_used_but_not_detected
 635                  #define yymore() yymore_used_but_not_detected
 636                  #define YY_MORE_ADJ 0
 637                  #define YY_RESTORE_YY_MORE_OFFSET
 638 karl        1.23 char *CQL_text;
 639 chuck       1.2  #line 1 "CQL.l"
 640 karl        1.23 /*
 641                  //%LICENSE////////////////////////////////////////////////////////////////
 642 kumpf       1.24 //
 643 karl        1.23 // Licensed to The Open Group (TOG) under one or more contributor license
 644                  // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
 645                  // this work for additional information regarding copyright ownership.
 646                  // Each contributor licenses this file to you under the OpenPegasus Open
 647                  // Source License; you may not use this file except in compliance with the
 648                  // License.
 649 kumpf       1.24 //
 650 karl        1.23 // Permission is hereby granted, free of charge, to any person obtaining a
 651                  // copy of this software and associated documentation files (the "Software"),
 652                  // to deal in the Software without restriction, including without limitation
 653                  // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 654                  // and/or sell copies of the Software, and to permit persons to whom the
 655                  // Software is furnished to do so, subject to the following conditions:
 656 kumpf       1.24 //
 657 karl        1.23 // The above copyright notice and this permission notice shall be included
 658                  // in all copies or substantial portions of the Software.
 659 kumpf       1.24 //
 660 karl        1.23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 661 kumpf       1.24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 662 karl        1.23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 663                  // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 664                  // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 665                  // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 666                  // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 667 kumpf       1.24 //
 668 karl        1.23 //////////////////////////////////////////////////////////////////////////
 669                  */
 670 kumpf       1.24 /*
 671 karl        1.16    This file describes the language tokens possible for CQL. When a token is
 672                     matched, the token postion is updated in the CQL_globalParserState, copying
 673                     from the lex buffer  to a shared buffer (shared with the lexer and parser)
 674                     may happen, then a token identifier is returned to the parser.
 675 humberto    1.11 
 676 kumpf       1.24 */
 677 karl        1.23 #line 42 "CQL.l"
 678 chuck       1.2  extern int CQLInput(char* buffer, int& numRead, int numRequested);
 679                  extern int CQL_error(const char*);
 680                  
 681                  #ifdef CQLINPUT
 682                  #define YY_INPUT(BUF, NREAD, NREQUESTED) CQLInput(BUF, NREAD, NREQUESTED)
 683                  #endif
 684                  
 685                  #include <Pegasus/Common/Config.h>
 686 chuck       1.13 #include <Pegasus/Common/CommonUTF.h>
 687                  #include <Pegasus/Common/MessageLoader.h>
 688 chuck       1.2  #include "CQLParserState.h"
 689                  #include <stdlib.h>
 690                  #include <stdio.h>
 691                  #include <cstring>
 692                  #include "CQLObjects.h"
 693                  #include "CQLYACC.h"
 694                  PEGASUS_NAMESPACE_BEGIN
 695 kumpf       1.24 
 696 humberto    1.10 extern CQLParserState* CQL_globalParserState;
 697 kumpf       1.24 
 698 chuck       1.2  PEGASUS_NAMESPACE_END
 699 dave.sudlik 1.18 
 700                  
 701                  #ifdef CQL_DEBUG_LEXER
 702                  #define CQL_DEBUG_TRACE(X) \
 703                      printf(X);
 704                  #define CQL_DEBUG_TRACE2(X,Y) \
 705                      printf(X,Y);
 706                  #else
 707                  #define CQL_DEBUG_TRACE(X)
 708                  #define CQL_DEBUG_TRACE2(X,Y)
 709                  #endif
 710 chuck       1.2  
 711 kumpf       1.20 /* Avoid warn_unused_result warnings in Linux RPM build */
 712 kumpf       1.21 #ifndef ECHO
 713 karl        1.23 # define ECHO do { size_t ignored = fwrite(CQL_text, CQL_leng, 1, CQL_out); } while(0)
 714 kumpf       1.21 #endif
 715 kumpf       1.20 
 716 chuck       1.2  int lineno;
 717                  
 718 karl        1.23 #line 716 "lex.CQL_.c"
 719                  
 720                  #define INITIAL 0
 721                  
 722                  #ifndef YY_NO_UNISTD_H
 723                  /* Special case for "unistd.h", since it is non-ANSI. We include it way
 724                   * down here because we want the user's section 1 to have been scanned first.
 725                   * The user has a chance to override it with an option.
 726                   */
 727                  #include <unistd.h>
 728                  #endif
 729                  
 730                  #ifndef YY_EXTRA_TYPE
 731                  #define YY_EXTRA_TYPE void *
 732                  #endif
 733                  
 734                  static int yy_init_globals (void );
 735 chuck       1.2  
 736                  /* Macros after this point can all be overridden by user definitions in
 737                   * section 1.
 738                   */
 739                  
 740                  #ifndef YY_SKIP_YYWRAP
 741                  #ifdef __cplusplus
 742 karl        1.23 extern "C" int CQL_wrap (void );
 743 chuck       1.2  #else
 744 karl        1.23 extern int CQL_wrap (void );
 745 chuck       1.2  #endif
 746                  #endif
 747                  
 748 karl        1.23     static void yyunput (int c,char *buf_ptr  );
 749 kumpf       1.24 
 750 chuck       1.2  #ifndef yytext_ptr
 751 karl        1.23 static void yy_flex_strncpy (char *,yyconst char *,int );
 752 chuck       1.2  #endif
 753                  
 754                  #ifdef YY_NEED_STRLEN
 755 karl        1.23 static int yy_flex_strlen (yyconst char * );
 756 chuck       1.2  #endif
 757                  
 758                  #ifndef YY_NO_INPUT
 759 karl        1.23 
 760 chuck       1.2  #ifdef __cplusplus
 761 karl        1.23 static int yyinput (void );
 762 chuck       1.2  #else
 763 karl        1.23 static int input (void );
 764 chuck       1.2  #endif
 765                  
 766                  #endif
 767                  
 768                  /* Amount of stuff to slurp up with each read. */
 769                  #ifndef YY_READ_BUF_SIZE
 770                  #define YY_READ_BUF_SIZE 8192
 771                  #endif
 772                  
 773                  /* Copy whatever the last rule matched to the standard output. */
 774                  #ifndef ECHO
 775                  /* This used to be an fputs(), but since the string might contain NUL's,
 776                   * we now use fwrite().
 777                   */
 778 karl        1.23 #define ECHO fwrite( CQL_text, CQL_leng, 1, CQL_out )
 779 chuck       1.2  #endif
 780                  
 781                  /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 782                   * is returned in "result".
 783                   */
 784                  #ifndef YY_INPUT
 785                  #define YY_INPUT(buf,result,max_size) \
 786 karl        1.23 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 787 karl        1.17 		{ \
 788 karl        1.23 		int c = '*'; \
 789                  		int n; \
 790 karl        1.17 		for ( n = 0; n < max_size && \
 791 karl        1.23 			     (c = getc( CQL_in )) != EOF && c != '\n'; ++n ) \
 792 karl        1.17 			buf[n] = (char) c; \
 793                  		if ( c == '\n' ) \
 794                  			buf[n++] = (char) c; \
 795 karl        1.23 		if ( c == EOF && ferror( CQL_in ) ) \
 796 karl        1.17 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 797                  		result = n; \
 798                  		} \
 799 karl        1.23 	else \
 800                  		{ \
 801                  		errno=0; \
 802                  		while ( (result = fread(buf, 1, max_size, CQL_in))==0 && ferror(CQL_in)) \
 803                  			{ \
 804                  			if( errno != EINTR) \
 805                  				{ \
 806                  				YY_FATAL_ERROR( "input in flex scanner failed" ); \
 807                  				break; \
 808                  				} \
 809                  			errno=0; \
 810                  			clearerr(CQL_in); \
 811                  			} \
 812                  		}\
 813                  \
 814                  
 815 chuck       1.2  #endif
 816                  
 817                  /* No semi-colon after return; correct usage is to write "yyterminate();" -
 818                   * we don't want an extra ';' after the "return" because that will cause
 819                   * some compilers to complain about unreachable statements.
 820                   */
 821                  #ifndef yyterminate
 822                  #define yyterminate() return YY_NULL
 823                  #endif
 824                  
 825                  /* Number of entries by which start-condition stack grows. */
 826                  #ifndef YY_START_STACK_INCR
 827                  #define YY_START_STACK_INCR 25
 828                  #endif
 829                  
 830                  /* Report a fatal error. */
 831                  #ifndef YY_FATAL_ERROR
 832                  #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
 833                  #endif
 834                  
 835 karl        1.23 /* end tables serialization structures and prototypes */
 836                  
 837 chuck       1.2  /* Default declaration of generated scanner - a define so the user can
 838                   * easily add parameters.
 839                   */
 840                  #ifndef YY_DECL
 841 karl        1.23 #define YY_DECL_IS_OURS 1
 842                  
 843                  extern int CQL_lex (void);
 844                  
 845                  #define YY_DECL int CQL_lex (void)
 846                  #endif /* !YY_DECL */
 847 chuck       1.2  
 848 karl        1.23 /* Code executed at the beginning of each rule, after CQL_text and CQL_leng
 849 chuck       1.2   * have been set up.
 850                   */
 851                  #ifndef YY_USER_ACTION
 852                  #define YY_USER_ACTION
 853                  #endif
 854                  
 855                  /* Code executed at the end of each rule. */
 856                  #ifndef YY_BREAK
 857                  #define YY_BREAK break;
 858                  #endif
 859                  
 860                  #define YY_RULE_SETUP \
 861 karl        1.17 	YY_USER_ACTION
 862 chuck       1.2  
 863 karl        1.23 /** The main scanner function which does all the work.
 864                   */
 865 chuck       1.2  YY_DECL
 866 karl        1.23 {
 867 karl        1.17 	register yy_state_type yy_current_state;
 868 karl        1.23 	register char *yy_cp, *yy_bp;
 869 karl        1.17 	register int yy_act;
 870 kumpf       1.24 
 871 karl        1.23 #line 122 "CQL.l"
 872 chuck       1.2  
 873                  
 874 karl        1.23 #line 872 "lex.CQL_.c"
 875 chuck       1.2  
 876 karl        1.23 	if ( !(yy_init) )
 877 karl        1.17 		{
 878 karl        1.23 		(yy_init) = 1;
 879 chuck       1.2  
 880                  #ifdef YY_USER_INIT
 881 karl        1.17 		YY_USER_INIT;
 882 chuck       1.2  #endif
 883                  
 884 karl        1.23 		if ( ! (yy_start) )
 885                  			(yy_start) = 1;	/* first start state */
 886 chuck       1.2  
 887 karl        1.23 		if ( ! CQL_in )
 888                  			CQL_in = stdin;
 889 chuck       1.2  
 890 karl        1.23 		if ( ! CQL_out )
 891                  			CQL_out = stdout;
 892 chuck       1.2  
 893 karl        1.23 		if ( ! YY_CURRENT_BUFFER ) {
 894                  			CQL_ensure_buffer_stack ();
 895                  			YY_CURRENT_BUFFER_LVALUE =
 896                  				CQL__create_buffer(CQL_in,YY_BUF_SIZE );
 897                  		}
 898 chuck       1.2  
 899 karl        1.23 		CQL__load_buffer_state( );
 900 karl        1.17 		}
 901                  
 902                  	while ( 1 )		/* loops until end-of-file is reached */
 903                  		{
 904 karl        1.23 		yy_cp = (yy_c_buf_p);
 905 karl        1.17 
 906 karl        1.23 		/* Support of CQL_text. */
 907                  		*yy_cp = (yy_hold_char);
 908 chuck       1.2  
 909 karl        1.17 		/* yy_bp points to the position in yy_ch_buf of the start of
 910                  		 * the current run.
 911                  		 */
 912                  		yy_bp = yy_cp;
 913 chuck       1.2  
 914 karl        1.23 		yy_current_state = (yy_start);
 915 chuck       1.2  yy_match:
 916 karl        1.17 		do
 917                  			{
 918                  			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
 919                  			if ( yy_accept[yy_current_state] )
 920                  				{
 921 karl        1.23 				(yy_last_accepting_state) = yy_current_state;
 922                  				(yy_last_accepting_cpos) = yy_cp;
 923 karl        1.17 				}
 924                  			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 925                  				{
 926                  				yy_current_state = (int) yy_def[yy_current_state];
 927                  				if ( yy_current_state >= 170 )
 928                  					yy_c = yy_meta[(unsigned int) yy_c];
 929                  				}
 930                  			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 931                  			++yy_cp;
 932                  			}
 933 karl        1.23 		while ( yy_current_state != 169 );
 934                  		yy_cp = (yy_last_accepting_cpos);
 935                  		yy_current_state = (yy_last_accepting_state);
 936 chuck       1.2  
 937                  yy_find_action:
 938 karl        1.17 		yy_act = yy_accept[yy_current_state];
 939                  
 940                  		YY_DO_BEFORE_ACTION;
 941                  
 942                  do_action:	/* This label is used only to access EOF actions. */
 943                  
 944                  		switch ( yy_act )
 945                  	{ /* beginning of action switch */
 946                  			case 0: /* must back up */
 947                  			/* undo the effects of YY_DO_BEFORE_ACTION */
 948 karl        1.23 			*yy_cp = (yy_hold_char);
 949                  			yy_cp = (yy_last_accepting_cpos);
 950                  			yy_current_state = (yy_last_accepting_state);
 951 karl        1.17 			goto yy_find_action;
 952 chuck       1.2  
 953                  case 1:
 954                  YY_RULE_SETUP
 955 karl        1.23 #line 124 "CQL.l"
 956 chuck       1.2  {
 957                  
 958 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_SELECT] ", CQL_text);
 959 kumpf       1.24     CQL_globalParserState->currentTokenPos+=CQL_leng;
 960 humberto    1.10     CQL_globalParserState->tokenCount++;
 961 karl        1.16     return TOK_SELECT;
 962 chuck       1.2  }
 963 karl        1.17 	YY_BREAK
 964 chuck       1.2  case 2:
 965                  YY_RULE_SETUP
 966 karl        1.23 #line 132 "CQL.l"
 967 chuck       1.2  {
 968                  
 969 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_FROM] ", CQL_text);
 970                      CQL_globalParserState->currentTokenPos+=CQL_leng;
 971 humberto    1.10     CQL_globalParserState->tokenCount++;
 972 karl        1.16     return TOK_FROM;
 973 chuck       1.2  }
 974 karl        1.17 	YY_BREAK
 975 chuck       1.2  case 3:
 976                  YY_RULE_SETUP
 977 karl        1.23 #line 140 "CQL.l"
 978 chuck       1.2  {
 979                  
 980 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_WHERE] ", CQL_text);
 981                      CQL_globalParserState->currentTokenPos+=CQL_leng;
 982 humberto    1.10     CQL_globalParserState->tokenCount++;
 983 karl        1.16     return TOK_WHERE;
 984 chuck       1.2  }
 985 karl        1.17 	YY_BREAK
 986 chuck       1.2  case 4:
 987                  YY_RULE_SETUP
 988 karl        1.23 #line 148 "CQL.l"
 989 chuck       1.2  {
 990                  
 991 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_ANY] ", CQL_text);
 992                      CQL_globalParserState->currentTokenPos+=CQL_leng;
 993 humberto    1.10     CQL_globalParserState->tokenCount++;
 994 karl        1.16     return TOK_ANY;
 995 chuck       1.2  }
 996 karl        1.17 	YY_BREAK
 997 chuck       1.2  case 5:
 998                  YY_RULE_SETUP
 999 karl        1.23 #line 156 "CQL.l"
1000 chuck       1.2  {
1001 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_AS] ", CQL_text);
1002                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1003 humberto    1.10     CQL_globalParserState->tokenCount++;
1004 karl        1.16     return TOK_AS;
1005 chuck       1.2  }
1006 karl        1.17 	YY_BREAK
1007 chuck       1.2  case 6:
1008                  YY_RULE_SETUP
1009 karl        1.23 #line 163 "CQL.l"
1010 chuck       1.2  {
1011 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_ASC] ", CQL_text);
1012                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1013 humberto    1.10     CQL_globalParserState->tokenCount++;
1014 karl        1.16     return TOK_ASC;
1015 chuck       1.2  }
1016 karl        1.17 	YY_BREAK
1017 chuck       1.2  case 7:
1018                  YY_RULE_SETUP
1019 karl        1.23 #line 170 "CQL.l"
1020 chuck       1.2  {
1021 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_BY] ", CQL_text);
1022                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1023 humberto    1.10     CQL_globalParserState->tokenCount++;
1024 karl        1.16     return TOK_BY;
1025 chuck       1.2  }
1026 karl        1.17 	YY_BREAK
1027 chuck       1.2  case 8:
1028                  YY_RULE_SETUP
1029 karl        1.23 #line 177 "CQL.l"
1030 chuck       1.2  {
1031 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_DESC] ", CQL_text);
1032                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1033 humberto    1.10     CQL_globalParserState->tokenCount++;
1034 karl        1.16     return TOK_DESC;
1035 chuck       1.2  }
1036 karl        1.17 	YY_BREAK
1037 chuck       1.2  case 9:
1038                  YY_RULE_SETUP
1039 karl        1.23 #line 185 "CQL.l"
1040 chuck       1.2  {
1041 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_DISTINCT] ", CQL_text);
1042                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1043 humberto    1.10     CQL_globalParserState->tokenCount++;
1044 karl        1.16     return TOK_DISTINCT;
1045 chuck       1.2  }
1046 karl        1.17 	YY_BREAK
1047 chuck       1.2  case 10:
1048                  YY_RULE_SETUP
1049 karl        1.23 #line 192 "CQL.l"
1050 chuck       1.2  {
1051 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_EVERY] ", CQL_text);
1052                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1053 humberto    1.10     CQL_globalParserState->tokenCount++;
1054 karl        1.16     return TOK_EVERY;
1055 chuck       1.2  }
1056 karl        1.17 	YY_BREAK
1057 chuck       1.2  case 11:
1058                  YY_RULE_SETUP
1059 karl        1.23 #line 199 "CQL.l"
1060 chuck       1.2  {
1061 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_FIRST] ", CQL_text);
1062                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1063 humberto    1.10     CQL_globalParserState->tokenCount++;
1064 karl        1.16     return TOK_FIRST;
1065 chuck       1.2  }
1066 karl        1.17 	YY_BREAK
1067 chuck       1.2  case 12:
1068                  YY_RULE_SETUP
1069 karl        1.23 #line 206 "CQL.l"
1070 chuck       1.2  {
1071 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_IN] ", CQL_text);
1072                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1073 humberto    1.10     CQL_globalParserState->tokenCount++;
1074 karl        1.16     return TOK_IN;
1075 chuck       1.2  }
1076 karl        1.17 	YY_BREAK
1077 chuck       1.2  case 13:
1078                  YY_RULE_SETUP
1079 karl        1.23 #line 213 "CQL.l"
1080 chuck       1.2  {
1081 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_IS] ", CQL_text);
1082                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1083 humberto    1.10     CQL_globalParserState->tokenCount++;
1084 karl        1.16     return TOK_IS;
1085 chuck       1.2  }
1086 karl        1.17 	YY_BREAK
1087 chuck       1.2  case 14:
1088                  YY_RULE_SETUP
1089 karl        1.23 #line 220 "CQL.l"
1090 chuck       1.2  {
1091 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [ISA] ", CQL_text);
1092                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1093 humberto    1.10     CQL_globalParserState->tokenCount++;
1094 karl        1.16     return TOK_ISA;
1095 chuck       1.2  }
1096 karl        1.17 	YY_BREAK
1097 chuck       1.2  case 15:
1098                  YY_RULE_SETUP
1099 karl        1.23 #line 227 "CQL.l"
1100 chuck       1.2  {
1101 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOKE_LIKE] ", CQL_text);
1102                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1103 humberto    1.10     CQL_globalParserState->tokenCount++;
1104 karl        1.16     return TOK_LIKE;
1105 chuck       1.2  }
1106 karl        1.17 	YY_BREAK
1107 chuck       1.2  case 16:
1108                  YY_RULE_SETUP
1109 karl        1.23 #line 234 "CQL.l"
1110 chuck       1.2  {
1111 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_ORDER] ", CQL_text);
1112                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1113 humberto    1.10     CQL_globalParserState->tokenCount++;
1114 karl        1.16     return TOK_ORDER;
1115 chuck       1.2  }
1116 karl        1.17 	YY_BREAK
1117 chuck       1.2  case 17:
1118                  YY_RULE_SETUP
1119 karl        1.23 #line 241 "CQL.l"
1120 chuck       1.2  {
1121 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_SATISFIES] ", CQL_text);
1122                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1123 humberto    1.10     CQL_globalParserState->tokenCount++;
1124 karl        1.16     return TOK_SATISFIES;
1125 chuck       1.2  }
1126 karl        1.17 	YY_BREAK
1127 chuck       1.2  case 18:
1128                  YY_RULE_SETUP
1129 karl        1.23 #line 248 "CQL.l"
1130 chuck       1.2  {
1131 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_TRUE] ", CQL_text);
1132                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1133 humberto    1.10     CQL_globalParserState->tokenCount++;
1134 karl        1.16     return TOK_TRUE;
1135 chuck       1.2  }
1136 karl        1.17 	YY_BREAK
1137 chuck       1.2  case 19:
1138                  YY_RULE_SETUP
1139 karl        1.23 #line 255 "CQL.l"
1140 chuck       1.2  {
1141 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_FALSE] ", CQL_text);
1142                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1143 humberto    1.10     CQL_globalParserState->tokenCount++;
1144 karl        1.16     return TOK_FALSE;
1145 chuck       1.2  }
1146 karl        1.17 	YY_BREAK
1147 chuck       1.2  case 20:
1148                  YY_RULE_SETUP
1149 karl        1.23 #line 262 "CQL.l"
1150 chuck       1.2  {
1151 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NULL] ", CQL_text);
1152                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1153 humberto    1.10     CQL_globalParserState->tokenCount++;
1154 karl        1.16     return TOK_NULL;
1155 chuck       1.2  }
1156 karl        1.17 	YY_BREAK
1157 chuck       1.2  case 21:
1158                  YY_RULE_SETUP
1159 karl        1.23 #line 269 "CQL.l"
1160 chuck       1.2  {
1161 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NOT] ", CQL_text);
1162                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1163 humberto    1.10     CQL_globalParserState->tokenCount++;
1164 karl        1.16     return TOK_NOT;
1165 chuck       1.2  }
1166 karl        1.17 	YY_BREAK
1167 chuck       1.2  case 22:
1168                  YY_RULE_SETUP
1169 karl        1.23 #line 276 "CQL.l"
1170 chuck       1.2  {
1171 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_AND] ", CQL_text);
1172                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1173 humberto    1.10     CQL_globalParserState->tokenCount++;
1174 karl        1.16     return TOK_AND;
1175 chuck       1.2  }
1176 karl        1.17 	YY_BREAK
1177 chuck       1.2  case 23:
1178                  YY_RULE_SETUP
1179 karl        1.23 #line 283 "CQL.l"
1180 chuck       1.2  {
1181 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_OR] ", CQL_text);
1182                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1183 humberto    1.10     CQL_globalParserState->tokenCount++;
1184 karl        1.16     return TOK_OR;
1185 chuck       1.2  }
1186 karl        1.17 	YY_BREAK
1187 karl        1.23 /* NOCHKSRC */
1188 chuck       1.2  case 24:
1189                  YY_RULE_SETUP
1190 karl        1.23 #line 290 "CQL.l"
1191 chuck       1.2  {
1192 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1193 humberto    1.10     CQL_globalParserState->tokenCount++;
1194 karl        1.16      /* remove any single quotes surrounding embedded literals */
1195                       size_t n;
1196                       if(CQL_lval.strValue)
1197                               delete [] CQL_lval.strValue;
1198 karl        1.23      /* CHKSRC */
1199 chuck       1.13     // chuck
1200 karl        1.23     if (!isUTF8Str(CQL_text))
1201 kumpf       1.24     {
1202 dave.sudlik 1.18         CQL_DEBUG_TRACE("LEX: [STRING]-> BAD UTF\n");
1203 chuck       1.13         throw CQLSyntaxErrorException(
1204 karl        1.16             MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1205                              "Bad UTF8 encountered parsing rule $0 in position $1.",
1206                              "identifier",
1207                              CQL_globalParserState->currentTokenPos));
1208                      }
1209 kumpf       1.24 
1210 karl        1.23      String s(CQL_text);
1211 karl        1.16      Uint32 index = s.find("'");
1212                       if(index != PEG_NOT_FOUND){
1213                          s.remove(index,1);
1214                          s.remove(s.size()-1,1);
1215                          CString cstr = s.getCString();
1216                          const char* string = (const char*)cstr;
1217                          n = strlen(string);
1218                          CQL_lval.strValue = new char[n+1];
1219                          memcpy(CQL_lval.strValue, string, n);
1220                       }else{
1221 karl        1.23         n = strlen(CQL_text);
1222 karl        1.16         CQL_lval.strValue = new char[n+1];
1223 karl        1.23       memcpy(CQL_lval.strValue, CQL_text, n);
1224 karl        1.16      }
1225 chuck       1.2      CQL_lval.strValue[n] = '\0';
1226 dave.sudlik 1.18     CQL_DEBUG_TRACE2("LEX: %s [SCOPED_PROPERTY] ", CQL_lval.strValue);
1227 chuck       1.2  
1228 karl        1.16     return TOK_SCOPED_PROPERTY;
1229 chuck       1.2  }
1230 karl        1.17 	YY_BREAK
1231 chuck       1.2  case 25:
1232                  YY_RULE_SETUP
1233 karl        1.23 #line 330 "CQL.l"
1234 chuck       1.2  {
1235 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NEGATIVE_HEXADECIMAL] ", CQL_text);
1236                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1237 humberto    1.10     CQL_globalParserState->tokenCount++;
1238 chuck       1.2      /* copy the hex value */
1239                      {
1240 karl        1.23         size_t n = strlen(CQL_text);
1241 karl        1.16     if(CQL_lval.strValue)
1242                          delete [] CQL_lval.strValue;
1243 chuck       1.2          CQL_lval.strValue = new char[n + 1];
1244 karl        1.23         memcpy(CQL_lval.strValue, CQL_text, n);
1245 chuck       1.2          CQL_lval.strValue[n] = '\0';
1246                      }
1247 karl        1.16     return TOK_NEGATIVE_HEXADECIMAL;
1248 chuck       1.2  }
1249 karl        1.17 	YY_BREAK
1250 chuck       1.2  case 26:
1251                  YY_RULE_SETUP
1252 karl        1.23 #line 346 "CQL.l"
1253 chuck       1.2  {
1254 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_HEXADECIMAL] ", CQL_text);
1255                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1256 humberto    1.10     CQL_globalParserState->tokenCount++;
1257 chuck       1.2      /* copy the hex value */
1258                      {
1259 karl        1.23         size_t n = strlen(CQL_text);
1260 chuck       1.2          if(CQL_lval.strValue)
1261                                  delete [] CQL_lval.strValue;
1262                          CQL_lval.strValue = new char[n + 1];
1263 karl        1.23         memcpy(CQL_lval.strValue, CQL_text, n);
1264 chuck       1.2          CQL_lval.strValue[n] = '\0';
1265                      }
1266 karl        1.16     return TOK_HEXADECIMAL;
1267 chuck       1.2  }
1268 karl        1.17 	YY_BREAK
1269 chuck       1.2  case 27:
1270                  YY_RULE_SETUP
1271 karl        1.23 #line 362 "CQL.l"
1272 chuck       1.2  {
1273 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NEGATIVE_BINARY] ", CQL_text);
1274                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1275 humberto    1.10     CQL_globalParserState->tokenCount++;
1276 kumpf       1.24     /* copy the bin value */
1277 chuck       1.2      {
1278 karl        1.23         size_t n = strlen(CQL_text);
1279 karl        1.16     if(CQL_lval.strValue)
1280 chuck       1.2                  delete [] CQL_lval.strValue;
1281                          CQL_lval.strValue = new char[n + 1];
1282 karl        1.23         memcpy(CQL_lval.strValue, CQL_text, n);
1283 chuck       1.2          CQL_lval.strValue[n] = '\0';
1284                      }
1285 karl        1.16     return TOK_NEGATIVE_BINARY;
1286 chuck       1.2  }
1287 karl        1.17 	YY_BREAK
1288 chuck       1.2  case 28:
1289                  YY_RULE_SETUP
1290 karl        1.23 #line 378 "CQL.l"
1291 chuck       1.2  {
1292 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_BINARY] ", CQL_text);
1293                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1294 humberto    1.10     CQL_globalParserState->tokenCount++;
1295 chuck       1.2      /* copy the bin value */
1296                      {
1297 karl        1.23         size_t n = strlen(CQL_text);
1298 chuck       1.2          if(CQL_lval.strValue)
1299                                  delete [] CQL_lval.strValue;
1300                          CQL_lval.strValue = new char[n + 1];
1301 karl        1.23         memcpy(CQL_lval.strValue, CQL_text, n);
1302 chuck       1.2          CQL_lval.strValue[n] = '\0';
1303                      }
1304 karl        1.16     return TOK_BINARY;
1305 chuck       1.2  }
1306 karl        1.17 	YY_BREAK
1307 chuck       1.2  case 29:
1308                  YY_RULE_SETUP
1309 karl        1.23 #line 395 "CQL.l"
1310 chuck       1.2  {
1311                  
1312 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NEGATIVE_INTEGER] ", CQL_text);
1313                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1314 humberto    1.10     CQL_globalParserState->tokenCount++;
1315 karl        1.23     size_t n = strlen(CQL_text);
1316 chuck       1.2      if(CQL_lval.strValue)
1317 karl        1.16         delete [] CQL_lval.strValue;
1318 chuck       1.2      CQL_lval.strValue = new char[n + 1];
1319 karl        1.23     memcpy(CQL_lval.strValue, CQL_text, n);
1320 chuck       1.2      CQL_lval.strValue[n] = '\0';
1321                  
1322 karl        1.23     /*CQL_lval.intValue = strtol(CQL_text, (char**)0, 10);*/
1323 karl        1.16     return TOK_NEGATIVE_INTEGER;
1324 chuck       1.2  }
1325 karl        1.17 	YY_BREAK
1326 chuck       1.2  case 30:
1327                  YY_RULE_SETUP
1328 karl        1.23 #line 411 "CQL.l"
1329 chuck       1.2  {
1330 karl        1.17 
1331 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_INTEGER] ", CQL_text);
1332                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1333 humberto    1.10     CQL_globalParserState->tokenCount++;
1334 karl        1.23     size_t n = strlen(CQL_text);
1335 chuck       1.2      if(CQL_lval.strValue)
1336                              delete [] CQL_lval.strValue;
1337                      CQL_lval.strValue = new char[n + 1];
1338 karl        1.23     memcpy(CQL_lval.strValue, CQL_text, n);
1339 chuck       1.2      CQL_lval.strValue[n] = '\0';
1340 karl        1.17 
1341 karl        1.23     /*CQL_lval.intValue = strtol(CQL_text, (char**)0, 10);*/
1342 karl        1.16     return TOK_INTEGER;
1343 chuck       1.2  }
1344 karl        1.17 	YY_BREAK
1345 chuck       1.2  case 31:
1346                  YY_RULE_SETUP
1347 karl        1.23 #line 427 "CQL.l"
1348 chuck       1.2  {
1349                  
1350 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NEGATIVE_REAL] ", CQL_text);
1351                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1352 humberto    1.10     CQL_globalParserState->tokenCount++;
1353 karl        1.23     size_t n = strlen(CQL_text);
1354 chuck       1.2      if(CQL_lval.strValue)
1355                              delete [] CQL_lval.strValue;
1356                      CQL_lval.strValue = new char[n + 1];
1357 karl        1.23     memcpy(CQL_lval.strValue, CQL_text, n);
1358 chuck       1.2      CQL_lval.strValue[n] = '\0';
1359                  
1360 karl        1.23     /*CQL_lval.realValue = strtod((char*)CQL_text, (char**)0);*/
1361 karl        1.16     return TOK_NEGATIVE_REAL;
1362 chuck       1.2  }
1363 karl        1.17 	YY_BREAK
1364 karl        1.23 /* NOCHKSRC */
1365 humberto    1.11 case 32:
1366 chuck       1.2  YY_RULE_SETUP
1367 karl        1.23 #line 443 "CQL.l"
1368 chuck       1.2  {
1369 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_REAL] ", CQL_text);
1370                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1371 humberto    1.10     CQL_globalParserState->tokenCount++;
1372 karl        1.23     size_t n = strlen(CQL_text);
1373 chuck       1.2      if(CQL_lval.strValue)
1374                              delete [] CQL_lval.strValue;
1375                      CQL_lval.strValue = new char[n + 1];
1376 karl        1.23     memcpy(CQL_lval.strValue, CQL_text, n);
1377 chuck       1.2      CQL_lval.strValue[n] = '\0';
1378 karl        1.17 
1379 karl        1.23     /*CQL_lval.realValue = strtod((char*)CQL_text, (char**)0);*/
1380 karl        1.16     return TOK_REAL;
1381 chuck       1.2  }
1382 karl        1.17 	YY_BREAK
1383 karl        1.23 /* CHKSRC */
1384 humberto    1.11 case 33:
1385 karl        1.23 /* rule 33 can match eol */
1386 chuck       1.2  YY_RULE_SETUP
1387 karl        1.23 #line 458 "CQL.l"
1388 chuck       1.2  {
1389 karl        1.16     /* \'[^\'\n]*\' */
1390 chuck       1.2      /* ATTN-B: handle long literals by using yyinput(). */
1391                      /* ATTN-B: Handle expansion of special characters */
1392                  
1393 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_STRING_LITERAL] ", CQL_text);
1394                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1395 humberto    1.10     CQL_globalParserState->tokenCount++;
1396 chuck       1.2      /* remove any escaped \ OR escaped ' */
1397                  
1398                      String _esc_doubleslash = "\\\\";
1399                      String _esc_singlequote = "\\'";
1400 chuck       1.13 
1401 karl        1.23     if (!isUTF8Str(CQL_text))
1402 kumpf       1.24     {
1403 dave.sudlik 1.18         CQL_DEBUG_TRACE("LEX: [STRING]-> BAD UTF\n");
1404 chuck       1.13         throw CQLSyntaxErrorException(
1405 kumpf       1.22             MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
1406                                  "Bad UTF8 encountered parsing rule $0 in position $1.",
1407                                  "literal_string",
1408 karl        1.17                 CQL_globalParserState->currentTokenPos));
1409 chuck       1.13     }
1410                  
1411 karl        1.23     String s(CQL_text);
1412 chuck       1.2  
1413                      Uint32 index = 1;
1414 kumpf       1.24     while((index = s.find(_esc_doubleslash)) != PEG_NOT_FOUND ||
1415 karl        1.16            (index = s.find(_esc_singlequote)) != PEG_NOT_FOUND)
1416                       {
1417                           // make sure we don't remove the slasy from say 'abc\'
1418                           if(index == s.size() - 2)
1419                                  break;
1420                           s.remove(index,1);
1421 chuck       1.2      }
1422                      CString cstr = s.getCString();
1423                      const char* string = (const char*)cstr;
1424                  
1425                      /* Copy the string (but remove the surrounding quotes */
1426                  
1427                      {
1428 karl        1.16     size_t n = strlen(string) - 2;
1429                      if(CQL_lval.strValue)
1430                          delete [] CQL_lval.strValue;
1431                      CQL_lval.strValue = new char[n + 1];
1432                      memcpy(CQL_lval.strValue, string + 1, n);
1433                      CQL_lval.strValue[n] = '\0';
1434 chuck       1.2      }
1435 karl        1.16     return TOK_STRING_LITERAL;
1436 chuck       1.2  }
1437 karl        1.17 	YY_BREAK
1438 humberto    1.11 case 34:
1439 karl        1.23 *yy_cp = (yy_hold_char); /* undo effects of setting up CQL_text */
1440                  (yy_c_buf_p) = yy_cp -= 1;
1441                  YY_DO_BEFORE_ACTION; /* set up CQL_text again */
1442 chuck       1.2  YY_RULE_SETUP
1443 karl        1.23 #line 508 "CQL.l"
1444 chuck       1.2  {
1445                  
1446 dave.sudlik 1.18     CQL_DEBUG_TRACE("Unterminated string");
1447 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1448 humberto    1.10     CQL_globalParserState->tokenCount++;
1449 chuck       1.2  }
1450 karl        1.17 	YY_BREAK
1451 humberto    1.11 case 35:
1452 chuck       1.2  YY_RULE_SETUP
1453 karl        1.23 #line 515 "CQL.l"
1454 chuck       1.2  {
1455 dave.sudlik 1.18    CQL_DEBUG_TRACE("LEX: [TOK_STAR] ");
1456 karl        1.23    CQL_globalParserState->currentTokenPos+=CQL_leng;
1457 humberto    1.10    CQL_globalParserState->tokenCount++;
1458 karl        1.16    return TOK_STAR;
1459 chuck       1.2  }
1460 karl        1.17 	YY_BREAK
1461 humberto    1.11 case 36:
1462 chuck       1.2  YY_RULE_SETUP
1463 karl        1.23 #line 522 "CQL.l"
1464 chuck       1.2  {
1465 dave.sudlik 1.18    CQL_DEBUG_TRACE("LEX: [TOK_DIV] ");
1466 karl        1.23    CQL_globalParserState->currentTokenPos+=CQL_leng;
1467 humberto    1.10    CQL_globalParserState->tokenCount++;
1468 karl        1.16    return TOK_DIV;
1469 chuck       1.2  }
1470 karl        1.17 	YY_BREAK
1471 humberto    1.11 case 37:
1472 chuck       1.2  YY_RULE_SETUP
1473 karl        1.23 #line 529 "CQL.l"
1474 chuck       1.2  {
1475 dave.sudlik 1.18    CQL_DEBUG_TRACE("LEX: [TOK_PLUS] ");
1476 karl        1.23    CQL_globalParserState->currentTokenPos+=CQL_leng;
1477 humberto    1.10    CQL_globalParserState->tokenCount++;
1478 karl        1.16    return TOK_PLUS;
1479 chuck       1.2  }
1480 karl        1.17 	YY_BREAK
1481 humberto    1.11 case 38:
1482 chuck       1.2  YY_RULE_SETUP
1483 karl        1.23 #line 536 "CQL.l"
1484 chuck       1.2  {
1485 dave.sudlik 1.18    CQL_DEBUG_TRACE("LEX: [TOK_MINUS] ");
1486 karl        1.23    CQL_globalParserState->currentTokenPos+=CQL_leng;
1487 humberto    1.10    CQL_globalParserState->tokenCount++;
1488 karl        1.16    return TOK_MINUS;
1489 chuck       1.2  }
1490 karl        1.17 	YY_BREAK
1491 humberto    1.11 case 39:
1492 chuck       1.2  YY_RULE_SETUP
1493 karl        1.23 #line 543 "CQL.l"
1494 chuck       1.2  {
1495 dave.sudlik 1.18    CQL_DEBUG_TRACE("LEX: [TOK_COMMA] ");
1496 karl        1.23    CQL_globalParserState->currentTokenPos+=CQL_leng;
1497 humberto    1.10    CQL_globalParserState->tokenCount++;
1498 karl        1.16    return TOK_COMMA;
1499 chuck       1.2  }
1500 karl        1.17 	YY_BREAK
1501 humberto    1.11 case 40:
1502 chuck       1.2  YY_RULE_SETUP
1503 karl        1.23 #line 550 "CQL.l"
1504 chuck       1.2  {
1505 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_DOTDOT] ");
1506 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1507 humberto    1.10     CQL_globalParserState->tokenCount++;
1508 karl        1.16     return TOK_DOTDOT;
1509 chuck       1.2  }
1510 karl        1.17 	YY_BREAK
1511 humberto    1.11 case 41:
1512 chuck       1.2  YY_RULE_SETUP
1513 karl        1.23 #line 557 "CQL.l"
1514 chuck       1.2  {
1515 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_HASH] ");
1516 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1517 humberto    1.10     CQL_globalParserState->tokenCount++;
1518 karl        1.16     return TOK_HASH;
1519 chuck       1.2  }
1520 karl        1.17 	YY_BREAK
1521 humberto    1.11 case 42:
1522 chuck       1.2  YY_RULE_SETUP
1523 karl        1.23 #line 564 "CQL.l"
1524 chuck       1.2  {
1525 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_DOT] ");
1526 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1527 humberto    1.10     CQL_globalParserState->tokenCount++;
1528 karl        1.16     return TOK_DOT;
1529 chuck       1.2  }
1530 karl        1.17 	YY_BREAK
1531 humberto    1.11 case 43:
1532 chuck       1.2  YY_RULE_SETUP
1533 karl        1.23 #line 571 "CQL.l"
1534 chuck       1.2  {
1535 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_LBRKT] ");
1536 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1537 humberto    1.10     CQL_globalParserState->tokenCount++;
1538 karl        1.16     return TOK_LBRKT;
1539 chuck       1.2  }
1540 karl        1.17 	YY_BREAK
1541 humberto    1.11 case 44:
1542 chuck       1.2  YY_RULE_SETUP
1543 karl        1.23 #line 578 "CQL.l"
1544 chuck       1.2  {
1545 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_RBRKT] ");
1546 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1547 humberto    1.10     CQL_globalParserState->tokenCount++;
1548 karl        1.16     return TOK_RBRKT;
1549 chuck       1.2  }
1550 karl        1.17 	YY_BREAK
1551 humberto    1.11 case 45:
1552 chuck       1.2  YY_RULE_SETUP
1553 karl        1.23 #line 585 "CQL.l"
1554 chuck       1.2  {
1555 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_LPAR] ");
1556 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1557 humberto    1.10     CQL_globalParserState->tokenCount++;
1558 karl        1.16     return TOK_LPAR;
1559 chuck       1.2  }
1560 karl        1.17 	YY_BREAK
1561 humberto    1.11 case 46:
1562 chuck       1.2  YY_RULE_SETUP
1563 karl        1.23 #line 592 "CQL.l"
1564 chuck       1.2  {
1565 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX: [TOK_RPAR] ");
1566 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1567 humberto    1.10     CQL_globalParserState->tokenCount++;
1568 karl        1.16     return TOK_RPAR;
1569 chuck       1.2  }
1570 karl        1.17 	YY_BREAK
1571 humberto    1.11 case 47:
1572 chuck       1.2  YY_RULE_SETUP
1573 karl        1.23 #line 599 "CQL.l"
1574 chuck       1.2  {
1575 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_DBL_PIPE] ", CQL_text);
1576                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1577 humberto    1.10     CQL_globalParserState->tokenCount++;
1578 karl        1.16     return TOK_DBL_PIPE;
1579 chuck       1.2  }
1580 karl        1.17 	YY_BREAK
1581 humberto    1.11 case 48:
1582 chuck       1.2  YY_RULE_SETUP
1583 karl        1.23 #line 606 "CQL.l"
1584 chuck       1.2  {
1585 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_UNDERSCORE] ", CQL_text);
1586                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1587 humberto    1.10     CQL_globalParserState->tokenCount++;
1588 karl        1.16     return TOK_UNDERSCORE;
1589 chuck       1.2  }
1590 karl        1.17 	YY_BREAK
1591 humberto    1.11 case 49:
1592 chuck       1.2  YY_RULE_SETUP
1593 karl        1.23 #line 613 "CQL.l"
1594 kumpf       1.24 {
1595 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_EQ] ", CQL_text);
1596                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1597 humberto    1.10     CQL_globalParserState->tokenCount++;
1598 kumpf       1.24     return TOK_EQ;
1599 chuck       1.2  }
1600 karl        1.17 	YY_BREAK
1601 humberto    1.11 case 50:
1602 chuck       1.2  YY_RULE_SETUP
1603 karl        1.23 #line 621 "CQL.l"
1604 kumpf       1.24 {
1605 chuck       1.2  
1606 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_NE] ", CQL_text);
1607                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1608 humberto    1.10     CQL_globalParserState->tokenCount++;
1609 kumpf       1.24     return TOK_NE;
1610 chuck       1.2  }
1611 karl        1.17 	YY_BREAK
1612 humberto    1.11 case 51:
1613 chuck       1.2  YY_RULE_SETUP
1614 karl        1.23 #line 630 "CQL.l"
1615 kumpf       1.24 {
1616 chuck       1.2  
1617 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_LE] ", CQL_text);
1618                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1619 humberto    1.10     CQL_globalParserState->tokenCount++;
1620 kumpf       1.24     return TOK_LE;
1621 chuck       1.2  }
1622 karl        1.17 	YY_BREAK
1623 humberto    1.11 case 52:
1624 chuck       1.2  YY_RULE_SETUP
1625 karl        1.23 #line 638 "CQL.l"
1626 kumpf       1.24 {
1627 chuck       1.2  
1628 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_LT] ", CQL_text);
1629                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1630 humberto    1.10     CQL_globalParserState->tokenCount++;
1631 kumpf       1.24     return TOK_LT;
1632 chuck       1.2  }
1633 karl        1.17 	YY_BREAK
1634 humberto    1.11 case 53:
1635 chuck       1.2  YY_RULE_SETUP
1636 karl        1.23 #line 646 "CQL.l"
1637 kumpf       1.24 {
1638 chuck       1.2  
1639 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_GE] ", CQL_text);
1640                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1641 humberto    1.10     CQL_globalParserState->tokenCount++;
1642 kumpf       1.24     return TOK_GE;
1643 chuck       1.2  }
1644 karl        1.17 	YY_BREAK
1645 humberto    1.11 case 54:
1646 chuck       1.2  YY_RULE_SETUP
1647 karl        1.23 #line 654 "CQL.l"
1648 kumpf       1.24 {
1649 chuck       1.2  
1650 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_GT] ", CQL_text);
1651                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1652 humberto    1.10     CQL_globalParserState->tokenCount++;
1653 kumpf       1.24     return TOK_GT;
1654 chuck       1.2  }
1655 karl        1.17 	YY_BREAK
1656 humberto    1.11 case 55:
1657 chuck       1.2  YY_RULE_SETUP
1658 karl        1.23 #line 662 "CQL.l"
1659 chuck       1.2  {
1660                  
1661 karl        1.23     CQL_DEBUG_TRACE2("LEX: %s [TOK_IDENTIFIER] ", CQL_text);
1662                      CQL_globalParserState->currentTokenPos+=CQL_leng;
1663 humberto    1.10     CQL_globalParserState->tokenCount++;
1664 chuck       1.2      {
1665 karl        1.23         size_t n = strlen(CQL_text);
1666 karl        1.17         if(CQL_lval.strValue)
1667                              delete [] CQL_lval.strValue;
1668                          CQL_lval.strValue = new char[n + 1];
1669 karl        1.23         memcpy(CQL_lval.strValue, CQL_text, n);
1670 karl        1.17         CQL_lval.strValue[n] = '\0';
1671 chuck       1.2      }
1672                  
1673 karl        1.16     return TOK_IDENTIFIER;
1674 chuck       1.2  }
1675 karl        1.17 	YY_BREAK
1676 humberto    1.11 case 56:
1677 chuck       1.2  YY_RULE_SETUP
1678 karl        1.23 #line 679 "CQL.l"
1679 chuck       1.2  {
1680                  
1681                      /* Ignore blanks */
1682 karl        1.23     CQL_globalParserState->currentTokenPos+=CQL_leng;
1683 chuck       1.2  }
1684 karl        1.17 	YY_BREAK
1685 humberto    1.11 case 57:
1686 karl        1.23 /* rule 57 can match eol */
1687 chuck       1.2  YY_RULE_SETUP
1688 karl        1.23 #line 685 "CQL.l"
1689 chuck       1.2  {
1690 karl        1.16     CQL_globalParserState->currentTokenPos=0;
1691                      return 0;
1692 chuck       1.2     }
1693 karl        1.17 	YY_BREAK
1694 chuck       1.2  case YY_STATE_EOF(INITIAL):
1695 karl        1.23 #line 690 "CQL.l"
1696 chuck       1.2  {
1697                               return 0;
1698                          }
1699 karl        1.17 	YY_BREAK
1700 humberto    1.11 case 58:
1701 chuck       1.2  YY_RULE_SETUP
1702 karl        1.23 #line 694 "CQL.l"
1703 chuck       1.2  {
1704 kumpf       1.19     delete [] CQL_lval.strValue;
1705 chuck       1.2      CQL_lval.strValue = 0;
1706 dave.sudlik 1.18     CQL_DEBUG_TRACE("LEX::TOK_UNEXPECTED_CHAR\n");
1707 chuck       1.2  
1708 karl        1.16     return TOK_UNEXPECTED_CHAR;
1709 chuck       1.2  }
1710 karl        1.17 	YY_BREAK
1711 humberto    1.11 case 59:
1712 chuck       1.2  YY_RULE_SETUP
1713 karl        1.23 #line 702 "CQL.l"
1714 chuck       1.2  ECHO;
1715 karl        1.17 	YY_BREAK
1716 karl        1.23 #line 1714 "lex.CQL_.c"
1717 chuck       1.2  
1718 karl        1.17 	case YY_END_OF_BUFFER:
1719                  		{
1720                  		/* Amount of text matched not including the EOB char. */
1721 karl        1.23 		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1722 karl        1.17 
1723                  		/* Undo the effects of YY_DO_BEFORE_ACTION. */
1724 karl        1.23 		*yy_cp = (yy_hold_char);
1725 karl        1.17 		YY_RESTORE_YY_MORE_OFFSET
1726                  
1727 karl        1.23 		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1728 karl        1.17 			{
1729                  			/* We're scanning a new file or input source.  It's
1730                  			 * possible that this happened because the user
1731 karl        1.23 			 * just pointed CQL_in at a new source and called
1732                  			 * CQL_lex().  If so, then we have to assure
1733                  			 * consistency between YY_CURRENT_BUFFER and our
1734 karl        1.17 			 * globals.  Here is the right place to do so, because
1735                  			 * this is the first action (other than possibly a
1736                  			 * back-up) that will match for the new input source.
1737                  			 */
1738 karl        1.23 			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1739                  			YY_CURRENT_BUFFER_LVALUE->yy_input_file = CQL_in;
1740                  			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1741 karl        1.17 			}
1742                  
1743                  		/* Note that here we test for yy_c_buf_p "<=" to the position
1744                  		 * of the first EOB in the buffer, since yy_c_buf_p will
1745                  		 * already have been incremented past the NUL character
1746                  		 * (since all states make transitions on EOB to the
1747                  		 * end-of-buffer state).  Contrast this with the test
1748                  		 * in input().
1749                  		 */
1750 karl        1.23 		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1751 karl        1.17 			{ /* This was really a NUL. */
1752                  			yy_state_type yy_next_state;
1753                  
1754 karl        1.23 			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1755 karl        1.17 
1756 karl        1.23 			yy_current_state = yy_get_previous_state(  );
1757 karl        1.17 
1758                  			/* Okay, we're now positioned to make the NUL
1759                  			 * transition.  We couldn't have
1760                  			 * yy_get_previous_state() go ahead and do it
1761                  			 * for us because it doesn't know how to deal
1762                  			 * with the possibility of jamming (and we don't
1763                  			 * want to build jamming into it because then it
1764                  			 * will run more slowly).
1765                  			 */
1766                  
1767                  			yy_next_state = yy_try_NUL_trans( yy_current_state );
1768                  
1769 karl        1.23 			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1770 karl        1.17 
1771                  			if ( yy_next_state )
1772                  				{
1773                  				/* Consume the NUL. */
1774 karl        1.23 				yy_cp = ++(yy_c_buf_p);
1775 karl        1.17 				yy_current_state = yy_next_state;
1776                  				goto yy_match;
1777                  				}
1778                  
1779                  			else
1780                  				{
1781 karl        1.23 				yy_cp = (yy_last_accepting_cpos);
1782                  				yy_current_state = (yy_last_accepting_state);
1783 karl        1.17 				goto yy_find_action;
1784                  				}
1785                  			}
1786                  
1787 karl        1.23 		else switch ( yy_get_next_buffer(  ) )
1788 karl        1.17 			{
1789                  			case EOB_ACT_END_OF_FILE:
1790                  				{
1791 karl        1.23 				(yy_did_buffer_switch_on_eof) = 0;
1792 karl        1.17 
1793 karl        1.23 				if ( CQL_wrap( ) )
1794 karl        1.17 					{
1795                  					/* Note: because we've taken care in
1796                  					 * yy_get_next_buffer() to have set up
1797 karl        1.23 					 * CQL_text, we can now set up
1798 karl        1.17 					 * yy_c_buf_p so that if some total
1799                  					 * hoser (like flex itself) wants to
1800                  					 * call the scanner after we return the
1801                  					 * YY_NULL, it'll still work - another
1802                  					 * YY_NULL will get returned.
1803                  					 */
1804 karl        1.23 					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1805 karl        1.17 
1806                  					yy_act = YY_STATE_EOF(YY_START);
1807                  					goto do_action;
1808                  					}
1809                  
1810                  				else
1811                  					{
1812 karl        1.23 					if ( ! (yy_did_buffer_switch_on_eof) )
1813 karl        1.17 						YY_NEW_FILE;
1814                  					}
1815                  				break;
1816                  				}
1817                  
1818                  			case EOB_ACT_CONTINUE_SCAN:
1819 karl        1.23 				(yy_c_buf_p) =
1820                  					(yytext_ptr) + yy_amount_of_matched_text;
1821 karl        1.17 
1822 karl        1.23 				yy_current_state = yy_get_previous_state(  );
1823 karl        1.17 
1824 karl        1.23 				yy_cp = (yy_c_buf_p);
1825                  				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1826 karl        1.17 				goto yy_match;
1827                  
1828                  			case EOB_ACT_LAST_MATCH:
1829 karl        1.23 				(yy_c_buf_p) =
1830                  				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1831 karl        1.17 
1832 karl        1.23 				yy_current_state = yy_get_previous_state(  );
1833 karl        1.17 
1834 karl        1.23 				yy_cp = (yy_c_buf_p);
1835                  				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1836 karl        1.17 				goto yy_find_action;
1837                  			}
1838                  		break;
1839                  		}
1840                  
1841                  	default:
1842                  		YY_FATAL_ERROR(
1843                  			"fatal flex scanner internal error--no action found" );
1844                  	} /* end of action switch */
1845                  		} /* end of scanning one token */
1846 karl        1.23 } /* end of CQL_lex */
1847 chuck       1.2  
1848                  /* yy_get_next_buffer - try to read in a new buffer
1849                   *
1850                   * Returns a code representing an action:
1851 karl        1.17  *	EOB_ACT_LAST_MATCH -
1852                   *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1853                   *	EOB_ACT_END_OF_FILE - end of file
1854 chuck       1.2   */
1855 karl        1.23 static int yy_get_next_buffer (void)
1856                  {
1857                      	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1858                  	register char *source = (yytext_ptr);
1859 karl        1.17 	register int number_to_move, i;
1860                  	int ret_val;
1861                  
1862 karl        1.23 	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1863 karl        1.17 		YY_FATAL_ERROR(
1864                  		"fatal flex scanner internal error--end of buffer missed" );
1865                  
1866 karl        1.23 	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1867 karl        1.17 		{ /* Don't try to fill the buffer, so this is an EOF. */
1868 karl        1.23 		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1869 karl        1.17 			{
1870                  			/* We matched a single character, the EOB, so
1871                  			 * treat this as a final EOF.
1872                  			 */
1873                  			return EOB_ACT_END_OF_FILE;
1874                  			}
1875                  
1876                  		else
1877                  			{
1878                  			/* We matched some text prior to the EOB, first
1879                  			 * process it.
1880                  			 */
1881                  			return EOB_ACT_LAST_MATCH;
1882                  			}
1883                  		}
1884                  
1885                  	/* Try to read more data. */
1886                  
1887                  	/* First move last chars to start of buffer. */
1888 karl        1.23 	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1889 karl        1.17 
1890                  	for ( i = 0; i < number_to_move; ++i )
1891                  		*(dest++) = *(source++);
1892                  
1893 karl        1.23 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1894 karl        1.17 		/* don't do the read, it's not guaranteed to return an EOF,
1895                  		 * just force an EOF
1896                  		 */
1897 karl        1.23 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1898 karl        1.17 
1899                  	else
1900                  		{
1901 karl        1.23 			int num_to_read =
1902                  			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1903 karl        1.16 
1904 karl        1.17 		while ( num_to_read <= 0 )
1905                  			{ /* Not enough room in the buffer - grow it. */
1906 chuck       1.2  
1907 karl        1.17 			/* just a shorter name for the current buffer */
1908 karl        1.23 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1909 chuck       1.2  
1910 karl        1.17 			int yy_c_buf_p_offset =
1911 karl        1.23 				(int) ((yy_c_buf_p) - b->yy_ch_buf);
1912 chuck       1.2  
1913 karl        1.17 			if ( b->yy_is_our_buffer )
1914                  				{
1915                  				int new_size = b->yy_buf_size * 2;
1916                  
1917                  				if ( new_size <= 0 )
1918                  					b->yy_buf_size += b->yy_buf_size / 8;
1919                  				else
1920                  					b->yy_buf_size *= 2;
1921                  
1922                  				b->yy_ch_buf = (char *)
1923                  					/* Include room in for 2 EOB chars. */
1924 karl        1.23 					CQL_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
1925 karl        1.17 				}
1926                  			else
1927                  				/* Can't grow it, we don't own it. */
1928                  				b->yy_ch_buf = 0;
1929                  
1930                  			if ( ! b->yy_ch_buf )
1931                  				YY_FATAL_ERROR(
1932                  				"fatal error - scanner input buffer overflow" );
1933                  
1934 karl        1.23 			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1935 karl        1.17 
1936 karl        1.23 			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1937 karl        1.17 						number_to_move - 1;
1938 karl        1.23 
1939 karl        1.17 			}
1940                  
1941                  		if ( num_to_read > YY_READ_BUF_SIZE )
1942                  			num_to_read = YY_READ_BUF_SIZE;
1943                  
1944                  		/* Read in more data. */
1945 karl        1.23 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1946                  			(yy_n_chars), (size_t) num_to_read );
1947 karl        1.17 
1948 karl        1.23 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1949 karl        1.17 		}
1950                  
1951 karl        1.23 	if ( (yy_n_chars) == 0 )
1952 karl        1.17 		{
1953                  		if ( number_to_move == YY_MORE_ADJ )
1954                  			{
1955                  			ret_val = EOB_ACT_END_OF_FILE;
1956 karl        1.23 			CQL_restart(CQL_in  );
1957 karl        1.17 			}
1958                  
1959                  		else
1960                  			{
1961                  			ret_val = EOB_ACT_LAST_MATCH;
1962 karl        1.23 			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1963 karl        1.17 				YY_BUFFER_EOF_PENDING;
1964                  			}
1965                  		}
1966                  
1967                  	else
1968                  		ret_val = EOB_ACT_CONTINUE_SCAN;
1969                  
1970 karl        1.23 	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1971                  		/* Extend the array by 50%, plus the number we really need. */
1972                  		yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1973                  		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) CQL_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size  );
1974                  		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1975                  			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1976                  	}
1977 chuck       1.2  
1978 karl        1.23 	(yy_n_chars) += number_to_move;
1979                  	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1980                  	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1981                  
1982                  	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1983 karl        1.16 
1984 karl        1.17 	return ret_val;
1985 karl        1.23 }
1986 chuck       1.2  
1987                  /* yy_get_previous_state - get the state just before the EOB char was reached */
1988                  
1989 karl        1.23     static yy_state_type yy_get_previous_state (void)
1990                  {
1991 karl        1.17 	register yy_state_type yy_current_state;
1992                  	register char *yy_cp;
1993 kumpf       1.24 
1994 karl        1.23 	yy_current_state = (yy_start);
1995 karl        1.17 
1996 karl        1.23 	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1997 karl        1.17 		{
1998                  		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1999                  		if ( yy_accept[yy_current_state] )
2000                  			{
2001 karl        1.23 			(yy_last_accepting_state) = yy_current_state;
2002                  			(yy_last_accepting_cpos) = yy_cp;
2003 karl        1.17 			}
2004                  		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2005                  			{
2006                  			yy_current_state = (int) yy_def[yy_current_state];
2007                  			if ( yy_current_state >= 170 )
2008                  				yy_c = yy_meta[(unsigned int) yy_c];
2009                  			}
2010                  		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2011                  		}
2012 chuck       1.2  
2013 karl        1.17 	return yy_current_state;
2014 karl        1.23 }
2015 chuck       1.2  
2016                  /* yy_try_NUL_trans - try to make a transition on the NUL character
2017                   *
2018                   * synopsis
2019 karl        1.17  *	next_state = yy_try_NUL_trans( current_state );
2020 chuck       1.2   */
2021 karl        1.23     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
2022                  {
2023 karl        1.17 	register int yy_is_jam;
2024 karl        1.23     	register char *yy_cp = (yy_c_buf_p);
2025 karl        1.17 
2026                  	register YY_CHAR yy_c = 1;
2027                  	if ( yy_accept[yy_current_state] )
2028                  		{
2029 karl        1.23 		(yy_last_accepting_state) = yy_current_state;
2030                  		(yy_last_accepting_cpos) = yy_cp;
2031 karl        1.17 		}
2032                  	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2033                  		{
2034                  		yy_current_state = (int) yy_def[yy_current_state];
2035                  		if ( yy_current_state >= 170 )
2036                  			yy_c = yy_meta[(unsigned int) yy_c];
2037                  		}
2038                  	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2039                  	yy_is_jam = (yy_current_state == 169);
2040 karl        1.16 
2041 karl        1.17 	return yy_is_jam ? 0 : yy_current_state;
2042 karl        1.23 }
2043 chuck       1.2  
2044 karl        1.23     static void yyunput (int c, register char * yy_bp )
2045                  {
2046                  	register char *yy_cp;
2047 kumpf       1.24 
2048 karl        1.23     yy_cp = (yy_c_buf_p);
2049 chuck       1.2  
2050 karl        1.23 	/* undo effects of setting up CQL_text */
2051                  	*yy_cp = (yy_hold_char);
2052 karl        1.16 
2053 karl        1.23 	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2054 karl        1.17 		{ /* need to shift things up to make room */
2055                  		/* +2 for EOB chars. */
2056 karl        1.23 		register int number_to_move = (yy_n_chars) + 2;
2057                  		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2058                  					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2059 karl        1.17 		register char *source =
2060 karl        1.23 				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2061 karl        1.17 
2062 karl        1.23 		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2063 karl        1.17 			*--dest = *--source;
2064                  
2065                  		yy_cp += (int) (dest - source);
2066                  		yy_bp += (int) (dest - source);
2067 karl        1.23 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2068                  			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2069 karl        1.17 
2070 karl        1.23 		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2071 karl        1.17 			YY_FATAL_ERROR( "flex scanner push-back overflow" );
2072                  		}
2073                  
2074                  	*--yy_cp = (char) c;
2075                  
2076 karl        1.23 	(yytext_ptr) = yy_bp;
2077                  	(yy_hold_char) = *yy_cp;
2078                  	(yy_c_buf_p) = yy_cp;
2079                  }
2080 chuck       1.2  
2081                  #ifndef YY_NO_INPUT
2082                  #ifdef __cplusplus
2083 karl        1.23     static int yyinput (void)
2084 chuck       1.2  #else
2085 karl        1.23     static int input  (void)
2086 chuck       1.2  #endif
2087 karl        1.23 
2088                  {
2089 karl        1.17 	int c;
2090 kumpf       1.24 
2091 karl        1.23 	*(yy_c_buf_p) = (yy_hold_char);
2092 chuck       1.2  
2093 karl        1.23 	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
2094 karl        1.17 		{
2095                  		/* yy_c_buf_p now points to the character we want to return.
2096                  		 * If this occurs *before* the EOB characters, then it's a
2097                  		 * valid NUL; if not, then we've hit the end of the buffer.
2098                  		 */
2099 karl        1.23 		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
2100 karl        1.17 			/* This was really a NUL. */
2101 karl        1.23 			*(yy_c_buf_p) = '\0';
2102 karl        1.17 
2103                  		else
2104                  			{ /* need more input */
2105 karl        1.23 			int offset = (yy_c_buf_p) - (yytext_ptr);
2106                  			++(yy_c_buf_p);
2107 karl        1.17 
2108 karl        1.23 			switch ( yy_get_next_buffer(  ) )
2109 karl        1.17 				{
2110                  				case EOB_ACT_LAST_MATCH:
2111                  					/* This happens because yy_g_n_b()
2112                  					 * sees that we've accumulated a
2113                  					 * token and flags that we need to
2114                  					 * try matching the token before
2115                  					 * proceeding.  But for input(),
2116                  					 * there's no matching to consider.
2117                  					 * So convert the EOB_ACT_LAST_MATCH
2118                  					 * to EOB_ACT_END_OF_FILE.
2119                  					 */
2120                  
2121                  					/* Reset buffer status. */
2122 karl        1.23 					CQL_restart(CQL_in );
2123 karl        1.17 
2124 karl        1.23 					/*FALLTHROUGH*/
2125 karl        1.17 
2126                  				case EOB_ACT_END_OF_FILE:
2127                  					{
2128 karl        1.23 					if ( CQL_wrap( ) )
2129 karl        1.17 						return EOF;
2130 chuck       1.2  
2131 karl        1.23 					if ( ! (yy_did_buffer_switch_on_eof) )
2132 karl        1.17 						YY_NEW_FILE;
2133 chuck       1.2  #ifdef __cplusplus
2134 karl        1.17 					return yyinput();
2135 chuck       1.2  #else
2136 karl        1.17 					return input();
2137 chuck       1.2  #endif
2138 karl        1.17 					}
2139 chuck       1.2  
2140 karl        1.17 				case EOB_ACT_CONTINUE_SCAN:
2141 karl        1.23 					(yy_c_buf_p) = (yytext_ptr) + offset;
2142 karl        1.17 					break;
2143                  				}
2144                  			}
2145                  		}
2146 chuck       1.2  
2147 karl        1.23 	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
2148                  	*(yy_c_buf_p) = '\0';	/* preserve CQL_text */
2149                  	(yy_hold_char) = *++(yy_c_buf_p);
2150 chuck       1.2  
2151 karl        1.17 	return c;
2152 karl        1.23 }
2153                  #endif	/* ifndef YY_NO_INPUT */
2154 chuck       1.2  
2155 karl        1.23 /** Immediately switch to a different input stream.
2156                   * @param input_file A readable stream.
2157 kumpf       1.24  *
2158 karl        1.23  * @note This function does not reset the start condition to @c INITIAL .
2159                   */
2160                      void CQL_restart  (FILE * input_file )
2161                  {
2162 kumpf       1.24 
2163 karl        1.23 	if ( ! YY_CURRENT_BUFFER ){
2164                          CQL_ensure_buffer_stack ();
2165                  		YY_CURRENT_BUFFER_LVALUE =
2166                              CQL__create_buffer(CQL_in,YY_BUF_SIZE );
2167 karl        1.17 	}
2168 chuck       1.2  
2169 karl        1.23 	CQL__init_buffer(YY_CURRENT_BUFFER,input_file );
2170                  	CQL__load_buffer_state( );
2171                  }
2172 chuck       1.2  
2173 karl        1.23 /** Switch to a different input buffer.
2174                   * @param new_buffer The new input buffer.
2175 kumpf       1.24  *
2176 karl        1.23  */
2177                      void CQL__switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
2178                  {
2179 kumpf       1.24 
2180 karl        1.23 	/* TODO. We should be able to replace this entire function body
2181                  	 * with
2182                  	 *		CQL_pop_buffer_state();
2183                  	 *		CQL_push_buffer_state(new_buffer);
2184                       */
2185                  	CQL_ensure_buffer_stack ();
2186                  	if ( YY_CURRENT_BUFFER == new_buffer )
2187 karl        1.17 		return;
2188                  
2189 karl        1.23 	if ( YY_CURRENT_BUFFER )
2190 karl        1.17 		{
2191                  		/* Flush out information for old buffer. */
2192 karl        1.23 		*(yy_c_buf_p) = (yy_hold_char);
2193                  		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2194                  		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2195 karl        1.17 		}
2196                  
2197 karl        1.23 	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2198                  	CQL__load_buffer_state( );
2199 karl        1.17 
2200                  	/* We don't actually know whether we did this switch during
2201 karl        1.23 	 * EOF (CQL_wrap()) processing, but the only time this flag
2202                  	 * is looked at is after CQL_wrap() is called, so it's safe
2203 karl        1.17 	 * to go ahead and always set it.
2204                  	 */
2205 karl        1.23 	(yy_did_buffer_switch_on_eof) = 1;
2206                  }
2207 chuck       1.2  
2208 karl        1.23 static void CQL__load_buffer_state  (void)
2209                  {
2210                      	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2211                  	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2212                  	CQL_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2213                  	(yy_hold_char) = *(yy_c_buf_p);
2214                  }
2215 chuck       1.2  
2216 karl        1.23 /** Allocate and initialize an input buffer state.
2217                   * @param file A readable stream.
2218                   * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2219 kumpf       1.24  *
2220 karl        1.23  * @return the allocated buffer state.
2221                   */
2222                      YY_BUFFER_STATE CQL__create_buffer  (FILE * file, int  size )
2223                  {
2224 karl        1.17 	YY_BUFFER_STATE b;
2225 kumpf       1.24 
2226 karl        1.23 	b = (YY_BUFFER_STATE) CQL_alloc(sizeof( struct yy_buffer_state )  );
2227 karl        1.17 	if ( ! b )
2228 karl        1.23 		YY_FATAL_ERROR( "out of dynamic memory in CQL__create_buffer()" );
2229 chuck       1.2  
2230 karl        1.17 	b->yy_buf_size = size;
2231 chuck       1.2  
2232 karl        1.17 	/* yy_ch_buf has to be 2 characters longer than the size given because
2233                  	 * we need to put in 2 end-of-buffer characters.
2234                  	 */
2235 karl        1.23 	b->yy_ch_buf = (char *) CQL_alloc(b->yy_buf_size + 2  );
2236 karl        1.17 	if ( ! b->yy_ch_buf )
2237 karl        1.23 		YY_FATAL_ERROR( "out of dynamic memory in CQL__create_buffer()" );
2238 chuck       1.2  
2239 karl        1.17 	b->yy_is_our_buffer = 1;
2240 chuck       1.2  
2241 karl        1.23 	CQL__init_buffer(b,file );
2242 chuck       1.2  
2243 karl        1.17 	return b;
2244 karl        1.23 }
2245 chuck       1.2  
2246 karl        1.23 /** Destroy the buffer.
2247                   * @param b a buffer created with CQL__create_buffer()
2248 kumpf       1.24  *
2249 karl        1.23  */
2250                      void CQL__delete_buffer (YY_BUFFER_STATE  b )
2251                  {
2252 kumpf       1.24 
2253 karl        1.17 	if ( ! b )
2254                  		return;
2255 chuck       1.2  
2256 karl        1.23 	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2257                  		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2258 chuck       1.2  
2259 karl        1.17 	if ( b->yy_is_our_buffer )
2260 karl        1.23 		CQL_free((void *) b->yy_ch_buf  );
2261 chuck       1.2  
2262 karl        1.23 	CQL_free((void *) b  );
2263                  }
2264 chuck       1.2  
2265 karl        1.23 /* Initializes or reinitializes a buffer.
2266                   * This function is sometimes called more than once on the same buffer,
2267                   * such as during a CQL_restart() or at EOF.
2268                   */
2269                      static void CQL__init_buffer  (YY_BUFFER_STATE  b, FILE * file )
2270 chuck       1.2  
2271 karl        1.23 {
2272                  	int oerrno = errno;
2273 kumpf       1.24 
2274 karl        1.23 	CQL__flush_buffer(b );
2275 chuck       1.2  
2276 karl        1.17 	b->yy_input_file = file;
2277                  	b->yy_fill_buffer = 1;
2278 chuck       1.2  
2279 karl        1.23     /* If b is the current buffer, then CQL__init_buffer was _probably_
2280                       * called from CQL_restart() or through yy_get_next_buffer.
2281                       * In that case, we don't want to reset the lineno or column.
2282                       */
2283                      if (b != YY_CURRENT_BUFFER){
2284                          b->yy_bs_lineno = 1;
2285                          b->yy_bs_column = 0;
2286                      }
2287 chuck       1.2  
2288 karl        1.23         b->yy_is_interactive = 0;
2289 kumpf       1.24 
2290 karl        1.23 	errno = oerrno;
2291                  }
2292 chuck       1.2  
2293 karl        1.23 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2294                   * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2295 kumpf       1.24  *
2296 karl        1.23  */
2297                      void CQL__flush_buffer (YY_BUFFER_STATE  b )
2298                  {
2299                      	if ( ! b )
2300 karl        1.17 		return;
2301                  
2302                  	b->yy_n_chars = 0;
2303                  
2304                  	/* We always need two end-of-buffer characters.  The first causes
2305                  	 * a transition to the end-of-buffer state.  The second causes
2306                  	 * a jam in that state.
2307                  	 */
2308                  	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2309                  	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2310                  
2311                  	b->yy_buf_pos = &b->yy_ch_buf[0];
2312                  
2313                  	b->yy_at_bol = 1;
2314                  	b->yy_buffer_status = YY_BUFFER_NEW;
2315                  
2316 karl        1.23 	if ( b == YY_CURRENT_BUFFER )
2317                  		CQL__load_buffer_state( );
2318                  }
2319                  
2320                  /** Pushes the new state onto the stack. The new state becomes
2321                   *  the current state. This function will allocate the stack
2322                   *  if necessary.
2323                   *  @param new_buffer The new state.
2324 kumpf       1.24  *
2325 karl        1.23  */
2326                  void CQL_push_buffer_state (YY_BUFFER_STATE new_buffer )
2327                  {
2328                      	if (new_buffer == NULL)
2329                  		return;
2330                  
2331                  	CQL_ensure_buffer_stack();
2332                  
2333                  	/* This block is copied from CQL__switch_to_buffer. */
2334                  	if ( YY_CURRENT_BUFFER )
2335                  		{
2336                  		/* Flush out information for old buffer. */
2337                  		*(yy_c_buf_p) = (yy_hold_char);
2338                  		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
2339                  		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
2340                  		}
2341                  
2342                  	/* Only push if top exists. Otherwise, replace top. */
2343                  	if (YY_CURRENT_BUFFER)
2344                  		(yy_buffer_stack_top)++;
2345                  	YY_CURRENT_BUFFER_LVALUE = new_buffer;
2346 karl        1.23 
2347                  	/* copied from CQL__switch_to_buffer. */
2348                  	CQL__load_buffer_state( );
2349                  	(yy_did_buffer_switch_on_eof) = 1;
2350                  }
2351                  
2352                  /** Removes and deletes the top of the stack, if present.
2353                   *  The next element becomes the new top.
2354 kumpf       1.24  *
2355 karl        1.23  */
2356                  void CQL_pop_buffer_state (void)
2357                  {
2358                      	if (!YY_CURRENT_BUFFER)
2359                  		return;
2360                  
2361                  	CQL__delete_buffer(YY_CURRENT_BUFFER );
2362                  	YY_CURRENT_BUFFER_LVALUE = NULL;
2363                  	if ((yy_buffer_stack_top) > 0)
2364                  		--(yy_buffer_stack_top);
2365                  
2366                  	if (YY_CURRENT_BUFFER) {
2367                  		CQL__load_buffer_state( );
2368                  		(yy_did_buffer_switch_on_eof) = 1;
2369                  	}
2370                  }
2371                  
2372                  /* Allocates the stack if it does not exist.
2373                   *  Guarantees space for at least one push.
2374                   */
2375                  static void CQL_ensure_buffer_stack (void)
2376 karl        1.23 {
2377                  	int num_to_alloc;
2378 kumpf       1.24 
2379 karl        1.23 	if (!(yy_buffer_stack)) {
2380                  
2381                  		/* First allocation is just for 2 elements, since we don't know if this
2382                  		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2383                  		 * immediate realloc on the next call.
2384                           */
2385                  		num_to_alloc = 1;
2386                  		(yy_buffer_stack) = (struct yy_buffer_state**)CQL_alloc
2387                  								(num_to_alloc * sizeof(struct yy_buffer_state*)
2388                  								);
2389                  		if ( ! (yy_buffer_stack) )
2390                  			YY_FATAL_ERROR( "out of dynamic memory in CQL_ensure_buffer_stack()" );
2391 kumpf       1.24 								
2392 karl        1.23 		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2393                  				
2394                  		(yy_buffer_stack_max) = num_to_alloc;
2395                  		(yy_buffer_stack_top) = 0;
2396                  		return;
2397 karl        1.17 	}
2398 chuck       1.2  
2399 karl        1.23 	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
2400                  
2401                  		/* Increase the buffer to prepare for a possible push. */
2402                  		int grow_size = 8 /* arbitrary grow size */;
2403 chuck       1.2  
2404 karl        1.23 		num_to_alloc = (yy_buffer_stack_max) + grow_size;
2405                  		(yy_buffer_stack) = (struct yy_buffer_state**)CQL_realloc
2406                  								((yy_buffer_stack),
2407                  								num_to_alloc * sizeof(struct yy_buffer_state*)
2408                  								);
2409                  		if ( ! (yy_buffer_stack) )
2410                  			YY_FATAL_ERROR( "out of dynamic memory in CQL_ensure_buffer_stack()" );
2411                  
2412                  		/* zero only the new slots.*/
2413                  		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
2414                  		(yy_buffer_stack_max) = num_to_alloc;
2415                  	}
2416                  }
2417                  
2418                  /** Setup the input buffer state to scan directly from a user-specified character buffer.
2419                   * @param base the character buffer
2420                   * @param size the size in bytes of the character buffer
2421 kumpf       1.24  *
2422                   * @return the newly allocated buffer state object.
2423 karl        1.23  */
2424                  YY_BUFFER_STATE CQL__scan_buffer  (char * base, yy_size_t  size )
2425                  {
2426 karl        1.17 	YY_BUFFER_STATE b;
2427 kumpf       1.24 
2428 karl        1.17 	if ( size < 2 ||
2429                  	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
2430                  	     base[size-1] != YY_END_OF_BUFFER_CHAR )
2431                  		/* They forgot to leave room for the EOB's. */
2432                  		return 0;
2433                  
2434 karl        1.23 	b = (YY_BUFFER_STATE) CQL_alloc(sizeof( struct yy_buffer_state )  );
2435 karl        1.17 	if ( ! b )
2436 karl        1.23 		YY_FATAL_ERROR( "out of dynamic memory in CQL__scan_buffer()" );
2437 karl        1.17 
2438                  	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
2439                  	b->yy_buf_pos = b->yy_ch_buf = base;
2440                  	b->yy_is_our_buffer = 0;
2441                  	b->yy_input_file = 0;
2442                  	b->yy_n_chars = b->yy_buf_size;
2443                  	b->yy_is_interactive = 0;
2444                  	b->yy_at_bol = 1;
2445                  	b->yy_fill_buffer = 0;
2446                  	b->yy_buffer_status = YY_BUFFER_NEW;
2447 chuck       1.2  
2448 karl        1.23 	CQL__switch_to_buffer(b  );
2449 chuck       1.2  
2450 karl        1.17 	return b;
2451 karl        1.23 }
2452 chuck       1.2  
2453 karl        1.23 /** Setup the input buffer state to scan a string. The next call to CQL_lex() will
2454                   * scan from a @e copy of @a str.
2455                   * @param yystr a NUL-terminated string to scan
2456 kumpf       1.24  *
2457 karl        1.23  * @return the newly allocated buffer state object.
2458                   * @note If you want to scan bytes that may contain NUL values, then use
2459                   *       CQL__scan_bytes() instead.
2460                   */
2461                  YY_BUFFER_STATE CQL__scan_string (yyconst char * yystr )
2462                  {
2463 kumpf       1.24 
2464 karl        1.23 	return CQL__scan_bytes(yystr,strlen(yystr) );
2465                  }
2466 chuck       1.2  
2467 karl        1.23 /** Setup the input buffer state to scan the given bytes. The next call to CQL_lex() will
2468                   * scan from a @e copy of @a bytes.
2469                   * @param bytes the byte buffer to scan
2470                   * @param len the number of bytes in the buffer pointed to by @a bytes.
2471 kumpf       1.24  *
2472 karl        1.23  * @return the newly allocated buffer state object.
2473                   */
2474                  YY_BUFFER_STATE CQL__scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
2475                  {
2476 karl        1.17 	YY_BUFFER_STATE b;
2477                  	char *buf;
2478                  	yy_size_t n;
2479                  	int i;
2480 kumpf       1.24 
2481 karl        1.17 	/* Get memory for full buffer, including space for trailing EOB's. */
2482 karl        1.23 	n = _yybytes_len + 2;
2483                  	buf = (char *) CQL_alloc(n  );
2484 karl        1.17 	if ( ! buf )
2485 karl        1.23 		YY_FATAL_ERROR( "out of dynamic memory in CQL__scan_bytes()" );
2486 karl        1.17 
2487 karl        1.23 	for ( i = 0; i < _yybytes_len; ++i )
2488                  		buf[i] = yybytes[i];
2489 karl        1.17 
2490 karl        1.23 	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2491 karl        1.17 
2492 karl        1.23 	b = CQL__scan_buffer(buf,n );
2493 karl        1.17 	if ( ! b )
2494 karl        1.23 		YY_FATAL_ERROR( "bad buffer in CQL__scan_bytes()" );
2495 karl        1.17 
2496                  	/* It's okay to grow etc. this buffer, and we should throw it
2497                  	 * away when we're done.
2498                  	 */
2499                  	b->yy_is_our_buffer = 1;
2500 chuck       1.2  
2501 karl        1.17 	return b;
2502 karl        1.23 }
2503                  
2504                  #ifndef YY_EXIT_FAILURE
2505                  #define YY_EXIT_FAILURE 2
2506 chuck       1.2  #endif
2507                  
2508 karl        1.23 static void yy_fatal_error (yyconst char* msg )
2509                  {
2510                      	(void) fprintf( stderr, "%s\n", msg );
2511                  	exit( YY_EXIT_FAILURE );
2512                  }
2513                  
2514                  /* Redefine yyless() so it works in section 3 code. */
2515                  
2516                  #undef yyless
2517                  #define yyless(n) \
2518                  	do \
2519                  		{ \
2520                  		/* Undo effects of setting up CQL_text. */ \
2521                          int yyless_macro_arg = (n); \
2522                          YY_LESS_LINENO(yyless_macro_arg);\
2523                  		CQL_text[CQL_leng] = (yy_hold_char); \
2524                  		(yy_c_buf_p) = CQL_text + yyless_macro_arg; \
2525                  		(yy_hold_char) = *(yy_c_buf_p); \
2526                  		*(yy_c_buf_p) = '\0'; \
2527                  		CQL_leng = yyless_macro_arg; \
2528                  		} \
2529 karl        1.23 	while ( 0 )
2530                  
2531                  /* Accessor  methods (get/set functions) to struct members. */
2532 chuck       1.2  
2533 karl        1.23 /** Get the current line number.
2534 kumpf       1.24  *
2535 karl        1.23  */
2536                  int CQL_get_lineno  (void)
2537                  {
2538 kumpf       1.24 
2539 karl        1.23     return CQL_lineno;
2540                  }
2541 karl        1.17 
2542 karl        1.23 /** Get the input stream.
2543 kumpf       1.24  *
2544 karl        1.23  */
2545                  FILE *CQL_get_in  (void)
2546                  {
2547                          return CQL_in;
2548                  }
2549 karl        1.17 
2550 karl        1.23 /** Get the output stream.
2551 kumpf       1.24  *
2552 karl        1.23  */
2553                  FILE *CQL_get_out  (void)
2554                  {
2555                          return CQL_out;
2556                  }
2557 karl        1.17 
2558 karl        1.23 /** Get the length of the current token.
2559 kumpf       1.24  *
2560 karl        1.23  */
2561                  int CQL_get_leng  (void)
2562                  {
2563                          return CQL_leng;
2564                  }
2565 karl        1.17 
2566 karl        1.23 /** Get the current token.
2567 kumpf       1.24  *
2568 karl        1.23  */
2569 chuck       1.2  
2570 karl        1.23 char *CQL_get_text  (void)
2571                  {
2572                          return CQL_text;
2573                  }
2574 chuck       1.2  
2575 karl        1.23 /** Set the current line number.
2576                   * @param line_number
2577 kumpf       1.24  *
2578 karl        1.23  */
2579                  void CQL_set_lineno (int  line_number )
2580                  {
2581 kumpf       1.24 
2582 karl        1.23     CQL_lineno = line_number;
2583                  }
2584 chuck       1.2  
2585 karl        1.23 /** Set the input stream. This does not discard the current
2586                   * input buffer.
2587                   * @param in_str A readable stream.
2588 kumpf       1.24  *
2589 karl        1.23  * @see CQL__switch_to_buffer
2590                   */
2591                  void CQL_set_in (FILE *  in_str )
2592                  {
2593                          CQL_in = in_str ;
2594                  }
2595 chuck       1.2  
2596 karl        1.23 void CQL_set_out (FILE *  out_str )
2597                  {
2598                          CQL_out = out_str ;
2599                  }
2600 chuck       1.2  
2601 karl        1.23 int CQL_get_debug  (void)
2602                  {
2603                          return CQL__flex_debug;
2604                  }
2605 chuck       1.2  
2606 karl        1.23 void CQL_set_debug (int  bdebug )
2607                  {
2608                          CQL__flex_debug = bdebug ;
2609                  }
2610 chuck       1.2  
2611 karl        1.23 static int yy_init_globals (void)
2612                  {
2613                          /* Initialization is the same as for the non-reentrant scanner.
2614                       * This function is called from CQL_lex_destroy(), so don't allocate here.
2615                       */
2616 chuck       1.2  
2617 karl        1.23     (yy_buffer_stack) = 0;
2618                      (yy_buffer_stack_top) = 0;
2619                      (yy_buffer_stack_max) = 0;
2620                      (yy_c_buf_p) = (char *) 0;
2621                      (yy_init) = 0;
2622                      (yy_start) = 0;
2623 chuck       1.2  
2624 karl        1.23 /* Defined in main.c */
2625                  #ifdef YY_STDINIT
2626                      CQL_in = stdin;
2627                      CQL_out = stdout;
2628 chuck       1.2  #else
2629 karl        1.23     CQL_in = (FILE *) 0;
2630                      CQL_out = (FILE *) 0;
2631 chuck       1.2  #endif
2632                  
2633 karl        1.23     /* For future reference: Set errno on error, since we are called by
2634                       * CQL_lex_init()
2635                       */
2636                      return 0;
2637                  }
2638 chuck       1.2  
2639 karl        1.23 /* CQL_lex_destroy is for both reentrant and non-reentrant scanners. */
2640                  int CQL_lex_destroy  (void)
2641                  {
2642 kumpf       1.24 
2643 karl        1.23     /* Pop the buffer stack, destroying each element. */
2644                  	while(YY_CURRENT_BUFFER){
2645                  		CQL__delete_buffer(YY_CURRENT_BUFFER  );
2646                  		YY_CURRENT_BUFFER_LVALUE = NULL;
2647                  		CQL_pop_buffer_state();
2648                  	}
2649                  
2650                  	/* Destroy the stack itself. */
2651                  	CQL_free((yy_buffer_stack) );
2652                  	(yy_buffer_stack) = NULL;
2653                  
2654                      /* Reset the globals. This is important in a non-reentrant scanner so the next time
2655                       * CQL_lex() is called, initialization will occur. */
2656                      yy_init_globals( );
2657 chuck       1.2  
2658 karl        1.23     return 0;
2659                  }
2660 chuck       1.2  
2661 karl        1.23 /*
2662                   * Internal utility routines.
2663                   */
2664 chuck       1.2  
2665                  #ifndef yytext_ptr
2666 karl        1.23 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2667                  {
2668 karl        1.17 	register int i;
2669                  	for ( i = 0; i < n; ++i )
2670                  		s1[i] = s2[i];
2671 karl        1.23 }
2672 chuck       1.2  #endif
2673                  
2674                  #ifdef YY_NEED_STRLEN
2675 karl        1.23 static int yy_flex_strlen (yyconst char * s )
2676                  {
2677 karl        1.17 	register int n;
2678                  	for ( n = 0; s[n]; ++n )
2679                  		;
2680 chuck       1.2  
2681 karl        1.17 	return n;
2682 karl        1.23 }
2683 chuck       1.2  #endif
2684                  
2685 karl        1.23 void *CQL_alloc (yy_size_t  size )
2686                  {
2687 karl        1.17 	return (void *) malloc( size );
2688 karl        1.23 }
2689 chuck       1.2  
2690 karl        1.23 void *CQL_realloc  (void * ptr, yy_size_t  size )
2691                  {
2692 karl        1.17 	/* The cast to (char *) in the following accommodates both
2693                  	 * implementations that use char* generic pointers, and those
2694                  	 * that use void* generic pointers.  It works with the latter
2695                  	 * because both ANSI C and C++ allow castless assignment from
2696                  	 * any pointer type to void*, and deal with argument conversions
2697                  	 * as though doing an assignment.
2698                  	 */
2699                  	return (void *) realloc( (char *) ptr, size );
2700 karl        1.23 }
2701                  
2702                  void CQL_free (void * ptr )
2703                  {
2704                  	free( (char *) ptr );	/* see CQL_realloc() for (char *) cast */
2705                  }
2706                  
2707                  #define YYTABLES_NAME "yytables"
2708 chuck       1.2  
2709 karl        1.23 #line 702 "CQL.l"
2710 chuck       1.2  
2711                  
2712                  extern "C" int CQL_wrap()
2713                  {
2714                      return 1;
2715                  }
2716                  
2717                  
2718 karl        1.23 

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2