flex_BPredicate.c 59 KB

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