mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 16:05:25 +02:00
Code streamlining.
Change-Id: Iaafe325b1c984b4246bd80b3b80a4f08c612d32a
This commit is contained in:
parent
a8d768376d
commit
739bc922cf
2 changed files with 11 additions and 12 deletions
|
@ -24,20 +24,20 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
*/
|
*/
|
||||||
public interface ICPPASTTemplateId extends ICPPASTName, IASTNameOwner {
|
public interface ICPPASTTemplateId extends ICPPASTName, IASTNameOwner {
|
||||||
/**
|
/**
|
||||||
* TEMPLATE_NAME is the IASTName.
|
* The template name in the template ID.
|
||||||
*/
|
*/
|
||||||
public static final ASTNodeProperty TEMPLATE_NAME = new ASTNodeProperty(
|
public static final ASTNodeProperty TEMPLATE_NAME = new ASTNodeProperty(
|
||||||
"ICPPASTTemplateId.TEMPLATE_NAME - TemplateId Name"); //$NON-NLS-1$
|
"ICPPASTTemplateId.TEMPLATE_NAME - TemplateId Name"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the name.
|
* Returns the name.
|
||||||
*
|
*
|
||||||
* @return {@code IASTName}
|
* @return {@code IASTName}
|
||||||
*/
|
*/
|
||||||
public IASTName getTemplateName();
|
public IASTName getTemplateName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name.
|
* Sets the name.
|
||||||
*
|
*
|
||||||
* @param name {@code IASTName}
|
* @param name {@code IASTName}
|
||||||
*/
|
*/
|
||||||
|
@ -50,9 +50,10 @@ public interface ICPPASTTemplateId extends ICPPASTName, IASTNameOwner {
|
||||||
"ICPPASTTemplateId.TEMPLATE_ID_ARGUMENT - TemplateId Argument"); //$NON-NLS-1$
|
"ICPPASTTemplateId.TEMPLATE_ID_ARGUMENT - TemplateId Argument"); //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant.
|
* @deprecated Use IASTNode.EMPTY_NODE_ARRAY instead.
|
||||||
*/
|
*/
|
||||||
public static final IASTNode[] EMPTY_ARG_ARRAY = {};
|
@Deprecated
|
||||||
|
public static final IASTNode[] EMPTY_ARG_ARRAY = IASTNode.EMPTY_NODE_ARRAY;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds template argument.
|
* Adds template argument.
|
||||||
|
|
|
@ -39,7 +39,7 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor;
|
||||||
*/
|
*/
|
||||||
public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateId, IASTAmbiguityParent {
|
public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateId, IASTAmbiguityParent {
|
||||||
private IASTName templateName;
|
private IASTName templateName;
|
||||||
private IASTNode[] templateArguments;
|
private IASTNode[] templateArguments = IASTNode.EMPTY_NODE_ARRAY;
|
||||||
|
|
||||||
public CPPASTTemplateId() {
|
public CPPASTTemplateId() {
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateI
|
||||||
|
|
||||||
private void internalAddTemplateArgument(IASTNode node) {
|
private void internalAddTemplateArgument(IASTNode node) {
|
||||||
assertNotFrozen();
|
assertNotFrozen();
|
||||||
templateArguments = ArrayUtil.append(IASTNode.class, templateArguments, node);
|
templateArguments = ArrayUtil.append(templateArguments, node);
|
||||||
if (node != null) {
|
if (node != null) {
|
||||||
node.setParent(this);
|
node.setParent(this);
|
||||||
node.setPropertyInParent(TEMPLATE_ID_ARGUMENT);
|
node.setPropertyInParent(TEMPLATE_ID_ARGUMENT);
|
||||||
|
@ -115,9 +115,7 @@ public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IASTNode[] getTemplateArguments() {
|
public IASTNode[] getTemplateArguments() {
|
||||||
if (templateArguments == null)
|
return ArrayUtil.trim(templateArguments);
|
||||||
return ICPPASTTemplateId.EMPTY_ARG_ARRAY;
|
|
||||||
return ArrayUtil.trim(IASTNode.class, templateArguments);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -196,12 +194,12 @@ public class CPPASTTemplateId extends CPPASTNameBase implements ICPPASTTemplateI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDeclaration() {
|
public boolean isDeclaration() {
|
||||||
return false; //for now this seems to be true
|
return false; // For now this seems to be true.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isReference() {
|
public boolean isReference() {
|
||||||
return true; //for now this seems to be true
|
return true; // For now this seems to be true.
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue