[ACCEPTED]-What does the "yy" in lex.yy.c stand for?-flex-lexer

Accepted answer
Score: 19

Lex was meant to be used in concert with 7 Yacc. The history and details of this are 6 detailed in Steven Johnson's paper Yacc: Yet Another Compiler Compiler. The 5 Yacc parser uses only names beginning in 4 "yy' - there's no apparent meaning 3 discussed beyond simply desiring a namespace. The 2 "yy" in lex.yy.c indicates that 1 the lex output is intended for a yacc parser.

Score: 1

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

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

Score: 0

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

Score: 0

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

More Related questions