1991-02-19 08:39:46 -04:00
|
|
|
|
1990-10-14 09:07:46 -03:00
|
|
|
/* Token types */
|
|
|
|
|
2000-07-08 21:55:06 -03:00
|
|
|
#ifndef Py_TOKEN_H
|
|
|
|
#define Py_TOKEN_H
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-10-17 21:15:31 -03:00
|
|
|
#undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
|
|
|
|
|
1990-10-14 09:07:46 -03:00
|
|
|
#define ENDMARKER 0
|
|
|
|
#define NAME 1
|
|
|
|
#define NUMBER 2
|
|
|
|
#define STRING 3
|
|
|
|
#define NEWLINE 4
|
|
|
|
#define INDENT 5
|
|
|
|
#define DEDENT 6
|
|
|
|
#define LPAR 7
|
|
|
|
#define RPAR 8
|
|
|
|
#define LSQB 9
|
|
|
|
#define RSQB 10
|
|
|
|
#define COLON 11
|
|
|
|
#define COMMA 12
|
|
|
|
#define SEMI 13
|
|
|
|
#define PLUS 14
|
|
|
|
#define MINUS 15
|
|
|
|
#define STAR 16
|
|
|
|
#define SLASH 17
|
|
|
|
#define VBAR 18
|
|
|
|
#define AMPER 19
|
|
|
|
#define LESS 20
|
|
|
|
#define GREATER 21
|
|
|
|
#define EQUAL 22
|
|
|
|
#define DOT 23
|
|
|
|
#define PERCENT 24
|
2006-08-29 01:40:24 -03:00
|
|
|
/* #define BACKQUOTE 25 */
|
1990-10-14 09:07:46 -03:00
|
|
|
#define LBRACE 26
|
|
|
|
#define RBRACE 27
|
1991-10-20 17:24:45 -03:00
|
|
|
#define EQEQUAL 28
|
|
|
|
#define NOTEQUAL 29
|
|
|
|
#define LESSEQUAL 30
|
|
|
|
#define GREATEREQUAL 31
|
1991-10-24 11:59:31 -03:00
|
|
|
#define TILDE 32
|
|
|
|
#define CIRCUMFLEX 33
|
|
|
|
#define LEFTSHIFT 34
|
|
|
|
#define RIGHTSHIFT 35
|
1996-01-11 20:51:44 -04:00
|
|
|
#define DOUBLESTAR 36
|
2000-08-24 17:09:45 -03:00
|
|
|
#define PLUSEQUAL 37
|
|
|
|
#define MINEQUAL 38
|
|
|
|
#define STAREQUAL 39
|
|
|
|
#define SLASHEQUAL 40
|
|
|
|
#define PERCENTEQUAL 41
|
|
|
|
#define AMPEREQUAL 42
|
|
|
|
#define VBAREQUAL 43
|
|
|
|
#define CIRCUMFLEXEQUAL 44
|
|
|
|
#define LEFTSHIFTEQUAL 45
|
|
|
|
#define RIGHTSHIFTEQUAL 46
|
|
|
|
#define DOUBLESTAREQUAL 47
|
2001-08-08 02:00:18 -03:00
|
|
|
#define DOUBLESLASH 48
|
|
|
|
#define DOUBLESLASHEQUAL 49
|
2004-08-02 03:10:11 -03:00
|
|
|
#define AT 50
|
2006-12-28 02:47:50 -04:00
|
|
|
#define RARROW 51
|
2007-03-18 16:01:53 -03:00
|
|
|
#define ELLIPSIS 52
|
1995-01-12 07:45:45 -04:00
|
|
|
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
|
2007-03-18 16:01:53 -03:00
|
|
|
#define OP 53
|
|
|
|
#define ERRORTOKEN 54
|
|
|
|
#define N_TOKENS 55
|
1990-10-14 09:07:46 -03:00
|
|
|
|
|
|
|
/* Special definitions for cooperation with parser */
|
|
|
|
|
|
|
|
#define NT_OFFSET 256
|
|
|
|
|
|
|
|
#define ISTERMINAL(x) ((x) < NT_OFFSET)
|
|
|
|
#define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
|
|
|
|
#define ISEOF(x) ((x) == ENDMARKER)
|
|
|
|
|
|
|
|
|
2002-08-12 04:21:58 -03:00
|
|
|
PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */
|
|
|
|
PyAPI_FUNC(int) PyToken_OneChar(int);
|
|
|
|
PyAPI_FUNC(int) PyToken_TwoChars(int, int);
|
|
|
|
PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
|
1993-07-28 06:05:47 -03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* !Py_TOKEN_H */
|