cpython/Include/token.h

78 lines
1.7 KiB
C
Raw Normal View History

1991-02-19 12:39:46 +00:00
/***********************************************************
2000-06-30 23:50:40 +00:00
Copyright (c) 2000, BeOpen.com.
Copyright (c) 1995-2000, Corporation for National Research Initiatives.
Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
All rights reserved.
1996-10-25 14:44:06 +00:00
2000-06-30 23:50:40 +00:00
See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
1991-02-19 12:39:46 +00:00
******************************************************************/
1990-10-14 12:07:46 +00:00
/* Token types */
#ifndef Py_TOKEN_H
#define Py_TOKEN_H
#ifdef __cplusplus
extern "C" {
#endif
1990-10-14 12:07:46 +00: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 BACKQUOTE 25
#define LBRACE 26
#define RBRACE 27
1991-10-20 20:24:45 +00:00
#define EQEQUAL 28
#define NOTEQUAL 29
#define LESSEQUAL 30
#define GREATEREQUAL 31
1991-10-24 14:59:31 +00:00
#define TILDE 32
#define CIRCUMFLEX 33
#define LEFTSHIFT 34
#define RIGHTSHIFT 35
1996-01-12 00:51:44 +00:00
#define DOUBLESTAR 36
/* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
1996-01-12 00:51:44 +00:00
#define OP 37
#define ERRORTOKEN 38
#define N_TOKENS 39
1990-10-14 12:07:46 +00: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)
extern DL_IMPORT(char *) _PyParser_TokenNames[]; /* Token names */
extern DL_IMPORT(int) PyToken_OneChar(int);
extern DL_IMPORT(int) PyToken_TwoChars(int, int);
#ifdef __cplusplus
}
#endif
#endif /* !Py_TOKEN_H */