Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Indexer advice

Alex,
I think I gave a good summary on what you need to do for 
Objective C integration here: 
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg14431.html 

For indexing it would be points 1-4:
1) An AST:
    * You'll need to define all the interfaces necessary to represent
the syntax of Objective C. You can probably
       reuse the interfaces for plain C and extend/add addtional ones as
requried.
    * You need interfaces to represent the bindings.
    see packages: org.eclipse.cdt.core.dom.ast,
org.eclipse.cdt.core.dom.ast.c
    
    * You need an implementation for the interfaces. Again you can
probably reuse the implementation for plain
       C and add what's needed. You will have to do your own IASTName,
IASTTranslationUnit and all the bindings 
       because these interfaces return the linkage they belong to.
    see packages: org.eclipse.cdt.internal.core.dom.parser,
org.eclipse.cdt.internal.core.dom.parser.c
 
2) A parser to create the AST:
    You probably want to reuse CPreprocessor (you'll need some
extensions) for preprocessing. To do the 
    grammar you have the choice between extending the LR-parser for C or
extending 
    AbstractGnuSourceCodeParser or even GNUCSourceParser. 
 
3) Semantics:
   * Name resolution is started from IASTName. You need to link your
ast-names to the name-resolution 
     algorthms.
   see: CVisitor
 
4) Persistance:
   * For your bindings you need two other implementations: One for the
pdom and one for the composite index:
   see packages org.eclipse.cdt.internal.core.pdom.c,
org.eclipse.cdt.internal.core.index.composite.c
   * Your implementation of ILinkage in this context (extenstion to
PDOMLinkage) will take care of mapping 
     bindings from the ast to the index.
 
Markus.


> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Alex Blewitt
> Sent: Thursday, July 16, 2009 8:49 AM
> To: CDT General developers list.
> Subject: [cdt-dev] Indexer advice
> Importance: Low
> 
> In order to start working on a number of features, I need to 
> get indexer support working in objectiveclipse. Since a lot 
> of this is driven by types which don't exist in the base 
> CDT's indexer, what's the best way forward? It doesn't look 
> like I can extend the set of indexed types with the current 
> indexer  - does this mean I need to roll my own?
> 
> Lastly, obj-c has some interesting naming conventions for methods.  
> Wheras c/c++ have a single token <-> name mapping, that's not 
> the case for obj-c in all but the simple case. A method might 
> have the signature 
> doSomething:withSomething:andSomethingElse: but exist in a 
> call as [obj doSomething:1 withSomething:2 andSomethingElse: 
> 3] (c.f.  
> definition).
> 
> The hyperlinking does highlight the single token (which is 
> probably OK from a UI perspective) but the jump-to-index 
> needs to be aware of the full name (since it's possible that 
> like Java methods, they may be overloaded with different 
> numbers of arguments).
> 
> I'd appreciate your advice on the way I should go forwards with this.
> 
> Alex
> 
> Sent from my (new) iPhone
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 


Back to the top