cparse.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* -----------------------------------------------------------------------------
  2. * This file is part of SWIG, which is licensed as a whole under version 3
  3. * (or any later version) of the GNU General Public License. Some additional
  4. * terms also apply to certain portions of SWIG. The full details of the SWIG
  5. * license and copyrights can be found in the LICENSE and COPYRIGHT files
  6. * included with the SWIG source code as distributed by the SWIG developers
  7. * and at https://www.swig.org/legal.html.
  8. *
  9. * cparse.h
  10. *
  11. * SWIG parser module.
  12. * ----------------------------------------------------------------------------- */
  13. #ifndef SWIG_CPARSE_H
  14. #define SWIG_CPARSE_H
  15. #include "swig.h"
  16. #include "swigwarn.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /* cscanner.c */
  21. extern String *cparse_file;
  22. extern int cparse_line;
  23. extern int cparse_cplusplus;
  24. extern int cparse_cplusplusout;
  25. extern int cparse_start_line;
  26. extern String *cparse_unknown_directive;
  27. extern int scan_doxygen_comments;
  28. extern void Swig_cparse_cplusplus(int);
  29. extern void Swig_cparse_cplusplusout(int);
  30. extern void scanner_file(File *);
  31. extern void scanner_next_token(int);
  32. extern void skip_balanced(int startchar, int endchar);
  33. extern String *get_raw_text_balanced(int startchar, int endchar);
  34. extern void skip_decl(void);
  35. extern void scanner_check_typedef(void);
  36. extern void scanner_ignore_typedef(void);
  37. extern void scanner_last_id(int);
  38. extern void scanner_clear_rename(void);
  39. extern void scanner_set_location(String *file, int line);
  40. extern void scanner_set_main_input_file(String *file);
  41. extern String *scanner_get_main_input_file(void);
  42. extern void Swig_cparse_follow_locators(int);
  43. extern void start_inline(char *, int);
  44. extern String *scanner_ccode;
  45. extern int yylex(void);
  46. /* parser.y */
  47. extern SwigType *Swig_cparse_type(String *);
  48. extern Node *Swig_cparse(File *);
  49. extern Hash *Swig_cparse_features(void);
  50. extern void SWIG_cparse_set_compact_default_args(int defargs);
  51. extern int SWIG_cparse_template_reduce(int treduce);
  52. /* util.c */
  53. extern void Swig_cparse_replace_descriptor(String *s);
  54. extern SwigType *Swig_cparse_smartptr(Node *n);
  55. extern void cparse_normalize_void(Node *);
  56. extern Parm *Swig_cparse_parm(String *s);
  57. extern ParmList *Swig_cparse_parms(String *s, Node *file_line_node);
  58. extern Node *Swig_cparse_new_node(const_String_or_char_ptr tag);
  59. /* templ.c */
  60. extern int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab *tscope);
  61. extern Node *Swig_cparse_template_locate(String *name, ParmList *tparms, Symtab *tscope);
  62. extern void Swig_cparse_debug_templates(int);
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #define SWIG_WARN_NODE_BEGIN(Node) \
  67. { \
  68. String *wrnfilter = Node ? Getattr(Node,"feature:warnfilter") : 0; \
  69. if (wrnfilter) Swig_warnfilter(wrnfilter,1)
  70. #define SWIG_WARN_NODE_END(Node) \
  71. if (wrnfilter) Swig_warnfilter(wrnfilter,0); \
  72. }
  73. #define COMPOUND_EXPR_VAL(dtype) \
  74. ((dtype).type == T_CHAR || (dtype).type == T_WCHAR ? (dtype).rawval : (dtype).val)
  75. #endif