Re: parsing ISO C++(1998/2003)
- From: "Ira Baxter" <idbaxter@xxxxxxxxxxxxxx>
- Date: 26 Apr 2007 09:35:44 -0400
"Aaron Gray" <ang.usenet@xxxxxxxxx> wrote in message
<parthaspanda2005@xxxxxxxxx> wrote in message
No matter how many shots at it, I havent been
able to get bison/yacc to parse the C++ grammar
specified in the reference manual.
GLR (Bison has GLR) was ment to be the answer, although it is slow compared
to other techniques.
Elkhound and Elsa tried GLR approach and failed.
Failed? From what I hear, Elsa can parse virtually all of ANSI C++.
What's the failure, exactly?
All the major C++ parsers are hand coded, recursive decent and precedance
based binary ops.
Guess our DMS Software Reengineering Toolkit isn't a major C++ parser.
Nonetheless, it is NOT hand code. It uses
GLR to parse variety of C++ dialects (ANSI, GNU,
MS including 2005), with grammar rules taken pretty directly from
from ANSI standard (and adjusted according to dialects, etc.).
See http://www.semanticdesigns.com/Products/FrontEndsd/CppFrontEnds.html
How do I get the grammar in the manual
not to change much as well as pass under
bison/yacc?
Thats probably impossible.
Aaron
Use GLR. There are several proof by examples.
So this is very practical.
However, you'll find that there is an enormous amount of work to build
a working C++ front end above and beyond parsing.
If you think of parsing C++ as climbing foothills, getting the rest of
the front end right (preprocessor, name and type resolution, managing
the real dialects used, linking) is like climbing the Himalayas.
People don't seem to understand this very well. Maybe it because they
never get past parsing.
--
Ira Baxter, CTO
www.semanticdesigns.com
.
- Follow-Ups:
- Re: parsing ISO C++(1998/2003)
- From: Aaron Gray
- Re: parsing ISO C++(1998/2003)
- References:
- parsing ISO C++(1998/2003)
- From: parthaspanda2005
- Re: parsing ISO C++(1998/2003)
- From: Aaron Gray
- parsing ISO C++(1998/2003)
- Prev by Date: Re: C Hashmap implementation
- Next by Date: Re: SSA without phi
- Previous by thread: Re: parsing ISO C++(1998/2003)
- Next by thread: Re: parsing ISO C++(1998/2003)
- Index(es):
Relevant Pages
|
|