[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LPEG for C++
- From: Wesley Smith <wesley.hoke@...>
- Date: Sat, 19 Sep 2009 11:46:25 -0700
Here's a start on a C parser. Mostly useful for lists of expression
statements without things like structs, or branching/looping code:
On Sat, Sep 19, 2009 at 11:31 AM, David Manura <email@example.com> wrote:
> On Fri, Sep 18, 2009 at 8:48 AM, Peter Cawley wrote:
>> You might be interested in reusing some code I wrote recently. It is a
>> Lua/LPEG creation to parse C++ source files, extract information, and
>> then output it in wiki markup.
> For comparison, there's another LPeg-based C tokenizer at . There
> may be some issues using a C tokenizer as is on C++. For example,
> '::' is a C++ only token. Peter's supports that (mine doesn't) though
> doesn't appear to specially mark C++ keywords like 'try' and 'class'
> for example.
> Reliably parsing, not just lexing, C++ is no small feat. gccxml was
> discussed previously on this list . See also . Using the xml
> output option from Doxygen may be a fairly accessible solution that's
> good enough.
>  http://lua-users.org/wiki/LpegRecipes
>  http://www.gccxml.org/
>  http://lua-users.org/lists/lua-l/
>  http://stackoverflow.com/questions/526797/good-tools-for-creating-a-c-c-parser-analyzer