[vlc-commits] CSSGrammar: refactor lex/parse-param

Alexandre Janniaux git at videolan.org
Sat Apr 11 10:41:12 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Tue Mar 10 00:58:29 2020 +0100| [be9934a479fc1fa1f187192602c4e7b09f36a230] | committer: Alexandre Janniaux

CSSGrammar: refactor lex/parse-param

Scanner is used by both lexer and parser, so %param allows binding to
both, and css_parser is only used by the parser so there is no need to
declare it in the yylex function. As the function was not correctly
exposed to the lexer code, it was leading to different prototype for
both generated compile unit.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be9934a479fc1fa1f187192602c4e7b09f36a230
---

 modules/codec/webvtt/CSSGrammar.y | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/modules/codec/webvtt/CSSGrammar.y b/modules/codec/webvtt/CSSGrammar.y
index f9d7fd06b0..e51b132525 100644
--- a/modules/codec/webvtt/CSSGrammar.y
+++ b/modules/codec/webvtt/CSSGrammar.y
@@ -28,10 +28,9 @@
  */
 %define api.pure full
 
-%parse-param { yyscan_t scanner }
+%param { yyscan_t scanner }
 %parse-param { vlc_css_parser_t *css_parser }
-%lex-param   { yyscan_t scanner }
-%lex-param   { vlc_css_parser_t *css_parser }
+
 
 %{
 #ifdef HAVE_CONFIG_H
@@ -64,7 +63,7 @@ typedef void* yyscan_t;
 
 %{
 /* See bison pure calling */
-#define YY_DECL int yylex(union YYSTYPE *, yyscan_t, vlc_css_parser_t *)
+#define YY_DECL int yylex(union YYSTYPE *, yyscan_t)
 YY_DECL;
 
 static int yyerror(yyscan_t scanner, vlc_css_parser_t *p, const char *msg)



More information about the vlc-commits mailing list