shieber@harvard.harvard.edu (01/09/90)
I have a Mac II running THINK C and am interested in getting a version of Yacc and Lex for it. Has anyone written such a thing, or ported a version? For instance, has anyone ported the GNU Bison and Flex to Macs? (From the code I ftped, it didn't look like the GNU people themselves had done the port.) Any and all pointers (including to commercial products) would be much appreciated. -- Stuart Shieber shieber@harvard.harvard.edu shieber@harvard.bitnet -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.
levin@BBN.COM (Joel B Levin) (01/10/90)
In article <1990Jan9.021314.5308@esegue.segue.boston.ma.us> shieber@harvard.harvard.edu writes: |I have a Mac II running THINK C and am interested in getting a version |of Yacc and Lex for it. ... I have seen at least one, maybe two, commercial versions of Yacc (probably Lex is available too) advertised in MacTutor. Flex and Bison have been ported as MPW tools only (i.e. they have to be run as commands under the MPW shell); as such they are available from sources like the Sumex archive. They will not run standalone. /JBL Nets: levin@bbn.com or {...}!bbn!levin POTS: (617)873-3463 -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.
rsfinn@athena.mit.edu (Russell S. Finn) (01/10/90)
In article <1990Jan9.021314.5308@esegue.segue.boston.ma.us> shieber@harvard.harvard.edu writes: > >I have a Mac II running THINK C and am interested in getting a version >of Yacc and Lex for it. ... I'm working on porting Bison and Flex to the THINK C environment. I was able to bring up Bison fairly quickly, but ran into problems with Flex which I haven't gotten past yet. I haven't tested Bison extensively yet. No user interface, just the "ccommand" dialog (from TC 4.0) which lets you type in a command line. Net denizen Earle Horton has apparently ported Bison and Flex to the MPW C compiler. Perhaps he will see this and post some of his experiences as well. -- Russ -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.
earleh@microsoft.UUCP (Earle HORTON) (01/11/90)
In article <1990Jan10.021257.11269@esegue.segue.boston.ma.us> rsfinn@athena.mit.edu (Russell S. Finn) writes: >Net denizen Earle Horton has apparently ported Bison and Flex to the >MPW C compiler. Perhaps he will see this and post some of his >experiences as well. Sure. Note: This is me, but the address is a little different. There are three big problems with porting Flex to a Macintosh development system, and a few other little ones. a) Flex uses lots of global data, chiefly in arrays. Many development systems for the Macintosh do not allow more than 32k of global data. The approach I chose to use in porting Flex 2.x was to use Aztec C 3.6c with the "large data" model. For THINK C, you may want to convert a bunch of arrays to pointers, then allocate the space for these pointers from the heap. b) The Macintosh character set uses all eight bits of a character. Flex uses the high-order bit as a flag, and in addition uses raw chars as array subscripts. Combine this with signed chars, and you have a recipe for program death. Chars have to be masked to eight bits in numerous places within Flex, and the code which uses the high bit as a flag has to be rewritten. I strongly recommend that you obtain the code from my port of Flex, rather than attempting this task yourself. c) The line demarcation character used in Macintosh 'TEXT' files is conventionally the carriage return character, with decimal value 13. Flex uses a hard-coded '\n' in numerous places to denote newline, and '\n' is equal to 10 in most non-weird C implementations. To make Flex work with Macintosh 'TEXT' files, either filter the input and output so that Flex sees an end of line as a '\n', or change Flex to use '\r' instead of '\n' everywhere. There is an ftp archive at ohio-state where you can find a copy of Berkeley Yacc which is free to use and not subject to the GNU Copyleft. I ported this to Aztec C 3.6c, and sent a copy of the sources to sumex while I was still doing Macintosh development. Porting to THINK C should be relatively straightforward. Earle R. Horton -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus}!esegue. Meta-mail to compilers-request@esegue. Please send responses to the author of the message, not the poster.