Re: Lex & Yacc - Levine, Mason & Brown

John R. Levine <johnl@iecc.cambridge.ma.us>
Fri, 27 Nov 1992 01:55:44 GMT

          From comp.compilers

Related articles
Lex & Yacc - Levine, Mason & Brown pjj@cs.man.ac.uk (1992-11-26)
Re: Lex & Yacc - Levine, Mason & Brown johnl@iecc.cambridge.ma.us (John R. Levine) (1992-11-27)
| List of all articles for this month |

Newsgroups: comp.compilers
From: John R. Levine <johnl@iecc.cambridge.ma.us>
Organization: Compilers Central
Date: Fri, 27 Nov 1992 01:55:44 GMT
Keywords: lex, yacc, errors, books
References: 92-11-148

|I am reviewing your book, and I am baffled by example 2-8 on page 44. I have
|tried examples 2.7 and 2.8 on a Sun 4 and they behave identically. The text
|surrounding the example does not seem to explain the problem, ...


Whoops. It's a typesetting glitch. The two cases are supposed to read like
this:


--- ch2-07.l ---


%s MAGIC


%%
<MAGIC>.+ { BEGIN 0; printf("Magic:"); ECHO; }
magic BEGIN MAGIC;
.+ ECHO;
%%


--- ch2-08.l ---


%{
/* This example deliberately doesn't work! */
%}


%s MAGIC


%%
magic BEGIN MAGIC;
.+ ECHO;
<MAGIC>.+ { BEGIN 0; printf("Magic:"); ECHO; }
%%


Troff bites me again -- the lines that start with dots look to troff like
comments. I'll be sure to fix this in the next printing.


|I am supposed to submit my review by the end of the month. I am VERY
|impressed, by the way. My only negative onservation so far is the wierd
|tabbing (looks like a 6-space v. 8-space error).


Thanks. I had a lot of typesetting trouble, largely because we discovered
fairly late in the process that the set of macros I was using on my machine
wasn't quite the same as the publisher's people were using. Aargh.
--
Regards,
John Levine, johnl@iecc.cambridge.ma.us, {spdcc|ima|world}!iecc!johnl


--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.