parse-events-flex.c 67 KB

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