parse.h 2.6 KB

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