Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

lex(1) OSS Shell and Utilities Reference Manual
yywrap() Returns 0 (zero) if there is more input to scan or 1 if there is not.
The default yywrap() always returns 1. It is implemented as a
macro.
yyterminate()
Can be used instead of a return statement in an action. It terminates
the scanner and returns a 0 (zero) to the scanners caller.
yyterminate() is automatically called when an End-of-File is
encountered. It is a macro and can be redened.
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 le. When in doubt, use YY_BUF_SIZE for the size.
yy_switch_to_buffer(
new_buffer)
Switches the scanners 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 le 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 denition can be changed by redening 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
le-pointer yyin variable. Its action is to place up to max_size char-
acters 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 redenition of
YY_INPUT, in the denitions section of the input le:
%{
#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 le, and scanning continues. If it returns a nonzero value, then
the scanner terminates, returning zero to its caller.
556 Hewlett-Packard Company 527188-003