perf annotate: Fix off by one symbol hist size allocation and hit accounting
[linux-block.git] / tools / perf / util / parse-events-flex.c
CommitLineData
89812fc8
JO
1
2#line 3 "<stdout>"
3
4#define YY_INT_ALIGNED short int
5
6/* A lexical scanner generated by flex */
7
8#define yy_create_buffer parse_events__create_buffer
9#define yy_delete_buffer parse_events__delete_buffer
10#define yy_flex_debug parse_events__flex_debug
11#define yy_init_buffer parse_events__init_buffer
12#define yy_flush_buffer parse_events__flush_buffer
13#define yy_load_buffer_state parse_events__load_buffer_state
14#define yy_switch_to_buffer parse_events__switch_to_buffer
15#define yyin parse_events_in
16#define yyleng parse_events_leng
17#define yylex parse_events_lex
18#define yylineno parse_events_lineno
19#define yyout parse_events_out
20#define yyrestart parse_events_restart
21#define yytext parse_events_text
22#define yywrap parse_events_wrap
23#define yyalloc parse_events_alloc
24#define yyrealloc parse_events_realloc
25#define yyfree parse_events_free
26
27#define FLEX_SCANNER
28#define YY_FLEX_MAJOR_VERSION 2
29#define YY_FLEX_MINOR_VERSION 5
30#define YY_FLEX_SUBMINOR_VERSION 35
31#if YY_FLEX_SUBMINOR_VERSION > 0
32#define FLEX_BETA
33#endif
34
35/* First, we deal with platform-specific or compiler-specific issues. */
36
37/* begin standard C headers. */
38#include <stdio.h>
39#include <string.h>
40#include <errno.h>
41#include <stdlib.h>
42
43/* end standard C headers. */
44
45/* flex integer type definitions */
46
47#ifndef FLEXINT_H
48#define FLEXINT_H
49
50/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
51
52#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
53
54/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
55 * if you want the limit (max/min) macros for int types.
56 */
57#ifndef __STDC_LIMIT_MACROS
58#define __STDC_LIMIT_MACROS 1
59#endif
60
61#include <inttypes.h>
62typedef int8_t flex_int8_t;
63typedef uint8_t flex_uint8_t;
64typedef int16_t flex_int16_t;
65typedef uint16_t flex_uint16_t;
66typedef int32_t flex_int32_t;
67typedef uint32_t flex_uint32_t;
68#else
69typedef signed char flex_int8_t;
70typedef short int flex_int16_t;
71typedef int flex_int32_t;
72typedef unsigned char flex_uint8_t;
73typedef unsigned short int flex_uint16_t;
74typedef unsigned int flex_uint32_t;
75#endif /* ! C99 */
76
77/* Limits of integral types. */
78#ifndef INT8_MIN
79#define INT8_MIN (-128)
80#endif
81#ifndef INT16_MIN
82#define INT16_MIN (-32767-1)
83#endif
84#ifndef INT32_MIN
85#define INT32_MIN (-2147483647-1)
86#endif
87#ifndef INT8_MAX
88#define INT8_MAX (127)
89#endif
90#ifndef INT16_MAX
91#define INT16_MAX (32767)
92#endif
93#ifndef INT32_MAX
94#define INT32_MAX (2147483647)
95#endif
96#ifndef UINT8_MAX
97#define UINT8_MAX (255U)
98#endif
99#ifndef UINT16_MAX
100#define UINT16_MAX (65535U)
101#endif
102#ifndef UINT32_MAX
103#define UINT32_MAX (4294967295U)
104#endif
105
106#endif /* ! FLEXINT_H */
107
108#ifdef __cplusplus
109
110/* The "const" storage-class-modifier is valid. */
111#define YY_USE_CONST
112
113#else /* ! __cplusplus */
114
115/* C99 requires __STDC__ to be defined as 1. */
116#if defined (__STDC__)
117
118#define YY_USE_CONST
119
120#endif /* defined (__STDC__) */
121#endif /* ! __cplusplus */
122
123#ifdef YY_USE_CONST
124#define yyconst const
125#else
126#define yyconst
127#endif
128
129/* Returned upon end-of-file. */
130#define YY_NULL 0
131
132/* Promotes a possibly negative, possibly signed char to an unsigned
133 * integer for use as an array index. If the signed char is negative,
134 * we want to instead treat it as an 8-bit unsigned char, hence the
135 * double cast.
136 */
137#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
138
139/* Enter a start condition. This macro really ought to take a parameter,
140 * but we do it the disgusting crufty way forced on us by the ()-less
141 * definition of BEGIN.
142 */
143#define BEGIN (yy_start) = 1 + 2 *
144
145/* Translate the current start state into a value that can be later handed
146 * to BEGIN to return to the state. The YYSTATE alias is for lex
147 * compatibility.
148 */
149#define YY_START (((yy_start) - 1) / 2)
150#define YYSTATE YY_START
151
152/* Action number for EOF rule of a given start state. */
153#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
154
155/* Special action meaning "start processing a new file". */
156#define YY_NEW_FILE parse_events_restart(parse_events_in )
157
158#define YY_END_OF_BUFFER_CHAR 0
159
160/* Size of default input buffer. */
161#ifndef YY_BUF_SIZE
162#define YY_BUF_SIZE 16384
163#endif
164
165/* The state buf must be large enough to hold one state per character in the main buffer.
166 */
167#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
168
169#ifndef YY_TYPEDEF_YY_BUFFER_STATE
170#define YY_TYPEDEF_YY_BUFFER_STATE
171typedef struct yy_buffer_state *YY_BUFFER_STATE;
172#endif
173
174extern int parse_events_leng;
175
176extern FILE *parse_events_in, *parse_events_out;
177
178#define EOB_ACT_CONTINUE_SCAN 0
179#define EOB_ACT_END_OF_FILE 1
180#define EOB_ACT_LAST_MATCH 2
181
182 #define YY_LESS_LINENO(n)
183
184/* Return all but the first "n" matched characters back to the input stream. */
185#define yyless(n) \
186 do \
187 { \
188 /* Undo effects of setting up parse_events_text. */ \
189 int yyless_macro_arg = (n); \
190 YY_LESS_LINENO(yyless_macro_arg);\
191 *yy_cp = (yy_hold_char); \
192 YY_RESTORE_YY_MORE_OFFSET \
193 (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
194 YY_DO_BEFORE_ACTION; /* set up parse_events_text again */ \
195 } \
196 while ( 0 )
197
198#define unput(c) yyunput( c, (yytext_ptr) )
199
200#ifndef YY_TYPEDEF_YY_SIZE_T
201#define YY_TYPEDEF_YY_SIZE_T
202typedef size_t yy_size_t;
203#endif
204
205#ifndef YY_STRUCT_YY_BUFFER_STATE
206#define YY_STRUCT_YY_BUFFER_STATE
207struct yy_buffer_state
208 {
209 FILE *yy_input_file;
210
211 char *yy_ch_buf; /* input buffer */
212 char *yy_buf_pos; /* current position in input buffer */
213
214 /* Size of input buffer in bytes, not including room for EOB
215 * characters.
216 */
217 yy_size_t yy_buf_size;
218
219 /* Number of characters read into yy_ch_buf, not including EOB
220 * characters.
221 */
222 int yy_n_chars;
223
224 /* Whether we "own" the buffer - i.e., we know we created it,
225 * and can realloc() it to grow it, and should free() it to
226 * delete it.
227 */
228 int yy_is_our_buffer;
229
230 /* Whether this is an "interactive" input source; if so, and
231 * if we're using stdio for input, then we want to use getc()
232 * instead of fread(), to make sure we stop fetching input after
233 * each newline.
234 */
235 int yy_is_interactive;
236
237 /* Whether we're considered to be at the beginning of a line.
238 * If so, '^' rules will be active on the next match, otherwise
239 * not.
240 */
241 int yy_at_bol;
242
243 int yy_bs_lineno; /**< The line count. */
244 int yy_bs_column; /**< The column count. */
245
246 /* Whether to try to fill the input buffer when we reach the
247 * end of it.
248 */
249 int yy_fill_buffer;
250
251 int yy_buffer_status;
252
253#define YY_BUFFER_NEW 0
254#define YY_BUFFER_NORMAL 1
255 /* When an EOF's been seen but there's still some text to process
256 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
257 * shouldn't try reading from the input source any more. We might
258 * still have a bunch of tokens to match, though, because of
259 * possible backing-up.
260 *
261 * When we actually see the EOF, we change the status to "new"
262 * (via parse_events_restart()), so that the user can continue scanning by
263 * just pointing parse_events_in at a new input file.
264 */
265#define YY_BUFFER_EOF_PENDING 2
266
267 };
268#endif /* !YY_STRUCT_YY_BUFFER_STATE */
269
270/* Stack of input buffers. */
271static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
272static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
273static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
274
275/* We provide macros for accessing buffer states in case in the
276 * future we want to put the buffer states in a more general
277 * "scanner state".
278 *
279 * Returns the top of the stack, or NULL.
280 */
281#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
282 ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
283 : NULL)
284
285/* Same as previous macro, but useful when we know that the buffer stack is not
286 * NULL or when we need an lvalue. For internal use only.
287 */
288#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
289
290/* yy_hold_char holds the character lost when parse_events_text is formed. */
291static char yy_hold_char;
292static int yy_n_chars; /* number of characters read into yy_ch_buf */
293int parse_events_leng;
294
295/* Points to current character in buffer. */
296static char *yy_c_buf_p = (char *) 0;
297static int yy_init = 0; /* whether we need to initialize */
298static int yy_start = 0; /* start state number */
299
300/* Flag which is used to allow parse_events_wrap()'s to do buffer switches
301 * instead of setting up a fresh parse_events_in. A bit of a hack ...
302 */
303static int yy_did_buffer_switch_on_eof;
304
305void parse_events_restart (FILE *input_file );
306void parse_events__switch_to_buffer (YY_BUFFER_STATE new_buffer );
307YY_BUFFER_STATE parse_events__create_buffer (FILE *file,int size );
308void parse_events__delete_buffer (YY_BUFFER_STATE b );
309void parse_events__flush_buffer (YY_BUFFER_STATE b );
310void parse_events_push_buffer_state (YY_BUFFER_STATE new_buffer );
311void parse_events_pop_buffer_state (void );
312
313static void parse_events_ensure_buffer_stack (void );
314static void parse_events__load_buffer_state (void );
315static void parse_events__init_buffer (YY_BUFFER_STATE b,FILE *file );
316
317#define YY_FLUSH_BUFFER parse_events__flush_buffer(YY_CURRENT_BUFFER )
318
319YY_BUFFER_STATE parse_events__scan_buffer (char *base,yy_size_t size );
320YY_BUFFER_STATE parse_events__scan_string (yyconst char *yy_str );
321YY_BUFFER_STATE parse_events__scan_bytes (yyconst char *bytes,int len );
322
323void *parse_events_alloc (yy_size_t );
324void *parse_events_realloc (void *,yy_size_t );
325void parse_events_free (void * );
326
327#define yy_new_buffer parse_events__create_buffer
328
329#define yy_set_interactive(is_interactive) \
330 { \
331 if ( ! YY_CURRENT_BUFFER ){ \
332 parse_events_ensure_buffer_stack (); \
333 YY_CURRENT_BUFFER_LVALUE = \
334 parse_events__create_buffer(parse_events_in,YY_BUF_SIZE ); \
335 } \
336 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
337 }
338
339#define yy_set_bol(at_bol) \
340 { \
341 if ( ! YY_CURRENT_BUFFER ){\
342 parse_events_ensure_buffer_stack (); \
343 YY_CURRENT_BUFFER_LVALUE = \
344 parse_events__create_buffer(parse_events_in,YY_BUF_SIZE ); \
345 } \
346 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
347 }
348
349#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
350
351/* Begin user sect3 */
352
353typedef unsigned char YY_CHAR;
354
355FILE *parse_events_in = (FILE *) 0, *parse_events_out = (FILE *) 0;
356
357typedef int yy_state_type;
358
359extern int parse_events_lineno;
360
361int parse_events_lineno = 1;
362
363extern char *parse_events_text;
364#define yytext_ptr parse_events_text
365
366static yy_state_type yy_get_previous_state (void );
367static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
368static int yy_get_next_buffer (void );
369static void yy_fatal_error (yyconst char msg[] );
370
371/* Done after the current pattern has been matched and before the
372 * corresponding action - sets up parse_events_text.
373 */
374#define YY_DO_BEFORE_ACTION \
375 (yytext_ptr) = yy_bp; \
376 parse_events_leng = (size_t) (yy_cp - yy_bp); \
377 (yy_hold_char) = *yy_cp; \
378 *yy_cp = '\0'; \
379 (yy_c_buf_p) = yy_cp;
380
8f707d84
JO
381#define YY_NUM_RULES 49
382#define YY_END_OF_BUFFER 50
89812fc8
JO
383/* This struct is not used in this scanner,
384 but its presence is necessary. */
385struct yy_trans_info
386 {
387 flex_int32_t yy_verify;
388 flex_int32_t yy_nxt;
389 };
8f707d84 390static yyconst flex_int16_t yy_accept[440] =
89812fc8 391 { 0,
8f707d84
JO
392 0, 0, 50, 49, 43, 46, 45, 44, 39, 39,
393 47, 48, 43, 43, 43, 43, 43, 43, 43, 43,
394 43, 43, 41, 43, 43, 43, 43, 43, 41, 42,
395 43, 43, 42, 42, 43, 39, 0, 43, 43, 43,
396 21, 43, 43, 43, 43, 43, 43, 43, 43, 43,
397 43, 43, 15, 43, 0, 43, 43, 43, 41, 0,
398 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
399 43, 43, 43, 38, 38, 43, 43, 43, 43, 40,
400 43, 43, 0, 43, 43, 43, 24, 43, 43, 43,
401 43, 43, 43, 0, 43, 43, 43, 41, 0, 43,
402
403 43, 43, 0, 19, 20, 43, 43, 43, 43, 43,
404 43, 43, 30, 43, 43, 43, 38, 38, 43, 43,
405 43, 43, 43, 43, 43, 0, 0, 43, 43, 43,
406 43, 0, 43, 43, 43, 0, 43, 0, 22, 43,
407 43, 41, 0, 23, 43, 43, 19, 20, 26, 43,
408 37, 43, 43, 31, 25, 43, 43, 43, 26, 43,
409 43, 43, 43, 43, 0, 43, 0, 0, 0, 0,
410 43, 43, 43, 43, 0, 43, 43, 43, 0, 0,
411 43, 22, 43, 43, 41, 23, 0, 43, 26, 43,
412 43, 43, 43, 0, 43, 43, 43, 43, 27, 0,
413
414 27, 0, 43, 0, 0, 0, 0, 43, 43, 24,
415 0, 0, 32, 43, 0, 0, 0, 1, 43, 12,
416 0, 43, 0, 43, 0, 31, 0, 35, 43, 43,
417 43, 0, 0, 43, 0, 0, 0, 43, 43, 0,
418 43, 43, 0, 0, 0, 33, 34, 43, 0, 0,
419 0, 43, 0, 43, 0, 43, 0, 0, 43, 43,
420 43, 0, 43, 0, 0, 0, 43, 43, 0, 0,
421 43, 7, 0, 0, 0, 0, 0, 0, 0, 43,
422 0, 43, 0, 43, 0, 0, 28, 43, 0, 0,
423 43, 0, 43, 0, 0, 43, 0, 0, 0, 0,
424
425 10, 0, 0, 43, 0, 43, 0, 43, 0, 0,
426 43, 43, 0, 0, 43, 0, 0, 0, 0, 43,
427 9, 0, 0, 0, 1, 0, 0, 0, 43, 0,
428 16, 0, 0, 28, 43, 0, 11, 43, 0, 0,
429 0, 0, 36, 0, 0, 0, 0, 0, 0, 43,
430 0, 0, 12, 43, 0, 0, 0, 0, 0, 0,
431 6, 0, 0, 0, 0, 0, 4, 14, 13, 0,
432 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
89812fc8 433 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
8f707d84 434 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
89812fc8 435
8f707d84
JO
436 0, 0, 0, 0, 0, 0, 0, 17, 0, 5,
437 15, 18, 0, 0, 29, 0, 0, 0, 0, 0,
438 0, 0, 0, 0, 0, 0, 0, 7, 3, 0,
439 0, 0, 2, 0, 0, 0, 0, 0, 0
89812fc8
JO
440 } ;
441
442static yyconst flex_int32_t yy_ec[256] =
443 { 0,
444 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
445 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
446 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
447 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
448 1, 2, 1, 3, 4, 1, 5, 6, 7, 8,
449 9, 9, 9, 9, 9, 9, 9, 10, 1, 1,
450 11, 1, 2, 1, 12, 13, 14, 15, 12, 12,
451 2, 2, 16, 2, 2, 17, 2, 2, 2, 2,
452 2, 18, 2, 19, 2, 2, 2, 2, 2, 2,
8f707d84 453 1, 1, 1, 1, 20, 1, 21, 22, 23, 24,
89812fc8 454
8f707d84
JO
455 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
456 35, 36, 2, 37, 38, 39, 40, 41, 42, 43,
457 44, 2, 1, 1, 1, 1, 1, 1, 1, 1,
89812fc8
JO
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
460 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
461 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
462 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
463 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
464 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
465
466 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
467 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
468 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
469 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
470 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
471 1, 1, 1, 1, 1
472 } ;
473
8f707d84 474static yyconst flex_int32_t yy_meta[45] =
89812fc8
JO
475 { 0,
476 1, 2, 1, 1, 1, 3, 3, 3, 3, 1,
8f707d84
JO
477 1, 3, 3, 3, 3, 2, 2, 2, 2, 2,
478 3, 3, 3, 3, 3, 3, 2, 2, 2, 2,
89812fc8 479 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
8f707d84 480 2, 2, 2, 2
89812fc8
JO
481 } ;
482
8f707d84 483static yyconst flex_int16_t yy_base[442] =
89812fc8 484 { 0,
8f707d84
JO
485 0, 0, 510, 511, 0, 511, 511, 511, 39, 43,
486 511, 511, 488, 474, 46, 482, 32, 20, 37, 57,
487 473, 484, 34, 64, 59, 64, 469, 467, 78, 113,
488 41, 481, 464, 0, 0, 104, 0, 461, 461, 494,
489 0, 483, 470, 472, 465, 44, 472, 470, 453, 467,
490 455, 448, 0, 464, 447, 468, 444, 443, 64, 443,
491 464, 448, 441, 67, 457, 447, 443, 52, 451, 436,
492 446, 435, 446, 445, 76, 444, 95, 430, 438, 0,
493 445, 426, 100, 439, 438, 435, 0, 427, 456, 431,
494 105, 454, 425, 424, 442, 422, 421, 112, 420, 438,
495
496 425, 410, 117, 0, 0, 424, 412, 436, 408, 409,
497 405, 417, 0, 416, 411, 413, 83, 107, 415, 405,
498 399, 404, 395, 429, 395, 126, 119, 394, 392, 395,
499 405, 404, 401, 396, 399, 100, 398, 400, 0, 400,
500 381, 123, 397, 0, 414, 380, 511, 511, 378, 378,
501 511, 393, 376, 387, 0, 407, 375, 384, 383, 367,
502 374, 380, 400, 378, 383, 361, 361, 378, 377, 359,
503 371, 357, 361, 365, 348, 387, 363, 346, 73, 359,
504 349, 511, 347, 347, 0, 511, 361, 343, 0, 378,
505 342, 376, 341, 352, 353, 337, 343, 349, 335, 349,
506
507 0, 354, 347, 348, 345, 344, 327, 331, 339, 146,
508 340, 123, 150, 323, 326, 337, 332, 0, 329, 0,
509 313, 333, 329, 325, 327, 0, 331, 0, 328, 329,
510 325, 316, 334, 307, 317, 316, 306, 319, 307, 132,
511 301, 301, 306, 308, 311, 0, 0, 331, 311, 301,
512 295, 296, 307, 290, 307, 292, 305, 285, 296, 284,
513 318, 286, 291, 294, 293, 277, 291, 276, 280, 284,
514 268, 0, 286, 272, 283, 270, 276, 281, 284, 270,
515 271, 273, 261, 266, 259, 266, 272, 267, 272, 271,
516 258, 269, 287, 252, 251, 252, 249, 248, 260, 242,
517
518 511, 245, 243, 277, 255, 244, 246, 239, 244, 236,
519 236, 232, 228, 240, 236, 230, 242, 228, 228, 240,
520 511, 239, 226, 233, 511, 232, 234, 221, 224, 218,
521 0, 217, 217, 0, 229, 230, 511, 248, 222, 229,
522 212, 223, 0, 209, 221, 206, 209, 222, 238, 203,
523 202, 201, 511, 234, 205, 217, 200, 194, 193, 194,
524 511, 197, 207, 195, 188, 142, 0, 511, 511, 130,
525 202, 209, 191, 192, 200, 511, 199, 193, 182, 187,
526 197, 180, 181, 190, 176, 200, 173, 172, 185, 184,
527 511, 169, 184, 171, 184, 183, 199, 164, 172, 162,
528
529 161, 160, 166, 162, 171, 170, 147, 511, 158, 511,
530 511, 511, 167, 152, 511, 169, 152, 154, 153, 161,
531 162, 149, 145, 158, 147, 149, 145, 511, 511, 154,
532 152, 137, 511, 138, 145, 131, 53, 54, 511, 172,
533 66
89812fc8
JO
534 } ;
535
8f707d84 536static yyconst flex_int16_t yy_def[442] =
89812fc8 537 { 0,
8f707d84
JO
538 439, 1, 439, 439, 440, 439, 439, 439, 439, 439,
539 439, 439, 440, 440, 440, 440, 440, 440, 440, 440,
540 440, 440, 440, 440, 440, 440, 440, 440, 440, 440,
541 440, 440, 440, 440, 440, 439, 441, 440, 440, 440,
542 440, 440, 440, 440, 440, 440, 440, 440, 440, 440,
543 440, 440, 440, 440, 439, 440, 440, 440, 440, 439,
544 440, 440, 440, 440, 440, 440, 440, 440, 440, 440,
545 440, 440, 440, 30, 30, 440, 440, 440, 440, 441,
546 440, 440, 439, 440, 440, 440, 440, 440, 440, 440,
547 440, 440, 440, 439, 440, 440, 440, 440, 439, 440,
548
549 440, 440, 439, 440, 440, 440, 440, 440, 440, 440,
550 440, 440, 440, 440, 440, 440, 30, 30, 440, 440,
551 440, 440, 440, 440, 440, 439, 439, 440, 440, 440,
552 440, 439, 440, 440, 440, 439, 440, 439, 440, 440,
553 440, 440, 439, 440, 440, 440, 439, 439, 440, 440,
554 439, 440, 440, 440, 440, 440, 440, 440, 30, 440,
555 440, 440, 440, 440, 439, 440, 439, 439, 439, 439,
556 440, 440, 440, 440, 439, 440, 440, 440, 439, 439,
557 440, 439, 440, 440, 440, 439, 439, 440, 440, 440,
558 440, 440, 440, 439, 440, 440, 440, 440, 440, 439,
559
560 440, 439, 440, 439, 439, 439, 439, 440, 440, 440,
561 439, 439, 440, 440, 439, 439, 439, 440, 440, 440,
562 439, 440, 439, 440, 439, 440, 439, 440, 440, 440,
563 440, 439, 439, 440, 439, 439, 439, 440, 440, 439,
564 440, 440, 439, 439, 439, 440, 440, 440, 439, 439,
565 439, 440, 439, 440, 439, 440, 439, 439, 440, 440,
566 440, 439, 440, 439, 439, 439, 440, 440, 439, 439,
567 440, 440, 439, 439, 439, 439, 439, 439, 439, 440,
568 439, 440, 439, 440, 439, 439, 440, 440, 439, 439,
569 440, 439, 440, 439, 439, 440, 439, 439, 439, 439,
570
571 439, 439, 439, 440, 439, 440, 439, 440, 439, 439,
572 440, 440, 439, 439, 440, 439, 439, 439, 439, 440,
573 439, 439, 439, 439, 439, 439, 439, 439, 440, 439,
574 440, 439, 439, 440, 440, 439, 439, 440, 439, 439,
575 439, 439, 440, 439, 439, 439, 439, 439, 439, 440,
576 439, 439, 439, 440, 439, 439, 439, 439, 439, 439,
577 439, 439, 439, 439, 439, 439, 440, 439, 439, 439,
578 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
579 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
580 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
581
582 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
583 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
584 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
585 439, 439, 439, 439, 439, 439, 439, 439, 0, 439,
586 439
89812fc8
JO
587 } ;
588
8f707d84 589static yyconst flex_int16_t yy_nxt[556] =
89812fc8
JO
590 { 0,
591 4, 5, 6, 7, 8, 9, 10, 10, 10, 11,
8f707d84
JO
592 12, 5, 5, 5, 13, 14, 15, 16, 5, 5,
593 17, 18, 19, 20, 21, 22, 5, 23, 24, 5,
594 23, 25, 26, 27, 28, 29, 30, 31, 32, 23,
595 5, 33, 34, 5, 36, 36, 36, 36, 36, 36,
596 36, 36, 40, 41, 44, 46, 47, 50, 48, 49,
597 55, 59, 42, 45, 59, 64, 87, 60, 80, 59,
598 103, 51, 52, 59, 53, 56, 76, 433, 109, 77,
599 54, 37, 61, 87, 66, 110, 438, 62, 67, 111,
600 104, 98, 68, 65, 98, 105, 117, 63, 71, 98,
601
602 74, 118, 72, 98, 215, 59, 159, 74, 59, 36,
603 36, 36, 36, 59, 73, 120, 216, 59, 74, 74,
604 74, 74, 179, 126, 74, 74, 74, 74, 127, 121,
605 134, 74, 180, 74, 74, 74, 74, 75, 74, 142,
606 147, 169, 142, 135, 113, 148, 167, 142, 168, 240,
607 185, 142, 170, 185, 429, 244, 246, 247, 185, 245,
608 269, 383, 185, 381, 270, 241, 384, 382, 416, 437,
609 242, 436, 417, 35, 35, 435, 434, 433, 432, 431,
610 430, 429, 428, 427, 426, 425, 424, 423, 422, 421,
611 420, 419, 418, 415, 415, 414, 413, 412, 411, 410,
612
613 409, 408, 407, 406, 405, 404, 403, 402, 401, 400,
614 399, 398, 186, 397, 396, 395, 394, 393, 392, 391,
615 390, 389, 388, 387, 148, 386, 385, 380, 379, 378,
616 377, 376, 375, 374, 373, 372, 371, 370, 369, 368,
617 367, 366, 365, 364, 363, 362, 361, 360, 359, 358,
618 357, 356, 355, 354, 353, 352, 351, 350, 349, 348,
619 347, 346, 345, 344, 343, 342, 341, 340, 339, 338,
620 337, 336, 335, 334, 333, 332, 331, 330, 329, 328,
621 327, 326, 325, 324, 323, 322, 321, 320, 319, 318,
622 317, 316, 315, 314, 313, 312, 311, 310, 309, 308,
623
624 307, 306, 305, 304, 303, 302, 301, 300, 299, 298,
625 297, 296, 295, 294, 293, 113, 292, 148, 147, 291,
626 290, 289, 288, 287, 286, 285, 284, 283, 282, 281,
627 280, 279, 278, 277, 276, 275, 274, 273, 272, 271,
628 268, 267, 266, 265, 264, 263, 182, 262, 261, 260,
629 259, 258, 257, 256, 255, 254, 253, 252, 251, 250,
630 249, 248, 243, 239, 238, 237, 236, 235, 147, 234,
631 233, 232, 201, 231, 230, 229, 228, 227, 226, 225,
632 224, 223, 222, 221, 220, 219, 218, 217, 214, 213,
633 212, 211, 210, 209, 113, 208, 207, 206, 205, 204,
634
635 203, 202, 201, 200, 199, 198, 197, 74, 196, 195,
636 194, 193, 192, 191, 190, 189, 188, 187, 186, 184,
637 183, 182, 181, 178, 177, 176, 175, 174, 173, 172,
638 171, 166, 165, 164, 163, 162, 161, 160, 158, 157,
639 156, 155, 154, 153, 152, 151, 150, 149, 146, 145,
640 144, 143, 141, 140, 139, 138, 137, 136, 133, 132,
641 131, 130, 129, 128, 125, 124, 123, 122, 119, 74,
642 116, 115, 114, 113, 112, 108, 107, 106, 102, 101,
643 100, 99, 97, 96, 95, 94, 93, 92, 91, 90,
644 89, 87, 88, 86, 85, 84, 41, 83, 82, 81,
645
646 79, 78, 70, 69, 58, 57, 43, 39, 38, 439,
647 3, 439, 439, 439, 439, 439, 439, 439, 439, 439,
648 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
649 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
650 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
651 439, 439, 439, 439, 439
89812fc8
JO
652 } ;
653
8f707d84 654static yyconst flex_int16_t yy_chk[556] =
89812fc8
JO
655 { 0,
656 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
657 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
658 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
659 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
8f707d84
JO
660 1, 1, 1, 1, 9, 9, 9, 9, 10, 10,
661 10, 10, 15, 15, 17, 18, 18, 19, 18, 18,
662 20, 23, 15, 17, 23, 25, 46, 24, 441, 23,
663 64, 19, 19, 23, 19, 20, 31, 438, 68, 31,
664 19, 9, 24, 46, 26, 68, 437, 24, 26, 68,
665 64, 59, 26, 25, 59, 64, 75, 24, 29, 59,
666
667 75, 75, 29, 59, 179, 29, 117, 117, 29, 36,
668 36, 36, 36, 29, 29, 77, 179, 29, 30, 30,
669 30, 30, 136, 83, 30, 30, 30, 30, 83, 77,
670 91, 118, 136, 30, 30, 30, 30, 30, 30, 98,
671 103, 127, 98, 91, 118, 103, 126, 98, 126, 210,
672 142, 98, 127, 142, 436, 212, 213, 213, 142, 212,
673 240, 370, 142, 366, 240, 210, 370, 366, 407, 435,
674 210, 434, 407, 440, 440, 432, 431, 430, 427, 426,
675 425, 424, 423, 422, 421, 420, 419, 418, 417, 416,
676 414, 413, 409, 406, 405, 404, 403, 402, 401, 400,
677
678 399, 398, 397, 396, 395, 394, 393, 392, 390, 389,
679 388, 387, 386, 385, 384, 383, 382, 381, 380, 379,
680 378, 377, 375, 374, 373, 372, 371, 365, 364, 363,
681 362, 360, 359, 358, 357, 356, 355, 354, 352, 351,
682 350, 349, 348, 347, 346, 345, 344, 342, 341, 340,
683 339, 338, 336, 335, 333, 332, 330, 329, 328, 327,
684 326, 324, 323, 322, 320, 319, 318, 317, 316, 315,
685 314, 313, 312, 311, 310, 309, 308, 307, 306, 305,
686 304, 303, 302, 300, 299, 298, 297, 296, 295, 294,
687 293, 292, 291, 290, 289, 288, 287, 286, 285, 284,
688
689 283, 282, 281, 280, 279, 278, 277, 276, 275, 274,
690 273, 271, 270, 269, 268, 267, 266, 265, 264, 263,
691 262, 261, 260, 259, 258, 257, 256, 255, 254, 253,
692 252, 251, 250, 249, 248, 245, 244, 243, 242, 241,
693 239, 238, 237, 236, 235, 234, 233, 232, 231, 230,
694 229, 227, 225, 224, 223, 222, 221, 219, 217, 216,
695 215, 214, 211, 209, 208, 207, 206, 205, 204, 203,
696 202, 200, 199, 198, 197, 196, 195, 194, 193, 192,
697 191, 190, 188, 187, 184, 183, 181, 180, 178, 177,
698 176, 175, 174, 173, 172, 171, 170, 169, 168, 167,
699
700 166, 165, 164, 163, 162, 161, 160, 159, 158, 157,
701 156, 154, 153, 152, 150, 149, 146, 145, 143, 141,
702 140, 138, 137, 135, 134, 133, 132, 131, 130, 129,
703 128, 125, 124, 123, 122, 121, 120, 119, 116, 115,
704 114, 112, 111, 110, 109, 108, 107, 106, 102, 101,
705 100, 99, 97, 96, 95, 94, 93, 92, 90, 89,
706 88, 86, 85, 84, 82, 81, 79, 78, 76, 74,
707 73, 72, 71, 70, 69, 67, 66, 65, 63, 62,
708 61, 60, 58, 57, 56, 55, 54, 52, 51, 50,
709 49, 48, 47, 45, 44, 43, 42, 40, 39, 38,
710
711 33, 32, 28, 27, 22, 21, 16, 14, 13, 3,
712 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
713 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
714 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
715 439, 439, 439, 439, 439, 439, 439, 439, 439, 439,
716 439, 439, 439, 439, 439
89812fc8
JO
717 } ;
718
719static yy_state_type yy_last_accepting_state;
720static char *yy_last_accepting_cpos;
721
722extern int parse_events__flex_debug;
723int parse_events__flex_debug = 0;
724
725/* The intent behind this definition is that it'll catch
726 * any uses of REJECT which flex missed.
727 */
728#define REJECT reject_used_but_not_detected
729#define yymore() yymore_used_but_not_detected
730#define YY_MORE_ADJ 0
731#define YY_RESTORE_YY_MORE_OFFSET
732char *parse_events_text;
733#line 1 "util/parse-events.l"
734#line 5 "util/parse-events.l"
735#include <errno.h>
736#include "../perf.h"
737#include "parse-events-bison.h"
8f707d84 738#include "parse-events.h"
89812fc8
JO
739
740static int __value(char *str, int base, int token)
741{
742 long num;
743
744 errno = 0;
745 num = strtoul(str, NULL, base);
746 if (errno)
747 return PE_ERROR;
748
749 parse_events_lval.num = num;
750 return token;
751}
752
753static int value(int base)
754{
755 return __value(parse_events_text, base, PE_VALUE);
756}
757
758static int raw(void)
759{
760 return __value(parse_events_text + 1, 16, PE_RAW);
761}
762
763static int str(int token)
764{
765 parse_events_lval.str = strdup(parse_events_text);
766 return token;
767}
768
769static int sym(int type, int config)
770{
771 parse_events_lval.num = (type << 16) + config;
772 return PE_VALUE_SYM;
773}
774
8f707d84
JO
775static int term(int type)
776{
777 parse_events_lval.num = type;
778 return PE_TERM;
779}
780
781#line 782 "<stdout>"
89812fc8
JO
782
783#define INITIAL 0
784
785#ifndef YY_NO_UNISTD_H
786/* Special case for "unistd.h", since it is non-ANSI. We include it way
787 * down here because we want the user's section 1 to have been scanned first.
788 * The user has a chance to override it with an option.
789 */
790#include <unistd.h>
791#endif
792
793#ifndef YY_EXTRA_TYPE
794#define YY_EXTRA_TYPE void *
795#endif
796
797static int yy_init_globals (void );
798
799/* Accessor methods to globals.
800 These are made visible to non-reentrant scanners for convenience. */
801
802int parse_events_lex_destroy (void );
803
804int parse_events_get_debug (void );
805
806void parse_events_set_debug (int debug_flag );
807
808YY_EXTRA_TYPE parse_events_get_extra (void );
809
810void parse_events_set_extra (YY_EXTRA_TYPE user_defined );
811
812FILE *parse_events_get_in (void );
813
814void parse_events_set_in (FILE * in_str );
815
816FILE *parse_events_get_out (void );
817
818void parse_events_set_out (FILE * out_str );
819
820int parse_events_get_leng (void );
821
822char *parse_events_get_text (void );
823
824int parse_events_get_lineno (void );
825
826void parse_events_set_lineno (int line_number );
827
828/* Macros after this point can all be overridden by user definitions in
829 * section 1.
830 */
831
832#ifndef YY_SKIP_YYWRAP
833#ifdef __cplusplus
834extern "C" int parse_events_wrap (void );
835#else
836extern int parse_events_wrap (void );
837#endif
838#endif
839
840 static void yyunput (int c,char *buf_ptr );
841
842#ifndef yytext_ptr
843static void yy_flex_strncpy (char *,yyconst char *,int );
844#endif
845
846#ifdef YY_NEED_STRLEN
847static int yy_flex_strlen (yyconst char * );
848#endif
849
850#ifndef YY_NO_INPUT
851
852#ifdef __cplusplus
853static int yyinput (void );
854#else
855static int input (void );
856#endif
857
858#endif
859
860/* Amount of stuff to slurp up with each read. */
861#ifndef YY_READ_BUF_SIZE
862#define YY_READ_BUF_SIZE 8192
863#endif
864
865/* Copy whatever the last rule matched to the standard output. */
866#ifndef ECHO
867/* This used to be an fputs(), but since the string might contain NUL's,
868 * we now use fwrite().
869 */
870#define ECHO do { if (fwrite( parse_events_text, parse_events_leng, 1, parse_events_out )) {} } while (0)
871#endif
872
873/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
874 * is returned in "result".
875 */
876#ifndef YY_INPUT
877#define YY_INPUT(buf,result,max_size) \
878 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
879 { \
880 int c = '*'; \
881 unsigned n; \
882 for ( n = 0; n < max_size && \
883 (c = getc( parse_events_in )) != EOF && c != '\n'; ++n ) \
884 buf[n] = (char) c; \
885 if ( c == '\n' ) \
886 buf[n++] = (char) c; \
887 if ( c == EOF && ferror( parse_events_in ) ) \
888 YY_FATAL_ERROR( "input in flex scanner failed" ); \
889 result = n; \
890 } \
891 else \
892 { \
893 errno=0; \
894 while ( (result = fread(buf, 1, max_size, parse_events_in))==0 && ferror(parse_events_in)) \
895 { \
896 if( errno != EINTR) \
897 { \
898 YY_FATAL_ERROR( "input in flex scanner failed" ); \
899 break; \
900 } \
901 errno=0; \
902 clearerr(parse_events_in); \
903 } \
904 }\
905\
906
907#endif
908
909/* No semi-colon after return; correct usage is to write "yyterminate();" -
910 * we don't want an extra ';' after the "return" because that will cause
911 * some compilers to complain about unreachable statements.
912 */
913#ifndef yyterminate
914#define yyterminate() return YY_NULL
915#endif
916
917/* Number of entries by which start-condition stack grows. */
918#ifndef YY_START_STACK_INCR
919#define YY_START_STACK_INCR 25
920#endif
921
922/* Report a fatal error. */
923#ifndef YY_FATAL_ERROR
924#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
925#endif
926
927/* end tables serialization structures and prototypes */
928
929/* Default declaration of generated scanner - a define so the user can
930 * easily add parameters.
931 */
932#ifndef YY_DECL
933#define YY_DECL_IS_OURS 1
934
935extern int parse_events_lex (void);
936
937#define YY_DECL int parse_events_lex (void)
938#endif /* !YY_DECL */
939
940/* Code executed at the beginning of each rule, after parse_events_text and parse_events_leng
941 * have been set up.
942 */
943#ifndef YY_USER_ACTION
944#define YY_USER_ACTION
945#endif
946
947/* Code executed at the end of each rule. */
948#ifndef YY_BREAK
949#define YY_BREAK break;
950#endif
951
952#define YY_RULE_SETUP \
953 YY_USER_ACTION
954
955/** The main scanner function which does all the work.
956 */
957YY_DECL
958{
959 register yy_state_type yy_current_state;
960 register char *yy_cp, *yy_bp;
961 register int yy_act;
962
8f707d84 963#line 60 "util/parse-events.l"
89812fc8 964
8f707d84 965#line 966 "<stdout>"
89812fc8
JO
966
967 if ( !(yy_init) )
968 {
969 (yy_init) = 1;
970
971#ifdef YY_USER_INIT
972 YY_USER_INIT;
973#endif
974
975 if ( ! (yy_start) )
976 (yy_start) = 1; /* first start state */
977
978 if ( ! parse_events_in )
979 parse_events_in = stdin;
980
981 if ( ! parse_events_out )
982 parse_events_out = stdout;
983
984 if ( ! YY_CURRENT_BUFFER ) {
985 parse_events_ensure_buffer_stack ();
986 YY_CURRENT_BUFFER_LVALUE =
987 parse_events__create_buffer(parse_events_in,YY_BUF_SIZE );
988 }
989
990 parse_events__load_buffer_state( );
991 }
992
993 while ( 1 ) /* loops until end-of-file is reached */
994 {
995 yy_cp = (yy_c_buf_p);
996
997 /* Support of parse_events_text. */
998 *yy_cp = (yy_hold_char);
999
1000 /* yy_bp points to the position in yy_ch_buf of the start of
1001 * the current run.
1002 */
1003 yy_bp = yy_cp;
1004
1005 yy_current_state = (yy_start);
1006yy_match:
1007 do
1008 {
1009 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1010 if ( yy_accept[yy_current_state] )
1011 {
1012 (yy_last_accepting_state) = yy_current_state;
1013 (yy_last_accepting_cpos) = yy_cp;
1014 }
1015 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1016 {
1017 yy_current_state = (int) yy_def[yy_current_state];
8f707d84 1018 if ( yy_current_state >= 440 )
89812fc8
JO
1019 yy_c = yy_meta[(unsigned int) yy_c];
1020 }
1021 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1022 ++yy_cp;
1023 }
8f707d84 1024 while ( yy_base[yy_current_state] != 511 );
89812fc8
JO
1025
1026yy_find_action:
1027 yy_act = yy_accept[yy_current_state];
1028 if ( yy_act == 0 )
1029 { /* have to back up */
1030 yy_cp = (yy_last_accepting_cpos);
1031 yy_current_state = (yy_last_accepting_state);
1032 yy_act = yy_accept[yy_current_state];
1033 }
1034
1035 YY_DO_BEFORE_ACTION;
1036
1037do_action: /* This label is used only to access EOF actions. */
1038
1039 switch ( yy_act )
1040 { /* beginning of action switch */
1041 case 0: /* must back up */
1042 /* undo the effects of YY_DO_BEFORE_ACTION */
1043 *yy_cp = (yy_hold_char);
1044 yy_cp = (yy_last_accepting_cpos);
1045 yy_current_state = (yy_last_accepting_state);
1046 goto yy_find_action;
1047
1048case 1:
1049YY_RULE_SETUP
8f707d84 1050#line 61 "util/parse-events.l"
89812fc8
JO
1051{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CPU_CYCLES); }
1052 YY_BREAK
1053case 2:
1054YY_RULE_SETUP
8f707d84 1055#line 62 "util/parse-events.l"
89812fc8
JO
1056{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_STALLED_CYCLES_FRONTEND); }
1057 YY_BREAK
1058case 3:
1059YY_RULE_SETUP
8f707d84 1060#line 63 "util/parse-events.l"
89812fc8
JO
1061{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_STALLED_CYCLES_BACKEND); }
1062 YY_BREAK
1063case 4:
1064YY_RULE_SETUP
8f707d84 1065#line 64 "util/parse-events.l"
89812fc8
JO
1066{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_INSTRUCTIONS); }
1067 YY_BREAK
1068case 5:
1069YY_RULE_SETUP
8f707d84 1070#line 65 "util/parse-events.l"
89812fc8
JO
1071{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CACHE_REFERENCES); }
1072 YY_BREAK
1073case 6:
1074YY_RULE_SETUP
8f707d84 1075#line 66 "util/parse-events.l"
89812fc8
JO
1076{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_CACHE_MISSES); }
1077 YY_BREAK
1078case 7:
1079YY_RULE_SETUP
8f707d84 1080#line 67 "util/parse-events.l"
89812fc8
JO
1081{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BRANCH_INSTRUCTIONS); }
1082 YY_BREAK
1083case 8:
1084YY_RULE_SETUP
8f707d84 1085#line 68 "util/parse-events.l"
89812fc8
JO
1086{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BRANCH_MISSES); }
1087 YY_BREAK
1088case 9:
1089YY_RULE_SETUP
8f707d84 1090#line 69 "util/parse-events.l"
89812fc8
JO
1091{ return sym(PERF_TYPE_HARDWARE, PERF_COUNT_HW_BUS_CYCLES); }
1092 YY_BREAK
1093case 10:
1094YY_RULE_SETUP
8f707d84 1095#line 70 "util/parse-events.l"
89812fc8
JO
1096{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_CLOCK); }
1097 YY_BREAK
1098case 11:
1099YY_RULE_SETUP
8f707d84 1100#line 71 "util/parse-events.l"
89812fc8
JO
1101{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_TASK_CLOCK); }
1102 YY_BREAK
1103case 12:
1104YY_RULE_SETUP
8f707d84 1105#line 72 "util/parse-events.l"
89812fc8
JO
1106{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS); }
1107 YY_BREAK
1108case 13:
1109YY_RULE_SETUP
8f707d84 1110#line 73 "util/parse-events.l"
89812fc8
JO
1111{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS_MIN); }
1112 YY_BREAK
1113case 14:
1114YY_RULE_SETUP
8f707d84 1115#line 74 "util/parse-events.l"
89812fc8
JO
1116{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_PAGE_FAULTS_MAJ); }
1117 YY_BREAK
1118case 15:
1119YY_RULE_SETUP
8f707d84 1120#line 75 "util/parse-events.l"
89812fc8
JO
1121{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CONTEXT_SWITCHES); }
1122 YY_BREAK
1123case 16:
1124YY_RULE_SETUP
8f707d84 1125#line 76 "util/parse-events.l"
89812fc8
JO
1126{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_CPU_MIGRATIONS); }
1127 YY_BREAK
1128case 17:
1129YY_RULE_SETUP
8f707d84 1130#line 77 "util/parse-events.l"
89812fc8
JO
1131{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_ALIGNMENT_FAULTS); }
1132 YY_BREAK
1133case 18:
1134YY_RULE_SETUP
8f707d84 1135#line 78 "util/parse-events.l"
89812fc8
JO
1136{ return sym(PERF_TYPE_SOFTWARE, PERF_COUNT_SW_EMULATION_FAULTS); }
1137 YY_BREAK
1138case 19:
8f707d84 1139#line 81 "util/parse-events.l"
89812fc8 1140case 20:
8f707d84 1141#line 82 "util/parse-events.l"
89812fc8 1142case 21:
8f707d84 1143#line 83 "util/parse-events.l"
89812fc8 1144case 22:
8f707d84 1145#line 84 "util/parse-events.l"
89812fc8 1146case 23:
8f707d84 1147#line 85 "util/parse-events.l"
89812fc8 1148case 24:
8f707d84 1149#line 86 "util/parse-events.l"
89812fc8
JO
1150case 25:
1151YY_RULE_SETUP
8f707d84 1152#line 86 "util/parse-events.l"
89812fc8
JO
1153{ return str(PE_NAME_CACHE_TYPE); }
1154 YY_BREAK
1155case 26:
8f707d84 1156#line 89 "util/parse-events.l"
89812fc8 1157case 27:
8f707d84 1158#line 90 "util/parse-events.l"
89812fc8 1159case 28:
8f707d84 1160#line 91 "util/parse-events.l"
89812fc8 1161case 29:
8f707d84 1162#line 92 "util/parse-events.l"
89812fc8 1163case 30:
8f707d84 1164#line 93 "util/parse-events.l"
89812fc8
JO
1165case 31:
1166YY_RULE_SETUP
8f707d84 1167#line 93 "util/parse-events.l"
89812fc8
JO
1168{ return str(PE_NAME_CACHE_OP_RESULT); }
1169 YY_BREAK
8f707d84
JO
1170/*
1171 * These are event config hardcoded term names to be specified
1172 * within xxx/.../ syntax. So far we dont clash with other names,
1173 * so we can put them here directly. In case the we have a conflict
1174 * in future, this needs to go into '//' condition block.
1175 */
89812fc8
JO
1176case 32:
1177YY_RULE_SETUP
8f707d84
JO
1178#line 101 "util/parse-events.l"
1179{ return term(PARSE_EVENTS__TERM_TYPE_CONFIG); }
89812fc8
JO
1180 YY_BREAK
1181case 33:
1182YY_RULE_SETUP
8f707d84
JO
1183#line 102 "util/parse-events.l"
1184{ return term(PARSE_EVENTS__TERM_TYPE_CONFIG1); }
89812fc8
JO
1185 YY_BREAK
1186case 34:
1187YY_RULE_SETUP
8f707d84
JO
1188#line 103 "util/parse-events.l"
1189{ return term(PARSE_EVENTS__TERM_TYPE_CONFIG2); }
89812fc8
JO
1190 YY_BREAK
1191case 35:
1192YY_RULE_SETUP
8f707d84
JO
1193#line 104 "util/parse-events.l"
1194{ return term(PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); }
89812fc8
JO
1195 YY_BREAK
1196case 36:
1197YY_RULE_SETUP
8f707d84
JO
1198#line 105 "util/parse-events.l"
1199{ return term(PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); }
89812fc8
JO
1200 YY_BREAK
1201case 37:
1202YY_RULE_SETUP
8f707d84
JO
1203#line 107 "util/parse-events.l"
1204{ return PE_PREFIX_MEM; }
89812fc8
JO
1205 YY_BREAK
1206case 38:
1207YY_RULE_SETUP
8f707d84
JO
1208#line 108 "util/parse-events.l"
1209{ return raw(); }
89812fc8
JO
1210 YY_BREAK
1211case 39:
1212YY_RULE_SETUP
8f707d84
JO
1213#line 109 "util/parse-events.l"
1214{ return value(10); }
89812fc8
JO
1215 YY_BREAK
1216case 40:
1217YY_RULE_SETUP
8f707d84
JO
1218#line 110 "util/parse-events.l"
1219{ return value(16); }
89812fc8
JO
1220 YY_BREAK
1221case 41:
1222YY_RULE_SETUP
8f707d84
JO
1223#line 112 "util/parse-events.l"
1224{ return str(PE_MODIFIER_EVENT); }
89812fc8
JO
1225 YY_BREAK
1226case 42:
1227YY_RULE_SETUP
8f707d84
JO
1228#line 113 "util/parse-events.l"
1229{ return str(PE_MODIFIER_BP); }
89812fc8
JO
1230 YY_BREAK
1231case 43:
1232YY_RULE_SETUP
8f707d84
JO
1233#line 114 "util/parse-events.l"
1234{ return str(PE_NAME); }
89812fc8
JO
1235 YY_BREAK
1236case 44:
1237YY_RULE_SETUP
8f707d84
JO
1238#line 115 "util/parse-events.l"
1239{ return '/'; }
1240 YY_BREAK
1241case 45:
1242YY_RULE_SETUP
1243#line 116 "util/parse-events.l"
1244{ return '-'; }
1245 YY_BREAK
1246case 46:
1247YY_RULE_SETUP
1248#line 117 "util/parse-events.l"
1249{ return ','; }
1250 YY_BREAK
1251case 47:
1252YY_RULE_SETUP
1253#line 118 "util/parse-events.l"
1254{ return ':'; }
1255 YY_BREAK
1256case 48:
1257YY_RULE_SETUP
1258#line 119 "util/parse-events.l"
1259{ return '='; }
1260 YY_BREAK
1261case 49:
1262YY_RULE_SETUP
1263#line 121 "util/parse-events.l"
89812fc8
JO
1264ECHO;
1265 YY_BREAK
8f707d84 1266#line 1267 "<stdout>"
89812fc8
JO
1267case YY_STATE_EOF(INITIAL):
1268 yyterminate();
1269
1270 case YY_END_OF_BUFFER:
1271 {
1272 /* Amount of text matched not including the EOB char. */
1273 int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1274
1275 /* Undo the effects of YY_DO_BEFORE_ACTION. */
1276 *yy_cp = (yy_hold_char);
1277 YY_RESTORE_YY_MORE_OFFSET
1278
1279 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1280 {
1281 /* We're scanning a new file or input source. It's
1282 * possible that this happened because the user
1283 * just pointed parse_events_in at a new source and called
1284 * parse_events_lex(). If so, then we have to assure
1285 * consistency between YY_CURRENT_BUFFER and our
1286 * globals. Here is the right place to do so, because
1287 * this is the first action (other than possibly a
1288 * back-up) that will match for the new input source.
1289 */
1290 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1291 YY_CURRENT_BUFFER_LVALUE->yy_input_file = parse_events_in;
1292 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1293 }
1294
1295 /* Note that here we test for yy_c_buf_p "<=" to the position
1296 * of the first EOB in the buffer, since yy_c_buf_p will
1297 * already have been incremented past the NUL character
1298 * (since all states make transitions on EOB to the
1299 * end-of-buffer state). Contrast this with the test
1300 * in input().
1301 */
1302 if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1303 { /* This was really a NUL. */
1304 yy_state_type yy_next_state;
1305
1306 (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1307
1308 yy_current_state = yy_get_previous_state( );
1309
1310 /* Okay, we're now positioned to make the NUL
1311 * transition. We couldn't have
1312 * yy_get_previous_state() go ahead and do it
1313 * for us because it doesn't know how to deal
1314 * with the possibility of jamming (and we don't
1315 * want to build jamming into it because then it
1316 * will run more slowly).
1317 */
1318
1319 yy_next_state = yy_try_NUL_trans( yy_current_state );
1320
1321 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1322
1323 if ( yy_next_state )
1324 {
1325 /* Consume the NUL. */
1326 yy_cp = ++(yy_c_buf_p);
1327 yy_current_state = yy_next_state;
1328 goto yy_match;
1329 }
1330
1331 else
1332 {
1333 yy_cp = (yy_c_buf_p);
1334 goto yy_find_action;
1335 }
1336 }
1337
1338 else switch ( yy_get_next_buffer( ) )
1339 {
1340 case EOB_ACT_END_OF_FILE:
1341 {
1342 (yy_did_buffer_switch_on_eof) = 0;
1343
1344 if ( parse_events_wrap( ) )
1345 {
1346 /* Note: because we've taken care in
1347 * yy_get_next_buffer() to have set up
1348 * parse_events_text, we can now set up
1349 * yy_c_buf_p so that if some total
1350 * hoser (like flex itself) wants to
1351 * call the scanner after we return the
1352 * YY_NULL, it'll still work - another
1353 * YY_NULL will get returned.
1354 */
1355 (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1356
1357 yy_act = YY_STATE_EOF(YY_START);
1358 goto do_action;
1359 }
1360
1361 else
1362 {
1363 if ( ! (yy_did_buffer_switch_on_eof) )
1364 YY_NEW_FILE;
1365 }
1366 break;
1367 }
1368
1369 case EOB_ACT_CONTINUE_SCAN:
1370 (yy_c_buf_p) =
1371 (yytext_ptr) + yy_amount_of_matched_text;
1372
1373 yy_current_state = yy_get_previous_state( );
1374
1375 yy_cp = (yy_c_buf_p);
1376 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1377 goto yy_match;
1378
1379 case EOB_ACT_LAST_MATCH:
1380 (yy_c_buf_p) =
1381 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1382
1383 yy_current_state = yy_get_previous_state( );
1384
1385 yy_cp = (yy_c_buf_p);
1386 yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1387 goto yy_find_action;
1388 }
1389 break;
1390 }
1391
1392 default:
1393 YY_FATAL_ERROR(
1394 "fatal flex scanner internal error--no action found" );
1395 } /* end of action switch */
1396 } /* end of scanning one token */
1397} /* end of parse_events_lex */
1398
1399/* yy_get_next_buffer - try to read in a new buffer
1400 *
1401 * Returns a code representing an action:
1402 * EOB_ACT_LAST_MATCH -
1403 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1404 * EOB_ACT_END_OF_FILE - end of file
1405 */
1406static int yy_get_next_buffer (void)
1407{
1408 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1409 register char *source = (yytext_ptr);
1410 register int number_to_move, i;
1411 int ret_val;
1412
1413 if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1414 YY_FATAL_ERROR(
1415 "fatal flex scanner internal error--end of buffer missed" );
1416
1417 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1418 { /* Don't try to fill the buffer, so this is an EOF. */
1419 if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1420 {
1421 /* We matched a single character, the EOB, so
1422 * treat this as a final EOF.
1423 */
1424 return EOB_ACT_END_OF_FILE;
1425 }
1426
1427 else
1428 {
1429 /* We matched some text prior to the EOB, first
1430 * process it.
1431 */
1432 return EOB_ACT_LAST_MATCH;
1433 }
1434 }
1435
1436 /* Try to read more data. */
1437
1438 /* First move last chars to start of buffer. */
1439 number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1440
1441 for ( i = 0; i < number_to_move; ++i )
1442 *(dest++) = *(source++);
1443
1444 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1445 /* don't do the read, it's not guaranteed to return an EOF,
1446 * just force an EOF
1447 */
1448 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1449
1450 else
1451 {
1452 int num_to_read =
1453 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1454
1455 while ( num_to_read <= 0 )
1456 { /* Not enough room in the buffer - grow it. */
1457
1458 /* just a shorter name for the current buffer */
1459 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1460
1461 int yy_c_buf_p_offset =
1462 (int) ((yy_c_buf_p) - b->yy_ch_buf);
1463
1464 if ( b->yy_is_our_buffer )
1465 {
1466 int new_size = b->yy_buf_size * 2;
1467
1468 if ( new_size <= 0 )
1469 b->yy_buf_size += b->yy_buf_size / 8;
1470 else
1471 b->yy_buf_size *= 2;
1472
1473 b->yy_ch_buf = (char *)
1474 /* Include room in for 2 EOB chars. */
1475 parse_events_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1476 }
1477 else
1478 /* Can't grow it, we don't own it. */
1479 b->yy_ch_buf = 0;
1480
1481 if ( ! b->yy_ch_buf )
1482 YY_FATAL_ERROR(
1483 "fatal error - scanner input buffer overflow" );
1484
1485 (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1486
1487 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1488 number_to_move - 1;
1489
1490 }
1491
1492 if ( num_to_read > YY_READ_BUF_SIZE )
1493 num_to_read = YY_READ_BUF_SIZE;
1494
1495 /* Read in more data. */
1496 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1497 (yy_n_chars), (size_t) num_to_read );
1498
1499 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1500 }
1501
1502 if ( (yy_n_chars) == 0 )
1503 {
1504 if ( number_to_move == YY_MORE_ADJ )
1505 {
1506 ret_val = EOB_ACT_END_OF_FILE;
1507 parse_events_restart(parse_events_in );
1508 }
1509
1510 else
1511 {
1512 ret_val = EOB_ACT_LAST_MATCH;
1513 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1514 YY_BUFFER_EOF_PENDING;
1515 }
1516 }
1517
1518 else
1519 ret_val = EOB_ACT_CONTINUE_SCAN;
1520
1521 if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1522 /* Extend the array by 50%, plus the number we really need. */
1523 yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1524 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) parse_events_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1525 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1526 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1527 }
1528
1529 (yy_n_chars) += number_to_move;
1530 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1531 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1532
1533 (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1534
1535 return ret_val;
1536}
1537
1538/* yy_get_previous_state - get the state just before the EOB char was reached */
1539
1540 static yy_state_type yy_get_previous_state (void)
1541{
1542 register yy_state_type yy_current_state;
1543 register char *yy_cp;
1544
1545 yy_current_state = (yy_start);
1546
1547 for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1548 {
1549 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1550 if ( yy_accept[yy_current_state] )
1551 {
1552 (yy_last_accepting_state) = yy_current_state;
1553 (yy_last_accepting_cpos) = yy_cp;
1554 }
1555 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1556 {
1557 yy_current_state = (int) yy_def[yy_current_state];
8f707d84 1558 if ( yy_current_state >= 440 )
89812fc8
JO
1559 yy_c = yy_meta[(unsigned int) yy_c];
1560 }
1561 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1562 }
1563
1564 return yy_current_state;
1565}
1566
1567/* yy_try_NUL_trans - try to make a transition on the NUL character
1568 *
1569 * synopsis
1570 * next_state = yy_try_NUL_trans( current_state );
1571 */
1572 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1573{
1574 register int yy_is_jam;
1575 register char *yy_cp = (yy_c_buf_p);
1576
1577 register YY_CHAR yy_c = 1;
1578 if ( yy_accept[yy_current_state] )
1579 {
1580 (yy_last_accepting_state) = yy_current_state;
1581 (yy_last_accepting_cpos) = yy_cp;
1582 }
1583 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1584 {
1585 yy_current_state = (int) yy_def[yy_current_state];
8f707d84 1586 if ( yy_current_state >= 440 )
89812fc8
JO
1587 yy_c = yy_meta[(unsigned int) yy_c];
1588 }
1589 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
8f707d84 1590 yy_is_jam = (yy_current_state == 439);
89812fc8
JO
1591
1592 return yy_is_jam ? 0 : yy_current_state;
1593}
1594
1595 static void yyunput (int c, register char * yy_bp )
1596{
1597 register char *yy_cp;
1598
1599 yy_cp = (yy_c_buf_p);
1600
1601 /* undo effects of setting up parse_events_text */
1602 *yy_cp = (yy_hold_char);
1603
1604 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1605 { /* need to shift things up to make room */
1606 /* +2 for EOB chars. */
1607 register int number_to_move = (yy_n_chars) + 2;
1608 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1609 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1610 register char *source =
1611 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1612
1613 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1614 *--dest = *--source;
1615
1616 yy_cp += (int) (dest - source);
1617 yy_bp += (int) (dest - source);
1618 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1619 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1620
1621 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1622 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1623 }
1624
1625 *--yy_cp = (char) c;
1626
1627 (yytext_ptr) = yy_bp;
1628 (yy_hold_char) = *yy_cp;
1629 (yy_c_buf_p) = yy_cp;
1630}
1631
1632#ifndef YY_NO_INPUT
1633#ifdef __cplusplus
1634 static int yyinput (void)
1635#else
1636 static int input (void)
1637#endif
1638
1639{
1640 int c;
1641
1642 *(yy_c_buf_p) = (yy_hold_char);
1643
1644 if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1645 {
1646 /* yy_c_buf_p now points to the character we want to return.
1647 * If this occurs *before* the EOB characters, then it's a
1648 * valid NUL; if not, then we've hit the end of the buffer.
1649 */
1650 if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1651 /* This was really a NUL. */
1652 *(yy_c_buf_p) = '\0';
1653
1654 else
1655 { /* need more input */
1656 int offset = (yy_c_buf_p) - (yytext_ptr);
1657 ++(yy_c_buf_p);
1658
1659 switch ( yy_get_next_buffer( ) )
1660 {
1661 case EOB_ACT_LAST_MATCH:
1662 /* This happens because yy_g_n_b()
1663 * sees that we've accumulated a
1664 * token and flags that we need to
1665 * try matching the token before
1666 * proceeding. But for input(),
1667 * there's no matching to consider.
1668 * So convert the EOB_ACT_LAST_MATCH
1669 * to EOB_ACT_END_OF_FILE.
1670 */
1671
1672 /* Reset buffer status. */
1673 parse_events_restart(parse_events_in );
1674
1675 /*FALLTHROUGH*/
1676
1677 case EOB_ACT_END_OF_FILE:
1678 {
1679 if ( parse_events_wrap( ) )
1680 return EOF;
1681
1682 if ( ! (yy_did_buffer_switch_on_eof) )
1683 YY_NEW_FILE;
1684#ifdef __cplusplus
1685 return yyinput();
1686#else
1687 return input();
1688#endif
1689 }
1690
1691 case EOB_ACT_CONTINUE_SCAN:
1692 (yy_c_buf_p) = (yytext_ptr) + offset;
1693 break;
1694 }
1695 }
1696 }
1697
1698 c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1699 *(yy_c_buf_p) = '\0'; /* preserve parse_events_text */
1700 (yy_hold_char) = *++(yy_c_buf_p);
1701
1702 return c;
1703}
1704#endif /* ifndef YY_NO_INPUT */
1705
1706/** Immediately switch to a different input stream.
1707 * @param input_file A readable stream.
1708 *
1709 * @note This function does not reset the start condition to @c INITIAL .
1710 */
1711 void parse_events_restart (FILE * input_file )
1712{
1713
1714 if ( ! YY_CURRENT_BUFFER ){
1715 parse_events_ensure_buffer_stack ();
1716 YY_CURRENT_BUFFER_LVALUE =
1717 parse_events__create_buffer(parse_events_in,YY_BUF_SIZE );
1718 }
1719
1720 parse_events__init_buffer(YY_CURRENT_BUFFER,input_file );
1721 parse_events__load_buffer_state( );
1722}
1723
1724/** Switch to a different input buffer.
1725 * @param new_buffer The new input buffer.
1726 *
1727 */
1728 void parse_events__switch_to_buffer (YY_BUFFER_STATE new_buffer )
1729{
1730
1731 /* TODO. We should be able to replace this entire function body
1732 * with
1733 * parse_events_pop_buffer_state();
1734 * parse_events_push_buffer_state(new_buffer);
1735 */
1736 parse_events_ensure_buffer_stack ();
1737 if ( YY_CURRENT_BUFFER == new_buffer )
1738 return;
1739
1740 if ( YY_CURRENT_BUFFER )
1741 {
1742 /* Flush out information for old buffer. */
1743 *(yy_c_buf_p) = (yy_hold_char);
1744 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1745 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1746 }
1747
1748 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1749 parse_events__load_buffer_state( );
1750
1751 /* We don't actually know whether we did this switch during
1752 * EOF (parse_events_wrap()) processing, but the only time this flag
1753 * is looked at is after parse_events_wrap() is called, so it's safe
1754 * to go ahead and always set it.
1755 */
1756 (yy_did_buffer_switch_on_eof) = 1;
1757}
1758
1759static void parse_events__load_buffer_state (void)
1760{
1761 (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1762 (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1763 parse_events_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1764 (yy_hold_char) = *(yy_c_buf_p);
1765}
1766
1767/** Allocate and initialize an input buffer state.
1768 * @param file A readable stream.
1769 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1770 *
1771 * @return the allocated buffer state.
1772 */
1773 YY_BUFFER_STATE parse_events__create_buffer (FILE * file, int size )
1774{
1775 YY_BUFFER_STATE b;
1776
1777 b = (YY_BUFFER_STATE) parse_events_alloc(sizeof( struct yy_buffer_state ) );
1778 if ( ! b )
1779 YY_FATAL_ERROR( "out of dynamic memory in parse_events__create_buffer()" );
1780
1781 b->yy_buf_size = size;
1782
1783 /* yy_ch_buf has to be 2 characters longer than the size given because
1784 * we need to put in 2 end-of-buffer characters.
1785 */
1786 b->yy_ch_buf = (char *) parse_events_alloc(b->yy_buf_size + 2 );
1787 if ( ! b->yy_ch_buf )
1788 YY_FATAL_ERROR( "out of dynamic memory in parse_events__create_buffer()" );
1789
1790 b->yy_is_our_buffer = 1;
1791
1792 parse_events__init_buffer(b,file );
1793
1794 return b;
1795}
1796
1797/** Destroy the buffer.
1798 * @param b a buffer created with parse_events__create_buffer()
1799 *
1800 */
1801 void parse_events__delete_buffer (YY_BUFFER_STATE b )
1802{
1803
1804 if ( ! b )
1805 return;
1806
1807 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1808 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1809
1810 if ( b->yy_is_our_buffer )
1811 parse_events_free((void *) b->yy_ch_buf );
1812
1813 parse_events_free((void *) b );
1814}
1815
1816#ifndef __cplusplus
1817extern int isatty (int );
1818#endif /* __cplusplus */
1819
1820/* Initializes or reinitializes a buffer.
1821 * This function is sometimes called more than once on the same buffer,
1822 * such as during a parse_events_restart() or at EOF.
1823 */
1824 static void parse_events__init_buffer (YY_BUFFER_STATE b, FILE * file )
1825
1826{
1827 int oerrno = errno;
1828
1829 parse_events__flush_buffer(b );
1830
1831 b->yy_input_file = file;
1832 b->yy_fill_buffer = 1;
1833
1834 /* If b is the current buffer, then parse_events__init_buffer was _probably_
1835 * called from parse_events_restart() or through yy_get_next_buffer.
1836 * In that case, we don't want to reset the lineno or column.
1837 */
1838 if (b != YY_CURRENT_BUFFER){
1839 b->yy_bs_lineno = 1;
1840 b->yy_bs_column = 0;
1841 }
1842
1843 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1844
1845 errno = oerrno;
1846}
1847
1848/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1849 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1850 *
1851 */
1852 void parse_events__flush_buffer (YY_BUFFER_STATE b )
1853{
1854 if ( ! b )
1855 return;
1856
1857 b->yy_n_chars = 0;
1858
1859 /* We always need two end-of-buffer characters. The first causes
1860 * a transition to the end-of-buffer state. The second causes
1861 * a jam in that state.
1862 */
1863 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1864 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1865
1866 b->yy_buf_pos = &b->yy_ch_buf[0];
1867
1868 b->yy_at_bol = 1;
1869 b->yy_buffer_status = YY_BUFFER_NEW;
1870
1871 if ( b == YY_CURRENT_BUFFER )
1872 parse_events__load_buffer_state( );
1873}
1874
1875/** Pushes the new state onto the stack. The new state becomes
1876 * the current state. This function will allocate the stack
1877 * if necessary.
1878 * @param new_buffer The new state.
1879 *
1880 */
1881void parse_events_push_buffer_state (YY_BUFFER_STATE new_buffer )
1882{
1883 if (new_buffer == NULL)
1884 return;
1885
1886 parse_events_ensure_buffer_stack();
1887
1888 /* This block is copied from parse_events__switch_to_buffer. */
1889 if ( YY_CURRENT_BUFFER )
1890 {
1891 /* Flush out information for old buffer. */
1892 *(yy_c_buf_p) = (yy_hold_char);
1893 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1894 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1895 }
1896
1897 /* Only push if top exists. Otherwise, replace top. */
1898 if (YY_CURRENT_BUFFER)
1899 (yy_buffer_stack_top)++;
1900 YY_CURRENT_BUFFER_LVALUE = new_buffer;
1901
1902 /* copied from parse_events__switch_to_buffer. */
1903 parse_events__load_buffer_state( );
1904 (yy_did_buffer_switch_on_eof) = 1;
1905}
1906
1907/** Removes and deletes the top of the stack, if present.
1908 * The next element becomes the new top.
1909 *
1910 */
1911void parse_events_pop_buffer_state (void)
1912{
1913 if (!YY_CURRENT_BUFFER)
1914 return;
1915
1916 parse_events__delete_buffer(YY_CURRENT_BUFFER );
1917 YY_CURRENT_BUFFER_LVALUE = NULL;
1918 if ((yy_buffer_stack_top) > 0)
1919 --(yy_buffer_stack_top);
1920
1921 if (YY_CURRENT_BUFFER) {
1922 parse_events__load_buffer_state( );
1923 (yy_did_buffer_switch_on_eof) = 1;
1924 }
1925}
1926
1927/* Allocates the stack if it does not exist.
1928 * Guarantees space for at least one push.
1929 */
1930static void parse_events_ensure_buffer_stack (void)
1931{
1932 int num_to_alloc;
1933
1934 if (!(yy_buffer_stack)) {
1935
1936 /* First allocation is just for 2 elements, since we don't know if this
1937 * scanner will even need a stack. We use 2 instead of 1 to avoid an
1938 * immediate realloc on the next call.
1939 */
1940 num_to_alloc = 1;
1941 (yy_buffer_stack) = (struct yy_buffer_state**)parse_events_alloc
1942 (num_to_alloc * sizeof(struct yy_buffer_state*)
1943 );
1944 if ( ! (yy_buffer_stack) )
1945 YY_FATAL_ERROR( "out of dynamic memory in parse_events_ensure_buffer_stack()" );
1946
1947 memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1948
1949 (yy_buffer_stack_max) = num_to_alloc;
1950 (yy_buffer_stack_top) = 0;
1951 return;
1952 }
1953
1954 if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1955
1956 /* Increase the buffer to prepare for a possible push. */
1957 int grow_size = 8 /* arbitrary grow size */;
1958
1959 num_to_alloc = (yy_buffer_stack_max) + grow_size;
1960 (yy_buffer_stack) = (struct yy_buffer_state**)parse_events_realloc
1961 ((yy_buffer_stack),
1962 num_to_alloc * sizeof(struct yy_buffer_state*)
1963 );
1964 if ( ! (yy_buffer_stack) )
1965 YY_FATAL_ERROR( "out of dynamic memory in parse_events_ensure_buffer_stack()" );
1966
1967 /* zero only the new slots.*/
1968 memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1969 (yy_buffer_stack_max) = num_to_alloc;
1970 }
1971}
1972
1973/** Setup the input buffer state to scan directly from a user-specified character buffer.
1974 * @param base the character buffer
1975 * @param size the size in bytes of the character buffer
1976 *
1977 * @return the newly allocated buffer state object.
1978 */
1979YY_BUFFER_STATE parse_events__scan_buffer (char * base, yy_size_t size )
1980{
1981 YY_BUFFER_STATE b;
1982
1983 if ( size < 2 ||
1984 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1985 base[size-1] != YY_END_OF_BUFFER_CHAR )
1986 /* They forgot to leave room for the EOB's. */
1987 return 0;
1988
1989 b = (YY_BUFFER_STATE) parse_events_alloc(sizeof( struct yy_buffer_state ) );
1990 if ( ! b )
1991 YY_FATAL_ERROR( "out of dynamic memory in parse_events__scan_buffer()" );
1992
1993 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1994 b->yy_buf_pos = b->yy_ch_buf = base;
1995 b->yy_is_our_buffer = 0;
1996 b->yy_input_file = 0;
1997 b->yy_n_chars = b->yy_buf_size;
1998 b->yy_is_interactive = 0;
1999 b->yy_at_bol = 1;
2000 b->yy_fill_buffer = 0;
2001 b->yy_buffer_status = YY_BUFFER_NEW;
2002
2003 parse_events__switch_to_buffer(b );
2004
2005 return b;
2006}
2007
2008/** Setup the input buffer state to scan a string. The next call to parse_events_lex() will
2009 * scan from a @e copy of @a str.
2010 * @param yystr a NUL-terminated string to scan
2011 *
2012 * @return the newly allocated buffer state object.
2013 * @note If you want to scan bytes that may contain NUL values, then use
2014 * parse_events__scan_bytes() instead.
2015 */
2016YY_BUFFER_STATE parse_events__scan_string (yyconst char * yystr )
2017{
2018
2019 return parse_events__scan_bytes(yystr,strlen(yystr) );
2020}
2021
2022/** Setup the input buffer state to scan the given bytes. The next call to parse_events_lex() will
2023 * scan from a @e copy of @a bytes.
2024 * @param bytes the byte buffer to scan
2025 * @param len the number of bytes in the buffer pointed to by @a bytes.
2026 *
2027 * @return the newly allocated buffer state object.
2028 */
2029YY_BUFFER_STATE parse_events__scan_bytes (yyconst char * yybytes, int _yybytes_len )
2030{
2031 YY_BUFFER_STATE b;
2032 char *buf;
2033 yy_size_t n;
2034 int i;
2035
2036 /* Get memory for full buffer, including space for trailing EOB's. */
2037 n = _yybytes_len + 2;
2038 buf = (char *) parse_events_alloc(n );
2039 if ( ! buf )
2040 YY_FATAL_ERROR( "out of dynamic memory in parse_events__scan_bytes()" );
2041
2042 for ( i = 0; i < _yybytes_len; ++i )
2043 buf[i] = yybytes[i];
2044
2045 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2046
2047 b = parse_events__scan_buffer(buf,n );
2048 if ( ! b )
2049 YY_FATAL_ERROR( "bad buffer in parse_events__scan_bytes()" );
2050
2051 /* It's okay to grow etc. this buffer, and we should throw it
2052 * away when we're done.
2053 */
2054 b->yy_is_our_buffer = 1;
2055
2056 return b;
2057}
2058
2059#ifndef YY_EXIT_FAILURE
2060#define YY_EXIT_FAILURE 2
2061#endif
2062
2063static void yy_fatal_error (yyconst char* msg )
2064{
2065 (void) fprintf( stderr, "%s\n", msg );
2066 exit( YY_EXIT_FAILURE );
2067}
2068
2069/* Redefine yyless() so it works in section 3 code. */
2070
2071#undef yyless
2072#define yyless(n) \
2073 do \
2074 { \
2075 /* Undo effects of setting up parse_events_text. */ \
2076 int yyless_macro_arg = (n); \
2077 YY_LESS_LINENO(yyless_macro_arg);\
2078 parse_events_text[parse_events_leng] = (yy_hold_char); \
2079 (yy_c_buf_p) = parse_events_text + yyless_macro_arg; \
2080 (yy_hold_char) = *(yy_c_buf_p); \
2081 *(yy_c_buf_p) = '\0'; \
2082 parse_events_leng = yyless_macro_arg; \
2083 } \
2084 while ( 0 )
2085
2086/* Accessor methods (get/set functions) to struct members. */
2087
2088/** Get the current line number.
2089 *
2090 */
2091int parse_events_get_lineno (void)
2092{
2093
2094 return parse_events_lineno;
2095}
2096
2097/** Get the input stream.
2098 *
2099 */
2100FILE *parse_events_get_in (void)
2101{
2102 return parse_events_in;
2103}
2104
2105/** Get the output stream.
2106 *
2107 */
2108FILE *parse_events_get_out (void)
2109{
2110 return parse_events_out;
2111}
2112
2113/** Get the length of the current token.
2114 *
2115 */
2116int parse_events_get_leng (void)
2117{
2118 return parse_events_leng;
2119}
2120
2121/** Get the current token.
2122 *
2123 */
2124
2125char *parse_events_get_text (void)
2126{
2127 return parse_events_text;
2128}
2129
2130/** Set the current line number.
2131 * @param line_number
2132 *
2133 */
2134void parse_events_set_lineno (int line_number )
2135{
2136
2137 parse_events_lineno = line_number;
2138}
2139
2140/** Set the input stream. This does not discard the current
2141 * input buffer.
2142 * @param in_str A readable stream.
2143 *
2144 * @see parse_events__switch_to_buffer
2145 */
2146void parse_events_set_in (FILE * in_str )
2147{
2148 parse_events_in = in_str ;
2149}
2150
2151void parse_events_set_out (FILE * out_str )
2152{
2153 parse_events_out = out_str ;
2154}
2155
2156int parse_events_get_debug (void)
2157{
2158 return parse_events__flex_debug;
2159}
2160
2161void parse_events_set_debug (int bdebug )
2162{
2163 parse_events__flex_debug = bdebug ;
2164}
2165
2166static int yy_init_globals (void)
2167{
2168 /* Initialization is the same as for the non-reentrant scanner.
2169 * This function is called from parse_events_lex_destroy(), so don't allocate here.
2170 */
2171
2172 (yy_buffer_stack) = 0;
2173 (yy_buffer_stack_top) = 0;
2174 (yy_buffer_stack_max) = 0;
2175 (yy_c_buf_p) = (char *) 0;
2176 (yy_init) = 0;
2177 (yy_start) = 0;
2178
2179/* Defined in main.c */
2180#ifdef YY_STDINIT
2181 parse_events_in = stdin;
2182 parse_events_out = stdout;
2183#else
2184 parse_events_in = (FILE *) 0;
2185 parse_events_out = (FILE *) 0;
2186#endif
2187
2188 /* For future reference: Set errno on error, since we are called by
2189 * parse_events_lex_init()
2190 */
2191 return 0;
2192}
2193
2194/* parse_events_lex_destroy is for both reentrant and non-reentrant scanners. */
2195int parse_events_lex_destroy (void)
2196{
2197
2198 /* Pop the buffer stack, destroying each element. */
2199 while(YY_CURRENT_BUFFER){
2200 parse_events__delete_buffer(YY_CURRENT_BUFFER );
2201 YY_CURRENT_BUFFER_LVALUE = NULL;
2202 parse_events_pop_buffer_state();
2203 }
2204
2205 /* Destroy the stack itself. */
2206 parse_events_free((yy_buffer_stack) );
2207 (yy_buffer_stack) = NULL;
2208
2209 /* Reset the globals. This is important in a non-reentrant scanner so the next time
2210 * parse_events_lex() is called, initialization will occur. */
2211 yy_init_globals( );
2212
2213 return 0;
2214}
2215
2216/*
2217 * Internal utility routines.
2218 */
2219
2220#ifndef yytext_ptr
2221static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2222{
2223 register int i;
2224 for ( i = 0; i < n; ++i )
2225 s1[i] = s2[i];
2226}
2227#endif
2228
2229#ifdef YY_NEED_STRLEN
2230static int yy_flex_strlen (yyconst char * s )
2231{
2232 register int n;
2233 for ( n = 0; s[n]; ++n )
2234 ;
2235
2236 return n;
2237}
2238#endif
2239
2240void *parse_events_alloc (yy_size_t size )
2241{
2242 return (void *) malloc( size );
2243}
2244
2245void *parse_events_realloc (void * ptr, yy_size_t size )
2246{
2247 /* The cast to (char *) in the following accommodates both
2248 * implementations that use char* generic pointers, and those
2249 * that use void* generic pointers. It works with the latter
2250 * because both ANSI C and C++ allow castless assignment from
2251 * any pointer type to void*, and deal with argument conversions
2252 * as though doing an assignment.
2253 */
2254 return (void *) realloc( (char *) ptr, size );
2255}
2256
2257void parse_events_free (void * ptr )
2258{
2259 free( (char *) ptr ); /* see parse_events_realloc() for (char *) cast */
2260}
2261
2262#define YYTABLES_NAME "yytables"
2263
8f707d84 2264#line 121 "util/parse-events.l"
89812fc8
JO
2265
2266
2267
2268int parse_events_wrap(void)
2269{
2270 return 1;
2271}
2272