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