YAMB: problems with yacc?

Jay Maynard jay at splut.UUCP
Sun Mar 20 23:39:54 AEST 1988


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.
I tried #defining YYDEBUG and setting yydebug to 1, but just got a lot
of output that I don't understand.
Am I bashing my head against YAMB (yet another Microport bug)?
Vitals: System V/AT (286) 2.3.0, plenty of (hard and ram-) disk.
I'd post the program here, to see if anyone else has the problem, but am
unsure of the legalities. (Any help here appreciated.)
The reason behind running a program that, according to its authors,
"provides about the same capabilities as a minimal pocket calculator,
and is substantially less portable"? I wanted to make sure I could make
it run before I went to the time and effort of keying in hoc6, the
full-featured version.

-- 
Jay Maynard, EMT-P, K5ZC...>splut!< | GEnie: JAYMAYNARD  CI$: 71036,1603
uucp: {uunet!nuchat,academ!uhnix1,{ihnp4,bellcore,killer}!tness1}!splut!jay
Never ascribe to malice that which can adequately be explained by stupidity.
The opinions herein are shared by none of my cats, much less anyone else.



More information about the Comp.unix.microport mailing list