1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 21:35:40 +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:
John Camelon 2005-04-08 17:58:25 +00:00
parent bd12de3806
commit f1b89e7b94
8 changed files with 22 additions and 12 deletions

View file

@ -123,6 +123,6 @@ public interface IASTDeclSpecifier extends IASTNode {
* *
* @return String * @return String
*/ */
public String getUnpreprocessedSignature(); public String getRawSignature();
} }

View file

@ -82,5 +82,15 @@ public interface IASTNode {
* @return continue on (true) or quit( false ) * @return continue on (true) or quit( false )
*/ */
public boolean accept(ASTVisitor visitor); 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();
} }

View file

@ -64,9 +64,9 @@ public abstract class ASTNode implements IASTNode {
} }
/* (non-Javadoc) /* (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() ); return getTranslationUnit().getUnpreprocessedSignature( getNodeLocations() );
} }
} }

View file

@ -113,9 +113,9 @@ public class CASTCompositeTypeSpecifier extends CASTBaseDeclSpecifier implements
} }
/* (non-Javadoc) /* (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$ return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
} }

View file

@ -82,9 +82,9 @@ public class CASTEnumerationSpecifier extends CASTBaseDeclSpecifier implements
} }
/* (non-Javadoc) /* (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$ return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
} }

View file

@ -27,9 +27,9 @@ public class CPPASTCompositeTypeSpecifier extends CPPASTBaseDeclSpecifier
private IScope scope; private IScope scope;
/* (non-Javadoc) /* (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$ return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
} }

View file

@ -96,9 +96,9 @@ public class CPPASTEnumerationSpecifier extends CPPASTBaseDeclSpecifier
/* /*
* (non-Javadoc) * (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$ return getName().toString() == null ? "" : getName().toString(); //$NON-NLS-1$
} }

View file

@ -163,7 +163,7 @@ public class DOMASTNodeLeaf implements IAdaptable {
} else if( node instanceof IASTDeclSpecifier ) } else if( node instanceof IASTDeclSpecifier )
{ {
buffer.append( START_OF_LIST ); buffer.append( START_OF_LIST );
buffer.append( ((IASTDeclSpecifier)node).getUnpreprocessedSignature() ); buffer.append( ((IASTDeclSpecifier)node).getRawSignature() );
return buffer.toString(); return buffer.toString();
} else if ( node instanceof IASTPreprocessorIncludeStatement ) { } else if ( node instanceof IASTPreprocessorIncludeStatement ) {
String path = ((IASTPreprocessorIncludeStatement)node).getPath(); String path = ((IASTPreprocessorIncludeStatement)node).getPath();