bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: push parser


From: Paul Eggert
Subject: Re: push parser
Date: Mon, 18 Dec 2006 09:44:40 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

"Joel E. Denny" <address@hidden> writes:

> Attached is a rather large patch that I believe fixes all the above.

Thanks for looking into it.  My, there is a lot of clever code here
without much explanation....  But I'll give some quick feedback anyway.

>   #define yyparse() yypull_parse (NULL, &yylex)

This will break a lot of code, I'm afraid, since many apps assume
yyparse is a true function and is not a macro.  It breaks Bison
itself, for example:

   gcc -std=gnu99  -I. -I../lib  -I../lib    -g -O2 -MT LR0.o -MD -MP -MF 
.deps/LR0.Tpo -c -o LR0.o LR0.c
   In file included from LR0.c:40:
   reader.h:41:21: error: macro "gram_parse" passed 1 arguments, but takes just 0
   make[1]: *** [LR0.o] Error 1

Perhaps you can come up with a better way of solving the same problem.

While we're on the subject, the "&yylex" isn't portable either.  yylex
might be a macro, or it might not have exactly the signature you
expect (it might return 'wchar_t', say).

+       YYCOPY (&yyptr->Stack##_alloc, Stack, yysize);                  \
+       Stack = &yyptr->Stack##_alloc;                                  \

The current yacc.c doesn't use ##, since ## is not portable to K&R C.

(Isn't backward compatibility fun?  :-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]