Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Adding c extensions - AbstractCLanguage etc

If all you want is for certain identifiers to be syntax highlighted, then I
believe you have to override AbstractCLanguage.getKeywords() and extend the
'org.eclipse.cdt.core.language' extension point.

Then there is the issue with language mappings. If you have your ILanguage
and GCCLanguage both mapped to the same content type then it appears that
gcc will take precedence. You can manually associate your language with the
c content type by using the Language Mappings section of the project
properties page. I'm not an expert on this, maybe someone else can
elaborate more on how language mappings work.

Now, if what you want is to extend C with new language constructs and AST
nodes, then that's a different story. The IBM CDT team is currently working
on a new C parser (C99 actually) that is highly extensible. It allows the
addition of new grammar rules and actions that build the AST.


Mike Kucera
IBM CDT Team
IBM Toronto Lab
905-413-3657
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] Adding c extensions - 
             04/23/2007 08:52          AbstractCLanguage etc           
             AM                                                        
                                                                       
                                                                       
             Please respond to                                         
               "CDT General                                            
             developers list."                                         
             <cdt-dev@eclipse.                                         
                   org>                                                
                                                                       
                                                                       




Hi,

I?m trying to add a few new keywords for our C-based language but I?d like
to re-use the CEditor. This looks like a simple case of extending
AbstractCLanguage and using custom parser and scanner configurations, then
associating this new language with the csource content type. This doesn?t
appear to work as the new keywords are not being highlighted, and I noticed
that CEditor uses CTextTools which uses a hard reference to GCCLanguage?
Will I have to create a new editor if I wish to add new keywords?

Thanks for any help,
Mike W_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top