16 May 1999 15:16:40 -0400

          From comp.compilers

Related articles
YACC->Bison kerrr@my-dejanews.com (1999-05-16)
Re: YACC->Bison rkrayhawk@aol.com (1999-05-20)
Re: YACC->Bison javid@sasi.com (Javeed Ahmed) (1999-09-10)
| List of all articles for this month |

From: kerrr@my-dejanews.com
Newsgroups: comp.compilers
Date: 16 May 1999 15:16:40 -0400
Organization: Compilers Central
Keywords: yacc, question, comment

We're working on porting our application to Linux, and have a section
that we're having trouble with. I've got a file named idr_parser.y,
which is compile with yacc. This will need to be compiled with bison.
The current code gives me this error:

Compiling: idr_parser.y
yacc -vdl idr_parser.y
("idr_parser.y", line 107) error: type clash (`' `token_id') on default
make[1]: *** [idr_parser.o] Error 1
make[1]: Leaving directory `/home/bob/cubit/source'
make: *** [cubit] Error 2%start statements

The lines in question with their line numbers are:

102: statements :
103: | statements statement
104: ;
106: statement : END
107: | command END
108: {
109: debug_idr_num("statement", "END", "number of entries",

Can someone point me the way to figure out how to make this code correct
for both yacc and bison?

[All versions of yacc, of which bison is one, apply a default action of
$$ = $1 to any rule without explicit action code. I'd guess that it's
counting the lines wrong and you have a rule with a token_id that is
default assigned to a LHS of a different type. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.