Token Positions
Previous: <Token Values=>TokenValue> * Next: <Pure Calling=>PureCallin> * Up: <Lexical=>Lexical>

#Wrap on
{fH4}Textual Positions of Tokens{f}

If you are using the {fEmphasis}@{fStrong}n{f}{f}-feature (\*Note <Action Features=>ActionFeat>: Special Features for Use in Actions) in
actions to keep track of the textual locations of tokens and groupings,
then you must provide this information in {fCode}yylex{f}.  The function
{fCode}yyparse{f} expects to find the textual location of a token just parsed
in the global variable {fCode}yylloc{f}.  So {fCode}yylex{f} must store the
proper data in that variable.  The value of {fCode}yylloc{f} is a structure
and you need only initialize the members that are going to be used by the
actions.  The four members are called {fCode}first\_line{f},
{fCode}first\_column{f}, {fCode}last\_line{f} and {fCode}last\_column{f}.  Note that
the use of this feature makes the parser noticeably slower.

The data type of {fCode}yylloc{f} has the name {fCode}YYLTYPE{f}.

