tags:

views:

394

answers:

4

What does the "yy" in lex.yy.c stand for?

A: 

I believe the "yy" is used to indicate that this is a generated code file.

Usually, the lex utility writes the program it generates to the file lex.yy.c - Reference

chills42
A: 

I think it comes from Yacc, one of the older parser generators.

Jonathan
A: 

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
+6  A: 

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