mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 08:55:25 +02:00
Applied patch for Devin Steffler.
patch includes: - made getUnpreprocessedSignature public in IASTNode - refactored it to be named getRawSignature
This commit is contained in:
parent
bd12de3806
commit
f1b89e7b94
8 changed files with 22 additions and 12 deletions
|
@ -123,6 +123,6 @@ public interface IASTDeclSpecifier extends IASTNode {
|
|||
*
|
||||
* @return String
|
||||
*/
|
||||
public String getUnpreprocessedSignature();
|
||||
public String getRawSignature();
|
||||
|
||||
}
|
||||
|
|
|
@ -82,5 +82,15 @@ public interface IASTNode {
|
|||
* @return continue on (true) or quit( false )
|
||||
*/
|
||||
public boolean accept(ASTVisitor visitor);
|
||||
|
||||
/**
|
||||
* Returns the raw signature of the IASTNode before it is processed by the preprocessor.
|
||||
*
|
||||
* Example:
|
||||
* #define ONE 1
|
||||
* int x=ONE; // getRawSignature() for this declaration would return "int x=ONE;"
|
||||
* @return the raw signature of the IASTNode before it is processed by the preprocessor
|
||||
*/
|
||||
public String getRawSignature();
|
||||
|
||||
}
|
||||
|
|
|
@ -64,9 +64,9 @@ public abstract class ASTNode implements IASTNode {
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTNode#getUnpreprocessedSignature()
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTNode#getRawSignature()
|
||||
*/
|
||||
public String getUnpreprocessedSignature() {
|
||||
public String getRawSignature() {
|
||||
return getTranslationUnit().getUnpreprocessedSignature( getNodeLocations() );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,9 +113,9 @@ public class CASTCompositeTypeSpecifier extends CASTBaseDeclSpecifier implements
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getUnpreprocessedSignature()
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getRawSignature()
|
||||
*/
|
||||
public String getUnpreprocessedSignature() {
|
||||
public String getRawSignature() {
|
||||
return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -82,9 +82,9 @@ public class CASTEnumerationSpecifier extends CASTBaseDeclSpecifier implements
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getUnpreprocessedSignature()
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getRawSignature()
|
||||
*/
|
||||
public String getUnpreprocessedSignature() {
|
||||
public String getRawSignature() {
|
||||
return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,9 @@ public class CPPASTCompositeTypeSpecifier extends CPPASTBaseDeclSpecifier
|
|||
private IScope scope;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getUnpreprocessedSignature()
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getRawSignature()
|
||||
*/
|
||||
public String getUnpreprocessedSignature() {
|
||||
public String getRawSignature() {
|
||||
return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -96,9 +96,9 @@ public class CPPASTEnumerationSpecifier extends CPPASTBaseDeclSpecifier
|
|||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getUnpreprocessedSignature()
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier#getRawSignature()
|
||||
*/
|
||||
public String getUnpreprocessedSignature() {
|
||||
public String getRawSignature() {
|
||||
return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ public class DOMASTNodeLeaf implements IAdaptable {
|
|||
} else if( node instanceof IASTDeclSpecifier )
|
||||
{
|
||||
buffer.append( START_OF_LIST );
|
||||
buffer.append( ((IASTDeclSpecifier)node).getUnpreprocessedSignature() );
|
||||
buffer.append( ((IASTDeclSpecifier)node).getRawSignature() );
|
||||
return buffer.toString();
|
||||
} else if ( node instanceof IASTPreprocessorIncludeStatement ) {
|
||||
String path = ((IASTPreprocessorIncludeStatement)node).getPath();
|
||||
|
|
Loading…
Add table
Reference in a new issue