All global variables in traditional flex have been replaced by macro equivalents.
Note that in the above example,
not plain variables. These are macros that will expand to their equivalent lvalue.
All of the familiar
flex globals have been replaced by their macro
equivalents. In particular,
are macros. You may safely use these macros in actions as if they were plain
variables. We only tell you this so you don’t expect to link to these variables
externally. Currently, each macro expands to a member of an internal struct, e.g.,
#define yytext (((struct yyguts_t*)yyscanner)->yytext_r)
One important thing to remember about
and friends is that
is not a global variable in a reentrant
scanner, you can not access it directly from outside an action or from
other functions. You must use an accessor method, e.g.,
to accomplish this. (See below).