[Xorp-hackers] Xorp-hackers Digest, Vol 30, Issue 12

杨小帅 eshe168 at gmail.com
Sun Sep 21 18:04:13 PDT 2008


Hi, all

I need add some other data structure into template file, so I must to
modify the *.ll and *.yy.
I have found a solution, that is to modify the generated *.cc and *.h
source code.

B.R.
Xiaoshuai Yang

2008/9/21  <xorp-hackers-request at icir.org>:
> Send Xorp-hackers mailing list submissions to
>        xorp-hackers at icir.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
> or, via email, send a message with subject or body 'help' to
>        xorp-hackers-request at icir.org
>
> You can reach the person managing the list at
>        xorp-hackers-owner at icir.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xorp-hackers digest..."
>
>
> Today's Topics:
>
>   1. Re: About make yacc? (Pavlin Radoslavov)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 19 Sep 2008 18:21:25 -0700
> From: Pavlin Radoslavov <pavlin at ICSI.Berkeley.EDU>
> Subject: Re: [Xorp-hackers] About make yacc?
> To: " ??? " <eshe168 at gmail.com>
> Cc: xorp-hackers at icir.org
> Message-ID: <200809200122.m8K1LQs9005554 at fruitcake.ICSI.Berkeley.EDU>
> Content-Type: text/plain; charset=gb2312
>
> ??? <eshe168 at gmail.com> wrote:
>
>> Hi,
>>      When I use make yacc, I found something wrong. And, The new
>> y.tplt_tab.cc is different with the old. I want to get reason. I do
>> not change template.yy. My OS is Debian.
>
> Sometimes using different version/different OS of yacc generates
> different result.
> We use the default yacc that comes with FreeBSD-7.0, which is based
> on the original Berkeley Yacc.
> The yacc one from Ubuntu for example is a very different
> implementation: it is based on GNU Bison.
>
> I just did a quick experiment on Ubuntu by using "gmake yacc" in the
> rtrmgr directory to regenerate the rtrmgr Yacc-generated files, and
> I observed the following:
>
> * The result generated files are very different from the
>  original files (because of GNU Bison).
> * The result generated files don't compile with the rest of the
>  rtrmgr files:
>
> g++ -DHAVE_CONFIG_H -I. -I.. -I/home/pavlin/xorp/rtrmgr -I/home/pavlin/xorp    -g -Werror -W -Wall -Wwrite-strings -Wcast-qual -Wpointer-arith -Wcast-align -Woverloaded-virtual -ftemplate-depth-25 -pipe -MT lex.boot.o -MD -MP -MF .deps/lex.boot.Tpo -c -o lex.boot.o /home/pavlin/xorp/rtrmgr/lex.boot.cc
> boot.ll:20: error: conflicting declaration 'char* bootlval'
> /home/pavlin/xorp/rtrmgr/y.boot_tab.h:104: error: 'bootlval' has a previous declaration as 'YYSTYPE bootlval'
> boot.ll: In function 'int bootlex()':
> boot.ll:264: error: invalid conversion from 'char*' to 'YYSTYPE'
> boot.ll:269: error: invalid conversion from 'char*' to 'YYSTYPE'
> boot.ll:274: error: invalid conversion from 'char*' to 'YYSTYPE'
> boot.ll:279: error: invalid conversion from 'char*' to 'YYSTYPE'
>
> ...
>
>
> Just curious, why do you need to run "gmake yacc"? Are you modifying
> some of the original rtrmgr/*.ll or rtrmgr/*.yy files or are you
> trying to make some fundamental changes to the rtrmgr parsing
> mechanism?
> If no, then you don't need to run "gmake yacc".
> If yes, the Yacc-generation is known to work only on FreeBSD, and I
> don't have a good answer how to do it on other OS-es. You can try to
> get it working with GNU Bison, but I don't know how difficult this
> would be.
>
> Pavlin
>
>>      Looking forward your answer!
>>      Here is error information:
>> yxs at Lenny621:~/xorp-cli/xorp-demo/rtrmgr$ make yacc
>> ( cd .;                                               \
>>       yacc -d -p tplt -o y.tplt_tab.c template.yy;            \
>>       mv y.tplt_tab.c y.tplt_tab.cc;                          \
>>       bash ../utils/rcsid2ident.sh y.tplt_tab.cc;     \
>>       yacc -d -p boot -o y.boot_tab.c boot.yy;                \
>>       mv y.boot_tab.c y.boot_tab.cc;                          \
>>       bash ../utils/rcsid2ident.sh y.boot_tab.cc;     \
>>       yacc -d -p opcmd -o y.opcmd_tab.c op_commands.yy;       \
>>       mv y.opcmd_tab.c y.opcmd_tab.cc;                        \
>>       bash ../utils/rcsid2ident.sh y.opcmd_tab.cc;    \
>>       touch .yacc_generated_files )
>> 61685
>>       static char const yyunexpected[] = "syntax error, unexpected %s";
>> ?
>> 56089
>>       static char const yyunexpected[] = "syntax error, unexpected %s";
>> ?
>> 56419
>>       static char const yyunexpected[] = "syntax error, unexpected %s";
>> ?
>>
>> B.R.
>> Xiaoshuai Yang
>>
>> _______________________________________________
>> Xorp-hackers mailing list
>> Xorp-hackers at icir.org
>> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
>
>
>
> ------------------------------
>
> _______________________________________________
> Xorp-hackers mailing list
> Xorp-hackers at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-hackers
>
>
> End of Xorp-hackers Digest, Vol 30, Issue 12
> ********************************************
>



More information about the Xorp-hackers mailing list