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 * swigscan.h 10 * 11 * C/C++ scanner. 12 * ----------------------------------------------------------------------------- */ 13 14 typedef struct Scanner Scanner; 15 16 extern Scanner *NewScanner(void); 17 extern void DelScanner(Scanner *); 18 extern void Scanner_clear(Scanner *); 19 extern void Scanner_push(Scanner *, String *); 20 extern void Scanner_pushtoken(Scanner *, int, const_String_or_char_ptr value); 21 extern int Scanner_token(Scanner *); 22 extern String *Scanner_text(Scanner *); 23 extern void Scanner_skip_line(Scanner *); 24 extern int Scanner_skip_balanced(Scanner *, int startchar, int endchar); 25 extern String *Scanner_get_raw_text_balanced(Scanner *, int startchar, int endchar); 26 extern void Scanner_set_location(Scanner *, String *file, int line); 27 extern String *Scanner_file(Scanner *); 28 extern int Scanner_line(Scanner *); 29 extern int Scanner_start_line(Scanner *); 30 extern void Scanner_idstart(Scanner *, const char *idchar); 31 extern String *Scanner_errmsg(Scanner *); 32 extern int Scanner_errline(Scanner *); 33 extern int Scanner_isoperator(int tokval); 34 extern void Scanner_locator(Scanner *, String *loc); 35 36 /* Note: Tokens in range 100+ are for C/C++ operators */ 37 38 #define SWIG_MAXTOKENS 200 39 #define SWIG_TOKEN_LPAREN 1 /* ( */ 40 #define SWIG_TOKEN_RPAREN 2 /* ) */ 41 #define SWIG_TOKEN_SEMI 3 /* ; */ 42 #define SWIG_TOKEN_LBRACE 4 /* { */ 43 #define SWIG_TOKEN_RBRACE 5 /* } */ 44 #define SWIG_TOKEN_LBRACKET 6 /* [ */ 45 #define SWIG_TOKEN_RBRACKET 7 /* ] */ 46 #define SWIG_TOKEN_BACKSLASH 8 /* \ */ 47 #define SWIG_TOKEN_ENDLINE 9 /* \n */ 48 #define SWIG_TOKEN_STRING 10 /* "str" */ 49 #define SWIG_TOKEN_POUND 11 /* # */ 50 #define SWIG_TOKEN_COLON 12 /* : */ 51 #define SWIG_TOKEN_DCOLON 13 /* :: */ 52 #define SWIG_TOKEN_DCOLONSTAR 14 /* ::* */ 53 #define SWIG_TOKEN_ID 15 /* identifier */ 54 #define SWIG_TOKEN_FLOAT 16 /* 3.1415F */ 55 #define SWIG_TOKEN_DOUBLE 17 /* 3.1415 */ 56 #define SWIG_TOKEN_INT 18 /* 314 */ 57 #define SWIG_TOKEN_UINT 19 /* 314U */ 58 #define SWIG_TOKEN_LONG 20 /* 314L */ 59 #define SWIG_TOKEN_ULONG 21 /* 314UL */ 60 #define SWIG_TOKEN_CHAR 22 /* 'charconst' */ 61 #define SWIG_TOKEN_PERIOD 23 /* . */ 62 #define SWIG_TOKEN_AT 24 /* @ */ 63 #define SWIG_TOKEN_DOLLAR 25 /* $ */ 64 #define SWIG_TOKEN_CODEBLOCK 26 /* %{ ... %} ... */ 65 #define SWIG_TOKEN_RSTRING 27 /* `charconst` */ 66 #define SWIG_TOKEN_LONGLONG 28 /* 314LL */ 67 #define SWIG_TOKEN_ULONGLONG 29 /* 314ULL */ 68 #define SWIG_TOKEN_QUESTION 30 /* ? */ 69 #define SWIG_TOKEN_COMMENT 31 /* C or C++ comment */ 70 #define SWIG_TOKEN_BOOL 32 /* true or false */ 71 #define SWIG_TOKEN_WSTRING 33 /* L"str" */ 72 #define SWIG_TOKEN_WCHAR 34 /* L'c' */ 73 74 #define SWIG_TOKEN_ILLEGAL 99 75 #define SWIG_TOKEN_ERROR -1 76 77 #define SWIG_TOKEN_COMMA 101 /* , */ 78 #define SWIG_TOKEN_STAR 102 /* * */ 79 #define SWIG_TOKEN_TIMES 102 /* * */ 80 #define SWIG_TOKEN_EQUAL 103 /* = */ 81 #define SWIG_TOKEN_EQUALTO 104 /* == */ 82 #define SWIG_TOKEN_NOTEQUAL 105 /* != */ 83 #define SWIG_TOKEN_PLUS 106 /* + */ 84 #define SWIG_TOKEN_MINUS 107 /* - */ 85 #define SWIG_TOKEN_AND 108 /* & */ 86 #define SWIG_TOKEN_LAND 109 /* && */ 87 #define SWIG_TOKEN_OR 110 /* | */ 88 #define SWIG_TOKEN_LOR 111 /* || */ 89 #define SWIG_TOKEN_XOR 112 /* ^ */ 90 #define SWIG_TOKEN_LESSTHAN 113 /* < */ 91 #define SWIG_TOKEN_GREATERTHAN 114 /* > */ 92 #define SWIG_TOKEN_LTEQUAL 115 /* <= */ 93 #define SWIG_TOKEN_GTEQUAL 116 /* >= */ 94 #define SWIG_TOKEN_NOT 117 /* ~ */ 95 #define SWIG_TOKEN_LNOT 118 /* ! */ 96 #define SWIG_TOKEN_SLASH 119 /* / */ 97 #define SWIG_TOKEN_DIVIDE 119 /* / */ 98 #define SWIG_TOKEN_PERCENT 120 /* % */ 99 #define SWIG_TOKEN_MODULO 120 /* % */ 100 #define SWIG_TOKEN_LSHIFT 121 /* << */ 101 #define SWIG_TOKEN_RSHIFT 122 /* >> */ 102 #define SWIG_TOKEN_PLUSPLUS 123 /* ++ */ 103 #define SWIG_TOKEN_MINUSMINUS 124 /* -- */ 104 #define SWIG_TOKEN_PLUSEQUAL 125 /* += */ 105 #define SWIG_TOKEN_MINUSEQUAL 126 /* -= */ 106 #define SWIG_TOKEN_TIMESEQUAL 127 /* *= */ 107 #define SWIG_TOKEN_DIVEQUAL 128 /* /= */ 108 #define SWIG_TOKEN_ANDEQUAL 129 /* &= */ 109 #define SWIG_TOKEN_OREQUAL 130 /* |= */ 110 #define SWIG_TOKEN_XOREQUAL 131 /* ^= */ 111 #define SWIG_TOKEN_LSEQUAL 132 /* <<= */ 112 #define SWIG_TOKEN_RSEQUAL 133 /* >>= */ 113 #define SWIG_TOKEN_MODEQUAL 134 /* %= */ 114 #define SWIG_TOKEN_ARROW 135 /* -> */ 115 #define SWIG_TOKEN_ARROWSTAR 136 /* ->* */ 116