Related articles |
---|
Anyone know this book? fpeelo@portablesolutions.com (Frank Peelo) (1998-03-03) |
Re: Anyone know this book? dwight@pentasoft.com (1998-03-06) |
Re: Anyone know this book? will@ccs.neu.edu (William D Clinger) (1998-03-13) |
From: | "Frank Peelo" <fpeelo@portablesolutions.com> |
Newsgroups: | comp.compilers |
Date: | 3 Mar 1998 10:54:21 -0500 |
Organization: | Indigo |
Keywords: | books, question |
Hi
I bought myself a copy of "Compiler Construction" by N. Wirth in the
hope of learning how to write a simple compiler. While it's generally
very interesting and good fun, I have a problem when I get to a bit I
have trouble working out: since I am not following a course, I don't
have a tutor or other students to discuss things with. I would love to
correspond with someone who has used this book in a course and might
be able to explain a couple of points.
For example, in one section he discusses generating a "table" to
represent a grammar. A construct like
p = t { '+' | '-' t }.
gets represented as
+-----------------+
v |
p --> [ ] --> [ '+' ] --|
----/ | |
/ [ '-' ] --+
t |
[ EMP ]
(Does that make sense? That's one reason I'd like to write to someone
who has the book - so as not to have to copy the diagrams!)
but what I don't understand is: why the pseudo-terminal symbol "EMP"
(indicating a lack of an alternative terminal symbol) is needed. I'm
doing the exercise of writing a program to parse EBNF files and
generate such a graph and I can't figure out where to put the empties!
Thanks
Frank
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.