Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (d - f)
flex(1)
yy_create_buffer(file, size)
Returns a YY_BUFFER_STATE handle to a new input buffer large
enough to accommodate size characters and associated with the given
file. When in doubt, use YY_BUF_SIZE for the size.
yy_switch_to_buffer(
new_buffer)
Switches the scanner’s processing to scan for tokens from the given
buffer, which must be a YY_BUFFER_STATE.
yy_delete_buffer(buffer)
Deletes the given buffer.
YY_NEW_FILE
Enables scanning to continue after the yyin variable has been
assigned a new file to process.
YY_DECL Controls how the scanning function, yylex(), is declared. By default,
it is int yylex() or, if prototypes are being used, int yylex(void). This
definition can be changed by redefining the YY_DECL macro. This
macro is expanded immediately before the {...} (braces) that delimit
the scanner function body.
YY_INPUT(buf,result,max_size)
Controls scanner input. By default, YY_INPUT reads from the file-
pointer yyin variable. Its action is to place up to max_size characters
in the character array buf and return in the integer variable result
either the number of characters read or the constant YY_NULL to
indicate EOF. Following is a sample redefinition of YY_INPUT,in
the definitions section of the input file:
%{
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size)\
{\
int c = getchar();\
result = (c == EOF) ? YY_NULL : (buf[0] = c, 1);\
}
%}
When the scanner receives an End-of-File indication from
YY_INPUT, it checks the yywrap() function. If yywrap() returns
zero, it is assumed that the yyin has been set up to point to another
input file, and scanning continues. If it returns a nonzero value, then
the scanner terminates, returning zero to its caller.
YY_USER_ACTION
Can be redefined to provide an action that is always executed prior to
the matched pattern’s action.
YY _USER_INIT
Can be redefined to provide an action that is always executed before
the first scan.
527188-007 Hewlett-Packard Company 3−151