@@ -23,36 +23,6 @@ char *s = NULL; /* to return WHOLE hyphenated-word */
23
23
24
24
YY_BUFFER_STATE buf = NULL ; /* buffer to parse; it need for parse from string */
25
25
26
- int lrlimit = -1 ; /* for limiting read from filehandle ( -1 - unlimited read ) */
27
- int bytestoread = 0 ; /* for limiting read from filehandle */
28
-
29
- /* redefine macro for read limited length */
30
- #define YY_INPUT (buf,result,max_size ) \
31
- if ( yy_current_buffer->yy_is_interactive ) { \
32
- int c = ' *' , n; \
33
- for ( n = 0 ; n < max_size && \
34
- (c = getc ( tsearch2_yyin )) != EOF && c != ' \n ' ; ++n ) \
35
- buf[n] = (char ) c; \
36
- if ( c == ' \n ' ) \
37
- buf[n++] = (char ) c; \
38
- if ( c == EOF && ferror ( tsearch2_yyin ) ) \
39
- YY_FATAL_ERROR ( " input in flex scanner failed" ); \
40
- result = n; \
41
- } else { \
42
- if ( lrlimit == 0 ) \
43
- result=YY_NULL; \
44
- else { \
45
- if ( lrlimit>0 ) { \
46
- bytestoread = ( lrlimit > max_size ) ? max_size : lrlimit; \
47
- lrlimit -= bytestoread; \
48
- } else \
49
- bytestoread = max_size; \
50
- if ( ((result = fread ( buf, 1 , bytestoread, tsearch2_yyin )) == 0 ) \
51
- && ferror ( tsearch2_yyin ) ) \
52
- YY_FATAL_ERROR ( " input in flex scanner failed" ); \
53
- } \
54
- }
55
-
56
26
%}
57
27
58
28
%option 8bit
@@ -334,13 +304,5 @@ void start_parse_str(char* str, int limit) {
334
304
BEGIN INITIAL;
335
305
}
336
306
337
- /* start parse from filehandle */
338
- void start_parse_fh ( FILE* fh, int limit ) {
339
- if (buf) end_parse ();
340
- lrlimit = ( limit ) ? limit : -1 ;
341
- buf = tsearch2_yy_create_buffer ( fh, YY_BUF_SIZE );
342
- tsearch2_yy_switch_to_buffer ( buf );
343
- BEGIN INITIAL;
344
- }
345
307
346
308
0 commit comments