1 /* exceptions.h - exception related functions prototypes
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5 M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6 P. Tomsich, J. Wenninger
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
29 $Id: exceptions.h 1480 2004-11-11 14:37:01Z twisti $
39 #include "nat/java_lang_String.h"
40 #include "nat/java_lang_Throwable.h"
43 /* system exception classes required in cacao */
45 extern classinfo *class_java_lang_Throwable;
46 extern classinfo *class_java_lang_Exception;
47 extern classinfo *class_java_lang_Error;
48 extern classinfo *class_java_lang_OutOfMemoryError;
51 /* exception/error super class */
53 extern char *string_java_lang_Throwable;
56 /* specify some exception strings for code generation */
58 extern char *string_java_lang_ArithmeticException;
59 extern char *string_java_lang_ArithmeticException_message;
60 extern char *string_java_lang_ArrayIndexOutOfBoundsException;
61 extern char *string_java_lang_ArrayStoreException;
62 extern char *string_java_lang_ClassCastException;
63 extern char *string_java_lang_ClassNotFoundException;
64 extern char *string_java_lang_CloneNotSupportedException;
65 extern char *string_java_lang_Exception;
66 extern char *string_java_lang_IllegalArgumentException;
67 extern char *string_java_lang_IllegalMonitorStateException;
68 extern char *string_java_lang_IndexOutOfBoundsException;
69 extern char *string_java_lang_InterruptedException;
70 extern char *string_java_lang_NegativeArraySizeException;
71 extern char *string_java_lang_NoSuchFieldException;
72 extern char *string_java_lang_NoSuchMethodException;
73 extern char *string_java_lang_NullPointerException;
76 /* specify some error strings for code generation */
78 extern char *string_java_lang_AbstractMethodError;
79 extern char *string_java_lang_ClassCircularityError;
80 extern char *string_java_lang_ClassFormatError;
81 extern char *string_java_lang_Error;
82 extern char *string_java_lang_ExceptionInInitializerError;
83 extern char *string_java_lang_IncompatibleClassChangeError;
84 extern char *string_java_lang_InternalError;
85 extern char *string_java_lang_LinkageError;
86 extern char *string_java_lang_NoClassDefFoundError;
87 extern char *string_java_lang_NoSuchFieldError;
88 extern char *string_java_lang_NoSuchMethodError;
89 extern char *string_java_lang_OutOfMemoryError;
90 extern char *string_java_lang_UnsupportedClassVersionError;
91 extern char *string_java_lang_VerifyError;
92 extern char *string_java_lang_VirtualMachineError;
95 /* function prototypes */
97 /* load, link and compile exceptions used in the system */
99 bool init_system_exceptions(void);
102 /* exception throwing functions */
104 void throw_exception();
105 void throw_exception_exit();
107 void throw_main_exception();
108 void throw_main_exception_exit();
110 void throw_cacao_exception_exit(char *exception, char *message, ...);
113 /* initialize new exceptions */
115 java_objectheader *new_exception(char *classname);
116 java_objectheader *new_exception_message(char *classname, char *message);
117 java_objectheader *new_exception_throwable(char *classname, java_lang_Throwable *cause);
118 java_objectheader *new_exception_utfmessage(char *classname, utf *message);
119 java_objectheader *new_exception_javastring(char *classname, java_lang_String *message);
120 java_objectheader *new_exception_int(char *classname, s4 i);
123 /* functions to generate compiler exceptions */
125 java_objectheader *new_classformaterror(classinfo *c, char *message, ...);
126 java_objectheader *new_verifyerror(methodinfo *m, char *message);
127 java_objectheader *new_unsupportedclassversionerror(classinfo *c, char *message, ...);
129 java_objectheader *new_arithmeticexception();
130 java_objectheader *new_arrayindexoutofboundsexception(s4 index);
131 java_objectheader *new_arraystoreexception();
132 java_objectheader *new_classcastexception();
133 java_objectheader *new_negativearraysizeexception();
134 java_objectheader *new_nullpointerexception();
136 #endif /* _EXCEPTIONS_H */
140 * These are local overrides for various environment variables in Emacs.
141 * Please do not remove this and leave it at the end of the file, where
142 * Emacs will automagically detect them.
143 * ---------------------------------------------------------------------
146 * indent-tabs-mode: t