Problem: getRawSignature() returns empty string. [message #158232] |
Thu, 17 November 2005 06:12 |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.40004 seconds