Programming Tools Guide
Chapter 13, yacc

Token numbers

Token numbers

By default, token numbers are chosen by yacc. The default token number for a literal character is the numerical value of the character in the local character set. Other names are assigned token numbers starting at 257. These definitions are placed in the file y.tab.h.

If the user prefers to assign the token numbers, the first appearance of the token name or literal in the declarations section must be followed immediately by a non-negative integer. This integer is taken to be the token number of the name or literal. Names and literals not defined this way are assigned default definitions by yacc. Since the potential for duplication exists here, care must be taken to make sure that all token numbers are distinct.