flex_BPredicate.c 58 KB

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