mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Cosmetics.
This commit is contained in:
parent
c4e0105038
commit
6a4d89220e
5 changed files with 15 additions and 21 deletions
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Andrew Ferguson (Symbian) - Initial Implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* Andrew Ferguson (Symbian) - Initial Implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
|
@ -17,8 +17,7 @@ import org.eclipse.cdt.core.dom.ast.IASTNode;
|
|||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||
|
||||
/**
|
||||
* Place-holder in the AST for template arguments that are not yet
|
||||
* understood.
|
||||
* Place-holder in the AST for template arguments that are not yet understood.
|
||||
*
|
||||
* @noextend This interface is not intended to be extended by clients.
|
||||
* @noimplement This interface is not intended to be implemented by clients.
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.core.dom.ast.cpp;
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM - Initial API and implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser;
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Andrew Ferguson (Symbian) - Initial Implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM Corporation
|
||||
* Andrew Ferguson (Symbian) - Initial Implementation
|
||||
* Markus Schorn (Wind River Systems)
|
||||
* IBM Corporation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
@ -33,15 +33,14 @@ import org.eclipse.core.runtime.Assert;
|
|||
* Ambiguity node for deciding between type-id and id-expression in a template argument.
|
||||
*/
|
||||
public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements ICPPASTAmbiguousTemplateArgument {
|
||||
|
||||
private List<IASTNode> fNodes;
|
||||
|
||||
|
||||
/**
|
||||
* @param nodes nodes of type {@link IASTTypeId}, {@link IASTIdExpression} or {@link ICPPASTPackExpansionExpression}.
|
||||
*/
|
||||
public CPPASTAmbiguousTemplateArgument(IASTNode... nodes) {
|
||||
fNodes= new ArrayList<IASTNode>(2);
|
||||
for(IASTNode node : nodes) {
|
||||
for (IASTNode node : nodes) {
|
||||
if (node instanceof IASTTypeId || node instanceof IASTIdExpression) {
|
||||
fNodes.add(node);
|
||||
} else if (node instanceof ICPPASTPackExpansionExpression) {
|
||||
|
@ -56,7 +55,6 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void beforeAlternative(IASTNode node) {
|
||||
|
@ -77,13 +75,11 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void afterResolution(ASTVisitor resolver, IASTNode best) {
|
||||
beforeAlternative(best);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IASTNode copy() {
|
||||
return copy(CopyStyle.withoutLocations);
|
||||
|
@ -91,14 +87,13 @@ public class CPPASTAmbiguousTemplateArgument extends ASTAmbiguousNode implements
|
|||
|
||||
@Override
|
||||
public IASTNode copy(CopyStyle style) {
|
||||
|
||||
int sizeOfNodes = fNodes.size();
|
||||
IASTNode[] copyNodes = new IASTNode[sizeOfNodes];
|
||||
int arrayIndex = 0;
|
||||
for(IASTNode node : fNodes) {
|
||||
if(node!=null){
|
||||
for (IASTNode node : fNodes) {
|
||||
if (node != null) {
|
||||
copyNodes[arrayIndex] = node.copy(style);
|
||||
}else{
|
||||
} else {
|
||||
copyNodes[arrayIndex]=null;
|
||||
}
|
||||
arrayIndex++;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* Markus Schorn - initial API and implementation
|
||||
* Markus Schorn - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue