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