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