Package: byacc Version: 20100216-1 Severity: wishlist Tags: patch The attached patch implements support for using YYLEX_PARAM. This is useful when building a reentrant lexer with flex.
-- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages byacc depends on: ii libc6 2.11.1-2 Embedded GNU C Library: Shared lib byacc recommends no packages. byacc suggests no packages. -- no debconf information
Be able to set options via YYLEX_PARAM, useful when using reentrant flex. --- byacc-20100216.orig/skeleton.c +++ byacc-20100216/skeleton.c @@ -55,6 +55,17 @@ const char *xdecls[] = "", "extern int YYPARSE_DECL();", "", + "/* compatibility with flex */", + "#ifdef YYLEX_PARAM", + "#define YYLEX_DECL() yylex(void *YYLEX_PARAM)", + "#define YYLEX yylex(YYLEX_PARAM)", + "#else", + "#define YYLEX_DECL() yylex(void)", + "#define YYLEX yylex()", + "#endif", + "", + "extern int YYLEX_DECL();", + "", 0 }; @@ -232,7 +243,7 @@ const char *body_2[] = " if ((yyn = yydefred[yystate]) != 0) goto yyreduce;", " if (yychar < 0)", " {", - " if ((yychar = yylex()) < 0) yychar = 0;", + " if ((yychar = YYLEX) < 0) yychar = 0;", "#if YYDEBUG", " if (yydebug)", " {", @@ -368,7 +379,7 @@ const char *trailer[] = " *++yystack.l_mark = yyval;", " if (yychar < 0)", " {", - " if ((yychar = yylex()) < 0) yychar = 0;", + " if ((yychar = YYLEX) < 0) yychar = 0;", "#if YYDEBUG", " if (yydebug)", " {",