Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem: getRawSignature() returns empty string.
Problem: getRawSignature() returns empty string. [message #158232] Thu, 17 November 2005 06:12
Eclipse UserFriend
Hello,
I am trying to print out unpreprocessed code.
But the method getRawSignature(), does not behave as I expected after
reading it's description.

I use the following code to create a ASTTranslationUnit:

IASTTranslationUnit astTranslationUnit;
astTranslationUnit = CDOM.getInstance().getASTService()
.getTranslationUnit( file, CDOM.getInstance()

getCodeReaderFactory(CDOM.PARSE_SAVED_RESOURCES));
System.out.println("rawSignature: " +
astTranslationUnit.getRawSignature());

When the <file> contains the following:
int main(void){
int integer = 1;
return integer;
}

everything works fine and getRawSignature returns a String containing all
the sourcecode of the function. When I change the code to:

int main(void){
#define ONE 1
int integer = 1;
return integer;
}

everything is still okay. But when using the defined Symbol ONE in the
assignment as follows:

int main(void){
#define ONE 1
int integer = ONE;
return integer;
}

an empty String is returned by getRawSignature(). I need to get the symbols
instead of the preprocessed values of defines in different situations.
But everytime a defined symbol is used in whatever manner an empty String
is
returned.
Can someone give me an advice how to access unpreprocessed code?

Regards
Tobi
Previous Topic:Parser: Variable Update Event
Next Topic:Standard make: 'Build path' does not work
Goto Forum:
  


Current Time: Thu Jul 17 21:41:37 EDT 2025

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

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

Back to the top