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
* Anton Leherbauer (Wind River Systems)
11
* Markus Schorn (Wind River Systems)
12
*******************************************************************************/
13
package org.eclipse.cdt.internal.core.dom.parser.cpp;
15
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
16
import org.eclipse.cdt.internal.core.dom.parser.ASTProblem;
19
* cpp-specific implementation allows actions to visit the problem.
21
public class CPPASTProblem extends ASTProblem {
23
public CPPASTProblem(int id, char[] arg, boolean isError) {
24
super(id, arg, isError);
28
public CPPASTProblem copy() {
29
char[] arg = getArgument();
30
CPPASTProblem problem = new CPPASTProblem(getID(), arg == null ? null : arg.clone(), isError());
31
problem.setOffsetAndLength(this);
36
public boolean accept( ASTVisitor action ){
37
if( action.shouldVisitProblems ){
38
switch( action.visit( this ) ){
39
case ASTVisitor.PROCESS_ABORT : return false;
40
case ASTVisitor.PROCESS_SKIP : return true;
44
if( action.shouldVisitProblems ){
45
switch( action.leave( this ) ){
46
case ASTVisitor.PROCESS_ABORT : return false;
47
case ASTVisitor.PROCESS_SKIP : return true;