Right, I understand that. I was hoping there was such an implementation using ANTLR since it looks like a fairly mature project. I'm not sure how stable or mature Elsa is (but comments to clarify that would be appreciated.). E.g., a quick scan of their Web page shows the comment that they only have a partial type checker. It also says their template instantiation is incomplete. --Vikram Associate Professor, Computer Science University of Illinois at Urbana-Champaign http://llvm.org/~vadve On Jul 11, 2009, at 3:23 PM, Chris Lattner wrote:> > On Jul 11, 2009, at 12:40 PM, Vikram S. Adve wrote: > >> We are looking for an open source C++ parser other than g++ if >> possible. Clang would be great but its C++ support is still some >> way away and we need something that works or nearly works now. Does >> anyone have any experience with ANTLR for parsing C++ and for >> extending their C++ parser? Any other feedback on ANTLR in general >> would be welcome too. Thanks, > > You need a lot more than a traditional parser to parse c++, you have > to do full template instantiation, partial template specialization etc > just to be able to correctly parse it. The "best answer" if you need > something ASAP is to use Elsa. > > -Chris > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090711/1d81c660/attachment.html>
On Jul 11, 2009, at 1:41 PM, Vikram S. Adve wrote:> Right, I understand that. I was hoping there was such an > implementation using ANTLR since it looks like a fairly mature > project.Not that I'm aware of.> I'm not sure how stable or mature Elsa is (but comments to clarify > that would be appreciated.). E.g., a quick scan of their Web page > shows the comment that they only have a partial type checker. It > also says their template instantiation is incomplete.Elsa definitely has its share of problems, but it is the best answer if you don't want to use G++. -Chris
Chris Lattner wrote:> On Jul 11, 2009, at 1:41 PM, Vikram S. Adve wrote: > >> Right, I understand that. I was hoping there was such an >> implementation using ANTLR since it looks like a fairly mature >> project. > > Not that I'm aware of. > >> I'm not sure how stable or mature Elsa is (but comments to clarify >> that would be appreciated.). E.g., a quick scan of their Web page >> shows the comment that they only have a partial type checker. It >> also says their template instantiation is incomplete. > > Elsa definitely has its share of problems, but it is the best answer > if you don't want to use G++. > > -ChrisI'm not sure if it mature enough to meet your needs, but I've been working on a fork of Elsa for a while now. Definitely a work in progress. It is pretty much stock Elsa, except: * It uses clang's file handling, preprocessor, and error reporting mechanisms. * It uses the LLVM back end for optimization and code generation. * It handles just about all of C now and a bit of C++. * The driver program is gcc-ish and supports many of the gcc command line arguments. * It can call all of the LLVM code generators out of the box. I can't really characterize how much C++ it can do yet: I've been more interested in getting it to work with LLVM and the clang bits. I know it can parse a lot of C++. I'm missing support for code generation for some of the C++ parts of the AST. It is a part time project, so my progress hasn't been as fast as I'd like. You DPJ project sound exactly like what I've been hoping to do eventually with my project, except I'd also like to throw in heterogeneous multiprocessing support. http://ellcc.org Most of the information, such as it is, is on the wiki: http::/ellcc.org/wiki -Rich