K&R II YACC grammar (was: Yacc probs w/ANSI-C)
Norman Diamond
diamond at diamond.csl.sony.junet
Sat Jul 8 16:54:28 AEST 1989
Some bright person asked:
-> Is anyone else worried about the ethical question here? Section
-> A13 really seems to encourage you to type it in, feed it to YACC,
-> and use it in your compiler ("This grammar can be transformed
-> mechanically into input acceptable to an automatic parser-
-> generator.") yet the copyright page contains the usual "No part
-> of this publication may be... stored in a retrieval system... in
-> any form or by any means..." etc. (No criticism of Robert; I'm
-> sure many others have done the same.) Any comments?
In article <660041 at hpclscu.HP.COM> shankar at hpclscu.HP.COM (Shankar Unni) writes:
>No, I don't see this as an ethical problem. This is where we draw the
>distinction between "an idea" and "the expression of an idea". In my
>opinion, a YACC grammar leans more towards an idea, rather than an
>expression thereof (after all, a grammar is not just a matter of opinion).
In fact a grammar is an expression of an idea. A language is an idea.
Given a language, there are an infinite number of grammars generating
the language (assuming that the language is of Type 0 or better).
Some grammars are better than others. Books generally give grammars
that are reasonably clear intuitively, to provide information in an
unambiguous manner, but these grammars are not especially good for
implementations (too slow, etc.). So the book here really should have
allowed the grammar in A13 to be typed in and used, because it assists
in teaching the reader. Write to the authors and ask for permission.
Maybe they'll give their grammar to the public domain.
--
Norman Diamond, Sony Computer Science Lab (diamond%csl.sony.jp at relay.cs.net)
The above opinions are claimed by your machine's init process (pid 1), after
being disowned and orphaned. However, if you see this at Waterloo, Stanford,
or Anterior, then their administrators must have approved of these opinions.
More information about the Comp.lang.c
mailing list