You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1952 lines
56 KiB

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