blob: 87477c59e163229354699bf283bc0ea5e925b65c [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{token} ---
2 Constants representing terminal nodes of the parse tree.}
Fred Drakeb91e9341998-07-23 17:59:49 +00003\declaremodule{standard}{token}
4
5\modulesynopsis{Constants representing terminal nodes of the parse tree.}
6
Fred Drakeb0df5671998-02-18 15:59:13 +00007
8This module provides constants which represent the numeric values of
9leaf nodes of the parse tree (terminal tokens). Refer to the file
10\file{Grammar/Grammar} in the Python distribution for the defintions
11of the names in the context of the language grammar. The specific
12numeric values which the names map to may change between Python
13versions.
14
15This module also provides one data object and some functions. The
16functions mirror definitions in the Python C header files.
17
Fred Drakeb0df5671998-02-18 15:59:13 +000018
19
20\begin{datadesc}{tok_name}
21Dictionary mapping the numeric values of the constants defined in this
22module back to name strings, allowing more human-readable
23representation of parse trees to be generated.
24\end{datadesc}
25
26\begin{funcdesc}{ISTERMINAL}{x}
27Return true for terminal token values.
28\end{funcdesc}
29
30\begin{funcdesc}{ISNONTERMINAL}{x}
31Return true for non-terminal token values.
32\end{funcdesc}
33
34\begin{funcdesc}{ISEOF}{x}
35Return true if \var{x} is the marker indicating the end of input.
36\end{funcdesc}
37
38\begin{seealso}
39\seemodule{parser}{second example uses this module}
40\end{seealso}