<blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">For a LL(1) parser, it might be a little bit difficult to parse complex
grammar like C++, but it might work.<br></blockquote><br>ANTLR is an LL(*) parser, i.e. it will resolve parsing ambiguities by looking ahead as many tokens required in order to choose the correct alternative. Of course, you can fix the lookahead for ANTLR within the preamble of the grammar.<br>
<br>As I mentioned earlier I think the C++ grammar I linked to is *pretty* good, but then Vikram wants something more end-to-end based on his response to my comment.<br clear="all"><br>Granville<br>
<br><br><div class="gmail_quote">2009/7/11 Mai, Haohui <span dir="ltr"><<a href="mailto:haohui.mai@gmail.com">haohui.mai@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  

<div text="#000000" bgcolor="#ffffff">
For a LL(1) parser, it might be a little bit difficult to parse complex
grammar like C++, but it might work.<br>
<br>
ANTLR worked great when other codes were written in Java, but it was a
little bit painful when using other languages like python.<br>
<br>
I worked on it two years ago. I guess they might have some improvement
now.<br><font color="#888888">
<br>
Haohui</font><div><div></div><div class="h5"><br>
<br>
On 07/11/2009 02:40 PM, Vikram S. Adve wrote:
</div></div><blockquote type="cite"><div><div></div><div class="h5">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,<br>
  <div> <span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="word-wrap: break-word;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
  <div style="font-family: Helvetica;"><span style="font-family: Arial;"><font size="3"><span style="font-size: 12px;"><br>
--Vikram</span></font></span></div>
  <div><font face="Arial"><i><font size="3"><span style="font-size: 12px;">Associate Professor, Computer Science</span></font></i></font></div>
  <div><font face="Arial"><i><font size="3"><span style="font-size: 12px;">University of Illinois at Urbana-Champaign</span></font></i></font></div>
  <div><font face="Arial"><i><font size="3"><span style="font-size: 12px;"><a href="http://llvm.org/%7Evadve" target="_blank">http://llvm.org/~vadve</a></span></font></i></font></div>
  <div><br>
  </div>
  <div><font face="Arial" size="3"><span style="font-size: 12px;"><i>P.S.   Sorry for
the spam. I know this question is not directly LLVM related but it is
peripherally related and this list is the best source I could think of
for C++ parsing experience.</i></span></font></div>
  </span></div>
  </span></div>
  </span></div>
  </span></div>
  </span></div>
  </span></div>
  </span></div>
  </span></div>
  </span></span></div>
  </span></div>
  </span></div>
  </div></div><pre><hr size="4" width="90%"><div class="im">
_______________________________________________
LLVM Developers mailing list
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
  </div></pre>
</blockquote>
<br>
</div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br>