re PR java/17779 (ICE: Seg fault)
[gcc.git] / gcc / java / parse.h
1 /* Language parser definitions for the GNU compiler for the Java(TM) language.
2 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
3 2005, 2006, 2007 Free Software Foundation, Inc.
4 Contributed by Alexandre Petit-Bianco (apbianco@cygnus.com)
5
6 This file is part of GCC.
7
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
12
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>.
21
22 Java and all Java-based marks are trademarks or registered trademarks
23 of Sun Microsystems, Inc. in the United States and other countries.
24 The Free Software Foundation is independent of Sun Microsystems, Inc. */
25
26 #ifndef GCC_JAVA_PARSE_H
27 #define GCC_JAVA_PARSE_H
28
29 /* Extern global variable declarations */
30 extern struct obstack temporary_obstack;
31 extern int quiet_flag;
32
33 #ifdef VERBOSE_SKELETON
34 #undef SOURCE_FRONTEND_DEBUG
35 #define SOURCE_FRONTEND_DEBUG(X) \
36 {if (!quiet_flag) {printf ("* "); printf X; putchar ('\n');} }
37 #else
38 #define SOURCE_FRONTEND_DEBUG(X)
39 #endif
40
41 /* Types classification, according to the JLS, section 4.2 */
42 #define JFLOAT_TYPE_P(TYPE) (TYPE && TREE_CODE ((TYPE)) == REAL_TYPE)
43 #define JINTEGRAL_TYPE_P(TYPE) ((TYPE) \
44 && (TREE_CODE ((TYPE)) == INTEGER_TYPE))
45 #define JNUMERIC_TYPE_P(TYPE) ((TYPE) \
46 && (JFLOAT_TYPE_P ((TYPE)) \
47 || JINTEGRAL_TYPE_P ((TYPE))))
48 #define JPRIMITIVE_TYPE_P(TYPE) ((TYPE) \
49 && (JNUMERIC_TYPE_P ((TYPE)) \
50 || TREE_CODE ((TYPE)) == BOOLEAN_TYPE))
51
52 /* Not defined in the LRM */
53 #define JSTRING_TYPE_P(TYPE) ((TYPE) \
54 && ((TYPE) == string_type_node || \
55 (TREE_CODE (TYPE) == POINTER_TYPE && \
56 TREE_TYPE (TYPE) == string_type_node)))
57 #define JREFERENCE_TYPE_P(TYPE) ((TYPE) \
58 && (TREE_CODE (TYPE) == RECORD_TYPE \
59 || (TREE_CODE (TYPE) == POINTER_TYPE \
60 && TREE_CODE (TREE_TYPE (TYPE)) == \
61 RECORD_TYPE)))
62
63 int java_report_errors (void);
64 extern tree do_resolve_class (tree, tree, tree, tree, tree);
65
66 /* Always in use, no matter what you compile */
67 void java_push_parser_context (void);
68 void java_pop_parser_context (int);
69 extern void java_parser_context_save_global (void);
70 extern void java_parser_context_restore_global (void);
71
72 #endif /* ! GCC_JAVA_PARSE_H */