annotate Include/token.h @ 70817:dd775b1561ba

Fix markup.
author Georg Brandl <georg@python.org>
date Tue, 14 Jun 2011 21:09:55 +0200
parents 62b61abd02b8
children 1c0c6fa7341c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
853b736a6a9e Added copyright notice.
Guido van Rossum <guido@python.org>
parents: 6
diff changeset
1
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 /* Token types */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 65505
diff changeset
3 #ifndef Py_LIMITED_API
13445
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
4 #ifndef Py_TOKEN_H
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
5 #define Py_TOKEN_H
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
6 #ifdef __cplusplus
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
7 extern "C" {
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
8 #endif
091ca6b9348f ANSI-fication and Py_PROTO extermination.
Fred Drake <fdrake@acm.org>
parents: 13256
diff changeset
9
65505
351d794d32f4 #4499: silence compiler warning on AIX.
R. David Murray <rdmurray@bitdance.com>
parents: 41230
diff changeset
10 #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
351d794d32f4 #4499: silence compiler warning on AIX.
R. David Murray <rdmurray@bitdance.com>
parents: 41230
diff changeset
11
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
12 #define ENDMARKER 0
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
13 #define NAME 1
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
14 #define NUMBER 2
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
15 #define STRING 3
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
16 #define NEWLINE 4
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
17 #define INDENT 5
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
18 #define DEDENT 6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
19 #define LPAR 7
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
20 #define RPAR 8
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
21 #define LSQB 9
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
22 #define RSQB 10
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
23 #define COLON 11
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
24 #define COMMA 12
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
25 #define SEMI 13
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
26 #define PLUS 14
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
27 #define MINUS 15
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
28 #define STAR 16
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
29 #define SLASH 17
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
30 #define VBAR 18
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
31 #define AMPER 19
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
32 #define LESS 20
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
33 #define GREATER 21
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
34 #define EQUAL 22
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
35 #define DOT 23
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
36 #define PERCENT 24
39698
07eb80264f61 Get rid of some more cases of backquotes. parsermodule.c doesn't compile
Neal Norwitz <nnorwitz@gmail.com>
parents: 32888
diff changeset
37 /* #define BACKQUOTE 25 */
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
38 #define LBRACE 26
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
39 #define RBRACE 27
399
1e4e6df0718e Added some new tokens
Guido van Rossum <guido@python.org>
parents: 145
diff changeset
40 #define EQEQUAL 28
1e4e6df0718e Added some new tokens
Guido van Rossum <guido@python.org>
parents: 145
diff changeset
41 #define NOTEQUAL 29
1e4e6df0718e Added some new tokens
Guido van Rossum <guido@python.org>
parents: 145
diff changeset
42 #define LESSEQUAL 30
1e4e6df0718e Added some new tokens
Guido van Rossum <guido@python.org>
parents: 145
diff changeset
43 #define GREATEREQUAL 31
409
b5fe6482072f Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents: 399
diff changeset
44 #define TILDE 32
b5fe6482072f Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents: 399
diff changeset
45 #define CIRCUMFLEX 33
b5fe6482072f Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents: 399
diff changeset
46 #define LEFTSHIFT 34
b5fe6482072f Added shift and mask ops.
Guido van Rossum <guido@python.org>
parents: 399
diff changeset
47 #define RIGHTSHIFT 35
3320
4e6d0b26efaf changes for ** (power) operator
Guido van Rossum <guido@python.org>
parents: 2129
diff changeset
48 #define DOUBLESTAR 36
14162
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
49 #define PLUSEQUAL 37
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
50 #define MINEQUAL 38
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
51 #define STAREQUAL 39
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
52 #define SLASHEQUAL 40
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
53 #define PERCENTEQUAL 41
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
54 #define AMPEREQUAL 42
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
55 #define VBAREQUAL 43
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
56 #define CIRCUMFLEXEQUAL 44
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
57 #define LEFTSHIFTEQUAL 45
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
58 #define RIGHTSHIFTEQUAL 46
27d7d89c774b The real suport for augmented assignment: new opcodes, new PyNumber and
Thomas Wouters <thomas@python.org>
parents: 13445
diff changeset
59 #define DOUBLESTAREQUAL 47
19051
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
60 #define DOUBLESLASH 48
f20727cc3d0f Implement PEP 238 in its (almost) full glory.
Guido van Rossum <guido@python.org>
parents: 14375
diff changeset
61 #define DOUBLESLASHEQUAL 49
32888
c7e03cf8333e PEP-0318, @decorator-style. In Guido's words:
Anthony Baxter <anthonybaxter@gmail.com>
parents: 24752
diff changeset
62 #define AT 50
40529
54cd47788811 PEP 3107 - Function Annotations thanks to Tony Lownds
Neal Norwitz <nnorwitz@gmail.com>
parents: 39698
diff changeset
63 #define RARROW 51
41230
b1a18c7ed5ca Make ELLIPSIS a separate token. This makes it a syntax error to write ". . ." for Ellipsis.
Georg Brandl <georg@python.org>
parents: 40529
diff changeset
64 #define ELLIPSIS 52
2129
05360cd616ae The great renaming, phase two: all header files have been updated to
Guido van Rossum <guido@python.org>
parents: 2058
diff changeset
65 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */
41230
b1a18c7ed5ca Make ELLIPSIS a separate token. This makes it a syntax error to write ". . ." for Ellipsis.
Georg Brandl <georg@python.org>
parents: 40529
diff changeset
66 #define OP 53
b1a18c7ed5ca Make ELLIPSIS a separate token. This makes it a syntax error to write ". . ." for Ellipsis.
Georg Brandl <georg@python.org>
parents: 40529
diff changeset
67 #define ERRORTOKEN 54
b1a18c7ed5ca Make ELLIPSIS a separate token. This makes it a syntax error to write ". . ." for Ellipsis.
Georg Brandl <georg@python.org>
parents: 40529
diff changeset
68 #define N_TOKENS 55
6
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
69
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
70 /* Special definitions for cooperation with parser */
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
71
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
72 #define NT_OFFSET 256
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
73
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
74 #define ISTERMINAL(x) ((x) < NT_OFFSET)
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
75 #define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
76 #define ISEOF(x) ((x) == ENDMARKER)
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
77
fc6fcd7df4f7 Initial revision
Guido van Rossum <guido@python.org>
parents:
diff changeset
78
24752
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19051
diff changeset
79 PyAPI_DATA(char *) _PyParser_TokenNames[]; /* Token names */
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19051
diff changeset
80 PyAPI_FUNC(int) PyToken_OneChar(int);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19051
diff changeset
81 PyAPI_FUNC(int) PyToken_TwoChars(int, int);
c1eb668525e1 Excise DL_EXPORT from Include.
Mark Hammond <mhammond@skippinet.com.au>
parents: 19051
diff changeset
82 PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int);
1329
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
83
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
84 #ifdef __cplusplus
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
85 }
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
86 #endif
519c25039c6a * Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents: 1257
diff changeset
87 #endif /* !Py_TOKEN_H */
66664
62b61abd02b8 Merge branches/pep-0384.
Martin v. Löwis <martin@v.loewis.de>
parents: 65505
diff changeset
88 #endif /* Py_LIMITED_API */