Thanks Hans, but I am not really looking for a C++ grammar. I need to write a parser for some other object oriented language, which is as complex as C++/Java.
And to complicate the matter further, this langauge has special constructs that doesn't allow me to use the symbol table for distinguishing between type and non-type identifier references. In other words, I will have to return just one lexical token (say IDENTIFIER) from the lexer for both type references as well as non-type variable references. Given these restrictions, I was wondering if writing a yacc/bison based LALR(1) parser is really an (good) option for me. Arijit On Fri, Aug 17, 2012 at 7:22 PM, Hans Aberg <haber...@telia.com> wrote: > On 17 Aug 2012, at 07:47, A D wrote: > > > I need to write a parser for a programming langauge which is as complex > as > > C++, and to even complicate the matter, there are constructs in this > > langauge that doesn't allow me to use type/identifier dis-ambiguating > lexer > > hack. In other words, I will have to return just one lexical token (say > > IDENTIFIER) from the lexer for both type references as well as non-type > > variable references. > > > > Given these restrictions, I was wondering if it would be a wise decision > > (or if it is even possoble) to use yacc/bison for my parser (given that I > > may not have the flexibility to use GLR for performance reasons)…? > > You might check with the Usenet newsgroup comp.compilers. > > At least an earlier revision of C++ is Yaccable: > http://www.parashift.com/c++-faq-lite/yaccable-grammar.html > > Hans > > > _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison