Anyone know the meaning of yy?

I think it has something to do with yacc, which has files ending in .y, and requires a function called yylex.


As others have pointed out here and on StackOverflow, it may simply be a doubling of the y from the name of the yacc utility, used for generating a unique name space.

The POSIX standard reserves the namespaces starting with both yy and YY for yacc with the following paragraph:

Names are of arbitrary length, made up of letters, periods (.), underscores (_), and non-initial digits. Uppercase and lowercase letters are distinct. Conforming applications shall not use names beginning in yy or YY since the yacc parser uses such names. Many of the names appear in the final output of yacc, and thus they should be chosen to conform with any additional rules created by the C compiler to be used. In particular they appear in #define statements.

Unfortunately, the POSIX docs are very bad at relating any form of history as to why things came to be the way that they currently are.