[net.sources] Syntax descrs of PASCAL/C/FORTRAN in YACC

conradi%vax.runit.unit.uninett@NTA-VAX.ARPA (Reidar Conradi) (02/12/86)

Are such available? - reidar

gabriel@ANL-MCS.ARPA (John Gabriel) (02/17/86)

There is an LALR(1) grammar for "C" in an appendix to

"C" A Reference Manual; S.B. Harbison & G.L. Steele, pub Prentice Hall,
1985 page 333.

As far as PASCAL is concerned, the syntax diagrams in Jensen and Wirth
are isomorphic to prescriptions for recursive descent rcognition. I do
not know if they are complete. There is also an ANSI standard for
PASCAL describing both syntax and semantics, ANSI-IEEE 770X3.97-1983
PASCAL. The syntax diagrams in ANSI should be complete.

For FORTRAN 77 there is also an ANSI standard having syntax diagrams
ANSI X3.9-1978 FORTRAN.

I think the algorithm to convert syntax diagrams to parsers is described 
either by Jensen and Wirth or in Peter Grogono's book on PASCAL. I do
not have either at hand - they are at home together with my copy of
IEEE 770. There is also a book called "Standard PASCAL", whose author
I forget which may also publish a grammar.

I just found a copy of Grogono in my bookshelf. The conversion from
syntax diagrams to recursive descent is described on p108 et seq.
It's not the one I recollect so you might look in Jensen & Wirth.
Syntax diagrams are in Grogono p327 et seq. The book is "Programming
in PASCAL", revised edition, pub Addison Wesley 1980, 
ISBN 0-201-02775-5.

		Sincerely
					John Gabriel