source: vendor/python/2.5/Doc/lib/libtoken.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.4 KB
Line 
1\section{\module{token} ---
2 Constants used with Python parse trees}
3
4\declaremodule{standard}{token}
5\modulesynopsis{Constants representing terminal nodes of the parse tree.}
6\sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org}
7
8
9This module provides constants which represent the numeric values of
10leaf nodes of the parse tree (terminal tokens). Refer to the file
11\file{Grammar/Grammar} in the Python distribution for the definitions
12of the names in the context of the language grammar. The specific
13numeric values which the names map to may change between Python
14versions.
15
16This module also provides one data object and some functions. The
17functions mirror definitions in the Python C header files.
18
19
20
21\begin{datadesc}{tok_name}
22Dictionary mapping the numeric values of the constants defined in this
23module back to name strings, allowing more human-readable
24representation of parse trees to be generated.
25\end{datadesc}
26
27\begin{funcdesc}{ISTERMINAL}{x}
28Return true for terminal token values.
29\end{funcdesc}
30
31\begin{funcdesc}{ISNONTERMINAL}{x}
32Return true for non-terminal token values.
33\end{funcdesc}
34
35\begin{funcdesc}{ISEOF}{x}
36Return true if \var{x} is the marker indicating the end of input.
37\end{funcdesc}
38
39
40\begin{seealso}
41 \seemodule{parser}{The second example for the \refmodule{parser}
42 module shows how to use the \module{symbol}
43 module.}
44\end{seealso}
Note: See TracBrowser for help on using the repository browser.