* lib/target-supports.exp
[official-gcc.git] / gcc / java / parse.h
blob74831714ddcfab10c01e0061131f349595a08db4
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)
6 This file is part of GCC.
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 2, or (at your option)
11 any later version.
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.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
23 Java and all Java-based marks are trademarks or registered trademarks
24 of Sun Microsystems, Inc. in the United States and other countries.
25 The Free Software Foundation is independent of Sun Microsystems, Inc. */
27 #ifndef GCC_JAVA_PARSE_H
28 #define GCC_JAVA_PARSE_H
30 /* Extern global variable declarations */
31 extern struct obstack temporary_obstack;
32 extern int quiet_flag;
34 #ifdef VERBOSE_SKELETON
35 #undef SOURCE_FRONTEND_DEBUG
36 #define SOURCE_FRONTEND_DEBUG(X) \
37 {if (!quiet_flag) {printf ("* "); printf X; putchar ('\n');} }
38 #else
39 #define SOURCE_FRONTEND_DEBUG(X)
40 #endif
42 /* Types classification, according to the JLS, section 4.2 */
43 #define JFLOAT_TYPE_P(TYPE) (TYPE && TREE_CODE ((TYPE)) == REAL_TYPE)
44 #define JINTEGRAL_TYPE_P(TYPE) ((TYPE) \
45 && (TREE_CODE ((TYPE)) == INTEGER_TYPE))
46 #define JNUMERIC_TYPE_P(TYPE) ((TYPE) \
47 && (JFLOAT_TYPE_P ((TYPE)) \
48 || JINTEGRAL_TYPE_P ((TYPE))))
49 #define JPRIMITIVE_TYPE_P(TYPE) ((TYPE) \
50 && (JNUMERIC_TYPE_P ((TYPE)) \
51 || TREE_CODE ((TYPE)) == BOOLEAN_TYPE))
53 /* Not defined in the LRM */
54 #define JSTRING_TYPE_P(TYPE) ((TYPE) \
55 && ((TYPE) == string_type_node || \
56 (TREE_CODE (TYPE) == POINTER_TYPE && \
57 TREE_TYPE (TYPE) == string_type_node)))
58 #define JREFERENCE_TYPE_P(TYPE) ((TYPE) \
59 && (TREE_CODE (TYPE) == RECORD_TYPE \
60 || (TREE_CODE (TYPE) == POINTER_TYPE \
61 && TREE_CODE (TREE_TYPE (TYPE)) == \
62 RECORD_TYPE)))
64 int java_report_errors (void);
65 extern tree do_resolve_class (tree, tree, tree, tree, tree);
67 /* Always in use, no matter what you compile */
68 void java_push_parser_context (void);
69 void java_pop_parser_context (int);
70 extern void java_parser_context_save_global (void);
71 extern void java_parser_context_restore_global (void);
73 #endif /* ! GCC_JAVA_PARSE_H */