home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk1.iso / answers / compilers-faq < prev    next >
Text File  |  1993-12-02  |  23KB  |  452 lines

  1. Newsgroups: comp.compilers,news.answers,comp.answers
  2. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!world!iecc!compilers-sender
  3. From: compilers-request@iecc.com (John R. Levine)
  4. Subject: comp.compilers monthly message and Frequently Asked Questions
  5. Message-ID: <monthly-Dec-93@comp.compilers>
  6. Followup-To: poster
  7. Keywords: administrivia
  8. Sender: compilers-sender@chico.iecc.com
  9. Supersedes: <monthly-Nov-93@comp.compilers>
  10. Organization: Compilers Central
  11. Date: Wed, 1 Dec 1993 12:00:04 GMT
  12. Approved: compilers@iecc.com
  13. Expires: Sat, 1 Jan 1994 23:59:00 GMT
  14. Lines: 435
  15. Xref: senator-bedfellow.mit.edu comp.compilers:5937 news.answers:15278 comp.answers:2868
  16.  
  17. Archive-name: compilers-faq
  18.  
  19. This is the comp.compilers monthly message, last edited November 1993.
  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. -- How do I respond to the author of a message?
  28. -- How do I contact the moderator?
  29. -- Are back issues available?
  30.  
  31. -- Some Frequently Asked Questions:
  32.  
  33. * Where can I get a C or C++ grammar in yacc?
  34. * Where can I get the Gnu C compiler?
  35. * Are there other free C compilers?
  36. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  37. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  38. * Where can I get a Cobol grammar in yacc?
  39. * Where can I get a Basic grammar in yacc?
  40. * Are there free versions of yacc and lex ?
  41. * Are there versions of yacc and lex for MS-DOS?
  42. * What other compilers and tools are freely available?
  43. * How can I get started with yacc and lex and compiler writing in general?
  44. * Where I can I FTP the sources to the programs in Holub's "Compiler
  45.   Design in C" or Mak's "Writing Compilers and Interpreters" ?
  46.  
  47. -- What is comp.compilers?
  48.  
  49. It is a moderated usenet news group addressing the topics of compilers in
  50. particular and programming language design and implementation in general.
  51. It started in 1986 as a moderated mailing list, but interest quickly grew to
  52. the point where it was promoted to a news group.  Recent topics have
  53. included optimization techniques, language design issues, announcements of
  54. new compiler tools, and book reviews.
  55.  
  56. Messages come from a wide variety of people ranging from undergraduate
  57. students to well-known experts in industry and academia.  Authors live all
  58. over the world -- there are regular messages from the U.S, Canada, Europe,
  59. Australia, and Japan, with occasional ones from as far away as Malaysia.  I
  60. have no idea how large the readership is, since the anarchic nature of
  61. usenet makes it impossible to tell who reads it, but I believe that the total
  62. is in the tens of thousands.
  63.  
  64. Unless there is specific language to the contrary, each message represents
  65. only the personal opinion of its author.  I claim no compilation copyright on
  66. comp.compilers.  As far as I am concerned, anyone can reproduce any message
  67. for any purpose.  Individual authors may retain rights to their messages,
  68. although I will not knowingly post anything that does not permit unlimited
  69. distribution in any form.  If you find comp.compilers useful in writing a
  70. book, producing a product, etc., I would appreciate an acknowledgement of
  71. usenet and comp.compilers.
  72.  
  73. -- How do I receive it?
  74.  
  75. The easiest way is to read comp.compilers on a system that gets usenet news.
  76.  
  77. If you don't have access to usenet news, it's also available via E-mail via
  78. a LISTSERV forwarder at the American University.  To subscribe a person
  79. should send e-mail to listserv@american.edu with one line in the mail
  80. message (not in the subject!)  That line should read:
  81.  
  82.                         SUBSCRIBE COMPIL-L full_name
  83. for example:
  84.                         SUBSCRIBE COMPIL-L Ima Hacker
  85.  
  86. To get off the list the subscriber should send e-mail to the same address
  87. with the message:       SIGNOFF COMPIL-L
  88.  
  89. If you have problems getting on or off the list, please contact me.  In
  90. particular, if you want to use an address other than your own personal mail
  91. address, you have to ask me to set it up.  If I receive bounce messages for
  92. an address on the mailing list for two days in a row, I delete it.  If this
  93. happens to you and your address subsequently becomes reachable again, you
  94. can resubscribe.
  95.  
  96. -- How do I submit a message?
  97.  
  98. Mail it to compilers@iecc.com, also known as compilers@iecc.uucp or
  99. iecc!compilers.  I review messages nearly every day, usually including
  100. weekends, and most messages are posted to the net within a day after I
  101. receive them.  Occasionally when I go on vacation there may be up to a
  102. week's delay, though I try to send out a message when that will happen.
  103.  
  104. Most net news systems will automatically turn posted messages into mail to
  105. compilers, but some, particularly systems running notes, don't do that
  106. correctly.  As a result, I sometimes receive hundreds of copies of a
  107. message, all mangled slightly differently.  Please mail your contributions
  108. unless you're sure your posting software works correctly.
  109.  
  110. When you send a message to compilers, I understand that to mean that you
  111. want me to post it to usenet, which means it will be sent to tens of
  112. thousands of potential readers at thousands of computers all around the
  113. world.  It may also appear in a printed comp.compilers annual and other
  114. books, in the ACM SIGPLAN Notices, in on-line and off-line archives,
  115. CD-ROMs, and anywhere else that some reader decides to use it.
  116.  
  117. If you don't want me to post something, send it instead to
  118. compilers-request.  (See below.)
  119.  
  120. PLEASE: Format messages with lines of less than 80 characters, since many
  121. news readers (including mine) don't auto-wrap very well.  Also remove quoted
  122. material not immediately germane to your response.  Messages must be in plain
  123. ASCII, not TeX input, troff, SGML, RTF or any other markup language.
  124.  
  125. -- What happens to submitted messages?
  126.  
  127. Barring mail problems, they arrive in a special mailbox here at iecc.  I
  128. then edit the headers, trim down quoted text, fix typos and grammatical
  129. errors, remove cute signatures, and then post them to usenet.  If I think a
  130. message needs more editing than that, I return it to the author for
  131. rewriting.  The main reasons I return a message are that it appears more
  132. appropriate for another group, the message is too garbled to fix, it
  133. contains too much quoted material relative to the amount of new material, or
  134. I don't understand it.  I also usually return messages that directly attack
  135. individuals, since the net has plenty of other places for ad-hominem battles.
  136. Another possibility is that a message doesn't have a valid return e-mail
  137. address.  If your mail system insists on putting a bogus address in the From:
  138. line, be sure that you put a usable address in your signature.
  139.  
  140. If a message asks a simple question I sometimes answer it myself rather than
  141. posting it.  When two or three messages arrive with the same answer to a
  142. question, I usually post only one of them, with a comment crediting the
  143. others.
  144.  
  145. If you send in a message and don't either see it posted or receive
  146. something back in a few days, it probably got lost in the mail and you
  147. should contact me, preferably via a different mail route.  I post or
  148. respond to all messages except for ones that appear to have been sent by
  149. mistake, e.g. no contents, contents consisting only of another quoted
  150. message, or a personal message for the author of a previous message.
  151. Sometimes when I'm feeling exasperated I disregard messages that re-ask
  152. one of the frequently asked questions that are answered below.
  153.  
  154. One of the most time-consuming jobs in moderating the group is trimming down
  155. the quotes in followup articles.  In most cases, you can expect readers to
  156. have seen the previous article, so only a few lines of quoted text should be
  157. needed to remind the reader of the context.
  158.  
  159. I have installed a simple-minded quote filter that mechanically returns to
  160. the sender any message that contains more quoted than unquoted lines.  Please
  161. edit your quotes before you send in a response, to avoid having the filter
  162. bounce your message.  Since the quote filter is pretty dumb, I do look at
  163. bounced messages myself.  If the filter bounces a message of yours by mistake,
  164. don't panic -- it'll get posted anyway.
  165.  
  166. ``Help wanted'' and ``Position Available'' messages are collected each week
  167. and posted in a digest every Sunday.
  168.  
  169. -- How do I respond to the author of a message?
  170.  
  171. I try to be sure that every message contains valid From: and Reply-To:
  172. headers.  The automatic "reply" commands in most news readers let you send
  173. mail to the author.  If you're replying to a message in a digest, be sure
  174. to respond to the author of the particular message, not to the pseudo-author
  175. of the digest.
  176.  
  177. Some obsolete news readers attempt to reply using the Path: header, but for
  178. technical reasons the Path: header in a moderated message cannot point to
  179. the actual author.  In fact, the Path: header in a compilers message is
  180. deliberately a bad mail address, so if you have such a news reader you'll
  181. have to edit the addresses in responses yourself and, I hope, encourage your
  182. system manager to update your news and mail software.
  183.  
  184. Sometimes mail to an author bounces, either because a gateway isn't
  185. working or because the return address is unregistered or otherwise bad.
  186. Please don't ask me to forward it, since my machine is no better connected
  187. than anyone else's.  (It's not on the Internet and only talks uucp.)  If
  188. you send me a message obviously intended for the author of an item, I will
  189. discard it on the theory that if it wasn't important enough for you to
  190. send it to the right place, it isn't important enough for me, either.
  191.  
  192. -- How do I contact the moderator?
  193.  
  194. Send me mail at compilers-request@iecc.com.  I treat messages to
  195. compilers-request as private messages to me unless they state that they
  196. are for publication.
  197.  
  198. -- Are back issues available?
  199.  
  200. I have complete archives going back to the original mailing list in 1986.
  201. The archives now fill about 17 megabytes, and are growing at over 200K per
  202. month.  I update the archives at the end of each month.  People with ftp
  203. access can get them from primost.cs.wisc.edu, (128.105.9.68) where James
  204. Larus has kindly provided space, in directory pub/comp.compilers.  The
  205. archives contain a compressed Unix mailbox format file for each month,
  206. with names like 91-08.Z.  The file INDEX.Z lists all of the subject lines
  207. for every message in the archives, and in most cases is the first file you
  208. should retrieve.  I am in the process of moving the archives to iecc.com
  209. (140.186.81.1).  The network software there is buggy, so although FTP works,
  210. it can be excruciatingly slow.  At iecc.com, everything is compressed with
  211. gzip rather than compress.
  212.  
  213. The archives are available via modem from Channel One, an excellent local
  214. BBS.  You have to register, but no payment is needed to download the
  215. archives which are in Area 6.  (If you call more than once or twice, it
  216. would be nice to sign up for at least the $25 trial membership.)  The 2400
  217. BPS telephone number is +1 617 354 8873, and the Telebit number is +1 617
  218. 354 0470.  There is a ZIP format archive per month with names like
  219. comp9108.zip, with the most recent archive also containing the index.
  220.  
  221. There is now a mail server at compilers-server@iecc.com that can mail you
  222. indexes, messages, and the files mentioned below.  Send it a message
  223. containing "help" to get started.
  224.  
  225. I have also published a printed edition of the 1990 messages grouped by
  226. thread and topic, and with some indexes, and may publish subsequent editions.
  227. (If you'd be intereted in editing the 1991, 1992, or later books, let me
  228. know.)  see the message which should immediately follow this one for further
  229. details on the 1990 book. 
  230.  
  231. -- Some Frequently Asked Questions:
  232.  
  233. NOTE: Many issues are discussed occasionally on comp.compilers, but not
  234. frequently enought to make the FAQ sheet.  If you have a question but the
  235. answer isn't in the FAQ, you may well be able to get good background by
  236. reading the appropriate articles in the archive.  If you can FTP, please
  237. at least get the index and look through it.
  238.  
  239. The various files that I mention below that I have are in the compilers
  240. archive at primost.cs.wisc.edu, and are also available from the mail
  241. server mentioned above.  If you can FTP them, please do so rather than
  242. using the mail server, since the mail bandwith is quite small.
  243.  
  244. * Where can I get a C or C++ grammar in yacc?
  245.  
  246. Jim Roskind's well-known C and C++ grammars are in the archive, as is
  247. a C grammar written by Jeff Lee.  Dave Jones posted a parser as
  248. message 91-09-030.  Another C grammar was posted to comp.sources.misc
  249. in June 1990, v13 i52, archive name ansi-c_su.  GCC and G++ are based
  250. on yacc grammars, see below.
  251.  
  252. * Where can I get the Gnu C compiler?
  253.  
  254. GCC is a high-quality free C and C++ compiler.  (Free is not the same as
  255. public domain, see the GCC distribution for details.)  It is available in
  256. source from from prep.ai.mit.edu.  You need an existing C compiler and
  257. libraries to bootstrap it.
  258.  
  259. A version for 386 MS-DOS by DJ Delorie <dj@ctron.com> is available by FTP
  260. from omnigate.clarkson.edu or wowbagger.pc-labor.uni-bremen.de and by
  261. mail from archive-server@omnigate.clarkson.edu in the archive msdos/djgpp.
  262. See messages 91-09-054 and 91-09-066.  Note: When omnigate is overloaded,
  263. it responds with "Access Denied."  Try later.
  264.  
  265. * Are there other free C compilers?
  266.  
  267. The lcc compiler, written by people at Princeton and Bell Labs, is
  268. available via FTP from princeton.edu.  It is supposed to generate code
  269. nearly as good as GCC while being considerably faster and smaller.  It
  270. comes with a demonstration VAX code generator and documentation on the
  271. code generation interfaces.  Production code generators for the VAX, MIPS,
  272. and Motorola 68020 are available for research use to universities willing
  273. to execute a license agreement; the FTP package elaborates.  Lcc uses a
  274. hard-coded C parser because it's faster than yacc.
  275.  
  276. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  277.  
  278. I have a small subset parser in the archive mentioned above.  The F2C
  279. Fortran to C translator is a respectable Fortran system (so long as
  280. you have a C compiler to compile its output and its libraries) and
  281. contains a full F77 parser and is available in source form via FTP
  282. from research.att.com and by mail from netlib@research.att.com.
  283.  
  284. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  285.  
  286. I have one each of those, too, in the archive mentioned above, though I
  287. haven't tried to use any of them.
  288.  
  289. * Where can I get a Cobol grammar in yacc?
  290.  
  291. Nowhere for free, as far as I can tell.  This question is asked every few
  292. months and there has never, ever, been any positive response. Perhaps some
  293. of the interested people could get together and write one.  The commercial
  294. PCYACC from Abraxas (see below) comes with a bunch of sample grammars
  295. including one for Cobol-85.
  296.  
  297. * Where can I get a Basic grammar in yacc?
  298.  
  299. Take a look at ftp.uu.net:comp.sources.unix/volume2/basic which contains
  300. a Basic interpreter with yacc parser.
  301.  
  302. * Are there free versions of yacc and lex ?
  303.  
  304. Vern Paxton's flex is a superior reimplementation of lex.  It is available
  305. from the same places as Gnu sources.  Berkeley Yacc is a quite compatible
  306. PD version of yacc by Bob Corbett, available as ~ftp/pub/byacc.tar.Z on
  307. okeeffe.berkeley.edu.  Gnu Bison is derived from an earlier version of
  308. Corbett's work and is also fairly compatible with yacc.  A byacc extension
  309. that displays graphically the progress of a parse can be found in Jim
  310. Roskind's C++ grammar in the FTP compilers archive.  (The files are too
  311. big for the mail archive, sorry.)
  312.  
  313. * Are there versions of yacc and lex for MS-DOS?
  314.  
  315. There are several of them.  Commercial versions are MKS lex&yacc from MKS
  316. in Waterloo Ont., +1 519 884 2251 or inquiry@mks.com, and PCYACC from
  317. Abraxas Software in Portland OR, +1 503 244 5253.  Both include both yacc
  318. and lex along with a lot of sample code.
  319.  
  320. The standard flex source compiles under the usual DOS compilers, although
  321. you may want to make some of the buffers smaller.  A DOS version of Bison
  322. is on wuarchive.wustl.edu [128.252.135.4] and other servers under
  323. /mirrors/msdos/txtutl/bison111.zip. See message 92-07-012 for more info.
  324.  
  325. * What other compilers and tools are freely available?
  326.  
  327. There is a three-part FAQ posting in comp.compilers and other groups
  328. listing compiler tools freely available in source form, maintained by
  329. David Muir Sharnoff <muir@cogsci.berkeley.edu>.  It is posted monthly,
  330. right after this message.  If it's not on your system, you can FTP it from
  331. rtfm.mit.edu in the directory /pub/usenet/news.answers/free-compilers, or
  332. via mail by sending a message to to mail-server@rtfm.mit.edu with the
  333. command "send usenet/news.answers/free-compilers/*" in the text.
  334.  
  335. * How can I get started with yacc and lex and compiler writing in general?
  336.  
  337. By reading any of the many books on the topic.  Here are a few of them.
  338. Also see message 93-01-155 which reviews many compiler textbooks.
  339.  
  340. Aho, Sethi, and Ullman, "Compilers: Principles, Techniques, and Tools,"
  341. Addison Wesley, 1986, ISBN 0-201-10088-6, the "dragon book".  Describes
  342. clearly and completely lexing and parsing techniques including the ones in
  343. yacc and lex.  The authors work or have worked at Bell Labs with Steve
  344. Johnson and Mike Lesk, the authors of Yacc and Lex.
  345.  
  346. Alan Holub, "Compiler Design in C," Prentice-Hall, 1990, ISBN
  347. 0-13-155045-4.  A large book containing the complete source code to a
  348. reimplementation of yacc and lex and a C compiler.  Quite well written,
  349. too, though it has a lot of errors.  The fourth printing is supposed to
  350. correct most of them.
  351.  
  352. John R. Levine, Tony Mason, and Doug Brown, ``Lex & Yacc,'' 2nd Edition,
  353. O'Reilly and Associates, 1992, ISBN 1-56592-000-7, $29.95.  A concise
  354. introduction with completely worked out examples and an extensive
  355. reference section.  The new edition is completely revised from the earlier
  356. 1990 edition.
  357.  
  358. Donnely and Stallman, "The Bison Manual," part of the on-line distrubution
  359. of the FSF's Bison, a reimplementation of yacc.  As with everything else from
  360. the FSF, full source code is included.
  361.  
  362. Axel T. Schreiner and H. George Friedman, Jr., "Introduction to Compiler
  363. Construction with UNIX," Prentice-Hall, 1985.  Oriented to tutorial work.
  364. Good for beginners.  Develops a small subset-of-C compiler through the book.
  365. (Recommended by Eric Hughes <hughes@ocf.Berkeley.EDU>.)  Richard Hash
  366. <rgh@shell.com> comments that the book has many typographical errors, and
  367. readers should be suspicious of the examples until they actually try them.
  368. Richard Y. Kim <richard@ear.mit.edu> reports that sources are available for
  369. FTP as a.cs.uiuc.edu:pub/friedman/tar.
  370.  
  371. Bennett, J.P. "Introduction to Compiling Techniques - A First Course Using
  372. Ansi C, Lex and Yacc," McGraw Hill Book Co, 1990, ISBN 0-07-707215-4.
  373. It's intended for a first course in modern compiler techniques, is very
  374. clearly written, and has a full chapter on YACC.  I found it to be a good
  375. introductory text before getting into the 'Dragon book'.  (Recommended by
  376. John Merlin <J.H.Merlin@ecs.southampton.ac.uk>.)  Source code is available
  377. at ftp.bath.ac.uk.
  378.  
  379. Charles N. Fischer & Richard J. LeBlanc, "Crafting A Compiler", Benjamin
  380. Cummings Publishing, Menlo Park, CA, 1988, ISBN 0-8053-3201-4.  There's
  381. also a revised version as of 1990 or 1991 titled "Crafting A Compiler in
  382. C", with all examples in C (the original used ADA/CS).  Erich Nahum
  383. <nahum@cs.umass.edu> writes: A key compiler reference.  We used the
  384. original to great effect in Eliot Moss' graduate compiler construction
  385. class here at UMass.  My feeling is that Fischer & LeBlanc is a good
  386. tutorial, and one should use Aho, Sethi, & Ullman as a reference.
  387.  
  388. Des Watson, "High-Level Languages and Their Compilers," International
  389. Computer Science Series, Addison-Wesley Publishing Company, Wokingham
  390. England, 1989.  Adrian Howard <adrianh@cogs.sussex.ac.uk> writes: This is
  391. the kindest, most readable introduction to compilers at the graduate level
  392. I have ever read - an excellent example of what textbooks should all be
  393. like.
  394.  
  395. W.M. Waite and G. Goos, "Compiler Construction," Springer-Verlag, New
  396. York, 1984.  Dick Grune <dick@cs.vu.nl> writes: A theoretical approach to
  397. compiler construction. Refreshing in that it gives a completely new view
  398. of many subjects. Heavy reading, high information density.
  399.  
  400. J.P. Tremblay and P.G. Sorenson, "The Theory and Practice of Compiler
  401. Writing," McGraw-Hill, 1985.  Dick Grune <dick@cs.vu.nl> writes: Extensive
  402. and detailed. Heavy reading. To be consulted when other sources fail.
  403.  
  404. James E. Hendrix, "The Small-C Compiler", 2nd ed., M&T Books, ISBN
  405. 0-934375-88-7 <Book Alone>, 1-55851-007-9 <MS-DOS Disk>,
  406. 0-934375-97-6 <Book AND Disk>.
  407.  
  408. William Jhun <ec_ind03@oswego.edu> writes: It explaines the C-language is
  409. thorough....and explains every single aspect of the compiler. The book
  410. compares source code to p-code to assembly. It goes over a nice set of
  411. optimization routines, explains the parser, the back end, and even
  412. includes source code, which the compiler on the disk can actually compile
  413. itself. It's an extremely interesting book, check it out.
  414.  
  415. Ronald Mak, "Writing Compilers and Interpreters: An Applied Approach",
  416. 1991, John Wiley and Sons, Inc. ISBN 0-471-50968-X.
  417.  
  418. Andrew Tucker <a_tucker@paul.spu.edu> writes: This 512-page book presents
  419. a strictly hands on approach, developing a Pascal interpreter and
  420. interactive debugger, then completing with a compiler which emits 8086
  421. assembly.  All source code is provided in print and on disk.  This book is
  422. very low to non-existent in theoretical content, but is very practical and
  423. readable for an introduction.  Taylor Hutt <thutt@access.digex.net>
  424. comments that the book is a piece of junk.  The code that is contained in
  425. the book is full of bugs, and the code that it generates will not work.
  426.  
  427. "The Art of Compiler Design", Thomas Pittman & James Peters, Prentice-Hall
  428. International, 1992, Englewood Cliffs, NJ 07632, 0-13-046160-1
  429.  
  430. Franklin L. Vermeulen <vfrank@vnet3.vub.ac.be> writes: This is a very
  431. nicely written and straightforward text on compiler construction.  There
  432. is a certain (unavoidable?) amount of overlap with a course on automata
  433. (as in Aho, Sethi and Ullman).  It is based on Modula-2 and on an
  434. experimental tool, the TAG compiler-compiler (Transformational Attribute
  435. Grammar) which seems to be a C-independent superset of lex/yacc, because
  436. its syntax allows you to specify all semantic actions without a single
  437. line of C-code (or any other implementation language, for that matter).
  438.  
  439. If anyone sends in others, I'll be happy to add them to the list.
  440.  
  441. * Where I can I FTP the sources to the programs in Holub's "Compiler
  442. Design in C" or Mak's "Writing Compilers and Interpreters" ?
  443.  
  444. You can't.  In each book there's ordering information for diskettes with
  445. the code.
  446.  
  447. Regards,
  448. John Levine, comp.compilers moderator
  449. -- 
  450. Send compilers articles to compilers@iecc.com or
  451. {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request@iecc.com.
  452.