[comp.sys.mac.programmer] summary:lex/flex/yacc/bison,etc for macs

frederic@currituck.cs.unc.edu (Robin Fredericksen) (02/13/91)

The following is a public thank you note to all who responded (so far) to my
request for information on lexical analyzers/parsers for the Mac, and
specifically for these tools for Think C.

The People:
Peter Newton                                     newton@cs.utexas.edu
Jerome Plun                                      jyp@wucs1.wustl.edu
Bill                                             johnston@oscar.ccm.udel.edu
Edgar Knapp                                      knapp@cs.utexas.edu
Tim Endres                                       time@ice.com
Pai Chou                                         chou@june.cs.washington.edu
Matthias Neeracher                               mneerach@iiic.ethz.ch
Assar Westerlund                                 assar@alex.stacken.kth.se
S.P. van de Burgt                                SP_vdBurgt@pttrnl.nl
Jon Leech                                        leech@cs.unc.edu
Ron Azuma                                        azuma@cs.unc.edu
Bryan Morse                                      morse@cs.unc.edu
Ray Pelletier                                    rp23+@andrew.cmu.edu

The responses included:
=====================================================
>I got flex and bison for THINK C from the nerdtools directory of
>ftp.apple.com.
=====================================================
>I have seen files named bison and yacc on apple.com in
>the pub/dts/mac/xxx directory(s).  xxx means somewhere at
>that level or deeper.

At		ftp.apple.com
under		./nerdtools/thinkc
are		flex.sit.hqx
		bison.sit.hqx

=====================================================
>You can found Flex and Bison for Think C on
>funic.funet.fi in directory /pub/mac/programming.
>I think they're named flextc.sit and bisontc.sit.

At		funic.funet.fi
under		/pub/mac/programming
are		flextc.sit
		bisontc.sit


It turns out that the above two sets are exactly the same code, so either
one should be OK.  (Use the closer one?)  In any case,  I owe great thanks
to the porter of this code, who so graciously left his name and email
address in the NOTES ON THINK C file in the distribution:

Russell S. Finn, 19-FEB-90 [the last update date I presume]
Internet: rsfinn@athena.mit.edu, rsfinn@neutron.lcs.mit.edu


=====================================================
>There are a couple of Lex/Yacc-like programs.  Here are the pointers to a
>few a know about:
>
>In the sumex ftp site (36.44.0.6):
>info-mac/lang/yacc.hqx	(I think it is for MPW)
>info-mac/source/c/think-c-bison.hqx
=====================================================
>MacYacc (a stand-lone application) can be found at
>>sumex-aim.stanford.edu, but it is 5 years old and clumsy. I also used
to have an MPW port of yacc, but it would crash MPW 3.0, so I threw it
>out. I have not seen yacc for LSC.
=====================================================
>Some time last month I FTP's a version of MAC YACC from somewhere. I
>think it might have been SUMEX-AIM. I haven't tried it yet, but it looks
>reasonably complete.
=====================================================
>How about:
>    /info-mac/lang/yacc.hqx
>    /info-mac/source/c/think-c-flex-part2.
>    /info-mac/source/c/think-c-flex-part1.
>
>At the info-mac archive sites...

At		sumex-aim.standord.edu
under		./info-mac/lang
is		yacc.hqx
under		./info-mac/source/c
is		think-c-bison.hqx

This THINK C version of bison is, once again, the version by Russell S. Finn.

The yacc thing becomes a standalone program called 'mac yacc' which doesn't
seem to work (I am using a Mac IIfx, so that doesn't mean much).  I bagged
that option for the flex/bison approach.


=====================================================
>Unless ThinkC allows global array larger than 32K you better forget
>it. The Lex and Yacc generated code contains ENORMOUS initialized
>global arrays to do their processing. MPW has a feature to handle
>these, but I am not sure that ThinkC does.

The foresighted porter of flex to THINK C has countered that problem by
providing the ability to turn certain tables into resources.  See his notes
in the ftp-able file for specifics.  In addition, flex provides much smaller
versions of the tables (the global arrays that you speak of) in the
compressed version of its output.

=======================================================
>I have used MacYacc and compiled it successfully with THINK C
>without any modification.  Make sure you prototype your calls.
>I have also tried the yacc output from unix and brought the
>source code to C. They worked exactly the same way.
>
>I have only heard about something like flex but never used it.
>I usually handcraft my scanner.  Why don't you try running
>lex on unix, then port the C code to THINK C?
>
>I got MacYacc from BMUG (Berkeley Macintosh Users Group)
>on their Programmer's Disk #3.  This was about 2-3 years
>ago, but I think it should still be there.

See notes on the mac-yacc thing that I found (above).

I thought of lex/yacc/unix, but I wanted something less painless
than rlogin'ing in, working, ftp'ing around and such.  I've handcrafted
stuff before, but what I want is more than just a simple file reader
( a simplified language compiler/interpreter).  Major changes are easier
to make with lex/yacc : flex/bison type tools (read prototyping, and I
don't care much whether the code is blindingly fast.

I did not check BMUG.  See notes on MacYacc above.


=====================================================
>You misunderstand this. It was not the FSF that has ported flex/bison, but
>(I believe) one Earle Horton or so. I remember having seen Think C versions
>of the bison/flex source floating around, so if you have ftp, I might find
>you a pointer to them.

I apologize for miswording my info request.  I believe that Earle Horton
was the name that I saw on the MPW version of bison/flex, but I have
ditched that stuff and cannot remember where I got it.  Can someone give
him certified credit?


Some later arrivals are:
==========================================================
>MACYACC
>Abraxas Softare, Inc.
>1-800-347-5214
>
>>Personal Version $249
Professional Version $495
>
>There is a brief review in the April, 1990 issue of MacTutor (p.62) as
>part of an introduction to yacc.  The prices are taken from an add in the
>latest issue and are considerably higher than those mentioned in the review.
>The reviewers advice is to get the personal version and save the money.
>The professional version includes lex and a lot of sample grammers.
>
>If you're looking for something free, I saw a yacc tool in the info-mac
>archives at sumex-aim.stanford.edu.
===========================================================
>Yacc is on SUMEX.STANFORD.EDU, no lex anywhere as far as I know.
>Bison/Flex for MPW is at APPLE.COM, w/sources.

Is APPLE.COM the same as ftp.apple.com?  These must be under the mpw
directory and not the thinkc directory.  So, those who want flex/bison
for MPW,  try it there.

****************************************************
Thanks for saving me MUCH TIME.
Eric Fredericksen     UNC-CH Computer Science       frederic@cs.unc.edu
Currently at the University of Utrecht
The Netherlands                                                     frederic@neuretp.biol.ruu.nl



-- 
-------------------------------------------------------------------------------
Eric Fredericksen	: Insert amazingly funny or enlightening quote
frederic@cs.unc.edu	: in this space here.
I don't need a disclaimer, I'm a graduate student so no one cares what I say...