From 6dd1f6b2429cdc22003c2fa0d02958c982fcec08 Mon Sep 17 00:00:00 2001 From: Markus Schorn Date: Wed, 13 Jan 2010 16:06:01 +0000 Subject: [PATCH] Bug 299495: Visiting if-statements. --- .../internal/core/dom/parser/c/CASTIfStatement.java | 11 ++++++----- .../core/dom/parser/cpp/CPPASTIfStatement.java | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTIfStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTIfStatement.java index 2a2a7fd56e5..0b10a7ad6ff 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTIfStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTIfStatement.java @@ -1,13 +1,14 @@ /******************************************************************************* - * Copyright (c) 2005, 2008 IBM Corporation and others. + * Copyright (c) 2005, 2010 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 Rational Software - Initial API and implementation - * Yuan Zhang / Beth Tibbitts (IBM Research) + * John Camelon (IBM Rational Software) - Initial API and implementation + * Yuan Zhang / Beth Tibbitts (IBM Research) + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.c; @@ -20,7 +21,7 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent; /** - * @author jcamelon + * If statements for C. */ public class CASTIfStatement extends ASTNode implements IASTIfStatement, IASTAmbiguityParent { @@ -107,7 +108,7 @@ public class CASTIfStatement extends ASTNode implements IASTIfStatement, IASTAmb IASTIfStatement stmt= this; loop: for(;;) { if (action.shouldVisitStatements) { - switch (action.visit(this)) { + switch (action.visit(stmt)) { case ASTVisitor.PROCESS_ABORT: return false; case ASTVisitor.PROCESS_SKIP: stmt= null; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTIfStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTIfStatement.java index c850b0641da..c7940c8138b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTIfStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTIfStatement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 IBM Corporation and others. + * Copyright (c) 2004, 2010 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 @@ -7,6 +7,7 @@ * * Contributors: * John Camelon (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp; @@ -114,7 +115,7 @@ public class CPPASTIfStatement extends ASTNode implements ICPPASTIfStatement, IA ICPPASTIfStatement stmt= this; loop: for(;;) { if (action.shouldVisitStatements) { - switch (action.visit(this)) { + switch (action.visit(stmt)) { case ASTVisitor.PROCESS_ABORT: return false; case ASTVisitor.PROCESS_SKIP: stmt= null;