flex_BPredicate.c 59 KB

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