flex_BPredicate.c 58 KB

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