Skip to content

Name yacc/lex prefix symbols

Mehdi Sabwat requested to merge b1ue/vlc:ytbdl/4 into master

As described in the documentation, this PR will allow naming parser and lexer symbols generated by yacc/lex.

The idea is to change the default "yy" prefix for the lexer and the parser, the generated C code will have proper defines to map the renamed functions with the standard ones and also in the entrypoints like yyparse/yylex, but we will need to call the right names if we want to make calls from the outside (ie. in the C code when we want to call the generated code).

Issues
  • Changing the prefix will also change the filename, and since autotools ywrap expects "lex.yy.c" as the name of the generated file, we "need" (I could not change the Makefile and autotools file to keep the same names) to force it.

  • Another issue is that YYSTYPE, is not included in the generated code defines.

Edited by Mehdi Sabwat

Merge request reports