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.

1541 lines
33 KiB

  1. /* A lexical scanner generated by flex */
  2. /* Scanner skeleton version:
  3. * $Header$
  4. */
  5. #define FLEX_SCANNER
  6. #define YY_FLEX_MAJOR_VERSION 2
  7. #define YY_FLEX_MINOR_VERSION 5
  8. %-
  9. #include <stdio.h>
  10. %*
  11. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  12. #ifdef c_plusplus
  13. #ifndef __cplusplus
  14. #define __cplusplus
  15. #endif
  16. #endif
  17. #ifdef __cplusplus
  18. #include <stdlib.h>
  19. %+
  20. class istream;
  21. %*
  22. #if HAVE_UNISTD_H
  23. #include <unistd.h>
  24. #endif
  25. /* Use prototypes in function declarations. */
  26. #define YY_USE_PROTOS
  27. /* The "const" storage-class-modifier is valid. */
  28. #define YY_USE_CONST
  29. #else /* ! __cplusplus */
  30. #if __STDC__
  31. #define YY_USE_PROTOS
  32. #define YY_USE_CONST
  33. #endif /* __STDC__ */
  34. #endif /* ! __cplusplus */
  35. #ifdef __TURBOC__
  36. #pragma warn -rch
  37. #pragma warn -use
  38. #include <io.h>
  39. #include <stdlib.h>
  40. #define YY_USE_CONST
  41. #define YY_USE_PROTOS
  42. #endif
  43. #ifdef YY_USE_CONST
  44. #define yyconst const
  45. #else
  46. #define yyconst
  47. #endif
  48. #ifdef YY_USE_PROTOS
  49. #define YY_PROTO(proto) proto
  50. #else
  51. #define YY_PROTO(proto) ()
  52. #endif
  53. /* Returned upon end-of-file. */
  54. #define YY_NULL 0
  55. /* Promotes a possibly negative, possibly signed char to an unsigned
  56. * integer for use as an array index. If the signed char is negative,
  57. * we want to instead treat it as an 8-bit unsigned char, hence the
  58. * double cast.
  59. */
  60. #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
  61. /* Enter a start condition. This macro really ought to take a parameter,
  62. * but we do it the disgusting crufty way forced on us by the ()-less
  63. * definition of BEGIN.
  64. */
  65. #define BEGIN yy_start = 1 + 2 *
  66. /* Translate the current start state into a value that can be later handed
  67. * to BEGIN to return to the state. The YYSTATE alias is for lex
  68. * compatibility.
  69. */
  70. #define YY_START ((yy_start - 1) / 2)
  71. #define YYSTATE YY_START
  72. /* Action number for EOF rule of a given start state. */
  73. #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
  74. /* Special action meaning "start processing a new file". */
  75. #define YY_NEW_FILE yyrestart( yyin )
  76. #define YY_END_OF_BUFFER_CHAR 0
  77. /* Size of default input buffer. */
  78. #define YY_BUF_SIZE 16384
  79. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  80. extern int yyleng;
  81. %-
  82. extern FILE *yyin, *yyout;
  83. %*
  84. #define EOB_ACT_CONTINUE_SCAN 0
  85. #define EOB_ACT_END_OF_FILE 1
  86. #define EOB_ACT_LAST_MATCH 2
  87. /* The funky do-while in the following #define is used to turn the definition
  88. * int a single C statement (which needs a semi-colon terminator). This
  89. * avoids problems with code like:
  90. *
  91. * if ( condition_holds )
  92. * yyless( 5 );
  93. * else
  94. * do_something_else();
  95. *
  96. * Prior to using the do-while the compiler would get upset at the
  97. * "else" because it interpreted the "if" statement as being all
  98. * done when it reached the ';' after the yyless() call.
  99. */
  100. /* Return all but the first 'n' matched characters back to the input stream. */
  101. #define yyless(n) \
  102. do \
  103. { \
  104. /* Undo effects of setting up yytext. */ \
  105. *yy_cp = yy_hold_char; \
  106. yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
  107. YY_DO_BEFORE_ACTION; /* set up yytext again */ \
  108. } \
  109. while ( 0 )
  110. #define unput(c) yyunput( c, yytext_ptr )
  111. /* The following is because we cannot portably get our hands on size_t
  112. * (without autoconf's help, which isn't available because we want
  113. * flex-generated scanners to compile on their own).
  114. */
  115. typedef unsigned int yy_size_t;
  116. struct yy_buffer_state
  117. {
  118. %-
  119. FILE *yy_input_file;
  120. %+
  121. istream* yy_input_file;
  122. %*
  123. char *yy_ch_buf; /* input buffer */
  124. char *yy_buf_pos; /* current position in input buffer */
  125. /* Size of input buffer in bytes, not including room for EOB
  126. * characters.
  127. */
  128. yy_size_t yy_buf_size;
  129. /* Number of characters read into yy_ch_buf, not including EOB
  130. * characters.
  131. */
  132. int yy_n_chars;
  133. /* Whether we "own" the buffer - i.e., we know we created it,
  134. * and can realloc() it to grow it, and should free() it to
  135. * delete it.
  136. */
  137. int yy_is_our_buffer;
  138. /* Whether this is an "interactive" input source; if so, and
  139. * if we're using stdio for input, then we want to use getc()
  140. * instead of fread(), to make sure we stop fetching input after
  141. * each newline.
  142. */
  143. int yy_is_interactive;
  144. /* Whether we're considered to be at the beginning of a line.
  145. * If so, '^' rules will be active on the next match, otherwise
  146. * not.
  147. */
  148. int yy_at_bol;
  149. /* Whether to try to fill the input buffer when we reach the
  150. * end of it.
  151. */
  152. int yy_fill_buffer;
  153. int yy_buffer_status;
  154. #define YY_BUFFER_NEW 0
  155. #define YY_BUFFER_NORMAL 1
  156. /* When an EOF's been seen but there's still some text to process
  157. * then we mark the buffer as YY_EOF_PENDING, to indicate that we
  158. * shouldn't try reading from the input source any more. We might
  159. * still have a bunch of tokens to match, though, because of
  160. * possible backing-up.
  161. *
  162. * When we actually see the EOF, we change the status to "new"
  163. * (via yyrestart()), so that the user can continue scanning by
  164. * just pointing yyin at a new input file.
  165. */
  166. #define YY_BUFFER_EOF_PENDING 2
  167. };
  168. %- Standard (non-C++) definition
  169. static YY_BUFFER_STATE yy_current_buffer = 0;
  170. %*
  171. /* We provide macros for accessing buffer states in case in the
  172. * future we want to put the buffer states in a more general
  173. * "scanner state".
  174. */
  175. #define YY_CURRENT_BUFFER yy_current_buffer
  176. %- Standard (non-C++) definition
  177. /* yy_hold_char holds the character lost when yytext is formed. */
  178. static char yy_hold_char;
  179. static int yy_n_chars; /* number of characters read into yy_ch_buf */
  180. int yyleng;
  181. /* Points to current character in buffer. */
  182. static char *yy_c_buf_p = (char *) 0;
  183. static int yy_init = 1; /* whether we need to initialize */
  184. static int yy_start = 0; /* start state number */
  185. /* Flag which is used to allow yywrap()'s to do buffer switches
  186. * instead of setting up a fresh yyin. A bit of a hack ...
  187. */
  188. static int yy_did_buffer_switch_on_eof;
  189. void yyrestart YY_PROTO(( FILE *input_file ));
  190. void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  191. void yy_load_buffer_state YY_PROTO(( void ));
  192. YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
  193. void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  194. void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  195. void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
  196. #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
  197. YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
  198. YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
  199. YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
  200. %*
  201. static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
  202. static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
  203. static void yy_flex_free YY_PROTO(( void * ));
  204. #define yy_new_buffer yy_create_buffer
  205. #define yy_set_interactive(is_interactive) \
  206. { \
  207. if ( ! yy_current_buffer ) \
  208. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  209. yy_current_buffer->yy_is_interactive = is_interactive; \
  210. }
  211. #define yy_set_bol(at_bol) \
  212. { \
  213. if ( ! yy_current_buffer ) \
  214. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
  215. yy_current_buffer->yy_at_bol = at_bol; \
  216. }
  217. #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
  218. %% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here
  219. %- Standard (non-C++) definition
  220. static yy_state_type yy_get_previous_state YY_PROTO(( void ));
  221. static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
  222. static int yy_get_next_buffer YY_PROTO(( void ));
  223. static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
  224. %*
  225. /* Done after the current pattern has been matched and before the
  226. * corresponding action - sets up yytext.
  227. */
  228. #define YY_DO_BEFORE_ACTION \
  229. yytext_ptr = yy_bp; \
  230. %% code to fiddle yytext and yyleng for yymore() goes here
  231. yy_hold_char = *yy_cp; \
  232. *yy_cp = '\0'; \
  233. %% code to copy yytext_ptr to yytext[] goes here, if %array
  234. yy_c_buf_p = yy_cp;
  235. %% data tables for the DFA and the user's section 1 definitions go here
  236. /* Macros after this point can all be overridden by user definitions in
  237. * section 1.
  238. */
  239. #ifndef YY_SKIP_YYWRAP
  240. #ifdef __cplusplus
  241. extern "C" int yywrap YY_PROTO(( void ));
  242. #else
  243. extern int yywrap YY_PROTO(( void ));
  244. #endif
  245. #endif
  246. %-
  247. #ifndef YY_NO_UNPUT
  248. static void yyunput YY_PROTO(( int c, char *buf_ptr ));
  249. #endif
  250. %*
  251. #ifndef yytext_ptr
  252. static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
  253. #endif
  254. #ifdef YY_NEED_STRLEN
  255. static int yy_flex_strlen YY_PROTO(( yyconst char * ));
  256. #endif
  257. #ifndef YY_NO_INPUT
  258. %- Standard (non-C++) definition
  259. #ifdef __cplusplus
  260. static int yyinput YY_PROTO(( void ));
  261. #else
  262. static int input YY_PROTO(( void ));
  263. #endif
  264. %*
  265. #endif
  266. #if YY_STACK_USED
  267. static int yy_start_stack_ptr = 0;
  268. static int yy_start_stack_depth = 0;
  269. static int *yy_start_stack = 0;
  270. #ifndef YY_NO_PUSH_STATE
  271. static void yy_push_state YY_PROTO(( int new_state ));
  272. #endif
  273. #ifndef YY_NO_POP_STATE
  274. static void yy_pop_state YY_PROTO(( void ));
  275. #endif
  276. #ifndef YY_NO_TOP_STATE
  277. static int yy_top_state YY_PROTO(( void ));
  278. #endif
  279. #else
  280. #define YY_NO_PUSH_STATE 1
  281. #define YY_NO_POP_STATE 1
  282. #define YY_NO_TOP_STATE 1
  283. #endif
  284. #ifdef YY_MALLOC_DECL
  285. YY_MALLOC_DECL
  286. #else
  287. #if __STDC__
  288. #ifndef __cplusplus
  289. #include <stdlib.h>
  290. #endif
  291. #else
  292. /* Just try to get by without declaring the routines. This will fail
  293. * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
  294. * or sizeof(void*) != sizeof(int).
  295. */
  296. #endif
  297. #endif
  298. /* Amount of stuff to slurp up with each read. */
  299. #ifndef YY_READ_BUF_SIZE
  300. #define YY_READ_BUF_SIZE 8192
  301. #endif
  302. /* Copy whatever the last rule matched to the standard output. */
  303. #ifndef ECHO
  304. %- Standard (non-C++) definition
  305. /* This used to be an fputs(), but since the string might contain NUL's,
  306. * we now use fwrite().
  307. */
  308. #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
  309. %+ C++ definition
  310. #define ECHO LexerOutput( yytext, yyleng )
  311. %*
  312. #endif
  313. /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
  314. * is returned in "result".
  315. */
  316. #ifndef YY_INPUT
  317. #define YY_INPUT(buf,result,max_size) \
  318. %% fread()/read() definition of YY_INPUT goes here unless we're doing C++
  319. %+ C++ definition
  320. if ( (result = LexerInput( (char *) buf, max_size )) < 0 ) \
  321. YY_FATAL_ERROR( "input in flex scanner failed" );
  322. %*
  323. #endif
  324. /* No semi-colon after return; correct usage is to write "yyterminate();" -
  325. * we don't want an extra ';' after the "return" because that will cause
  326. * some compilers to complain about unreachable statements.
  327. */
  328. #ifndef yyterminate
  329. #define yyterminate() return YY_NULL
  330. #endif
  331. /* Number of entries by which start-condition stack grows. */
  332. #ifndef YY_START_STACK_INCR
  333. #define YY_START_STACK_INCR 25
  334. #endif
  335. /* Report a fatal error. */
  336. #ifndef YY_FATAL_ERROR
  337. %-
  338. #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
  339. %+
  340. #define YY_FATAL_ERROR(msg) LexerError( msg )
  341. %*
  342. #endif
  343. /* Default declaration of generated scanner - a define so the user can
  344. * easily add parameters.
  345. */
  346. #ifndef YY_DECL
  347. %- Standard (non-C++) definition
  348. #define YY_DECL int yylex YY_PROTO(( void ))
  349. %+ C++ definition
  350. #define YY_DECL int yyFlexLexer::yylex()
  351. %*
  352. #endif
  353. /* Code executed at the beginning of each rule, after yytext and yyleng
  354. * have been set up.
  355. */
  356. #ifndef YY_USER_ACTION
  357. #define YY_USER_ACTION
  358. #endif
  359. /* Code executed at the end of each rule. */
  360. #ifndef YY_BREAK
  361. #define YY_BREAK break;
  362. #endif
  363. %% YY_RULE_SETUP definition goes here
  364. YY_DECL
  365. {
  366. register yy_state_type yy_current_state;
  367. register char *yy_cp, *yy_bp;
  368. register int yy_act;
  369. %% user's declarations go here
  370. if ( yy_init )
  371. {
  372. yy_init = 0;
  373. #ifdef YY_USER_INIT
  374. YY_USER_INIT;
  375. #endif
  376. if ( ! yy_start )
  377. yy_start = 1; /* first start state */
  378. if ( ! yyin )
  379. %-
  380. yyin = stdin;
  381. %+
  382. yyin = &cin;
  383. %*
  384. if ( ! yyout )
  385. %-
  386. yyout = stdout;
  387. %+
  388. yyout = &cout;
  389. %*
  390. if ( ! yy_current_buffer )
  391. yy_current_buffer =
  392. yy_create_buffer( yyin, YY_BUF_SIZE );
  393. yy_load_buffer_state();
  394. }
  395. while ( 1 ) /* loops until end-of-file is reached */
  396. {
  397. %% yymore()-related code goes here
  398. yy_cp = yy_c_buf_p;
  399. /* Support of yytext. */
  400. *yy_cp = yy_hold_char;
  401. /* yy_bp points to the position in yy_ch_buf of the start of
  402. * the current run.
  403. */
  404. yy_bp = yy_cp;
  405. %% code to set up and find next match goes here
  406. yy_find_action:
  407. %% code to find the action number goes here
  408. YY_DO_BEFORE_ACTION;
  409. %% code for yylineno update goes here
  410. do_action: /* This label is used only to access EOF actions. */
  411. %% debug code goes here
  412. switch ( yy_act )
  413. { /* beginning of action switch */
  414. %% actions go here
  415. case YY_END_OF_BUFFER:
  416. {
  417. /* Amount of text matched not including the EOB char. */
  418. int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
  419. /* Undo the effects of YY_DO_BEFORE_ACTION. */
  420. *yy_cp = yy_hold_char;
  421. if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
  422. {
  423. /* We're scanning a new file or input source. It's
  424. * possible that this happened because the user
  425. * just pointed yyin at a new source and called
  426. * yylex(). If so, then we have to assure
  427. * consistency between yy_current_buffer and our
  428. * globals. Here is the right place to do so, because
  429. * this is the first action (other than possibly a
  430. * back-up) that will match for the new input source.
  431. */
  432. yy_n_chars = yy_current_buffer->yy_n_chars;
  433. yy_current_buffer->yy_input_file = yyin;
  434. yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
  435. }
  436. /* Note that here we test for yy_c_buf_p "<=" to the position
  437. * of the first EOB in the buffer, since yy_c_buf_p will
  438. * already have been incremented past the NUL character
  439. * (since all states make transitions on EOB to the
  440. * end-of-buffer state). Contrast this with the test
  441. * in input().
  442. */
  443. if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  444. { /* This was really a NUL. */
  445. yy_state_type yy_next_state;
  446. yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
  447. yy_current_state = yy_get_previous_state();
  448. /* Okay, we're now positioned to make the NUL
  449. * transition. We couldn't have
  450. * yy_get_previous_state() go ahead and do it
  451. * for us because it doesn't know how to deal
  452. * with the possibility of jamming (and we don't
  453. * want to build jamming into it because then it
  454. * will run more slowly).
  455. */
  456. yy_next_state = yy_try_NUL_trans( yy_current_state );
  457. yy_bp = yytext_ptr + YY_MORE_ADJ;
  458. if ( yy_next_state )
  459. {
  460. /* Consume the NUL. */
  461. yy_cp = ++yy_c_buf_p;
  462. yy_current_state = yy_next_state;
  463. goto yy_match;
  464. }
  465. else
  466. {
  467. %% code to do back-up for compressed tables and set up yy_cp goes here
  468. goto yy_find_action;
  469. }
  470. }
  471. else switch ( yy_get_next_buffer() )
  472. {
  473. case EOB_ACT_END_OF_FILE:
  474. {
  475. yy_did_buffer_switch_on_eof = 0;
  476. if ( yywrap() )
  477. {
  478. /* Note: because we've taken care in
  479. * yy_get_next_buffer() to have set up
  480. * yytext, we can now set up
  481. * yy_c_buf_p so that if some total
  482. * hoser (like flex itself) wants to
  483. * call the scanner after we return the
  484. * YY_NULL, it'll still work - another
  485. * YY_NULL will get returned.
  486. */
  487. yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
  488. yy_act = YY_STATE_EOF(YY_START);
  489. goto do_action;
  490. }
  491. else
  492. {
  493. if ( ! yy_did_buffer_switch_on_eof )
  494. YY_NEW_FILE;
  495. }
  496. break;
  497. }
  498. case EOB_ACT_CONTINUE_SCAN:
  499. yy_c_buf_p =
  500. yytext_ptr + yy_amount_of_matched_text;
  501. yy_current_state = yy_get_previous_state();
  502. yy_cp = yy_c_buf_p;
  503. yy_bp = yytext_ptr + YY_MORE_ADJ;
  504. goto yy_match;
  505. case EOB_ACT_LAST_MATCH:
  506. yy_c_buf_p =
  507. &yy_current_buffer->yy_ch_buf[yy_n_chars];
  508. yy_current_state = yy_get_previous_state();
  509. yy_cp = yy_c_buf_p;
  510. yy_bp = yytext_ptr + YY_MORE_ADJ;
  511. goto yy_find_action;
  512. }
  513. break;
  514. }
  515. default:
  516. YY_FATAL_ERROR(
  517. "fatal flex scanner internal error--no action found" );
  518. } /* end of action switch */
  519. } /* end of scanning one token */
  520. } /* end of yylex */
  521. %+
  522. yyFlexLexer::yyFlexLexer( istream* arg_yyin, ostream* arg_yyout )
  523. {
  524. yyin = arg_yyin;
  525. yyout = arg_yyout;
  526. yy_c_buf_p = 0;
  527. yy_init = 1;
  528. yy_start = 0;
  529. yy_flex_debug = 0;
  530. yylineno = 1; // this will only get updated if %option yylineno
  531. yy_did_buffer_switch_on_eof = 0;
  532. yy_looking_for_trail_begin = 0;
  533. yy_more_flag = 0;
  534. yy_more_len = 0;
  535. yy_more_offset = yy_prev_more_offset = 0;
  536. yy_start_stack_ptr = yy_start_stack_depth = 0;
  537. yy_start_stack = 0;
  538. yy_current_buffer = 0;
  539. #ifdef YY_USES_REJECT
  540. yy_state_buf = new yy_state_type[YY_BUF_SIZE + 2];
  541. #else
  542. yy_state_buf = 0;
  543. #endif
  544. }
  545. yyFlexLexer::~yyFlexLexer()
  546. {
  547. delete yy_state_buf;
  548. yy_delete_buffer( yy_current_buffer );
  549. }
  550. void yyFlexLexer::switch_streams( istream* new_in, ostream* new_out )
  551. {
  552. if ( new_in )
  553. {
  554. yy_delete_buffer( yy_current_buffer );
  555. yy_switch_to_buffer( yy_create_buffer( new_in, YY_BUF_SIZE ) );
  556. }
  557. if ( new_out )
  558. yyout = new_out;
  559. }
  560. #ifdef YY_INTERACTIVE
  561. int yyFlexLexer::LexerInput( char* buf, int /* max_size */ )
  562. #else
  563. int yyFlexLexer::LexerInput( char* buf, int max_size )
  564. #endif
  565. {
  566. if ( yyin->eof() || yyin->fail() )
  567. return 0;
  568. #ifdef YY_INTERACTIVE
  569. yyin->get( buf[0] );
  570. if ( yyin->eof() )
  571. return 0;
  572. if ( yyin->bad() )
  573. return -1;
  574. return 1;
  575. #else
  576. (void) yyin->read( buf, max_size );
  577. if ( yyin->bad() )
  578. return -1;
  579. else
  580. return yyin->gcount();
  581. #endif
  582. }
  583. void yyFlexLexer::LexerOutput( const char* buf, int size )
  584. {
  585. (void) yyout->write( buf, size );
  586. }
  587. %*
  588. /* yy_get_next_buffer - try to read in a new buffer
  589. *
  590. * Returns a code representing an action:
  591. * EOB_ACT_LAST_MATCH -
  592. * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
  593. * EOB_ACT_END_OF_FILE - end of file
  594. */
  595. %-
  596. static int yy_get_next_buffer()
  597. %+
  598. int yyFlexLexer::yy_get_next_buffer()
  599. %*
  600. {
  601. register char *dest = yy_current_buffer->yy_ch_buf;
  602. register char *source = yytext_ptr;
  603. register int number_to_move, i;
  604. int ret_val;
  605. if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
  606. YY_FATAL_ERROR(
  607. "fatal flex scanner internal error--end of buffer missed" );
  608. if ( yy_current_buffer->yy_fill_buffer == 0 )
  609. { /* Don't try to fill the buffer, so this is an EOF. */
  610. if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
  611. {
  612. /* We matched a single character, the EOB, so
  613. * treat this as a final EOF.
  614. */
  615. return EOB_ACT_END_OF_FILE;
  616. }
  617. else
  618. {
  619. /* We matched some text prior to the EOB, first
  620. * process it.
  621. */
  622. return EOB_ACT_LAST_MATCH;
  623. }
  624. }
  625. /* Try to read more data. */
  626. /* First move last chars to start of buffer. */
  627. number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
  628. for ( i = 0; i < number_to_move; ++i )
  629. *(dest++) = *(source++);
  630. if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
  631. /* don't do the read, it's not guaranteed to return an EOF,
  632. * just force an EOF
  633. */
  634. yy_current_buffer->yy_n_chars = yy_n_chars = 0;
  635. else
  636. {
  637. int num_to_read =
  638. yy_current_buffer->yy_buf_size - number_to_move - 1;
  639. while ( num_to_read <= 0 )
  640. { /* Not enough room in the buffer - grow it. */
  641. #ifdef YY_USES_REJECT
  642. YY_FATAL_ERROR(
  643. "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
  644. #else
  645. /* just a shorter name for the current buffer */
  646. YY_BUFFER_STATE b = yy_current_buffer;
  647. int yy_c_buf_p_offset =
  648. (int) (yy_c_buf_p - b->yy_ch_buf);
  649. if ( b->yy_is_our_buffer )
  650. {
  651. int new_size = b->yy_buf_size * 2;
  652. if ( new_size <= 0 )
  653. b->yy_buf_size += b->yy_buf_size / 8;
  654. else
  655. b->yy_buf_size *= 2;
  656. b->yy_ch_buf = (char *)
  657. /* Include room in for 2 EOB chars. */
  658. yy_flex_realloc( (void *) b->yy_ch_buf,
  659. b->yy_buf_size + 2 );
  660. }
  661. else
  662. /* Can't grow it, we don't own it. */
  663. b->yy_ch_buf = 0;
  664. if ( ! b->yy_ch_buf )
  665. YY_FATAL_ERROR(
  666. "fatal error - scanner input buffer overflow" );
  667. yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
  668. num_to_read = yy_current_buffer->yy_buf_size -
  669. number_to_move - 1;
  670. #endif
  671. }
  672. if ( num_to_read > YY_READ_BUF_SIZE )
  673. num_to_read = YY_READ_BUF_SIZE;
  674. /* Read in more data. */
  675. YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
  676. yy_n_chars, num_to_read );
  677. yy_current_buffer->yy_n_chars = yy_n_chars;
  678. }
  679. if ( yy_n_chars == 0 )
  680. {
  681. if ( number_to_move == YY_MORE_ADJ )
  682. {
  683. ret_val = EOB_ACT_END_OF_FILE;
  684. yyrestart( yyin );
  685. }
  686. else
  687. {
  688. ret_val = EOB_ACT_LAST_MATCH;
  689. yy_current_buffer->yy_buffer_status =
  690. YY_BUFFER_EOF_PENDING;
  691. }
  692. }
  693. else
  694. ret_val = EOB_ACT_CONTINUE_SCAN;
  695. yy_n_chars += number_to_move;
  696. yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
  697. yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
  698. yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
  699. return ret_val;
  700. }
  701. /* yy_get_previous_state - get the state just before the EOB char was reached */
  702. %-
  703. static yy_state_type yy_get_previous_state()
  704. %+
  705. yy_state_type yyFlexLexer::yy_get_previous_state()
  706. %*
  707. {
  708. register yy_state_type yy_current_state;
  709. register char *yy_cp;
  710. %% code to get the start state into yy_current_state goes here
  711. for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
  712. {
  713. %% code to find the next state goes here
  714. }
  715. return yy_current_state;
  716. }
  717. /* yy_try_NUL_trans - try to make a transition on the NUL character
  718. *
  719. * synopsis
  720. * next_state = yy_try_NUL_trans( current_state );
  721. */
  722. %-
  723. #ifdef YY_USE_PROTOS
  724. static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
  725. #else
  726. static yy_state_type yy_try_NUL_trans( yy_current_state )
  727. yy_state_type yy_current_state;
  728. #endif
  729. %+
  730. yy_state_type yyFlexLexer::yy_try_NUL_trans( yy_state_type yy_current_state )
  731. %*
  732. {
  733. register int yy_is_jam;
  734. %% code to find the next state, and perhaps do backing up, goes here
  735. return yy_is_jam ? 0 : yy_current_state;
  736. }
  737. %-
  738. #ifndef YY_NO_UNPUT
  739. #ifdef YY_USE_PROTOS
  740. static void yyunput( int c, register char *yy_bp )
  741. #else
  742. static void yyunput( c, yy_bp )
  743. int c;
  744. register char *yy_bp;
  745. #endif
  746. %+
  747. void yyFlexLexer::yyunput( int c, register char* yy_bp )
  748. %*
  749. {
  750. register char *yy_cp = yy_c_buf_p;
  751. /* undo effects of setting up yytext */
  752. *yy_cp = yy_hold_char;
  753. if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  754. { /* need to shift things up to make room */
  755. /* +2 for EOB chars. */
  756. register int number_to_move = yy_n_chars + 2;
  757. register char *dest = &yy_current_buffer->yy_ch_buf[
  758. yy_current_buffer->yy_buf_size + 2];
  759. register char *source =
  760. &yy_current_buffer->yy_ch_buf[number_to_move];
  761. while ( source > yy_current_buffer->yy_ch_buf )
  762. *--dest = *--source;
  763. yy_cp += (int) (dest - source);
  764. yy_bp += (int) (dest - source);
  765. yy_current_buffer->yy_n_chars =
  766. yy_n_chars = yy_current_buffer->yy_buf_size;
  767. if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
  768. YY_FATAL_ERROR( "flex scanner push-back overflow" );
  769. }
  770. *--yy_cp = (char) c;
  771. %% update yylineno here
  772. yytext_ptr = yy_bp;
  773. yy_hold_char = *yy_cp;
  774. yy_c_buf_p = yy_cp;
  775. }
  776. %-
  777. #endif /* ifndef YY_NO_UNPUT */
  778. %*
  779. %-
  780. #ifdef __cplusplus
  781. static int yyinput()
  782. #else
  783. static int input()
  784. #endif
  785. %+
  786. int yyFlexLexer::yyinput()
  787. %*
  788. {
  789. int c;
  790. *yy_c_buf_p = yy_hold_char;
  791. if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
  792. {
  793. /* yy_c_buf_p now points to the character we want to return.
  794. * If this occurs *before* the EOB characters, then it's a
  795. * valid NUL; if not, then we've hit the end of the buffer.
  796. */
  797. if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
  798. /* This was really a NUL. */
  799. *yy_c_buf_p = '\0';
  800. else
  801. { /* need more input */
  802. int offset = yy_c_buf_p - yytext_ptr;
  803. ++yy_c_buf_p;
  804. switch ( yy_get_next_buffer() )
  805. {
  806. case EOB_ACT_LAST_MATCH:
  807. /* This happens because yy_g_n_b()
  808. * sees that we've accumulated a
  809. * token and flags that we need to
  810. * try matching the token before
  811. * proceeding. But for input(),
  812. * there's no matching to consider.
  813. * So convert the EOB_ACT_LAST_MATCH
  814. * to EOB_ACT_END_OF_FILE.
  815. */
  816. /* Reset buffer status. */
  817. yyrestart( yyin );
  818. /* fall through */
  819. case EOB_ACT_END_OF_FILE:
  820. {
  821. if ( yywrap() )
  822. return EOF;
  823. if ( ! yy_did_buffer_switch_on_eof )
  824. YY_NEW_FILE;
  825. #ifdef __cplusplus
  826. return yyinput();
  827. #else
  828. return input();
  829. #endif
  830. }
  831. case EOB_ACT_CONTINUE_SCAN:
  832. yy_c_buf_p = yytext_ptr + offset;
  833. break;
  834. }
  835. }
  836. }
  837. c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
  838. *yy_c_buf_p = '\0'; /* preserve yytext */
  839. yy_hold_char = *++yy_c_buf_p;
  840. %% update BOL and yylineno
  841. return c;
  842. }
  843. %-
  844. #ifdef YY_USE_PROTOS
  845. void yyrestart( FILE *input_file )
  846. #else
  847. void yyrestart( input_file )
  848. FILE *input_file;
  849. #endif
  850. %+
  851. void yyFlexLexer::yyrestart( istream* input_file )
  852. %*
  853. {
  854. if ( ! yy_current_buffer )
  855. yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
  856. yy_init_buffer( yy_current_buffer, input_file );
  857. yy_load_buffer_state();
  858. }
  859. %-
  860. #ifdef YY_USE_PROTOS
  861. void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  862. #else
  863. void yy_switch_to_buffer( new_buffer )
  864. YY_BUFFER_STATE new_buffer;
  865. #endif
  866. %+
  867. void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
  868. %*
  869. {
  870. if ( yy_current_buffer == new_buffer )
  871. return;
  872. if ( yy_current_buffer )
  873. {
  874. /* Flush out information for old buffer. */
  875. *yy_c_buf_p = yy_hold_char;
  876. yy_current_buffer->yy_buf_pos = yy_c_buf_p;
  877. yy_current_buffer->yy_n_chars = yy_n_chars;
  878. }
  879. yy_current_buffer = new_buffer;
  880. yy_load_buffer_state();
  881. /* We don't actually know whether we did this switch during
  882. * EOF (yywrap()) processing, but the only time this flag
  883. * is looked at is after yywrap() is called, so it's safe
  884. * to go ahead and always set it.
  885. */
  886. yy_did_buffer_switch_on_eof = 1;
  887. }
  888. %-
  889. #ifdef YY_USE_PROTOS
  890. void yy_load_buffer_state( void )
  891. #else
  892. void yy_load_buffer_state()
  893. #endif
  894. %+
  895. void yyFlexLexer::yy_load_buffer_state()
  896. %*
  897. {
  898. yy_n_chars = yy_current_buffer->yy_n_chars;
  899. yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
  900. yyin = yy_current_buffer->yy_input_file;
  901. yy_hold_char = *yy_c_buf_p;
  902. }
  903. %-
  904. #ifdef YY_USE_PROTOS
  905. YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
  906. #else
  907. YY_BUFFER_STATE yy_create_buffer( file, size )
  908. FILE *file;
  909. int size;
  910. #endif
  911. %+
  912. YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( istream* file, int size )
  913. %*
  914. {
  915. YY_BUFFER_STATE b;
  916. b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  917. if ( ! b )
  918. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  919. b->yy_buf_size = size;
  920. /* yy_ch_buf has to be 2 characters longer than the size given because
  921. * we need to put in 2 end-of-buffer characters.
  922. */
  923. b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
  924. if ( ! b->yy_ch_buf )
  925. YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
  926. b->yy_is_our_buffer = 1;
  927. yy_init_buffer( b, file );
  928. return b;
  929. }
  930. %-
  931. #ifdef YY_USE_PROTOS
  932. void yy_delete_buffer( YY_BUFFER_STATE b )
  933. #else
  934. void yy_delete_buffer( b )
  935. YY_BUFFER_STATE b;
  936. #endif
  937. %+
  938. void yyFlexLexer::yy_delete_buffer( YY_BUFFER_STATE b )
  939. %*
  940. {
  941. if ( ! b )
  942. return;
  943. if ( b == yy_current_buffer )
  944. yy_current_buffer = (YY_BUFFER_STATE) 0;
  945. if ( b->yy_is_our_buffer )
  946. yy_flex_free( (void *) b->yy_ch_buf );
  947. yy_flex_free( (void *) b );
  948. }
  949. %-
  950. #ifndef YY_ALWAYS_INTERACTIVE
  951. #ifndef YY_NEVER_INTERACTIVE
  952. extern int isatty YY_PROTO(( int ));
  953. #endif
  954. #endif
  955. #ifdef YY_USE_PROTOS
  956. void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
  957. #else
  958. void yy_init_buffer( b, file )
  959. YY_BUFFER_STATE b;
  960. FILE *file;
  961. #endif
  962. %+
  963. extern "C" int isatty YY_PROTO(( int ));
  964. void yyFlexLexer::yy_init_buffer( YY_BUFFER_STATE b, istream* file )
  965. %*
  966. {
  967. yy_flush_buffer( b );
  968. b->yy_input_file = file;
  969. b->yy_fill_buffer = 1;
  970. %-
  971. #if YY_ALWAYS_INTERACTIVE
  972. b->yy_is_interactive = 1;
  973. #else
  974. #if YY_NEVER_INTERACTIVE
  975. b->yy_is_interactive = 0;
  976. #else
  977. b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
  978. #endif
  979. #endif
  980. %+
  981. b->yy_is_interactive = 0;
  982. %*
  983. }
  984. %-
  985. #ifdef YY_USE_PROTOS
  986. void yy_flush_buffer( YY_BUFFER_STATE b )
  987. #else
  988. void yy_flush_buffer( b )
  989. YY_BUFFER_STATE b;
  990. #endif
  991. %+
  992. void yyFlexLexer::yy_flush_buffer( YY_BUFFER_STATE b )
  993. %*
  994. {
  995. if ( ! b )
  996. return;
  997. b->yy_n_chars = 0;
  998. /* We always need two end-of-buffer characters. The first causes
  999. * a transition to the end-of-buffer state. The second causes
  1000. * a jam in that state.
  1001. */
  1002. b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
  1003. b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
  1004. b->yy_buf_pos = &b->yy_ch_buf[0];
  1005. b->yy_at_bol = 1;
  1006. b->yy_buffer_status = YY_BUFFER_NEW;
  1007. if ( b == yy_current_buffer )
  1008. yy_load_buffer_state();
  1009. }
  1010. %*
  1011. #ifndef YY_NO_SCAN_BUFFER
  1012. %-
  1013. #ifdef YY_USE_PROTOS
  1014. YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
  1015. #else
  1016. YY_BUFFER_STATE yy_scan_buffer( base, size )
  1017. char *base;
  1018. yy_size_t size;
  1019. #endif
  1020. {
  1021. YY_BUFFER_STATE b;
  1022. if ( size < 2 ||
  1023. base[size-2] != YY_END_OF_BUFFER_CHAR ||
  1024. base[size-1] != YY_END_OF_BUFFER_CHAR )
  1025. /* They forgot to leave room for the EOB's. */
  1026. return 0;
  1027. b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
  1028. if ( ! b )
  1029. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
  1030. b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
  1031. b->yy_buf_pos = b->yy_ch_buf = base;
  1032. b->yy_is_our_buffer = 0;
  1033. b->yy_input_file = 0;
  1034. b->yy_n_chars = b->yy_buf_size;
  1035. b->yy_is_interactive = 0;
  1036. b->yy_at_bol = 1;
  1037. b->yy_fill_buffer = 0;
  1038. b->yy_buffer_status = YY_BUFFER_NEW;
  1039. yy_switch_to_buffer( b );
  1040. return b;
  1041. }
  1042. %*
  1043. #endif
  1044. #ifndef YY_NO_SCAN_STRING
  1045. %-
  1046. #ifdef YY_USE_PROTOS
  1047. YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
  1048. #else
  1049. YY_BUFFER_STATE yy_scan_string( yy_str )
  1050. yyconst char *yy_str;
  1051. #endif
  1052. {
  1053. int len;
  1054. for ( len = 0; yy_str[len]; ++len )
  1055. ;
  1056. return yy_scan_bytes( yy_str, len );
  1057. }
  1058. %*
  1059. #endif
  1060. #ifndef YY_NO_SCAN_BYTES
  1061. %-
  1062. #ifdef YY_USE_PROTOS
  1063. YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
  1064. #else
  1065. YY_BUFFER_STATE yy_scan_bytes( bytes, len )
  1066. yyconst char *bytes;
  1067. int len;
  1068. #endif
  1069. {
  1070. YY_BUFFER_STATE b;
  1071. char *buf;
  1072. yy_size_t n;
  1073. int i;
  1074. /* Get memory for full buffer, including space for trailing EOB's. */
  1075. n = len + 2;
  1076. buf = (char *) yy_flex_alloc( n );
  1077. if ( ! buf )
  1078. YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
  1079. for ( i = 0; i < len; ++i )
  1080. buf[i] = bytes[i];
  1081. buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
  1082. b = yy_scan_buffer( buf, n );
  1083. if ( ! b )
  1084. YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
  1085. /* It's okay to grow etc. this buffer, and we should throw it
  1086. * away when we're done.
  1087. */
  1088. b->yy_is_our_buffer = 1;
  1089. return b;
  1090. }
  1091. %*
  1092. #endif
  1093. #ifndef YY_NO_PUSH_STATE
  1094. %-
  1095. #ifdef YY_USE_PROTOS
  1096. static void yy_push_state( int new_state )
  1097. #else
  1098. static void yy_push_state( new_state )
  1099. int new_state;
  1100. #endif
  1101. %+
  1102. void yyFlexLexer::yy_push_state( int new_state )
  1103. %*
  1104. {
  1105. if ( yy_start_stack_ptr >= yy_start_stack_depth )
  1106. {
  1107. yy_size_t new_size;
  1108. yy_start_stack_depth += YY_START_STACK_INCR;
  1109. new_size = yy_start_stack_depth * sizeof( int );
  1110. if ( ! yy_start_stack )
  1111. yy_start_stack = (int *) yy_flex_alloc( new_size );
  1112. else
  1113. yy_start_stack = (int *) yy_flex_realloc(
  1114. (void *) yy_start_stack, new_size );
  1115. if ( ! yy_start_stack )
  1116. YY_FATAL_ERROR(
  1117. "out of memory expanding start-condition stack" );
  1118. }
  1119. yy_start_stack[yy_start_stack_ptr++] = YY_START;
  1120. BEGIN(new_state);
  1121. }
  1122. #endif
  1123. #ifndef YY_NO_POP_STATE
  1124. %-
  1125. static void yy_pop_state()
  1126. %+
  1127. void yyFlexLexer::yy_pop_state()
  1128. %*
  1129. {
  1130. if ( --yy_start_stack_ptr < 0 )
  1131. YY_FATAL_ERROR( "start-condition stack underflow" );
  1132. BEGIN(yy_start_stack[yy_start_stack_ptr]);
  1133. }
  1134. #endif
  1135. #ifndef YY_NO_TOP_STATE
  1136. %-
  1137. static int yy_top_state()
  1138. %+
  1139. int yyFlexLexer::yy_top_state()
  1140. %*
  1141. {
  1142. return yy_start_stack[yy_start_stack_ptr - 1];
  1143. }
  1144. #endif
  1145. #ifndef YY_EXIT_FAILURE
  1146. #define YY_EXIT_FAILURE 2
  1147. #endif
  1148. %-
  1149. #ifdef YY_USE_PROTOS
  1150. static void yy_fatal_error( yyconst char msg[] )
  1151. #else
  1152. static void yy_fatal_error( msg )
  1153. char msg[];
  1154. #endif
  1155. {
  1156. (void) fprintf( stderr, "%s\n", msg );
  1157. exit( YY_EXIT_FAILURE );
  1158. }
  1159. %+
  1160. void yyFlexLexer::LexerError( yyconst char msg[] )
  1161. {
  1162. cerr << msg << '\n';
  1163. exit( YY_EXIT_FAILURE );
  1164. }
  1165. %*
  1166. /* Redefine yyless() so it works in section 3 code. */
  1167. #undef yyless
  1168. #define yyless(n) \
  1169. do \
  1170. { \
  1171. /* Undo effects of setting up yytext. */ \
  1172. yytext[yyleng] = yy_hold_char; \
  1173. yy_c_buf_p = yytext + n; \
  1174. yy_hold_char = *yy_c_buf_p; \
  1175. *yy_c_buf_p = '\0'; \
  1176. yyleng = n; \
  1177. } \
  1178. while ( 0 )
  1179. /* Internal utility routines. */
  1180. #ifndef yytext_ptr
  1181. #ifdef YY_USE_PROTOS
  1182. static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
  1183. #else
  1184. static void yy_flex_strncpy( s1, s2, n )
  1185. char *s1;
  1186. yyconst char *s2;
  1187. int n;
  1188. #endif
  1189. {
  1190. register int i;
  1191. for ( i = 0; i < n; ++i )
  1192. s1[i] = s2[i];
  1193. }
  1194. #endif
  1195. #ifdef YY_NEED_STRLEN
  1196. #ifdef YY_USE_PROTOS
  1197. static int yy_flex_strlen( yyconst char *s )
  1198. #else
  1199. static int yy_flex_strlen( s )
  1200. yyconst char *s;
  1201. #endif
  1202. {
  1203. register int n;
  1204. for ( n = 0; s[n]; ++n )
  1205. ;
  1206. return n;
  1207. }
  1208. #endif
  1209. #ifdef YY_USE_PROTOS
  1210. static void *yy_flex_alloc( yy_size_t size )
  1211. #else
  1212. static void *yy_flex_alloc( size )
  1213. yy_size_t size;
  1214. #endif
  1215. {
  1216. return (void *) malloc( size );
  1217. }
  1218. #ifdef YY_USE_PROTOS
  1219. static void *yy_flex_realloc( void *ptr, yy_size_t size )
  1220. #else
  1221. static void *yy_flex_realloc( ptr, size )
  1222. void *ptr;
  1223. yy_size_t size;
  1224. #endif
  1225. {
  1226. /* The cast to (char *) in the following accommodates both
  1227. * implementations that use char* generic pointers, and those
  1228. * that use void* generic pointers. It works with the latter
  1229. * because both ANSI C and C++ allow castless assignment from
  1230. * any pointer type to void*, and deal with argument conversions
  1231. * as though doing an assignment.
  1232. */
  1233. return (void *) realloc( (char *) ptr, size );
  1234. }
  1235. #ifdef YY_USE_PROTOS
  1236. static void yy_flex_free( void *ptr )
  1237. #else
  1238. static void yy_flex_free( ptr )
  1239. void *ptr;
  1240. #endif
  1241. {
  1242. free( ptr );
  1243. }
  1244. #if YY_MAIN
  1245. int main()
  1246. {
  1247. yylex();
  1248. return 0;
  1249. }
  1250. #endif