blob: 9b8a3aae0746747ed90a86e435ec0594390e0404 [file] [log] [blame]
Serhiy Storchaka8ac65812018-12-22 11:18:40 +02001/* Auto-generated by Tools/scripts/generate_token.py */
Guido van Rossumf70e43a1991-02-19 12:39:46 +00002
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00003/* Token types */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +00004#ifndef Py_LIMITED_API
Fred Drake3cf4d2b2000-07-09 00:55:06 +00005#ifndef Py_TOKEN_H
6#define Py_TOKEN_H
7#ifdef __cplusplus
8extern "C" {
9#endif
10
R. David Murray051176f2010-10-18 00:15:31 +000011#undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
12
Jelle Zijlstraac317702017-10-05 20:24:46 -070013#define ENDMARKER 0
14#define NAME 1
15#define NUMBER 2
16#define STRING 3
17#define NEWLINE 4
18#define INDENT 5
19#define DEDENT 6
20#define LPAR 7
21#define RPAR 8
22#define LSQB 9
23#define RSQB 10
24#define COLON 11
25#define COMMA 12
26#define SEMI 13
27#define PLUS 14
28#define MINUS 15
29#define STAR 16
30#define SLASH 17
31#define VBAR 18
32#define AMPER 19
33#define LESS 20
34#define GREATER 21
35#define EQUAL 22
36#define DOT 23
37#define PERCENT 24
38#define LBRACE 25
39#define RBRACE 26
40#define EQEQUAL 27
41#define NOTEQUAL 28
42#define LESSEQUAL 29
43#define GREATEREQUAL 30
44#define TILDE 31
45#define CIRCUMFLEX 32
46#define LEFTSHIFT 33
47#define RIGHTSHIFT 34
48#define DOUBLESTAR 35
49#define PLUSEQUAL 36
50#define MINEQUAL 37
51#define STAREQUAL 38
52#define SLASHEQUAL 39
53#define PERCENTEQUAL 40
54#define AMPEREQUAL 41
55#define VBAREQUAL 42
56#define CIRCUMFLEXEQUAL 43
57#define LEFTSHIFTEQUAL 44
58#define RIGHTSHIFTEQUAL 45
59#define DOUBLESTAREQUAL 46
60#define DOUBLESLASH 47
Meador Inge33880602012-01-15 19:15:36 -060061#define DOUBLESLASHEQUAL 48
Benjamin Petersond51374e2014-04-09 23:55:56 -040062#define AT 49
Jelle Zijlstraac317702017-10-05 20:24:46 -070063#define ATEQUAL 50
Benjamin Petersond51374e2014-04-09 23:55:56 -040064#define RARROW 51
65#define ELLIPSIS 52
Emily Morehouse8f59ee02019-01-24 16:49:56 -070066#define COLONEQUAL 53
67#define OP 54
Guido van Rossum495da292019-03-07 12:38:08 -080068#define AWAIT 55
69#define ASYNC 56
70#define TYPE_IGNORE 57
71#define TYPE_COMMENT 58
72#define ERRORTOKEN 59
73#define N_TOKENS 63
Serhiy Storchaka8ac65812018-12-22 11:18:40 +020074#define NT_OFFSET 256
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000075
76/* Special definitions for cooperation with parser */
77
Jelle Zijlstraac317702017-10-05 20:24:46 -070078#define ISTERMINAL(x) ((x) < NT_OFFSET)
79#define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
80#define ISEOF(x) ((x) == ENDMARKER)
Lysandros Nikolaou9a4b38f2020-04-15 21:22:10 +030081#define ISWHITESPACE(x) ((x) == ENDMARKER || \
82 (x) == NEWLINE || \
83 (x) == INDENT || \
84 (x) == DEDENT)
Guido van Rossum85a5fbb1990-10-14 12:07:46 +000085
86
Serhiy Storchaka8ac65812018-12-22 11:18:40 +020087PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */
Mark Hammond91a681d2002-08-12 07:21:58 +000088PyAPI_FUNC(int) PyToken_OneChar(int);
89PyAPI_FUNC(int) PyToken_TwoChars(int, int);
90PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
Guido van Rossuma3309961993-07-28 09:05:47 +000091
92#ifdef __cplusplus
93}
94#endif
95#endif /* !Py_TOKEN_H */
Martin v. Löwis4d0d4712010-12-03 20:14:31 +000096#endif /* Py_LIMITED_API */