Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Invoking the DOM parser

I will add that you can use the parser and indexer standalone, if you are willing to do some work to build it. If you want to see how to build such a jar look in the PTP project's CVS under org.eclipse.ptp/rdt/org.eclipse.ptp.rdt.core.remotejars

Chris Recoskie
Team Lead, IBM CDT and RDT
IBM Toronto

Inactive hide details for "Schorn, Markus" ---05/20/2010 11:06:38 AM---Hi, The parser does not run (at least not out of the box"Schorn, Markus" ---05/20/2010 11:06:38 AM---Hi, The parser does not run (at least not out of the box) outside of the


"Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx>


"CDT General developers list." <cdt-dev@xxxxxxxxxxx>


05/20/2010 11:06 AM


RE: [cdt-dev] Invoking the DOM parser

Sent by:


The parser does not run (at least not out of the box) outside of the
eclipse environment. You best use create an eclipse plugin for your code
and run it together with the cdt-plugins in an eclipse application.

I recommend creating a CDT project containing your code. With that
creating an AST is easy: ITranslationUnit.getAST(...).

If that is not an option for you, you have to deal with a bunch of
  // For CDT 7.0, similar in previous releases
  ILanguage lang= GPPLanguage.getDefault();
  IncludeFileContentProvider fileCreator=
  IScannerInfo scannerInfo= new ExtendedScannerInfo();
  FileContent content=
  IParserLogService log= new DefaultLogService();
  IASTTranslationUnit ast= lang.getASTTranslationUnit(content,
                       fileCreator, null, 0, log);


> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx
> [
mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Stefan Holdermans
> Sent: Thursday, May 20, 2010 4:19 PM
> To: cdt-dev@xxxxxxxxxxx
> Subject: [cdt-dev] Invoking the DOM parser
> Importance: Low
> Hi all,
> Can someone provide me with some pointers on how to invoke
> the CDT DOM parser on an arbitrary C source file on disc?
> Searching Google has left me with some hints, but so far I
> haven't been able to put together anything useful.
> It seems that I should start off by constructing a
> CodeReader. But where do I find the .class file for
> CodeReader, i.e., which .jar file do I have to include in my project?
> Thanks in advance,
>   Stefan_______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
cdt-dev mailing list

GIF image

GIF image

Back to the top