Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
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
org.eclipse.cdt.internal.core.dom.parser.c99,
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 just
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 during
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 if
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 about
using the C preprocessor).


Mike Kucera
Software Developer
IBM CDT Team, Toronto
mkucera@xxxxxxxxxx




                                                                       
             "Michael                                                  
             Wrighton"                                                 
             <mikew@clearspeed                                          To
             .com>                     "CDT General developers list."  
             Sent by:                  <cdt-dev@xxxxxxxxxxx>           
             cdt-dev-bounces@e                                          cc
             clipse.org                                                
                                                                   Subject
                                       [cdt-dev] c99 parser build      
             07/10/2007 11:39                                          
             AM                                                        
                                                                       
                                                                       
             Please respond to                                         
               "CDT General                                            
             developers list."                                         
             <cdt-dev@eclipse.                                         
                   org>                                                
                                                                       
                                                                       




Hi,

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 get
started on my own C-based language. I?ve got the latest CDT checked out but
all I can see is a rather small org.eclipse.cdt.releng/c99/ directory?

Thanks
Mike Wrighton_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top