Path: utzoo!utgpu!watmath!watdragon!dahlia!dtsteen From: dtsteen@dahlia.waterloo.edu Newsgroups: comp.sys.amiga Subject: Bison mystery Keywords: bison out of memory Message-ID: <14622@watdragon.waterloo.edu> Date: 20 Jun 89 17:50:34 GMT Sender: daemon@watdragon.waterloo.edu Distribution: na Lines: 37 Recently, I have been playing with Bison and Flex (from Fred Fish disks 160-170 or thereabouts). Wonderful programs! I was able to build the ANSI C grammar from one of those disks with no problems. I tried rebuilding "CDecl", which had originally been built with yacc and lex, and not only did it work, but the resulting executable was 12K smaller than the original one (same compiler). I was ecstatic, and ready to place absolute faith in these programs, until I tried to process the following grammar: ------------------------------ %token DING DONG DELL %% rhyme : sound place ; sound : DING DONG ; place : DELL ; ------------------------------ This is from a mini-tutorial on yacc in an AT&T book. Surprise! It didn't work. Without an instant's hesitation, Bison reported that it was out of memory. A quick check yielded 650K free, and barely any of it touched before the error occurred. I've been experimenting for a while now, and have come to the following conclusion: Any grammar I write myself and try (i.e. anything short) will bomb, whereas any grammar taken from elsewhere (usually complex) will work just fine. Am I crazy or what? Has anyone else been playing with these programs and observed similar results? The Bison executable is 63356 bytes long. I have tried stack sizes from 50K to 200K with no avail. Memory fragmentation is unlikely to be the problem. And both Yacc and the (presumably newer) version of Bison on this Unix system compile the above grammar just fine. Markus Wandel (519) 884-9669