Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!ukc!stl!pgh From: pgh@stl.stc.co.uk (Peter Hamer) Newsgroups: comp.lang.c++ Subject: Lex/Yacc of C++ -- or even BNF Keywords: Lex, Yacc, C++ Message-ID: <1615@stl.stc.co.uk> Date: 25 Jul 89 09:45:47 GMT References: <5581@pt.cs.cmu.edu> Sender: news@stl.stc.co.uk Reply-To: "Peter Hamer" Organization: STC Technology Limited, London Road, Harlow, Essex, UK Lines: 24 I too would very much like a Lex/Yacc grammar of C++. BUT, failing this, I would welcome pointers to reasonably precise descriptions of the C++ grammar and/or or its differences from that of C. Obviously I would also appreciate warnings about over-simplified grammars [cf K&R for C :-)]. The only information I have on the C++ grammar at the moment is in Stroustrup's book (July 87 reprint). BTW for anybody intending to develop lex/yacc for C++. 1) I believe that the best source for a C grammar is Harbison & Steele. 2) A little while back somebody posted a lex/yacc grammar for (ANSA?) C to this group. Has anyone considered starting with the gnu C++ compiler, and doing one of the following? 1) Reverse-engineering the grammar. 2) Modifying the parser to produce the required output. 3) Using the parser as-is and manipulating (or unparsing) the syntax tree to produce the required output. Peter