What does the "yy" in lex.yy.c stand for?
Asked
Active
Viewed 1.2k times
4 Answers
21
Lex was meant to be used in concert with Yacc. The history and details of this are detailed in Steven Johnson's paper Yacc: Yet Another Compiler Compiler. The Yacc parser uses only names beginning in "yy' - there's no apparent meaning discussed beyond simply desiring a namespace. The "yy" in lex.yy.c indicates that the lex output is intended for a yacc parser.

peterb
- 1,360
- 9
- 14
1
Probably from YACC (Yet Another Compiler Compiler), which was used with Lex to implement quite a few compilers and similar programs. The Gnu equivalents are Bison and Flex, and look a lot more widespread now, so the connection may not be obvious.

David Thornley
- 56,304
- 9
- 91
- 158