1
/*******************************************************************************
2
* Copyright (c) 2004, 2008 IBM Corporation and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* IBM - Initial API and implementation
10
* Markus Schorn (Wind River Systems)
11
*******************************************************************************/
12
package org.eclipse.cdt.internal.core.dom.parser.c;
14
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
15
import org.eclipse.cdt.core.dom.ast.IASTProblem;
16
import org.eclipse.cdt.core.dom.ast.IASTProblemHolder;
17
import org.eclipse.cdt.internal.core.dom.parser.ASTNode;
22
abstract class CASTProblemOwner extends ASTNode implements IASTProblemHolder {
24
private IASTProblem problem;
26
public CASTProblemOwner() {
29
public CASTProblemOwner(IASTProblem problem) {
33
protected void copyBaseProblem(CASTProblemOwner copy) {
34
copy.setProblem(problem == null ? null : problem.copy());
35
copy.setOffsetAndLength(this);
38
public IASTProblem getProblem() {
42
public void setProblem(IASTProblem p) {
47
p.setPropertyInParent(PROBLEM);
52
public boolean accept( ASTVisitor action ){
53
if( action.shouldVisitProblems ){
54
switch( action.visit( getProblem() ) ){
55
case ASTVisitor.PROCESS_ABORT : return false;
56
case ASTVisitor.PROCESS_SKIP : return true;
59
switch( action.leave( getProblem() ) ){
60
case ASTVisitor.PROCESS_ABORT : return false;
61
case ASTVisitor.PROCESS_SKIP : return true;