Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] c99 parser build

Thanks. Actually I'm implementing a CDT plugin that supports C but just
with a couple of additional type qualifiers, that's all. But I want
these to be properly displayed in the outline view etc so from what I've
read, using this new LPG mechanism seems like the cleanest way of doing

I had a go using the old method but it looked as though I would have to
extend ASTStringUtil, CmodelBuilder2, TranslationUnit and god knows what
else above that, just to get the new qualifier strings in the AST nodes.

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Mike Kucera
Sent: 10 July 2007 17:07
To: CDT General developers list.
Subject: Re: [cdt-dev] c99 parser build

The code for the C99 parser is in CVS under org.eclipse.cdt/C99.

There are three grammar files in the package
1) C99Lexer.g, the grammar file that defines how the character stream
should be lexed into tokens
2) C99Parser.g, specifies the C99 grammar
3) C99ExprEvaluator.g, the preprocessor expression evaluator is itself
implemented as an LPG parser, you can probably ignore this if you are
interested in the grammar of C99.

Keep in mind that CDT is an IDE and not a compiler, so our parsers work
differently from what you would expect in a front end for a compiler or
interpreter. In particular we don't keep track of any semantic info
the parse and we don't do any type-checking.

Are you implementing an extension to the C spec? or are you implementing
your own language and just using C for inspiration? I'm asking because
you are designing a new language from scratch I would heavily advise
against using C as your source for inspiration (and don't even think
using the C preprocessor).

Mike Kucera
Software Developer
IBM CDT Team, Toronto




             .com>                     "CDT General developers list."

             Sent by:                  <cdt-dev@xxxxxxxxxxx>


                                       [cdt-dev] c99 parser build

             07/10/2007 11:39




             Please respond to

               "CDT General

             developers list."






Could someone tell me how I can build/enable the c99 parser? Really I?m
interested in looking at the source and the c99 grammar file so I can
started on my own C-based language. I?ve got the latest CDT checked out
all I can see is a rather small org.eclipse.cdt.releng/c99/ directory?

Mike Wrighton_______________________________________________
cdt-dev mailing list

cdt-dev mailing list

Back to the top