home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / compilers / faq < prev   
Encoding:
Internet Message Format  |  2004-05-02  |  38.9 KB

  1. Message-ID: <monthly-May-04@comp.compilers>
  2. Expires: 1 Jun 04 23:59:00 GMT
  3. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!xuxa.iecc.com!post-bot
  4. Date: Sat, 01 May 2004 07:00:00 EDT
  5. Newsgroups: comp.compilers,news.answers,comp.answers
  6. Subject: comp.compilers monthly message and Frequently Asked Questions
  7. From: compilers-request@iecc.com (John R. Levine)
  8. Organization: Compilers Central
  9. Keywords: administrivia
  10. Approved: compilers@iecc.com
  11. Followup-To: poster
  12. Lines: 815
  13. Xref: senator-bedfellow.mit.edu comp.compilers:24425 news.answers:270656 comp.answers:57015
  14.  
  15. Archive-name: compilers/faq
  16. Last-modified: $Date: 2003/08/14 14:39:40 $
  17.  
  18. This is the comp.compilers monthly message.  Changes since last month are
  19. indicated by the usual marks in the right margin.
  20.  
  21. Contents:
  22.  
  23. -- What is comp.compilers?
  24. -- How do I receive it?
  25. -- How do I submit a message?
  26. -- What happens to submitted messages?
  27. -- What message formats are appropriate?
  28. -- What topics are and aren't appropriate?
  29. -- Are help-wanted messages allowed?
  30. -- Why wasn't my message posted?
  31. -- How do I respond to the author of a message?
  32. -- How do I contact the moderator?
  33. -- Are back issues available?
  34.  
  35. -- Some Frequently Asked Questions:
  36.  
  37. * Where can I get a C or C++ grammar in yacc?
  38. * Where can I get the Gnu C compiler?
  39. * Are there other free C compilers?
  40. * Where can I get a free compiler for MS Windows?
  41. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  42. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  43. * Where can I get a Cobol grammar in yacc?
  44. * Where can I get a Basic grammar in yacc?
  45. * Where can I get a QBasic compiler?
  46. * Where can I get a PL/I or PL/M grammar?
  47. * Are there free versions of yacc and lex ?
  48. * Are there versions of yacc and lex for MS-DOS?
  49. * Are there C++ or Pascal versions of yacc and lex?
  50. * What other compilers and tools are freely available?
  51. * How can I get started with yacc and lex and compiler writing in general?
  52. * Where can I FTP the sources to the programs in Holub's "Compiler
  53.   Design in C" or Mak's "Writing Compilers and Interpreters" ?
  54. * Where can I learn about garbage collection ?
  55. * Where can I find specs for Intel object files?
  56.  
  57. -- What is comp.compilers?
  58.  
  59. It is a moderated usenet news group addressing the topics of compilers in
  60. particular and programming language design and implementation in general.
  61. It started in 1986 as a moderated mailing list, but interest quickly grew to
  62. the point where it was promoted to a news group.  Recent topics have
  63. included optimization techniques, language design issues, announcements of
  64. new compiler tools, and book reviews.
  65.  
  66. Messages come from a wide variety of people ranging from undergraduate
  67. students to well-known experts in industry and academia.  Authors live all
  68. over the world -- there are regular messages from the U.S, Canada, Europe,
  69. Australia, and Japan, with occasional ones from as far away as Malaysia.
  70. I cannot tell how large the readership is, since the anarchic nature of
  71. usenet makes it impossible to tell who reads it, but a reasonable guess is
  72. that the total is over 100,000, which would make it by far the most widely
  73. read medium on the topic in the world.
  74.  
  75. Unless there is specific language to the contrary, each message represents
  76. only the personal opinion of its author.  I claim no compilation copyright on
  77. comp.compilers.  As far as I am concerned, anyone can reproduce any message
  78. for any purpose.  Individual authors may retain rights to their messages,
  79. although I will not knowingly post anything that does not permit unlimited
  80. distribution in any form.  If you find comp.compilers useful in writing a
  81. book, producing a product, etc., I would appreciate an acknowledgement of
  82. usenet and comp.compilers.
  83.  
  84. -- How do I receive it?
  85.  
  86. The easiest way is to read comp.compilers on a system that gets usenet news.
  87.  
  88. If you don't have access to usenet news, it's also available via
  89. E-mail via a Majordomo mailing list.  To subscribe, a person should
  90. send e-mail to majordomo@lists.iecc.com with one line in the mail
  91. message (not in the subject!)  That line should read:
  92.  
  93.     subscribe compilers
  94.  
  95. If you want to get daily digests rather than individual messages,
  96. send this instead:
  97.  
  98.     subscribe-set compilers digest
  99.  
  100. You will get a confirmation message that you have to read and respond to
  101. in order to complete your subscription.
  102.  
  103. To get off the list the subscriber should send e-mail to the same address
  104. with this message:
  105.  
  106.     unsubscribe compilers
  107.  
  108. If you have problems getting on or off the list, please contact me.  In
  109. particular, if you want to use an address other than your own personal mail
  110. address, you have to ask me to set it up.  If I receive bounce messages for
  111. an address on the mailing list for ten messages in a row, it's
  112. automatically deleted.  If this happens to you and your address
  113. subsequently becomes reachable again, you can resubscribe.
  114.  
  115. -- How do I submit a message?
  116.  
  117. Mail it to compilers@iecc.com.  I review messages nearly every day, usually
  118. including weekends, and most messages are posted to the net within a day after
  119. I receive them.  Occasionally when I go out of town there may be up to a
  120. week's delay, though I try to send out a message when that will happen.
  121.  
  122. Most net news systems will automatically turn posted messages into mail to
  123. compilers, but some don't do that correctly.  As a result, I sometimes
  124. receive hundreds of copies of a message, all mangled slightly differently.
  125. Please mail your contributions unless you're sure your posting software
  126. works correctly.
  127.  
  128. When you send a message to compilers, I understand that to mean that you
  129. want me to post it to usenet, which means it will be sent to tens of
  130. thousands of potential readers at thousands of computers all around the
  131. world.  It may also appear in a printed comp.compilers annual and other
  132. books, in printed journals, in on-line and off-line archives, CD-ROMs, and
  133. anywhere else that some reader decides to use it.
  134.  
  135. If you don't want me to post something, send it instead to compilers-request.
  136. (See below.)
  137.  
  138. -- What happens to submitted messages?
  139.  
  140. Barring mail problems, they arrive in a special mailbox here at iecc, which
  141. sends an automated confirmation message that each has been received.  If
  142. they're appropriate to post, I then edit them a little, remove cute
  143. signatures, and then post them to usenet.  If I think a message needs more
  144. editing than that but is otherwise worth posting, I return it to the author
  145. for rewriting.  Other messages are discarded (see below.)
  146.  
  147. If I see that the automatically generated confirmation message bounced, I
  148. discard the message.  If you want your messages to be posted, please be
  149. sure the From: or Reply-To: line contains your correct e-mail address.
  150.  
  151. -- What message formats are appropriate?
  152.  
  153. Plain old ASCII.  No MIME, uuencoded, zipped, LaTeX, HTML, NeXTmail, RTF,
  154. GIF, gzip, MS Exchange, or anything else, just ASCII, because a majority of
  155. the readership still can't handle anything else.  Messages received in the
  156. broken HTML sent by misconfigured versions of mail programs such as Outlook
  157. Express and Netscape Messenger are usually discarded, since had you
  158. actually wanted people to read your message, you could have sent something
  159. legible.
  160.  
  161. Also, keep line lengths to between 70 and 80 characters, and don't justify
  162. lines with extra white space nor indent the whole message with white space.
  163. Messages received entirely in lower case are subject to gratuitous
  164. recapitalization.  (Your moderator has strong aesthetic opinions.)
  165.  
  166. If you want to make something non-ASCII available to the readership, put it
  167. on an FTP or WWW server and send in a descriptive note with the URL.
  168. Material of general interest can go on the archive server here.  Send me a
  169. message at compilers-request@iecc.com if you have something for the
  170. archive.
  171.  
  172. -- What topics are and aren't appropriate?
  173.  
  174. Any message discussing aspects of compiler design and implementation is
  175. appropriate.  Language design is usually OK as well insofar as it affects
  176. compiler design, until it drifts off into theological issues like where the
  177. semicolon goes.
  178.  
  179. Questions about particular compilers, programming languages, and systems
  180. should go to newsgroups about the language or system.
  181.  
  182. "For sale" messages should go to one of the misc.forsale or regional
  183. forsale groups.
  184.  
  185. I post one announcement per conference, for any conference with a topic
  186. relevant to compilers.  I usually post student offers to share a room at a
  187. conference, and should probably digest them as well.
  188.  
  189. Postings announcing commercial products are welcome so long as there
  190. is substantially more technical content than hype.
  191.  
  192. For technical reasons, I can't cross-post messages to other moderated groups,
  193. except one or two like comp.parallel with whom I have an informal agreement
  194. to allow cross-posts.
  195.  
  196. -- Are help-wanted messages allowed?
  197.  
  198. ``Help wanted'' and ``Position Available'' messages are collected each
  199. week and posted in a digest every Sunday.  Jobs remaining open may be
  200. re-posted once a month.  Since comp.compilers readers live all over
  201. the world, please be sure that your message includes some hint about
  202. the location of the job and whether non-residents of your country can
  203. apply.  Messages from recruiters are OK, but they must advertise
  204. actual specific job openings.
  205.  
  206.  
  207. -- Why wasn't my message posted?
  208.  
  209. The main reasons I don't post a message are that I never received it in the
  210. first place, it appears more appropriate for another group, the message is
  211. too garbled to fix, it contains too much quoted material relative to the
  212. amount of new material, or I don't understand it.  Another possibility is
  213. that a message doesn't have a valid return e-mail address.
  214.  
  215. When you respond to a previous article, you MUST edit down the quoted
  216. material to the minimum needed to remind readers about the topic.  In the
  217. past I usually did such editing myself, but with the increasing number of
  218. messages, I just don't have time any more and discard such messages.  If
  219. you can't take the time to edit your message, neither can I.  The mail
  220. receipt robot makes a guess about the amount of quoted material in each
  221. message and sends a warning in response if a message appears to have more
  222. quoted than new stuff.  Unless it guessed wrong, please edit and resumbit
  223. your message if you want it to appear.
  224.  
  225. I discard messages that say "reply to me because I don't read this group",
  226. and forward spams back to the appropriate postmaster.  Messages from
  227. anonymous or anonymized addresses are not acceptable, although I could be
  228. persuaded to post a message with the sender's identity removed given a
  229. plausible reason.
  230.  
  231. I also discard messages with invalid return addresses and in non-text
  232. formats, as discussed above.
  233.  
  234. If a message asks a simple question I sometimes answer it myself rather than
  235. posting it.  If you ask a question answered in the FAQ, discussed to death in
  236. the past, or appropriate for a different group, you'll get a form response.
  237.  
  238. If you send in a message and don't either see it posted or receive an
  239. acknowledgement from the robot, it probably got lost in the mail and you
  240. should contact me, preferably via a different mail route.
  241.  
  242. -- How do I respond to the author of a message?
  243.  
  244. I try to be sure that every message contains valid From: and Reply-To:
  245. headers.  The automatic "reply" commands in most news readers let you send
  246. mail to the author.  If you're replying to a message in a digest, be sure
  247. to respond to the author of the particular message, not to the pseudo-author
  248. of the digest.
  249.  
  250. Some obsolete news readers attempt to reply using the Path: header, but for
  251. technical reasons the Path: header in a moderated message cannot point to the
  252. actual author.  In fact, the Path: header in a compilers message is
  253. deliberately a bad mail address, so if you have such a news reader you'll
  254. have to edit the addresses in responses yourself and, I hope, encourage your
  255. system manager to update your news and mail software.
  256.  
  257. Sometimes mail to an author bounces, either because a gateway isn't working
  258. or because the return address is unregistered or otherwise bad.  Please don't
  259. ask me to forward it, since my machine is no better connected than anyone
  260. else's.  (It's just another node on the Internet.)  If you send me a message
  261. obviously intended for the author of an item, I will discard it on the theory
  262. that if it wasn't important enough for you to send it to the right place, it
  263. isn't important enough for me, either.
  264.  
  265. -- How do I contact the moderator?
  266.  
  267. Send me mail at compilers-request@iecc.com.  I treat messages to
  268. compilers-request as private messages to me unless they state that they are
  269. for publication.
  270.  
  271. -- Are back issues available?
  272.  
  273. I have complete archives going back to the original mailing list in
  274. 1986.  The archives now fill over 58 megabytes, and are growing at
  275. about 500K per month.  You can retrieve messages by full text search
  276. or by message number at the compilers web site at
  277. http://compilers.iecc.com/.  People with ftp access can get them
  278. from ftp://ftp.iecc.com/pub/articles.  The FTP archives contain a
  279. gzipped Unix mailbox format file for each month, with names like
  280. 91-08.gz.  Directory ftp://ftp.iecc.com/pub/index contains table of
  281. contents files, one for each year.
  282.  
  283. There is a mail server at compilers-server@iecc.com that can mail you
  284. indexes, messages, and some of the files mentioned below.  Send it a
  285. message containing "help" to get started.
  286.  
  287. I have also published a printed edition of the 1990 messages grouped by
  288. thread and topic, and with some indexes, and may publish subsequent
  289. editions.  (If you'd be interested in editing books for later years, let me
  290. know.)  You can buy copies of the 1990 book directly from me; send email
  291. to compilers-request@iecc.com for details.  (Yes, we take plastic.)
  292.  
  293.  
  294. -- Some Frequently Asked Questions:
  295.  
  296. NOTE: Many issues are discussed occasionally on comp.compilers, but not
  297. frequently enought to make the FAQ list.  If you have a question but the
  298. answer isn't in the FAQ, you may well be able to get good background by
  299. reading the appropriate articles in the archive.  Please at least visit
  300. the archive at http://compilers.iecc.com and do a little searching.
  301.  
  302. The various files that I mention below that I have are in the compilers FTP
  303. archive at http://ftp.iecc.com/pub/file/.
  304.  
  305. * Where can I get a C or C++ grammar in yacc?
  306.  
  307. Jim Roskind's well-known C and C++ grammars are in the FTP archive, as is
  308. a C grammar written by Jeff Lee.  Dave Jones posted a parser as message
  309. 91-09-030.  Another C grammar was posted to comp.sources.misc in June
  310. 1990, v13 i52, archive name ansi-c_su.  The GCC C and C++ parsers are
  311. based on yacc grammars, see below.
  312.  
  313. Also see cTool (formerly ctree), which parses C code into parse trees
  314. and makes symbol tables, described in message 95-07-114.
  315.     http://sourceforge.net/projects/ctool/
  316.  
  317. * Where can I get the Gnu C compiler?
  318.  
  319. GCC is a high-quality free compiler for C, C++, Fortran, Java, and
  320. some other languages. (Free is not the same as public domain, see the
  321. GCC distribution for details.)  It is available in source from
  322. http://gcc.gnu.org.  You need an existing C compiler and libraries to
  323. bootstrap it.
  324.  
  325. * Are there other free C compilers?
  326.  
  327. lcc is the retargetable compiler for ANSI C described in `A Retargetable C
  328. Compiler: Design and Implementation' (Benjamin/Cummings, 1995, ISBN
  329. 0-8053-1670-1). lcc is in production use at Princeton University and AT&T
  330. Bell Laboratories.  The current version of lcc generates code for the
  331. SPARC, MIPS R3000 and 386 under DOS (no libraries for DOS are available
  332. yet).  The code generator generator is available too as a icon program, and
  333. a C version is available as of version 3.5.  There are mailing lists
  334. lcc{,-bugs}@cs.princeton.edu, managed by majordomo@cs.princeton.edu.  The
  335. object code is not great, but the compiler is ANSI compatible and is small
  336. and fast.  Lcc uses a hard-coded C parser because it's faster than yacc,
  337. and now includes a preprocessor.  Lcc is available, along with docs and a
  338. sample chapter of the book http://www.CS.Princeton.EDU/software/lcc/
  339.  
  340. Thanks to Horst von Brand <vonbrand@inf.utfsm.cl> and
  341. Tom Harwood <harwood@bedford.progress.COM> for this info.
  342.  
  343. * Where can I get a free compiler for MS Windows?
  344.  
  345. A package called CYGWIN from Red Hat (who bought Cygnus Solutions) is
  346. based on GCC.  It includes C and C++ along with Unix emulation tools
  347. and libraries.  It can build either GUI or console applications.  It's
  348. unsupported but works pretty well, is widely used within Red Hat, and
  349. at the price, it's hard to complain.  Info at
  350. http://sources.redhat.com/cygwin/ Thanks to David Taylor
  351. <taylor@cygnus.com> for this info.
  352.  
  353. Also see http://www.mingw.org/, Minimalist GNU For Windows, which is like
  354. Cygwin but smaller and doesn't try to be full Posix.
  355.  
  356. A development system called "djgpp" by DJ Delorie <dj@delorie.com> is based
  357. on gcc and other GNU programs, and runs on 386 or higher PCs running
  358. MS-DOS.  DJGPP also has Pascal, FORTRAN, Ada, Bison and Flex for MS-DOS.
  359. It also has many other GNU tools that programmers often need, like emacs,
  360. make, fileutils, shellutils, textutils, sed, awk, perl, etc.  This is all
  361. available from ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/ or
  362. http://www.delorie.com/djgpp/
  363.  
  364. Another DOS version of GCC called EMX is at 
  365. ftp://ftp.informatik.tu-muenchen.de/pub/comp/os/os2/devtools/emx+gcc.
  366.  
  367. lcc-win32, a version of lcc for windows 95/NT can be downloaded from
  368. http://www.cs.virginia.edu/~lcc-win32/
  369.  
  370. Another C compiler with source is available at:
  371. http://members.tripod.com/~ladsoft/.  (Thanks to Quinn Tyler Jackson
  372. <qjackson@wave.home.com>.)
  373.  
  374.  
  375. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  376.  
  377. I have a small subset parser in the archive at ftp.iecc.com.  The F2C
  378. Fortran to C translator is a respectable Fortran system (so long as
  379. you have a C compiler to compile its output and its libraries) and
  380. contains a full F77 parser and is available in source form via FTP
  381. from netlib.bell-labs.com and by mail from netlib@research.bell-labs.com.
  382.  
  383. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  384.  
  385. I have one each of those, too, in the archive at ftp.iecc.com, though I
  386. haven't tried to use any of them.
  387.  
  388. According to the comp.lang.ada FAQ, a yacc grammar for Ada 95 is available:
  389.  
  390. ftp://sw-eng.falls-church.va.us/public/AdaIC/standards/95lrm_rat/grammar9x.y
  391.  
  392. and a lex grammar for Ada 95 is available:
  393.  
  394. ftp://sw-eng.falls-church.va.us/public/AdaIC/standards/95lrm_rat/lexer9x.l
  395.  
  396. There's an Ada front end called GNAT for GCC, available at
  397. ftp://cs.nyu.edu/pub/gnat/.
  398.  
  399. * Where can I get a free Cobol grammar in yacc?
  400.  
  401. See message 99-06-079 for a free Cobol compiler with source.
  402.  
  403. See http://adam.wins.uva.nl/~x/grammars/vs-cobol-ii/ for a grammar, but
  404. not one that yacc can use directly.
  405.  
  406. Siber Systems at http://www.siber.com/sct/ has a variety of Cobol tools
  407. for sale including a parser.
  408.  
  409. Semantic Designs provides commercial tools for parsing, analyzing,
  410. transforming, and prettyprinting COBOL85 and other dialects.
  411. (http://www.semdesigns.com/Products/DMS/DMSToolkit.html)
  412.  
  413. At http://www.netsis.it/~asantini/cobcy/ you can find a partial Cobol to
  414. C translator with a parser that handles about half of Cobol syntax.  Half
  415. is a lot better than none, particularly for free.
  416.  
  417. Ken Foskey waratah@zip.com.au has a Cobol parser project at
  418. http://www.zipworld.com.au/~waratah/
  419.  
  420. Also see the Cobol FAQ posted monthly to comp.lang.misc and comp.lang.cobol.
  421.  
  422. * Where can I get a Basic grammar in yacc?
  423.  
  424. Take a look at ftp://ftp.uu.net:/usenet/comp.sources.unix/volume2/basic/
  425. which contains a Basic interpreter with yacc parser.
  426.  
  427. * Where can I get a QBasic compiler?
  428.  
  429. Probably nowhere.  The "official" QBasic compilers were QuickBasic 4.5
  430. and the Microsoft Professional Development System, sometims called "QBX".
  431. You might still find copies at the big mail-order houses, but Microsoft
  432. has discontinued them.
  433.  
  434. A shareware compiler ASIC is available from simtel mirrors such as
  435. ftp://ftp.simtel.net/pub/simtelnet/msdos/basic/asic500.zip, which
  436. handles a large subset of Qbasic.  Also see
  437. http://www.users.uswest.net/~sdiggins/basm.html for another freeware
  438. Basic compiler.
  439.  
  440. PowerBasic and FirstBasic, commercial and shareware, respectively, from
  441. http://www.powerbasic.com resembles an extended QBasic.
  442.  
  443. There's a Qbasic mailing list; send "info qbasic" to
  444. listserv@midnight.postino.com for details.
  445.  
  446. * Where can I get a PL/I or PL/M grammar?
  447.  
  448. There's a PL/M in the archives at ftp://ftp.iecc.com/pub/file/plm.shar.gz
  449. Also see message 94-03-062 for a report on a PL/M to C translator.
  450.  
  451. * Are there free versions of yacc and lex ?
  452.  
  453. Vern Paxton's flex is a superior reimplementation of lex.  It is available
  454. from the same places as Gnu sources, but is not subject to the Gnu
  455. copyleft.  A version patched for Unicode characters is available at
  456. ftp://ftp.lauton.com/pub/flex-2.5.4-unicode-patch.tar.gz.
  457.  
  458. Berkeley Yacc is a quite compatible PD version of yacc by Bob
  459. Corbett, available on
  460. ftp://ftp.cs.berkeley.edu/ucb/4bsd/byacc.tar.Z. Gnu Bison is derived
  461. from an earlier version of Corbett's work and is also fairly compatible
  462. with yacc.  A byacc extension that displays graphically the progress of a
  463. parse can be found in Jim Roskind's C++ grammar in the FTP compilers
  464. archive.
  465.  
  466. * Are there versions of yacc and lex for MS-DOS?
  467.  
  468. There are several of them.  Commercial versions are MKS lex&yacc from MKS
  469. in Waterloo Ont., +1 519 884 2251, http://www.mks.com or inquiry@mks.com,
  470. and PCYACC from Abraxas Software in Portland OR, +1 503 244 5253.  Both
  471. include both yacc and lex along with a lot of sample code.
  472.  
  473. The standard flex source compiles under the usual DOS compilers, although
  474. you may want to make some of the buffers smaller.  A DOS version of Bison
  475. is on wuarchive.wustl.edu [128.252.135.4] and other servers under
  476. SimTel/msdos/pgmutil/bison111.zip. See message 92-07-012 for more info.
  477. Berkeley yacc is quite portable to any 32 bit system, but won't work on
  478. 16 bit systems without a lot of work.
  479.  
  480. * Are there C++ or Pascal versions of yacc and lex?
  481.  
  482. flexx++ and bison++ can be found at:
  483.  
  484. ftp://ftp.th-darmstadt.de/pub/programming/languages/C++/tools/flex++bison++/
  485.  
  486. A version of lex and yacc for Turbo Pascal, with source, is
  487. available at
  488. http://www.musikwissenschaft.uni-mainz.de/~ag/tply/tply.html
  489.  
  490. * What other compilers and tools are freely available?
  491.  
  492. There is a FAQ groups listing compiler tools freely available in
  493. source form, maintained by Steve Robenalt. It's available on the web
  494. at http://www.idiom.com/free-compilers, and you can retrieve a text
  495. version (possibly out of date) from
  496. ftp://ftp.idiom.com/pub/compilers-list/free-compilers.  The list is
  497. not updated very often; if you think it should be updated more
  498. frequently, feel free to drop them a note and offer to help with the
  499. work.
  500.  
  501. Also visit the web page http://www.first.gmd.de/cogent/catalog/ which includes
  502. pointers to a variety of compiler tools and resources.
  503.  
  504. * How can I get started with yacc and lex and compiler writing in general?
  505.  
  506. There are short on-line tutorials for lex and yacc at
  507. http://epaperpress.com/lexandyacc/index.html
  508.  
  509. Or read any of the many books on the topic.  Here are a few of them.
  510. Also see message 93-01-155 which reviews many compiler textbooks.
  511.  
  512. Pat Terry's "Compilers and Compiler Generators", originally published
  513. as a book, is on the web as http://www.scifac.ru.ac.za/compilers/
  514.  
  515. "Parsing Techniques - A Practical Guide" by Dick Grune and Ceriel
  516. J.H. Jacobs, published as a book in 1990, is now on the web as
  517. http://www.cs.vu.nl/~dick/PTAPG.html.
  518.  
  519. Aho, Sethi, and Ullman, "Compilers: Principles, Techniques, and Tools,"
  520. Addison Wesley, 1986, ISBN 0-201-10088-6, the "dragon book".
  521.  
  522. Describes clearly and completely lexing and parsing techniques including
  523. the ones in yacc and lex.  The authors work or have worked at Bell Labs
  524. with Steve Johnson and Mike Lesk, the authors of Yacc and Lex.  It's
  525. still the classic text, although it's getting kind of old.
  526.  
  527. Alan Holub, "Compiler Design in C," Prentice-Hall, 1990, ISBN
  528. 0-13-155045-4.
  529.  
  530. A large book containing the complete source code to a reimplementation of
  531. yacc and lex and a C compiler.  Quite well written, too, though it has a
  532. lot of errors.  The fourth printing is supposed to correct most of them.
  533. An errata list is in message 90-06-081, and a newer one in PDF (yuck) on
  534. his web site at <http://www.holub.com>.
  535.  
  536. John R. Levine (that's me), Tony Mason, and Doug Brown, ``Lex & Yacc,''
  537. 2nd Edition, O'Reilly and Associates, 1992, ISBN 1-56592-000-7, $29.95.
  538.  
  539. A concise introduction with completely worked out examples and an extensive
  540. reference section.  The new edition is completely revised from the earlier
  541. 1990 edition.  Source code can be FTP'ed from ftp.ora.com.  Get the second
  542. printing (see the copyright page) which fixes a bunch of typos.
  543.  
  544. Donnely and Stallman, "The Bison Manual," part of the on-line distrubution
  545. of the FSF's Bison, a reimplementation of yacc.  As with everything else
  546. from the FSF, full source code is included.
  547.  
  548. Axel T. Schreiner and H. George Friedman, Jr., "Introduction to Compiler
  549. Construction with UNIX," Prentice-Hall, 1985.
  550.  
  551. Oriented to tutorial work.  Good for beginners.  Develops a small
  552. subset-of-C compiler through the book.  (Recommended by Eric Hughes
  553. <hughes@ocf.Berkeley.EDU>.)  Richard Hash <rgh@shell.com> comments
  554. that the book has many typographical errors, and readers should be
  555. suspicious of the examples until they actually try them.  Sources are
  556. available for FTP as ftp://a.cs.uiuc.edu/pub/pub/faculty/friedman/tar
  557.  
  558. Bennett, J.P. "Introduction to Compiling Techniques - A First Course Using
  559. Ansi C, Lex and Yacc," McGraw Hill Book Co, 1990, ISBN 0-07-707215-4.
  560.  
  561. It's intended for a first course in modern compiler techniques, is very
  562. clearly written, and has a full chapter on YACC.  I found it to be a good
  563. introductory text before getting into the 'Dragon book'.  (Recommended by
  564. John Merlin <J.H.Merlin@ecs.southampton.ac.uk>.)  Source code is available
  565. at www.jeremybennett.com.
  566.  
  567. Charles N. Fischer & Richard J. LeBlanc, "Crafting A Compiler", Benjamin
  568. Cummings Publishing, Menlo Park, CA, 1988, ISBN 0-8053-3201-4.  There's
  569. also a revised version as of 1990 or 1991 titled "Crafting A Compiler in
  570. C", with all examples in C (the original used ADA/CS).  The tools are at
  571. http://www.cs.wisc.edu/~fischer/ftp/tools/
  572.  
  573. Erich Nahum <nahum@cs.umass.edu> writes: A key compiler reference.  We
  574. used the original to great effect in Eliot Moss' graduate compiler
  575. construction class here at UMass.  My feeling is that Fischer & LeBlanc is
  576. a good tutorial, and one should use Aho, Sethi, & Ullman as a reference.
  577.  
  578. Des Watson, "High-Level Languages and Their Compilers," International
  579. Computer Science Series, Addison-Wesley Publishing Company, Wokingham
  580. England, 1989.
  581.  
  582. Adrian Howard <adrianh@cogs.sussex.ac.uk> writes: This is the kindest,
  583. most readable introduction to compilers at the graduate level I have ever
  584. read - an excellent example of what textbooks should all be like.
  585.  
  586. W.M. Waite and G. Goos, "Compiler Construction," Springer-Verlag, New
  587. York, 1984.
  588.  
  589. Dick Grune <dick@cs.vu.nl> writes: A theoretical approach to compiler
  590. construction. Refreshing in that it gives a completely new view of many
  591. subjects. Heavy reading, high information density.
  592.  
  593. J.P. Tremblay and P.G. Sorenson, "The Theory and Practice of Compiler
  594. Writing," McGraw-Hill, 1985.
  595.  
  596. Dick Grune <dick@cs.vu.nl> writes: Extensive and detailed. Heavy reading.
  597. To be consulted when other sources fail.
  598.  
  599. James E. Hendrix, "The Small-C Compiler", 2nd ed., M&T Books, ISBN
  600. 0-934375-88-7 <Book Alone>, 1-55851-007-9 <MS-DOS Disk>, 0-934375-97-6
  601. <Book and Disk>.
  602.  
  603. William Jhun <ec_ind03@oswego.edu> writes: It explaines the C-language is
  604. thorough....and explains every single aspect of the compiler. The book
  605. compares source code to p-code to assembly. It goes over a nice set of
  606. optimization routines, explains the parser, the back end, and even
  607. includes source code, which the compiler on the disk can actually compile
  608. itself. It's an extremely interesting book, check it out. (Out of print,
  609. but see http://www.ddj.com/cdrom/ where you can buy a CD-ROM that has the
  610. full text of the book and a lot of other stuff.)
  611.  
  612. Ronald Mak, "Writing Compilers and Interpreters: An Applied Approach",
  613. 1991, John Wiley and Sons, Inc. ISBN 0-471-50968-X.
  614.  
  615. Andrew Tucker <a_tucker@paul.spu.edu> writes: This 512-page book presents
  616. a strictly hands on approach, developing a Pascal interpreter and
  617. interactive debugger, then completing with a compiler which emits 8086
  618. assembly.  All source code is provided in print and on disk.  This book is
  619. very low to non-existent in theoretical content, but is very practical and
  620. readable for an introduction.  Taylor Hutt <thutt@access.digex.net>
  621. comments that the book is a piece of junk.  The code that is contained in
  622. the book is full of bugs, and the code that it generates will not work.
  623.  
  624. "The Art of Compiler Design", Thomas Pittman & James Peters, Prentice-Hall
  625. International, 1992, Englewood Cliffs, NJ 07632, 0-13-046160-1
  626.  
  627. Franklin L. Vermeulen <vfrank@vnet3.vub.ac.be> writes: This is a very
  628. nicely written and straightforward text on compiler construction.  There
  629. is a certain (unavoidable?) amount of overlap with a course on automata
  630. (as in Aho, Sethi and Ullman).  It is based on Modula-2 and on an
  631. experimental tool, the TAG compiler-compiler (Transformational Attribute
  632. Grammar) which seems to be a C-independent superset of lex/yacc, because
  633. its syntax allows you to specify all semantic actions without a single
  634. line of C-code (or any other implementation language, for that matter).
  635.  
  636. A. Pyster, "Compiler Design and Constuction (Tools and Techniques)",
  637. Second Ed., Van Nostrand Reinhold, ISBN: 0-442-27536-6.
  638.  
  639. Gabriela O. de Vivo <gdevivo@dino.conicit.ve> writes: The book covers the
  640. general principles of compiler design and presents a good number of
  641. examples focusing on the building of pieceparts of compilers for C and
  642. Pascal.  The implementation (construction) language is C.  Note that this
  643. edition (in contrast with the previous one) is very related to the Unix
  644. world, including the use of tools like Lex, Yacc, and standard utilities.
  645. (Out of print.)
  646.  
  647. Thomas W. Parsons, "Introduction to compiler construction",
  648. Computer Science Press, c1992, ISBN: 0-716782618.
  649.  
  650. Quinn Tyler Jackson <qjackson@direct.ca> writes: Provides a broad overview
  651. of the topics of finite state automaton theory (deterministic and
  652. non-deterministic), lexical analysis, parsing models, and target generation
  653. and optimization strategies.  Includes appendices on lex and yacc.  Most
  654. examples in Pascal.  (Recommended reading for the faint at heart.)
  655.  
  656. "Programming a Personal Computer" by Per Brinch Hansen
  657. Prentice-Hall 1982 ISBN 0-13-730283-5
  658.  
  659. Joe Snyder <joe@semaphorecorp.com> writes:  This unfortunately-titled book
  660. explains the design and creation of a single-user programming environment
  661. for micros, using a Pascal-like language called Edison.  The author presents
  662. all source code and explanations for the step-by-step implementation of an
  663. Edison compiler and simple supporting operating system, all written in
  664. Edison itself (except for a small supporting kernel written in a symbolic
  665. assembler for PDP 11/23; the complete source can also be ordered for the IBM
  666. PC).
  667.  
  668. The most interesting things about this book are:  1) its ability to
  669. demonstrate how to create a complete, self-contained, self-maintaining,
  670. useful compiler and operating system, and 2) the interesting discussion of
  671. language design and specification problems and trade-offs in Chapter 2.
  672.  
  673.  
  674. "Brinch Hansen on Pascal Compilers" by Per Brinch Hansen
  675. Prentice-Hall 1985 ISBN 0-13-083098-4
  676.  
  677. Joe Snyder <joe@semaphorecorp.com> writes:  Another light-on-theory
  678. heavy-on-pragmatics here's-how-to-code-it book.  The author presents the
  679. design, implementation, and complete source code for a compiler and p-code
  680. interpreter for Pascal- (Pascal "minus"), a Pascal subset with boolean and
  681. integer types (but no characters, reals, subranged or enumerated types),
  682. constant and variable definitions and array and record types (but no packed,
  683. variant, set, pointer, nameless, renamed, or file types), expressions,
  684. assignment statements, nested procedure definitions with value and variable
  685. parameters, if statements, while statements, and begin-end blocks (but no
  686. function definitions, procedural parameters, goto statements and labels,
  687. case statements, repeat statements, for statements, and with statements).
  688.  
  689. The compiler and interpreter are written in Pascal* (Pascal "star"), a
  690. Pascal subset extended with some Edison-style features for creating
  691. software development systems.  A Pascal* compiler for the IBM PC is sold by
  692. the author, but it's easy to port the book's Pascal- compiler to any
  693. convenient Pascal platform.
  694.  
  695. This book makes the design and implementation of a compiler look easy.  I
  696. particularly like the way the author is concerned with quality,
  697. reliability, and testing.  The compiler and interpreter can easily be used
  698. as the basis for a more involved language or compiler project, especially
  699. if you're pressed to quickly get something up and running.
  700.  
  701.  
  702. "A Model Implementation of Standard Pascal" by Jim Welsh & Atholl Hay
  703. Prentice-Hall 1986 ISBN 0-13-586454-2
  704.  
  705. Joe Snyder <joe@semaphorecorp.com> writes: This book is only really useful
  706. if you need to implement a COMPLETE version of a platform-independent
  707. Pascal, but I find it interesting because the 483 pages consist entirely
  708. of the source code listing for the compiler and p-code interpreter (both
  709. written in Pascal itself), including copious {comments} to explain the
  710. code.  The code eagerly delves into the horrible minutiae necessary when
  711. implementing a complete language, and proves that no language designer
  712. should be allowed to present his design until AFTER being forced to write
  713. a complete compiler for the language.
  714.  
  715. "Writing Interactive Compilers and Interpreters" bu P.J. Brown, 1979, John
  716. Wiley & Sons Ltd ISBN 0 471 27609 X hbk ISBN 0471 100722 pbk
  717.  
  718. Martin Rodgers <mcr@wildcard.demon.co.uk> writes: Brown explains
  719. why we might wish to use an interactive compiler, and what we might mean
  720. when we make distinctions like "compiled" and "interpreted". He uses Basic
  721. as the example language for his book, plus a little pseudo code where
  722. necessary. Modern Basic may be very different to what he used, but it's
  723. easy to see how techniques that apply a line oriented language might be
  724. extended to a larger unit of compilation. Brown discusses issues that are
  725. specific to interactive language systems, which may be neglected in
  726. compiler books that focus more on a batch approach and optimised
  727. code. Still, he has a few things to say about the use of bytecodes and
  728. native code, plus what might today be called "Just In Time" compiling. An
  729. excellent introduction to compilers, with a few ideas for advanced
  730. compilers, too.  (Out of print.)
  731.  
  732. Peter Calingaert, "Program Translation Fundamentals", Computer Science
  733. Press, c1988, ISBN: 0-88175-096-4, pp 366. Quinn Tyler Jackson
  734. <qjackson@wave.home.com> writes: Covers assemblers, program modules, macro
  735. processing, interpretation and generation, source-program analysis, data
  736. structures, compilation, linking and loading.  The reader is assumed to
  737. have some experience "both in an assembler language and in a
  738. machine-independent procedural language."  It's a good overview of the many
  739. aspects of program translation and compilation, this book would make a good
  740. second look into compilation before diving into hard theory, but after
  741. having gleaned some basics from a more introductory work such.
  742.  
  743. Alberto Apostolico & Zvi Galil, "Pattern Matching Algorithms", Oxford
  744. University Press, 1997, ISBN: 0-19-511367-5.  Quinn Tyler Jackson
  745. <qjackson@wave.home.com> writes: This book "attempts a snapshot of the
  746. current state of the art in Pattern Matching" research, and in this
  747. reader's opinion, it achieves its stated goal.  From algorithms to
  748. find the shortest common superstrings, to 2D matrix searches, almost
  749. no pattern matching problem encountered by today's stringologist is
  750. left unaddressed.  The preface declares the book's intention to
  751. combine a graduate or advanced level course textbook with a
  752.  source for the specialist as well as the neophyte -- but I would
  753. advise the "neophyte" to have an adequate background in notation and
  754. formalisms, since the many authors are academics, and no algorithm
  755. presented goes without formal quantification.  The bibliographies at
  756. the end of each chapter are a priceless resource.
  757.  
  758. Steven S. Muchnick, Advanced Compiler Design & Implementation,Morgan
  759. Kaufmann Publishers, (1997), pp. 856, ISBN: 1-55860-320-4. Quinn Tyler
  760. Jackson <qjackson@wave.home.com> writes: Except perhaps for the brief
  761. overview of compiler architecture at the beginning, this book is for
  762. the seasoned compiler writer rather than the novice or student wanting
  763. an overview of compiler construction.  Muchnick's focus is on code
  764. generation, optimization, and, as the title suggests, advanced issues.
  765. My opinion is that this clear, thorough treatment is for the seasoned
  766. compiler engineer who already has one or two compiler or interpreter
  767. implementations on the curriculum vitae and who is looking for new
  768. ways to address some of the deeper issues of the field.  There is no
  769. hand holding going on with a book like this.
  770.  
  771.  
  772. Andrew W. Appel, Modern Compiler Implementation in C Cambridge
  773. University Press (1998), pp. 544, ISBN: 0-521-58390-X Quinn Tyler
  774. Jackson <qjackson@wave.home.com> writes: This book shines with the
  775. experience of those that came before it.  It covers all of the phases
  776. of compilation in a clear, readable fashion.  Many of the topics it
  777. brings to light were once the domain of the illuminati of compiler
  778. construction.  A conscientious reader, with some of the other
  779. literature (such as Levine et al.'s Lex & Yacc) under his belt, an
  780. Internet connection to hunt down the errata and source to the samples
  781. in the book, a good C compiler, and a determination to absorb the
  782. details, could probably learn to write a compiler from the ground up
  783. and come out of the experience without too many major holes in
  784. knowledge.
  785.  
  786. Wulf et al. book, The Design of an Optimizing Compiler, American
  787. Elsevier Publishing Co., Inc.), 1975.  A small classic about the
  788. Bliss-11 compiler, a highly optimizing compiler for a PDP-11.  The
  789. original version is long out of print, but it's still available via
  790. print-on-demand from University Microfilms.
  791.  
  792. If anyone sends in others, I'll be happy to add them to the list.
  793.  
  794. * Where can I FTP the sources to the programs in Holub's "Compiler
  795. Design in C" or Mak's "Writing Compilers and Interpreters" ?
  796.  
  797. The programs in Mak's second edition are at
  798. ftp://ftp.wiley.com/public/computer_books/Software_Development/Mak-Writing_Compilers/
  799. in an odd MS-DOS only format.  Holub's code is shareware, available on his
  800. web site at <http://www.holub.com>.
  801.  
  802. * Where can I learn about garbage collection ?
  803.  
  804. Garbage collection (more properly, automatic storage management) has its own
  805. mailing list and FAQ.  Find more info at:
  806.  
  807. http://iecc.com/gclist/
  808.  
  809. To join the list, send "subscribe gclist" to majordomo@lists.iecc.com.
  810.  
  811. * Where can I find specs for Intel object files?
  812.  
  813. Specs for Windows OMF and PE, and Unix ELF and DWARF are available
  814. at http://www.wotsit.org/search.asp?s=EXE.  (Also search for ELF,
  815. DWARF, COFF, etc.)
  816.  
  817. A more recent definition of PE is on Microsoft's web site at
  818. http://www.microsoft.com/whdc/hwdev/hardware/PECOFF.mspx (Clickwrap
  819. license required in which you agree not to sue them nor to use the
  820. spec to develop nuclear, biological, or chemical weapons.)
  821.  
  822. A more recent Dwarf spec (Dwarf3) is on http://www.eagercon.com/
  823.  
  824. Regards,
  825. John Levine, comp.compilers moderator
  826. --
  827. Send compilers articles to compilers@iecc.com, meta-mail to
  828. compilers-request@iecc.com.  Archives at http://compilers.iecc.com
  829.  
  830.