summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-17 09:46:11 (GMT)
committerGeorg Brandl <georg@python.org>2010-10-17 09:46:11 (GMT)
commiteec2d768cd1567345d7191f55f1818303e9130f1 (patch)
tree58a4a277b33b6cc68ca4d33b16ff5e872e9bab7e
parent80b75fd28817cfc7245ccfb13725338c641f533c (diff)
downloadcpython-eec2d768cd1567345d7191f55f1818303e9130f1.zip
cpython-eec2d768cd1567345d7191f55f1818303e9130f1.tar.gz
cpython-eec2d768cd1567345d7191f55f1818303e9130f1.tar.bz2
#8968: add actual name of token constants.
-rw-r--r--Doc/library/token.rst63
1 files changed, 61 insertions, 2 deletions
diff --git a/Doc/library/token.rst b/Doc/library/token.rst
index bc5c19e..991762f 100644
--- a/Doc/library/token.rst
+++ b/Doc/library/token.rst
@@ -12,8 +12,8 @@ in the Python distribution for the definitions of the names in the context of
the language grammar. The specific numeric values which the names map to may
change between Python versions.
-This module also provides one data object and some functions. The functions
-mirror definitions in the Python C header files.
+The module also provides a mapping from numeric codes to names and some
+functions. The functions mirror definitions in the Python C header files.
.. data:: tok_name
@@ -38,6 +38,65 @@ mirror definitions in the Python C header files.
Return true if *x* is the marker indicating the end of input.
+The token constants are:
+
+.. data:: ENDMARKER
+ NAME
+ NUMBER
+ STRING
+ NEWLINE
+ INDENT
+ DEDENT
+ LPAR
+ RPAR
+ LSQB
+ RSQB
+ COLON
+ COMMA
+ SEMI
+ PLUS
+ MINUS
+ STAR
+ SLASH
+ VBAR
+ AMPER
+ LESS
+ GREATER
+ EQUAL
+ DOT
+ PERCENT
+ BACKQUOTE
+ LBRACE
+ RBRACE
+ EQEQUAL
+ NOTEQUAL
+ LESSEQUAL
+ GREATEREQUAL
+ TILDE
+ CIRCUMFLEX
+ LEFTSHIFT
+ RIGHTSHIFT
+ DOUBLESTAR
+ PLUSEQUAL
+ MINEQUAL
+ STAREQUAL
+ SLASHEQUAL
+ PERCENTEQUAL
+ AMPEREQUAL
+ VBAREQUAL
+ CIRCUMFLEXEQUAL
+ LEFTSHIFTEQUAL
+ RIGHTSHIFTEQUAL
+ DOUBLESTAREQUAL
+ DOUBLESLASH
+ DOUBLESLASHEQUAL
+ AT
+ OP
+ ERRORTOKEN
+ N_TOKENS
+ NT_OFFSET
+
+
.. seealso::
Module :mod:`parser`