Mercurial > cpython-lru_cache-weakref
annotate Include/token.h @ 5817:48b94de85bf3 legacy-trunk
Extensive changes by AMK.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 17 Jul 1997 16:29:42 +0000 |
| parents | 65d2d8e67da3 |
| children | 60fdb1db1175 |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
1 #ifndef Py_TOKEN_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
2 #define Py_TOKEN_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
6 |
| 145 | 7 /*********************************************************** |
| 2058 | 8 Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, |
| 9 The Netherlands. | |
| 145 | 10 |
| 11 All Rights Reserved | |
| 12 | |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
13 Permission to use, copy, modify, and distribute this software and its |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
14 documentation for any purpose and without fee is hereby granted, |
| 145 | 15 provided that the above copyright notice appear in all copies and that |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
16 both that copyright notice and this permission notice appear in |
| 145 | 17 supporting documentation, and that the names of Stichting Mathematisch |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
18 Centrum or CWI or Corporation for National Research Initiatives or |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
19 CNRI not be used in advertising or publicity pertaining to |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
20 distribution of the software without specific, written prior |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
21 permission. |
| 145 | 22 |
|
4503
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
23 While CWI is the initial source for this software, a modified version |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
24 is made available by the Corporation for National Research Initiatives |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
25 (CNRI) at the Internet address ftp://ftp.python.org. |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
26 |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
27 STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
28 REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
29 MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
30 CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
31 DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
32 PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
33 TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
|
65d2d8e67da3
New permission notice, includes CNRI.
Guido van Rossum <guido@python.org>
parents:
3320
diff
changeset
|
34 PERFORMANCE OF THIS SOFTWARE. |
| 145 | 35 |
| 36 ******************************************************************/ | |
| 37 | |
| 6 | 38 /* Token types */ |
| 39 | |
| 40 #define ENDMARKER 0 | |
| 41 #define NAME 1 | |
| 42 #define NUMBER 2 | |
| 43 #define STRING 3 | |
| 44 #define NEWLINE 4 | |
| 45 #define INDENT 5 | |
| 46 #define DEDENT 6 | |
| 47 #define LPAR 7 | |
| 48 #define RPAR 8 | |
| 49 #define LSQB 9 | |
| 50 #define RSQB 10 | |
| 51 #define COLON 11 | |
| 52 #define COMMA 12 | |
| 53 #define SEMI 13 | |
| 54 #define PLUS 14 | |
| 55 #define MINUS 15 | |
| 56 #define STAR 16 | |
| 57 #define SLASH 17 | |
| 58 #define VBAR 18 | |
| 59 #define AMPER 19 | |
| 60 #define LESS 20 | |
| 61 #define GREATER 21 | |
| 62 #define EQUAL 22 | |
| 63 #define DOT 23 | |
| 64 #define PERCENT 24 | |
| 65 #define BACKQUOTE 25 | |
| 66 #define LBRACE 26 | |
| 67 #define RBRACE 27 | |
| 399 | 68 #define EQEQUAL 28 |
| 69 #define NOTEQUAL 29 | |
| 70 #define LESSEQUAL 30 | |
| 71 #define GREATEREQUAL 31 | |
|
409
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
399
diff
changeset
|
72 #define TILDE 32 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
399
diff
changeset
|
73 #define CIRCUMFLEX 33 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
399
diff
changeset
|
74 #define LEFTSHIFT 34 |
|
b5fe6482072f
Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents:
399
diff
changeset
|
75 #define RIGHTSHIFT 35 |
|
3320
4e6d0b26efaf
changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
76 #define DOUBLESTAR 36 |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
77 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ |
|
3320
4e6d0b26efaf
changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
78 #define OP 37 |
|
4e6d0b26efaf
changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
79 #define ERRORTOKEN 38 |
|
4e6d0b26efaf
changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents:
2129
diff
changeset
|
80 #define N_TOKENS 39 |
| 6 | 81 |
| 82 /* Special definitions for cooperation with parser */ | |
| 83 | |
| 84 #define NT_OFFSET 256 | |
| 85 | |
| 86 #define ISTERMINAL(x) ((x) < NT_OFFSET) | |
| 87 #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) | |
| 88 #define ISEOF(x) ((x) == ENDMARKER) | |
| 89 | |
| 90 | |
|
2129
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
91 extern char *_PyParser_TokenNames[]; /* Token names */ |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
92 extern int PyToken_OneChar Py_PROTO((int)); |
|
05360cd616ae
The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents:
2058
diff
changeset
|
93 extern int PyToken_TwoChars Py_PROTO((int, int)); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
94 |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
95 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
96 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
97 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
98 #endif /* !Py_TOKEN_H */ |
