[net.sources] Pascal diagrams in Grogono book.

mike@WISDOM.BITNET (Mike Trachtman) (02/21/86)

Having written a parser for Pascal, (which I am not free to release),
I must say that the diagrams in Grogono are incomplete,
and somewhat wrong.  They are pretty good, but they did goof up
in one or two places, and also there are certain keyworkds
that were not defined. (the different types of identifiers for example)

Secondly, Any given Pascal is unlikely to be like real Pascal,
since most real pascals, allow including files, modules,
compile listing control, and ...
Some of them are also less strict about placement of semi-colons,
allowing one to put them and end of statements, not only
as statement separators.

Thus if the point of having a description, is to write a preprocessor
for the language, one should realize that published context free
grammars are only a starting point for the syntax, after
which it is more of a challenge, to figure out the tiny details,
of what your compiler really accepts. (As you do not want your compiler
(I mean preprocessor) to refuse things, that the subsequent compiler
would accept.)

There is also the problem of convincing yacc to accept your grammar
w/o shift/reduce conflicts, when there aren't any, but a few days
fighting with the beast will accomplish that.
(the only shift/reduce conflict I was not able to eliminate is the
standard 'if then else if' conflict.

mike

                                Mike Trachtman
My address:

        mike@wisdom                             (BITNET)
        mike%wisdom.bitnet@wiscvm.ARPA          (ARPA/CSNET)
        mike%wisdom.bitnet@berkley              (ARPA/CSNET)
and if all else fails (ONLY for VERY short items)
        ...!decvax!humus!wisdom!mike            (UUCP)