From 14135e90aa185942abe1611cde3164c5686041bd Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Wed, 15 Mar 2017 18:50:55 -0400 Subject: [PATCH] Add rationale comments for conditional yyparse redefinition --- lib/hx509/sel.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/hx509/sel.h b/lib/hx509/sel.h index 52a84d31c..daa471e25 100644 --- a/lib/hx509/sel.h +++ b/lib/hx509/sel.h @@ -67,6 +67,20 @@ struct hx_expr_input { extern struct hx_expr_input _hx509_expr_input; +/* + * With bison/flex, the more modern way to allow multiple yacc/lex grammars to + * be linked into a single executable is to use the + * + * bison: -p, --name-prefix=,PREFIX/, -Dapi.prefix=PREFIX + * flex: -Pprefix, --prefix=STRING + * + * options, these take care of renaming all the machine-generated global entry + * points, some of which are new. When these options are used "yylex", + * "yyparse", ... are already defined and our (potentially incomplete) attempt + * to do the same conflicts with the "right" new way to handle this. The below + * logic gets us out of the way when the job has already been taken care of by + * the parser-generator. + */ #if !defined(yylex) #define yylex _hx509_sel_yylex #define yywrap _hx509_sel_yywrap