1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Fixed a typo.

This commit is contained in:
Sergey Prigogin 2010-03-01 05:14:49 +00:00
parent af930f51f9
commit a71b6c6659
6 changed files with 96 additions and 84 deletions

View file

@ -44,14 +44,14 @@ public interface ICPPASTTemplateDeclaration extends IASTDeclaration {
"ICPPASTTemplateDeclaration.OWNED_DECLARATION - Subdeclaration maintained grammatically"); //$NON-NLS-1$
/**
* Get templated declaration.
* Get template declaration.
*
* @return <code>IASTDeclaration</code>
*/
public IASTDeclaration getDeclaration();
/**
* Set the templated declaration.
* Set the template declaration.
*
* @param declaration
* <code>IASTDeclaration</code>
@ -74,9 +74,15 @@ public interface ICPPASTTemplateDeclaration extends IASTDeclaration {
/**
* Add a template parameter.
*
* @param parm
* <code>ICPPASTTemplateParameter</code>
* @param parm <code>ICPPASTTemplateParameter</code>
* @since 5.2
*/
public void addTemplateParameter(ICPPASTTemplateParameter parm);
/**
* @deprecated Use addTemplateParameter.
*/
@Deprecated
public void addTemplateParamter(ICPPASTTemplateParameter parm);
/**

View file

@ -32,7 +32,8 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
private short nestingLevel= -1;
private IASTDeclaration declaration;
private ICPPTemplateScope templateScope;
private ICPPASTTemplateParameter[] parameters = null;
private int parametersPos= -1;
public CPPASTTemplateDeclaration() {
}
@ -46,7 +47,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
copy.setDeclaration(declaration == null ? null : declaration.copy());
copy.exported = exported;
for (ICPPASTTemplateParameter param : getTemplateParameters())
copy.addTemplateParamter(param == null ? null : param.copy());
copy.addTemplateParameter(param == null ? null : param.copy());
copy.setOffsetAndLength(this);
return copy;
}
@ -79,7 +80,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
return parameters;
}
public void addTemplateParamter(ICPPASTTemplateParameter parm) {
public void addTemplateParameter(ICPPASTTemplateParameter parm) {
assertNotFrozen();
if (parm != null) {
parameters = (ICPPASTTemplateParameter[]) ArrayUtil.append(ICPPASTTemplateParameter.class, parameters, ++parametersPos, parm);
@ -88,8 +89,11 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
}
}
private ICPPASTTemplateParameter [] parameters = null;
private int parametersPos=-1;
@Deprecated
public void addTemplateParamter(ICPPASTTemplateParameter param) {
addTemplateParameter(param);
}
@Override
public boolean accept(ASTVisitor action) {
if (action.shouldVisitDeclarations) {
@ -105,7 +109,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
if (!params[i].accept(action)) return false;
}
if( declaration != null ) if( !declaration.accept( action ) ) return false;
if (declaration != null && !declaration.accept(action)) return false;
if (action.shouldVisitDeclarations) {
switch (action.leave(this)) {
@ -124,8 +128,7 @@ public class CPPASTTemplateDeclaration extends ASTNode implements
}
public void replace(IASTNode child, IASTNode other) {
if( declaration == child )
{
if (declaration == child) {
other.setParent(child.getParent());
other.setPropertyInParent(child.getPropertyInParent());
declaration = (IASTDeclaration) other;

View file

@ -70,7 +70,7 @@ public class CPPASTTemplateSpecialization extends ASTNode implements
}
}
if( declaration != null ) if( !declaration.accept( action ) ) return false;
if (declaration != null && !declaration.accept(action)) return false;
if (action.shouldVisitDeclarations) {
switch (action.leave(this)) {
@ -94,10 +94,15 @@ public class CPPASTTemplateSpecialization extends ASTNode implements
return ICPPASTTemplateParameter.EMPTY_TEMPLATEPARAMETER_ARRAY;
}
public void addTemplateParamter(ICPPASTTemplateParameter parm) {
public void addTemplateParameter(ICPPASTTemplateParameter param) {
assertNotFrozen();
}
@Deprecated
public void addTemplateParamter(ICPPASTTemplateParameter param) {
addTemplateParameter(param);
}
public ICPPTemplateScope getScope() {
if (templateScope == null)
templateScope = new CPPTemplateScope(this);

View file

@ -1640,7 +1640,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
templateDecl.setExported(exported);
for (int i = 0; i < parms.size(); ++i) {
ICPPASTTemplateParameter parm = parms.get(i);
templateDecl.addTemplateParamter(parm);
templateDecl.addTemplateParameter(parm);
}
return templateDecl;
}
@ -4005,8 +4005,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
(switch_body != null ? calculateEndOffset(switch_body) : LA(1).getEndOffset()) - startOffset);
if (switch_condition instanceof IASTExpression) {
switch_statement.setControllerExpression((IASTExpression) switch_condition);
}
else if( switch_condition instanceof IASTDeclaration ) {
} else if (switch_condition instanceof IASTDeclaration) {
switch_statement.setControllerDeclaration((IASTDeclaration) switch_condition);
}
@ -4068,8 +4067,7 @@ public class GNUCPPSourceParser extends AbstractGNUSourceCodeParser {
if (for_condition != null) {
if (for_condition instanceof IASTExpression) {
for_statement.setConditionExpression((IASTExpression) for_condition);
}
else if( for_condition instanceof IASTDeclaration ) {
} else if (for_condition instanceof IASTDeclaration) {
for_statement.setConditionDeclaration((IASTDeclaration) for_condition);
}
}

View file

@ -673,7 +673,7 @@ public class ExtractFunctionRefactoring extends CRefactoring {
templateDeclaration.setParent(unit);
for(ICPPASTTemplateParameter templateParameter : ((ICPPASTTemplateDeclaration) insertpoint.getParent()).getTemplateParameters()) {
templateDeclaration.addTemplateParamter(templateParameter.copy());
templateDeclaration.addTemplateParameter(templateParameter.copy());
}
templateDeclaration.setDeclaration(func);

View file

@ -232,7 +232,7 @@ public class ImplementMethodRefactoring extends CRefactoring {
templateDeclaration.setParent(unit);
for(ICPPASTTemplateParameter templateParameter : ((ICPPASTTemplateDeclaration) declarationParent.getParent().getParent() ).getTemplateParameters()) {
templateDeclaration.addTemplateParamter(templateParameter.copy());
templateDeclaration.addTemplateParameter(templateParameter.copy());
}
templateDeclaration.setDeclaration(func);