The macro YY_USER_ACTION
can be redefined to provide an action
which is always executed prior to the matched rule's action. For
example, it could be #define
d to call a routine to convert
yytext
to lower-case.
The macro YY_USER_INIT
may be redefined to provide an action
which is always executed before the first scan (and before the scanner's
internal initializations are done). For example, it could be used to
call a routine to read in a data table or open a logging file.
In the generated scanner, the actions are all gathered in one large
switch statement and separated using YY_BREAK
, which may be
redefined. By default, it is simply a break
, to separate each
rule's action from the following rule's. Redefining YY_BREAK
allows, for example, C++ users to `#define YY_BREAK' to do nothing
(while being very careful that every rule ends with a break
or a
return
!) to avoid suffering from unreachable statement warnings
where because a rule's action ends with return
, the
YY_BREAK
is inaccessible.