If the grammar uses literal string tokens, there are two ways that
yylex can determine the token kind codes for them:
yylexcan use these symbolic names like all others. In this case, the use of the literal string tokens in the grammar file has no effect on
This is the preferred approach.
yylexcan search for the multicharacter token in the
yytnametable. This method is discouraged: the primary purpose of string aliases is forging good error messages, not describing the spelling of keywords. In addition, looking for the token kind at runtime incurs a (small but noticeable) cost.
yytname table is generated only if you use the
%token-table declaration. See Bison Declaration Summary.