| Fred Drake | b0df567 | 1998-02-18 15:59:13 +0000 | [diff] [blame] | 1 | \section{Standard Module \sectcode{token}} | 
 | 2 | \label{module-token} | 
 | 3 | \stmodindex{token} | 
 | 4 |  | 
 | 5 | This module provides constants which represent the numeric values of | 
 | 6 | leaf nodes of the parse tree (terminal tokens).  Refer to the file | 
 | 7 | \file{Grammar/Grammar} in the Python distribution for the defintions | 
 | 8 | of the names in the context of the language grammar.  The specific | 
 | 9 | numeric values which the names map to may change between Python | 
 | 10 | versions. | 
 | 11 |  | 
 | 12 | This module also provides one data object and some functions.  The | 
 | 13 | functions mirror definitions in the Python C header files. | 
 | 14 |  | 
| Fred Drake | b0df567 | 1998-02-18 15:59:13 +0000 | [diff] [blame] | 15 |  | 
 | 16 |  | 
 | 17 | \begin{datadesc}{tok_name} | 
 | 18 | Dictionary mapping the numeric values of the constants defined in this | 
 | 19 | module back to name strings, allowing more human-readable | 
 | 20 | representation of parse trees to be generated. | 
 | 21 | \end{datadesc} | 
 | 22 |  | 
 | 23 | \begin{funcdesc}{ISTERMINAL}{x} | 
 | 24 | Return true for terminal token values. | 
 | 25 | \end{funcdesc} | 
 | 26 |  | 
 | 27 | \begin{funcdesc}{ISNONTERMINAL}{x} | 
 | 28 | Return true for non-terminal token values. | 
 | 29 | \end{funcdesc} | 
 | 30 |  | 
 | 31 | \begin{funcdesc}{ISEOF}{x} | 
 | 32 | Return true if \var{x} is the marker indicating the end of input. | 
 | 33 | \end{funcdesc} | 
 | 34 |  | 
 | 35 | \begin{seealso} | 
 | 36 | \seemodule{parser}{second example uses this module} | 
 | 37 | \end{seealso} |