1991-02-19 08:39:46 -04:00
|
|
|
|
1990-10-14 09:07:46 -03:00
|
|
|
/* Token types */
|
2010-12-03 16:14:31 -04:00
|
|
|
#ifndef Py_LIMITED_API
|
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 */
|
|
|
|
|
2017-10-06 00:24: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
|
|
|
|
#define LBRACE 25
|
|
|
|
#define RBRACE 26
|
|
|
|
#define EQEQUAL 27
|
|
|
|
#define NOTEQUAL 28
|
|
|
|
#define LESSEQUAL 29
|
|
|
|
#define GREATEREQUAL 30
|
|
|
|
#define TILDE 31
|
|
|
|
#define CIRCUMFLEX 32
|
|
|
|
#define LEFTSHIFT 33
|
|
|
|
#define RIGHTSHIFT 34
|
|
|
|
#define DOUBLESTAR 35
|
|
|
|
#define PLUSEQUAL 36
|
|
|
|
#define MINEQUAL 37
|
|
|
|
#define STAREQUAL 38
|
|
|
|
#define SLASHEQUAL 39
|
|
|
|
#define PERCENTEQUAL 40
|
|
|
|
#define AMPEREQUAL 41
|
|
|
|
#define VBAREQUAL 42
|
|
|
|
#define CIRCUMFLEXEQUAL 43
|
|
|
|
#define LEFTSHIFTEQUAL 44
|
|
|
|
#define RIGHTSHIFTEQUAL 45
|
|
|
|
#define DOUBLESTAREQUAL 46
|
|
|
|
#define DOUBLESLASH 47
|
2012-01-15 21:15:36 -04:00
|
|
|
#define DOUBLESLASHEQUAL 48
|
2014-04-10 00:55:56 -03:00
|
|
|
#define AT 49
|
2017-10-06 00:24:46 -03:00
|
|
|
#define ATEQUAL 50
|
2014-04-10 00:55:56 -03:00
|
|
|
#define RARROW 51
|
|
|
|
#define ELLIPSIS 52
|
1995-01-12 07:45:45 -04:00
|
|
|
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
|
2017-10-06 00:24:46 -03:00
|
|
|
#define OP 53
|
|
|
|
#define ERRORTOKEN 54
|
2017-05-31 11:00:21 -03:00
|
|
|
/* These aren't used by the C tokenizer but are needed for tokenize.py */
|
2017-10-06 00:24:46 -03:00
|
|
|
#define COMMENT 55
|
|
|
|
#define NL 56
|
|
|
|
#define ENCODING 57
|
|
|
|
#define N_TOKENS 58
|
1990-10-14 09:07:46 -03:00
|
|
|
|
|
|
|
/* Special definitions for cooperation with parser */
|
|
|
|
|
2017-10-06 00:24:46 -03:00
|
|
|
#define NT_OFFSET 256
|
1990-10-14 09:07:46 -03:00
|
|
|
|
2017-10-06 00:24:46 -03:00
|
|
|
#define ISTERMINAL(x) ((x) < NT_OFFSET)
|
|
|
|
#define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
|
|
|
|
#define ISEOF(x) ((x) == ENDMARKER)
|
1990-10-14 09:07:46 -03:00
|
|
|
|
|
|
|
|
2012-10-24 12:21:52 -03:00
|
|
|
PyAPI_DATA(const char *) _PyParser_TokenNames[]; /* Token names */
|
2002-08-12 04:21:58 -03:00
|
|
|
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 */
|
2010-12-03 16:14:31 -04:00
|
|
|
#endif /* Py_LIMITED_API */
|