Issue #5262: Improved fix.
[python.git] / Doc / library / symbol.rst
blob1735276fbeeb03b71e5ae70c69c86ed6e5e0cef1
2 :mod:`symbol` --- Constants used with Python parse trees
3 ========================================================
5 .. module:: symbol
6    :synopsis: Constants representing internal nodes of the parse tree.
7 .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org>
10 This module provides constants which represent the numeric values of internal
11 nodes of the parse tree.  Unlike most Python constants, these use lower-case
12 names.  Refer to the file :file:`Grammar/Grammar` in the Python distribution for
13 the definitions of the names in the context of the language grammar.  The
14 specific numeric values which the names map to may change between Python
15 versions.
17 This module also provides one additional data object:
20 .. data:: sym_name
22    Dictionary mapping the numeric values of the constants defined in this module
23    back to name strings, allowing more human-readable representation of parse trees
24    to be generated.
27 .. seealso::
29    Module :mod:`parser`
30       The second example for the :mod:`parser` module shows how to use the
31       :mod:`symbol` module.