Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » CDT Parser standalone(Utilisation du parser C/C++ de CDT afin d'accéder à l'AST d'un code source)
CDT Parser standalone [message #790151] Fri, 03 February 2012 17:12 Go to next message
Eclipse UserFriend
Bonjour,

Je suis sur un projet qui consiste en la génération d'un modèle de description de code source afin de détecter des patrons de conception dans celui-ci. Pour ce faire j'ai besoin de parcourir les différentes informations d'un code source (déclaration de classe, d'attributs, de méthodes, les invocations de méthodes...). J'essaye d'utiliser le parser de CDT car parcourir un AST me simplifierai grandement la vie, seulement je ne trouve aucune façon de faire ni de documentation qui me permettent d'accéder à cet AST sans passer par le biais d'un plugin.

Est-ce que quelqu'un saurait me dire comment je dois faire pour pouvoir utiliser le parser CDT en dehors d'Eclipse sur des fichiers qui ne sont pas dans un projet Eclipse ?

Merci d'avance.
Re: CDT Parser standalone [message #791822 is a reply to message #790151] Mon, 06 February 2012 04:51 Go to previous messageGo to next message
Eclipse UserFriend
Il faudrait poser la question en anglais...
Re: CDT Parser standalone [message #792112 is a reply to message #791822] Mon, 06 February 2012 11:25 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

I'm on a project that involves the generation of a model description of the source code to detect design patterns in it. To do this I need to navigate through the information of source code (class declaration, attributes, methods, method invocations ...). I try to use the CDT parser through an AST because I will simplify life much, only I can find no way to do or documentation that allow me to access the AST without going through a plugin.

Will someone tell me how can I do to use the parser outside of Eclipse CDT on files that are not in an Eclipse project?

Thank you in advance.
Re: CDT Parser standalone [message #792288 is a reply to message #792112] Mon, 06 February 2012 15:58 Go to previous message
Eclipse UserFriend
Quote:

Will someone tell me how can I do to use the parser outside of Eclipse CDT on files that are not in an Eclipse project?


I guess that this is not provided by CDT, but I'm not absolutely sure.

But maybe you could use clang for this purpose!? (Please Google for clang).

In a clang document i found this:

"clang has an xml writer for the AST. This can be used to print the AST for a translation unit into a file or to the standard output."

Regards,
Klaus
Previous Topic:CDT versus MS Visual C++
Next Topic:Install Eclipse Indigo
Goto Forum:
  


Current Time: Sun Jul 13 09:50:17 EDT 2025

Powered by FUDForum. Page generated in 0.04850 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top