From: Shigeru C. <ch...@is...> - 2003-04-25 17:27:26
|
Hi Larry, Date: Fri, 25 Apr 2003 12:23:53 -0600 From: Larry Evans <jca...@pr...> To: op...@cs... Subject: why no compiler-compiler to gen occ? > After downloading 2.6.1 and looking at the source files, I noticed > there's no use of any kind of compiler-compiler such as antlr or > yacc. The source code in parse.h looks like it could be generated > by antlr (since it's recursive decent); hence, I'm wondering why > antlr or something like it wasn't used. The reason is simple. Yacc, LALR(1), cannot parse C++ programs without awkward tricks of the lexical analyzer. ANTLR was not very popular when OpenC++ was written in around 1995 (at least, I didn't know it.) The final reason is that writing an LL(k) with-back-tracking parser by hand is easy. At that time, I thought I should not have wasted time for finding some nice compiler-compiler but started writing a parser by hand. If I rewrite OpenC++ today, hmm.. I might use ANTLR. I don't know. Chiba |