YAMB: problems with yacc?
Dragos Ruiu
work at dragos.UUCP
Tue Mar 22 12:44:29 AEST 1988
In article <437 at splut.UUCP>, jay at splut.UUCP (Jay Maynard) writes:
> I tried entering the program hoc1, from the book _The Unix Programming
> Environment_, and compiling it last night. It doesn't run: when fed an
> expression like 2+2, instead of printing 4, it prints 2. It appears to
> reproduce productions of the form:
> expr: expr '+' expr { $$ = $1 + $3 }...
> by simply returning $3, instead of computing the sum. I have checked the
> program against the printed source in the book twice, and found no
> errors. Neither yacc nor cc complain during compilation of the program.
> Vitals: System V/AT (286) 2.3.0, plenty of (hard and ram-) disk.
>
> --
> Jay Maynard, EMT-P, K5ZC...>splut!< | GEnie: JAYMAYNARD CI$: 71036,1603
> uucp: {uunet!nuchat,academ!uhnix1,{ihnp4,bellcore,killer}!tness1}!splut!jay
I also encountered the bug in yacc. It seems to be in the add/sub/mult/div
of two floating point numbers. I spent a bit of time looking over this
problem... but I eventually discarded my work and tried the desc calculator
program I wrote on BSD and HP-UX systems and they worked there.
I can dig up the sources in a day, but if my memory serves me correctly,
it's not a Yacc problem... I believe it was a bug in the c compiler as I
went and actually debugged the yacc output. There is a large set of
indirection and structure references produced by yacc, and printfs on the
intermediate results and actual results just don't match. Unfortunately
I don't have time to track down this bug anymore.
I can email the sources which produce bugs to interested parties. Or if
enough people are interested I can post them. They aren't long.
--
Dragos Ruiu ruiu at dragos.UUCP
...alberta!dragos!ruiu OS/2... No thanks I have a pencil.
Disclaimer: These are my employers opinions. I'm unemployed.
More information about the Comp.unix.microport
mailing list