@@ -1471,12 +1471,12 @@ example, the following is one way to eat up C comments:
1471
1471
@end example
1472
1472
1473
1473
@cindex flushing the internal buffer
1474
- @cindex YY_FLUSH_BUFFER
1475
- @code {YY_FLUSH_BUFFER; } flushes the scanner's internal buffer so that
1474
+ @cindex yy_flush_current_buffer()
1475
+ @code {yy_flush_current_buffer() } flushes the scanner's internal buffer so that
1476
1476
the next time the scanner attempts to match a token, it will first
1477
1477
refill the buffer using @code {yyread() } (@pxref {Generated Scanner }).
1478
1478
This action is a special case of the more general
1479
- @code {yy_flush_buffer; } function, described below (@pxref {Multiple
1479
+ @code {yy_flush_buffer() } function, described below (@pxref {Multiple
1480
1480
Input Buffers })
1481
1481
1482
1482
@cindex yyterminate()
@@ -1562,7 +1562,7 @@ the latter is available for compatibility with previous versions of
1562
1562
@code {flex }, and because it can be used to switch input files in the
1563
1563
middle of scanning. It can also be used to throw away the current input
1564
1564
buffer, by calling it with an argument of @file {yyin }; but it would be
1565
- better to use @code {YY_FLUSH_BUFFER } (@pxref {Actions }). Note that
1565
+ better to use @code {yy_flush_current_buffer() } (@pxref {Actions }). Note that
1566
1566
@code {yyrestart() } does @emph {not } reset the start condition to
1567
1567
@code {INITIAL } (@pxref {Start Conditions }).
1568
1568
@@ -2056,13 +2056,13 @@ for creating and switching between multiple input buffers. An input
2056
2056
buffer is created by using:
2057
2057
2058
2058
@cindex memory , allocating input buffers
2059
- @deftypefun YY_BUFFER_STATE yy_create_buffer ( FILE *file , int size )
2059
+ @deftypefun yybuffer yy_create_buffer ( FILE *file , int size )
2060
2060
@end deftypefun
2061
2061
2062
2062
which takes a @code {FILE } pointer and a size and creates a buffer
2063
2063
associated with the given file and large enough to hold @code {size }
2064
2064
characters (when in doubt, use @code {YY_BUF_SIZE } for the size). It
2065
- returns a @code {YY_BUFFER_STATE } handle, which may then be passed to
2065
+ returns a @code {yybuffer } handle, which may then be passed to
2066
2066
other routines (see below).
2067
2067
2068
2068
In target languages other than C/C++, this prototype will look
@@ -2071,11 +2071,11 @@ not have ``struct'' as part of its name. The input-stream type won't
2071
2071
be @code {FILE * }. But expect the same semamntics wxpressed in native
2072
2072
tytypes.
2073
2073
2074
- @tindex YY_BUFFER_STATE
2075
- The @code {YY_BUFFER_STATE } type is a
2076
- pointer to an opaque @code { struct yy_buffer_state } structure, so you may
2077
- safely initialize @code {YY_BUFFER_STATE } variables to @code {((YY_BUFFER_STATE )
2078
- 0 ) } if you wish, and also refer to the opaque structure in order to
2074
+ @tindex yybuffer
2075
+ The @code {yybuffer } type is a
2076
+ reference to an opaque buffer state structure, so you may
2077
+ safely initialize @code {yybuffer } variables to @code {((yybuffer )
2078
+ NULL ) } if you wish, and also refer to the opaque structure in order to
2079
2079
correctly declare input buffers in source files other than that of your
2080
2080
scanner. Note that the @code {FILE } pointer in the call to
2081
2081
@code {yy_create_buffer } is only used as the value of @file {yyin } seen by
@@ -2084,7 +2084,7 @@ scanner. Note that the @code{FILE} pointer in the call to
2084
2084
@code {yy_create_buffer }. You select a particular buffer to scan from
2085
2085
using:
2086
2086
2087
- @deftypefun void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer )
2087
+ @deftypefun void yy_switch_to_buffer ( yybuffer new_buffer )
2088
2088
@end deftypefun
2089
2089
2090
2090
The above function switches the scanner's input buffer so subsequent tokens
@@ -2097,7 +2097,7 @@ instead of this function. Note also that switching input sources via either
2097
2097
start condition.
2098
2098
2099
2099
@cindex memory , deleting input buffers
2100
- @deftypefun void yy_delete_buffer ( YY_BUFFER_STATE buffer )
2100
+ @deftypefun void yy_delete_buffer ( yybuffer buffer )
2101
2101
@end deftypefun
2102
2102
2103
2103
is used to reclaim the storage associated with a buffer. (@code {buffer }
@@ -2106,7 +2106,7 @@ the current contents of a buffer using:
2106
2106
2107
2107
@cindex pushing an input buffer
2108
2108
@cindex stack , input buffer push
2109
- @deftypefun void yypush_buffer_state ( YY_BUFFER_STATE buffer )
2109
+ @deftypefun void yypush_buffer_state ( yybuffer buffer )
2110
2110
@end deftypefun
2111
2111
2112
2112
This function pushes the new buffer state onto an internal stack. The pushed
@@ -2126,25 +2126,26 @@ becomes the new current state.
2126
2126
2127
2127
@cindex clearing an input buffer
2128
2128
@cindex flushing an input buffer
2129
- @deftypefun void yy_flush_buffer ( YY_BUFFER_STATE buffer )
2129
+ @deftypefun void yy_flush_buffer ( yybuffer buffer )
2130
2130
@end deftypefun
2131
2131
2132
2132
This function discards the buffer's contents,
2133
2133
so the next time the scanner attempts to match a token from the
2134
2134
buffer, it will first fill the buffer anew using
2135
2135
@code {yyread() }.
2136
2136
2137
- @deftypefun YY_BUFFER_STATE yy_new_buffer ( FILE *file , int size )
2137
+ @deftypefun yybuffer yy_new_buffer ( FILE *file , int size )
2138
2138
@end deftypefun
2139
2139
2140
2140
is an alias for @code {yy_create_buffer() },
2141
2141
provided for compatibility with the C++ use of @code {new } and
2142
2142
@code {delete } for creating and destroying dynamic objects.
2143
2143
2144
- @cindex YY_CURRENT_BUFFER , and multiple buffers
2145
- Finally, the macro @code {YY_CURRENT_BUFFER } macro returns a
2146
- @code {YY_BUFFER_STATE } handle to the current buffer. It should not be
2147
- used as an lvalue.
2144
+ @cindex yy_current_buffer() , and multiple buffers
2145
+ Finally, @code {yy_current_buffer() } returns a
2146
+ @code {yybuffer } handle to the current buffer. It should not be
2147
+ used as an lvalue, because it can return NULL to indicate no buffer is
2148
+ current.
2148
2149
2149
2150
@cindex EOF , example using multiple input buffers
2150
2151
Here are two examples of using these features for writing a scanner
@@ -2183,7 +2184,7 @@ maintains the stack internally.
2183
2184
<<EOF>> {
2184
2185
yypop_buffer_state();
2185
2186
2186
- if ( !YY_CURRENT_BUFFER )
2187
+ if ( !yy_current_buffer() )
2187
2188
{
2188
2189
yyterminate();
2189
2190
}
@@ -2204,7 +2205,7 @@ manages its own input buffer stack manually (instead of letting flex do it).
2204
2205
2205
2206
%{
2206
2207
#define MAX_INCLUDE_DEPTH 10
2207
- YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
2208
+ yybuffer include_stack[MAX_INCLUDE_DEPTH];
2208
2209
int include_stack_ptr = 0;
2209
2210
%}
2210
2211
@@ -2223,7 +2224,7 @@ manages its own input buffer stack manually (instead of letting flex do it).
2223
2224
}
2224
2225
2225
2226
include_stack[include_stack_ptr++] =
2226
- YY_CURRENT_BUFFER ;
2227
+ yy_current_buffer() ;
2227
2228
2228
2229
yyin = fopen( yytext, "r" );
2229
2230
@@ -2244,7 +2245,7 @@ manages its own input buffer stack manually (instead of letting flex do it).
2244
2245
2245
2246
else
2246
2247
{
2247
- yy_delete_buffer( YY_CURRENT_BUFFER );
2248
+ yy_delete_buffer( yy_current_buffer() );
2248
2249
yy_switch_to_buffer(
2249
2250
include_stack[include_stack_ptr] );
2250
2251
}
@@ -2257,16 +2258,16 @@ manages its own input buffer stack manually (instead of letting flex do it).
2257
2258
The following routines are available for setting up input buffers for
2258
2259
scanning in-memory strings instead of files. All of them create a new
2259
2260
input buffer for scanning the string, and return a corresponding
2260
- @code {YY_BUFFER_STATE } handle (which you should delete with
2261
+ @code {yybuffer } handle (which you should delete with
2261
2262
@code {yy_delete_buffer() } when done with it). They also switch to the
2262
2263
new buffer using @code {yy_switch_to_buffer() }, so the next call to
2263
2264
@code {yylex() } will start scanning the string.
2264
2265
2265
- @deftypefun YY_BUFFER_STATE yy_scan_string ( const char *str )
2266
+ @deftypefun yybuffer yy_scan_string ( const char *str )
2266
2267
scans a NUL-terminated string.
2267
2268
@end deftypefun
2268
2269
2269
- @deftypefun YY_BUFFER_STATE yy_scan_bytes ( const char *bytes , int len )
2270
+ @deftypefun yybuffer yy_scan_bytes ( const char *bytes , int len )
2270
2271
scans @code {len } bytes (including possibly @code {NUL }s) starting at location
2271
2272
@code {bytes }.
2272
2273
@end deftypefun
@@ -2277,7 +2278,7 @@ the contents of the buffer it is scanning.) You can avoid the copy by
2277
2278
using:
2278
2279
2279
2280
@vindex YY_END_OF_BUFFER_CHAR
2280
- @deftypefun YY_BUFFER_STATE yy_scan_buffer (char *base , yy_size_t size)
2281
+ @deftypefun yybuffer yy_scan_buffer (char *base , yy_size_t size)
2281
2282
which scans in place the buffer starting at @code {base }, consisting of
2282
2283
@code {size } bytes, the last two bytes of which @emph {must } be
2283
2284
@code {YY_END_OF_BUFFER_CHAR } (ASCII NUL). These last two bytes are not
@@ -2429,7 +2430,7 @@ Setting a post-action allows, for example, C++ users to suppress the
2429
2430
trailing break (while being very careful that every rule ends with a
2430
2431
@code {break } or a @code {return }!) to avoid suffering from unreachable
2431
2432
statement warnings where because a rule's action ends with
2432
- @code {return }, the @code { YY_BREAK } is inaccessible.
2433
+ @code {return }, the break is inaccessible.
2433
2434
2434
2435
@node User Values , Yacc , Misc Controls , Top
2435
2436
@chapter Values Available To the User
@@ -2493,9 +2494,9 @@ by the user.
2493
2494
In target languages other than C/C++, expect it to have
2494
2495
whatever tyoe is associated with I/O streams.
2495
2496
2496
- @vindex YY_CURRENT_BUFFER
2497
- @item YY_CURRENT_BUFFER
2498
- returns a @code {YY_BUFFER_STATE } handle to the current buffer.
2497
+ @vindex yy_current_buffer()
2498
+ @item yy_current_buffer()
2499
+ returns a @code {yybuffer } handle to the current buffer.
2499
2500
2500
2501
@vindex yystart()
2501
2502
@item yystart()
@@ -3860,7 +3861,7 @@ returns the current setting of the debugging flag.
3860
3861
Also provided are member functions equivalent to
3861
3862
@code {yy_switch_to_buffer() }, @code {yy_create_buffer() } (though the
3862
3863
first argument is an @code {istream& } object reference and not a
3863
- @code {FILE*) }, @code {yy_flush_buffer () }, @code {yy_delete_buffer() }, and
3864
+ @code {FILE*) }, @code {yy_flush_current_buffer () }, @code {yy_delete_buffer() }, and
3864
3865
@code {yyrestart() } (again, the first argument is a @code {istream& }
3865
3866
object reference).
3866
3867
@@ -4105,7 +4106,7 @@ another instance of itself.
4105
4106
%%
4106
4107
"eval(".+")" {
4107
4108
yyscan_t scanner;
4108
- YY_BUFFER_STATE buf;
4109
+ yybuffer buf;
4109
4110
4110
4111
yylex_init( &scanner );
4111
4112
yytext[yyleng-1] = ' ';
@@ -4917,8 +4918,8 @@ specified. You will rarely need to tune this buffer. The ideal size for this
4917
4918
stack is the maximum depth expected. The memory for this stack is
4918
4919
automatically destroyed when you call yylex_destroy(). @xref {option-stack }.
4919
4920
4920
- @item 40 bytes for each YY_BUFFER_STATE .
4921
- Flex allocates memory for each YY_BUFFER_STATE . The buffer state itself
4921
+ @item 40 bytes for each yybuffer .
4922
+ Flex allocates memory for each yybuffer . The buffer state itself
4922
4923
is about 40 bytes, plus an additional large character buffer (described above.)
4923
4924
The initial buffer state is created during initialization, and with each call
4924
4925
to yy_create_buffer(). You can't tune the size of this, but you can tune the
@@ -6075,7 +6076,7 @@ However, you can do this using multiple input buffers.
6075
6076
%%
6076
6077
macro/[a-z]+ {
6077
6078
/* Saw the macro "macro" followed by extra stuff. */
6078
- main_buffer = YY_CURRENT_BUFFER ;
6079
+ main_buffer = yy_current_buffer() ;
6079
6080
expansion_buffer = yy_scan_string(expand(yytext));
6080
6081
yy_switch_to_buffer(expansion_buffer);
6081
6082
}
@@ -6212,7 +6213,7 @@ you might try this:
6212
6213
@example
6213
6214
@verbatim
6214
6215
/* For non-reentrant C scanner only. */
6215
- yy_delete_buffer(YY_CURRENT_BUFFER );
6216
+ yy_delete_buffer(yy_current_buffer() );
6216
6217
yy_init = 1;
6217
6218
@end verbatim
6218
6219
@end example
@@ -6228,7 +6229,7 @@ situation. It is possible that some other globals may need resetting as well.
6228
6229
> We thought that it would be possible to have this number through the
6229
6230
> evaluation of the following expression:
6230
6231
>
6231
- > seek_position = (no_buffers)*YY_READ_BUF_SIZE + yy_c_buf_p - YY_CURRENT_BUFFER ->yy_ch_buf
6232
+ > seek_position = (no_buffers)*YY_READ_BUF_SIZE + yy_c_buf_p - yy_current_buffer() ->yy_ch_buf
6232
6233
@end verbatim
6233
6234
@end example
6234
6235
@@ -6239,7 +6240,7 @@ even though @code{YY_READ_BUF_SIZE} bytes were requested). The second problem
6239
6240
is that when refilling its internal buffer, @code {flex } keeps some characters
6240
6241
from the previous buffer (because usually it's in the middle of a match,
6241
6242
and needs those characters to construct @code {yytext } for the match once it's
6242
- done). Because of this, @code {yy_c_buf_p - YY_CURRENT_BUFFER ->yy_ch_buf } won't
6243
+ done). Because of this, @code {yy_c_buf_p - yy_current_buffer() ->yy_ch_buf } won't
6243
6244
be exactly the number of characters already read from the current buffer.
6244
6245
6245
6246
An alternative solution is to count the number of characters you've matched
@@ -6597,7 +6598,7 @@ Date: Wed, 13 Nov 1996 19:51:54 PST
6597
6598
From: Vern Paxson <vern>
6598
6599
6599
6600
> "yyunput()" them to input flow, question occurs. If I do this after I scan
6600
- > a carriage, the variable "YY_CURRENT_BUFFER ->yy_at_bol" is changed. That
6601
+ > a carriage, the variable "yy_current_buffer() ->yy_at_bol" is changed. That
6601
6602
> means the carriage flag has gone.
6602
6603
6603
6604
You can control this by calling yy_set_bol(). It's described in the manual.
@@ -7026,7 +7027,7 @@ In-reply-to: Your message of Mon, 08 Dec 1997 15:54:15 PST.
7026
7027
Date: Mon, 15 Dec 1997 13:21:35 PST
7027
7028
From: Vern Paxson <vern>
7028
7029
7029
- > stdin_handle = YY_CURRENT_BUFFER ;
7030
+ > stdin_handle = yy_current_buffer() ;
7030
7031
> ifstream fin( "aFile" );
7031
7032
> yy_switch_to_buffer( yy_create_buffer( fin, YY_BUF_SIZE ) );
7032
7033
>
@@ -8848,6 +8849,15 @@ yunput(): Replaced by yyunput().
8848
8849
YYSTATE: is accepted as an alias for @code {yystart() }
8849
8850
(since that is what's used by AT&T @code {lex }).
8850
8851
8852
+ @item
8853
+ YY_FLUSH_BUFFER: replaced by yy_flush_current_buffer().
8854
+
8855
+ @item
8856
+ YY_CURRENT_BUFFER: replaced by yy_current_buffer().
8857
+
8858
+ @item
8859
+ YY_BUFFER_STATE: replaced by yybuffer.
8860
+
8851
8861
@item
8852
8862
YY_NEW_FILE: In previous versions of @code {flex }, ehen assigning
8853
8863
@file {yyin } to a new input file, after doing the assignment you had to
@@ -8916,4 +8926,15 @@ to specific locations in the generated scanner, and may be used to insert arbitr
8916
8926
@c endf
8917
8927
@c nnoremap <F5> 1G/@node\s\+unnamed-faq-\d\+<cr>mfww"wy5ezt:call Faq2()<cr>
8918
8928
8929
+ @c Remaining problem points for the multilangage interface
8930
+ @c YY_NUM_RULES
8931
+ @c YY_FLEX_MAJOR_VERSION
8932
+ @c YY_FLEX_MINOR_VERSION
8933
+ @c YY_FLEX_SUBMINOR_VERSION
8934
+ @c YY_NULL
8935
+ @c YY_END_OF_BUFFER_CHAR
8936
+ @c YY_BUF_SIZE
8937
+ @c YYLMAX
8938
+
8939
+
8919
8940
@bye
0 commit comments