Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » parsing the c program using cdt(externally using eclipse cdt to parse the c program examples)
parsing the c program using cdt [message #1826944] Tue, 05 May 2020 05:59 Go to next message
Rama krishna is currently offline Rama krishnaFriend
Messages: 3
Registered: May 2020
Junior Member
i want to write a java program which will use the eclipse cdt as dependency and parse the c program and get all the details of the program,

for ex:

the global variables , methods with arguments, and local variables to that methods in hierarchical structure,

could you please give me some guidance of how i can write the java program by using cdt to process the c program.

Thanks in advance

[Updated on: Thu, 07 May 2020 06:04]

Report message to a moderator

Re: parsing the c program using cdt [message #1827231 is a reply to message #1826944] Mon, 11 May 2020 07:45 Go to previous messageGo to next message
Rama krishna is currently offline Rama krishnaFriend
Messages: 3
Registered: May 2020
Junior Member
Rama krishna wrote on Tue, 05 May 2020 05:59
i want to write a java program which will use the eclipse cdt as dependency and parse the c program and get all the details of the program,

for ex:

the global variables , methods with arguments, and local variables to that methods in hierarchical structure,

could you please give me some guidance of how i can write the java program by using cdt to process the c program.

Thanks in advance



have tried the below thing for getting all the included header file details IASTPreprocessorIncludeStatement[] includes = translationUnit.getIncludeDirectives();
For all the method and variable info. i have below implementation IASTDeclaration[] declaration = translationUnit.getDeclarations(); for(IASTDeclaration dec : declaration) {
for(IASTNode node : dec.getChildren()) { System.out.println("func "+node); } } but that's not addressed my requirement to get the method names first and then calling the local variables with its data types from that method object. Any help will be appreciated
Re: parsing the c program using cdt [message #1827232 is a reply to message #1826944] Mon, 11 May 2020 07:45 Go to previous message
Rama krishna is currently offline Rama krishnaFriend
Messages: 3
Registered: May 2020
Junior Member
Rama krishna wrote on Tue, 05 May 2020 05:59
i want to write a java program which will use the eclipse cdt as dependency and parse the c program and get all the details of the program,

for ex:

the global variables , methods with arguments, and local variables to that methods in hierarchical structure,

could you please give me some guidance of how i can write the java program by using cdt to process the c program.

Thanks in advance



have tried the below thing for getting all the included header file details IASTPreprocessorIncludeStatement[] includes = translationUnit.getIncludeDirectives();
For all the method and variable info. i have below implementation IASTDeclaration[] declaration = translationUnit.getDeclarations(); for(IASTDeclaration dec : declaration) {
for(IASTNode node : dec.getChildren()) { System.out.println("func "+node); } } but that's not addressed my requirement to get the method names first and then calling the local variables with its data types from that method object. Any help will be appreciated
Previous Topic:Possible reasons for being unable to add Memory monitors?
Next Topic:Downloaded Eclipse CDT for Mac, can't compile: No Binaries, CMake not found, CMake config errors
Goto Forum:
  


Current Time: Thu Apr 25 10:57:43 GMT 2024

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

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

Back to the top