Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Using CDT parser seperate from Eclipse(Using Index without Eclipse workspace and project)
Using CDT parser seperate from Eclipse [message #1753708] Thu, 09 February 2017 08:10 Go to next message
UiGyun Jeong is currently offline UiGyun JeongFriend
Messages: 2
Registered: February 2017
Junior Member
To analyze C++ source code which is in my server, I need to use CDT Parser apart from Eclipse.

Is there any good way for doing semantic analysis?
By using below code I succeeded syntactic analysis only.

IScannerInfo scanInfo = new ScannerInfo();
IParserLogService log = new DefaultLogService();
IncludeFileContentProvider fileCreator= IncludeFileContentProvider.getEmptyFilesProvider();
IIndex index = null;
int options = 8;
reader = FileContent.createForExternalFileLocation("fullPath");

GPPLanguage.getDefault().getASTTranslationUnit(reader, scanInfo, fileCreator, index, options, log)

I found out that the failure reason is index = null.

Because index object is managed by Eclipse WorkSpace, Project, creating index instance is so hard. (coupling)

Is there any good way to use Index without Eclipse workspace and project?
Re: Using CDT parser seperate from Eclipse [message #1754179 is a reply to message #1753708] Wed, 15 February 2017 05:05 Go to previous messageGo to next message
UiGyun Jeong is currently offline UiGyun JeongFriend
Messages: 2
Registered: February 2017
Junior Member
Self Reply

Doing c++ semantic analysis using CDT parser is possible. (without index)
By resolving binding it is possible.

The reason I can not resolve binding was I used IASTTranslationUnit.
By using ICPPASTTranslationUnit I can get binding object.
Re: Using CDT parser seperate from Eclipse [message #1815957 is a reply to message #1754179] Wed, 16 October 2019 01:56 Go to previous message
Federer Roger  is currently offline Federer Roger Friend
Messages: 30
Registered: December 2017
Member
I want to know how to do that (semantic analysis without index)?
Previous Topic:CMake project uses default (Ninja) project generator causing build failure
Next Topic:How can I get all TranslationUnits if I have a CProject?
Goto Forum:
  


Current Time: Tue Mar 19 08:45:37 GMT 2024

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

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

Back to the top