first scanner /parser copied from the jdt java version
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / compiler / problem / AbortCompilation.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v0.5 
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v05.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  ******************************************************************************/
11 package net.sourceforge.phpdt.internal.compiler.problem;
12
13 import net.sourceforge.phpdt.internal.compiler.CompilationResult;
14
15 /*
16  * Special unchecked exception type used 
17  * to abort from the compilation process
18  *
19  * should only be thrown from within problem handlers.
20  */
21 public class AbortCompilation extends RuntimeException {
22         public CompilationResult compilationResult;
23         public Throwable exception;
24         
25         public int problemId; 
26         public String[] problemArguments;
27
28         /* special fields used to abort silently (e.g. when cancelling build process) */
29         public boolean isSilent;
30         public RuntimeException silentException;
31 public AbortCompilation() {
32         this((CompilationResult)null);
33 }
34 public AbortCompilation(int problemId, String[] problemArguments) {
35
36         this.problemId = problemId;
37         this.problemArguments = problemArguments;
38 }
39 public AbortCompilation(CompilationResult compilationResult) {
40         this(compilationResult, null);
41 }
42 public AbortCompilation(CompilationResult compilationResult, Throwable exception) {
43         this.compilationResult = compilationResult;
44         this.exception = exception;
45 }
46 public AbortCompilation(boolean isSilent, RuntimeException silentException) {
47         this.isSilent = isSilent;
48         this.silentException = silentException;
49 }
50 }