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 http://www.swig.org/legal.html. 8 * 9 * cparse.h 10 * 11 * SWIG parser module. 12 * ----------------------------------------------------------------------------- */ 13 14 #ifndef SWIG_CPARSE_H_ 15 #define SWIG_CPARSE_H_ 16 17 #include "swig.h" 18 #include "swigwarn.h" 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /* cscanner.c */ 25 extern String *cparse_file; 26 extern int cparse_line; 27 extern int cparse_cplusplus; 28 extern int cparse_cplusplusout; 29 extern int cparse_start_line; 30 extern String *cparse_unknown_directive; 31 extern int scan_doxygen_comments; 32 33 extern void Swig_cparse_cplusplus(int); 34 extern void Swig_cparse_cplusplusout(int); 35 extern void scanner_file(File *); 36 extern void scanner_next_token(int); 37 extern void skip_balanced(int startchar, int endchar); 38 extern String *get_raw_text_balanced(int startchar, int endchar); 39 extern void skip_decl(void); 40 extern void scanner_check_typedef(void); 41 extern void scanner_ignore_typedef(void); 42 extern void scanner_last_id(int); 43 extern void scanner_clear_rename(void); 44 extern void scanner_set_location(String *file, int line); 45 extern void scanner_set_main_input_file(String *file); 46 extern String *scanner_get_main_input_file(); 47 extern void Swig_cparse_follow_locators(int); 48 extern void start_inline(char *, int); 49 extern String *scanner_ccode; 50 extern int yylex(void); 51 52 /* parser.y */ 53 extern SwigType *Swig_cparse_type(String *); 54 extern Node *Swig_cparse(File *); 55 extern Hash *Swig_cparse_features(void); 56 extern void SWIG_cparse_set_compact_default_args(int defargs); 57 extern int SWIG_cparse_template_reduce(int treduce); 58 59 /* util.c */ 60 extern void Swig_cparse_replace_descriptor(String *s); 61 extern SwigType *Swig_cparse_smartptr(Node *n); 62 extern void cparse_normalize_void(Node *); 63 extern Parm *Swig_cparse_parm(String *s); 64 extern ParmList *Swig_cparse_parms(String *s, Node *file_line_node); 65 extern Node *Swig_cparse_new_node(const_String_or_char_ptr tag); 66 67 /* templ.c */ 68 extern int Swig_cparse_template_expand(Node *n, String *rname, ParmList *tparms, Symtab *tscope); 69 extern Node *Swig_cparse_template_locate(String *name, ParmList *tparms, Symtab *tscope); 70 extern void Swig_cparse_debug_templates(int); 71 72 #ifdef __cplusplus 73 } 74 #endif 75 #define SWIG_WARN_NODE_BEGIN(Node) \ 76 { \ 77 String *wrnfilter = Node ? Getattr(Node,"feature:warnfilter") : 0; \ 78 if (wrnfilter) Swig_warnfilter(wrnfilter,1) 79 #define SWIG_WARN_NODE_END(Node) \ 80 if (wrnfilter) Swig_warnfilter(wrnfilter,0); \ 81 } 82 83 #define COMPOUND_EXPR_VAL(dtype) \ 84 ((dtype).type == T_CHAR || (dtype).type == T_WCHAR ? (dtype).rawval : (dtype).val) 85 #endif 86