help-bison
[Top][All Lists]
Advanced

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

"identifier redeclared" error on SunOS with yacc


From: Umut Emin
Subject: "identifier redeclared" error on SunOS with yacc
Date: Wed, 01 Oct 2008 06:19:36 +0200

Hello List,

I have written a parser in bison which works with flex
together. The compilation and execution work just fine
on machines with bison. I tried to port these in
a Sun OS where only yacc is installed
(version output> yacc: Software Generation Utilities (SGU) Solaris-ELF
(4.0) ). Unfortunately yacc  stops compiling with: "identifier
redecleration" errors.


Here are the 2 errors:

[Mi Okt 01 05:53:06] address@hidden flexer  >> make all
lex -t tokenizer.l > tokenizer.c 
916/1000 nodes(%e), 2996/6000 positions(%p), 517/1000 (%n), 14588
transitions,
142/10000 packed char classes(%k),  1589/2000 packed transitions(%a),
1197/12000 output slots(%o)
cc -pedantic -g -c dar.c
yacc -t -d -b parser parser.y 
mv parser.tab.h parser.h
mv parser.tab.c parser.c
cc -pedantic -g -o tokenizer.o -c tokenizer.c 
cc -pedantic -g -o parser.o -c parser.c 
"parser.y", line 66: identifier redeclared: YYSTYPE
        current : union  {int err_code, pointer to struct def_table {..}
def_tab, pointer to struct dec_table {..} dec_tab}
        previous: union  {int err_code, pointer to struct def_table {..}
def_tab, pointer to struct dec_table {..} dec_tab} : "parser.h", line 10
"parser.y", line 159: identifier redeclared: yylval
        current : union  {int err_code, pointer to struct def_table {..}
def_tab, pointer to struct dec_table {..} dec_tab}
        previous: union  {int err_code, pointer to struct def_table {..}
def_tab, pointer to struct dec_table {..} dec_tab} : "parser.h", line 11
cc: acomp failed for parser.c
*** Error code 2
make: Fatal error: Command failed for target `parser_compiling'


I have tried to solve the problem with the first error, deleting the
decleration which is on line 66 as specified in output, but I still get
the same error with the same line as I compile. 

Now I suspect, errors are caused by one of those small differences
between yacc and bison. Yet I can't point out the cause. Therefore, I
decided to ask here even it's not specificly a yacc mailing
list(couldn't find it btw.)

I attach also the parser.y for further inspections.

Thanks in advance.
-Umut


Attachment: parser.y
Description: Text document


reply via email to

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