flex_BPredicate.c 59 KB

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