[
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
"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
![]()
From: | ![]()
"Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx> |
![]()
To: | ![]()
"CDT General developers list." <cdt-dev@xxxxxxxxxxx> |
![]()
Date: | ![]()
05/20/2010 11:06 AM |
![]()
Subject: | ![]()
RE: [cdt-dev] Invoking the DOM parser |
![]()
Sent by: | ![]()
cdt-dev-bounces@xxxxxxxxxxx |
Hi,
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
details:
// For CDT 7.0, similar in previous releases
ILanguage lang= GPPLanguage.getDefault();
IncludeFileContentProvider fileCreator=
SavedFilesProvider.getInstance();
IScannerInfo scannerInfo= new ExtendedScannerInfo();
FileContent content=
FileContent.createForExternalFileLocation("c:/...");
IParserLogService log= new DefaultLogService();
IASTTranslationUnit ast= lang.getASTTranslationUnit(content,
scannerInfo,
fileCreator, null, 0, log);
Markus.
> -----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
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
>
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
![GIF image](gifSZBwepMplt.gif)
![GIF image](gifpxUflMnOnC.gif)