Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | |
| 2 | :mod:`symbol` --- Constants used with Python parse trees |
| 3 | ======================================================== |
| 4 | |
| 5 | .. module:: symbol |
| 6 | :synopsis: Constants representing internal nodes of the parse tree. |
| 7 | .. sectionauthor:: Fred L. Drake, Jr. <fdrake@acm.org> |
| 8 | |
| 9 | |
| 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. |
| 16 | |
| 17 | This module also provides one additional data object: |
| 18 | |
| 19 | |
| 20 | .. data:: sym_name |
| 21 | |
| 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. |
| 25 | |
| 26 | |
| 27 | .. seealso:: |
| 28 | |
| 29 | Module :mod:`parser` |
| 30 | The second example for the :mod:`parser` module shows how to use the |
| 31 | :mod:`symbol` module. |
| 32 | |