Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-02-28 16:43:33 +0000
committerMarkus Schorn2008-02-28 16:43:33 +0000
commita4513baa305ef32348e8588bb6d4f0221780d1d2 (patch)
tree4b421fe6b71e716eb1258042673b3393e4ba55c2 /core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java
parent40e3f39a27319db4b5e3c38de6310c0ac823afc3 (diff)
downloadorg.eclipse.cdt-a4513baa305ef32348e8588bb6d4f0221780d1d2.tar.gz
org.eclipse.cdt-a4513baa305ef32348e8588bb6d4f0221780d1d2.tar.xz
org.eclipse.cdt-a4513baa305ef32348e8588bb6d4f0221780d1d2.zip
Introduce interfaces for c- and c++ specific visitors to allow for visitors that work for both c- and c++.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java
index a2546480161..6078940eaf3 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTSimpleTypeTemplateParameter.java
@@ -1,20 +1,21 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
+ * IBM - Initial API and implementation
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.internal.core.dom.parser.cpp;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
-import org.eclipse.cdt.core.dom.ast.cpp.CPPASTVisitor;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTSimpleTypeTemplateParameter;
+import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTVisitor;
/**
* @author jcamelon
@@ -68,10 +69,10 @@ public class CPPASTSimpleTypeTemplateParameter extends CPPASTNode implements
}
}
- public boolean accept( ASTVisitor action ){
- if( action instanceof CPPASTVisitor &&
- ((CPPASTVisitor)action).shouldVisitTemplateParameters ){
- switch( ((CPPASTVisitor)action).visit( this ) ){
+ @Override
+ public boolean accept( ASTVisitor action ){
+ if (action.shouldVisitTemplateParameters && action instanceof ICPPASTVisitor) {
+ switch( ((ICPPASTVisitor)action).visit( this ) ){
case ASTVisitor.PROCESS_ABORT : return false;
case ASTVisitor.PROCESS_SKIP : return true;
default : break;
@@ -81,14 +82,13 @@ public class CPPASTSimpleTypeTemplateParameter extends CPPASTNode implements
if( name != null ) if( !name.accept( action ) ) return false;
if( typeId != null ) if( !typeId.accept( action ) ) return false;
- if( action instanceof CPPASTVisitor &&
- ((CPPASTVisitor)action).shouldVisitTemplateParameters ){
- switch( ((CPPASTVisitor)action).leave( this ) ){
- case ASTVisitor.PROCESS_ABORT : return false;
- case ASTVisitor.PROCESS_SKIP : return true;
- default : break;
- }
+ if (action.shouldVisitTemplateParameters && action instanceof ICPPASTVisitor) {
+ switch( ((ICPPASTVisitor)action).leave( this ) ){
+ case ASTVisitor.PROCESS_ABORT : return false;
+ case ASTVisitor.PROCESS_SKIP : return true;
+ default : break;
}
+ }
return true;
}

Back to the top