Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
2 | <html> | |
3 | <head> | |
4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> | |
5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> | |
6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> | |
7 | <link rel="first" href="lib.html" title='Python Library Reference' /> | |
8 | <link rel='contents' href='contents.html' title="Contents" /> | |
9 | <link rel='index' href='genindex.html' title='Index' /> | |
10 | <link rel='last' href='about.html' title='About this document...' /> | |
11 | <link rel='help' href='about.html' title='About this document...' /> | |
12 | <link rel="next" href="module-keyword.html" /> | |
13 | <link rel="prev" href="module-symbol.html" /> | |
14 | <link rel="parent" href="language.html" /> | |
15 | <link rel="next" href="module-keyword.html" /> | |
16 | <meta name='aesop' content='information' /> | |
17 | <title>18.3 token -- Constants used with Python parse trees</title> | |
18 | </head> | |
19 | <body> | |
20 | <DIV CLASS="navigation"> | |
21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> | |
22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
23 | <tr> | |
24 | <td class='online-navigation'><a rel="prev" title="18.2 symbol " | |
25 | href="module-symbol.html"><img src='../icons/previous.png' | |
26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
27 | <td class='online-navigation'><a rel="parent" title="18. Python Language Services" | |
28 | href="language.html"><img src='../icons/up.png' | |
29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
30 | <td class='online-navigation'><a rel="next" title="18.4 keyword " | |
31 | href="module-keyword.html"><img src='../icons/next.png' | |
32 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
33 | <td align="center" width="100%">Python Library Reference</td> | |
34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
35 | href="contents.html"><img src='../icons/contents.png' | |
36 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
38 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
39 | <td class='online-navigation'><a rel="index" title="Index" | |
40 | href="genindex.html"><img src='../icons/index.png' | |
41 | border='0' height='32' alt='Index' width='32' /></A></td> | |
42 | </tr></table> | |
43 | <div class='online-navigation'> | |
44 | <b class="navlabel">Previous:</b> | |
45 | <a class="sectref" rel="prev" href="module-symbol.html">18.2 symbol </A> | |
46 | <b class="navlabel">Up:</b> | |
47 | <a class="sectref" rel="parent" href="language.html">18. Python Language Services</A> | |
48 | <b class="navlabel">Next:</b> | |
49 | <a class="sectref" rel="next" href="module-keyword.html">18.4 keyword </A> | |
50 | </div> | |
51 | <hr /></div> | |
52 | </DIV> | |
53 | <!--End of Navigation Panel--> | |
54 | ||
55 | <H1><A NAME="SECTION0020300000000000000000"> | |
56 | 18.3 <tt class="module">token</tt> -- | |
57 | Constants used with Python parse trees</A> | |
58 | </H1> | |
59 | ||
60 | <P> | |
61 | <A NAME="module-token"></A> | |
62 | ||
63 | <P> | |
64 | This module provides constants which represent the numeric values of | |
65 | leaf nodes of the parse tree (terminal tokens). Refer to the file | |
66 | <span class="file">Grammar/Grammar</span> in the Python distribution for the definitions | |
67 | of the names in the context of the language grammar. The specific | |
68 | numeric values which the names map to may change between Python | |
69 | versions. | |
70 | ||
71 | <P> | |
72 | This module also provides one data object and some functions. The | |
73 | functions mirror definitions in the Python C header files. | |
74 | ||
75 | <P> | |
76 | <dl><dt><b><tt id='l2h-4961' xml:id='l2h-4961'>tok_name</tt></b></dt> | |
77 | <dd> | |
78 | Dictionary mapping the numeric values of the constants defined in this | |
79 | module back to name strings, allowing more human-readable | |
80 | representation of parse trees to be generated. | |
81 | </dd></dl> | |
82 | ||
83 | <P> | |
84 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
85 | <td><nobr><b><tt id='l2h-4962' xml:id='l2h-4962' class="function">ISTERMINAL</tt></b>(</nobr></td> | |
86 | <td><var>x</var>)</td></tr></table></dt> | |
87 | <dd> | |
88 | Return true for terminal token values. | |
89 | </dl> | |
90 | ||
91 | <P> | |
92 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
93 | <td><nobr><b><tt id='l2h-4963' xml:id='l2h-4963' class="function">ISNONTERMINAL</tt></b>(</nobr></td> | |
94 | <td><var>x</var>)</td></tr></table></dt> | |
95 | <dd> | |
96 | Return true for non-terminal token values. | |
97 | </dl> | |
98 | ||
99 | <P> | |
100 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> | |
101 | <td><nobr><b><tt id='l2h-4964' xml:id='l2h-4964' class="function">ISEOF</tt></b>(</nobr></td> | |
102 | <td><var>x</var>)</td></tr></table></dt> | |
103 | <dd> | |
104 | Return true if <var>x</var> is the marker indicating the end of input. | |
105 | </dl> | |
106 | ||
107 | <P> | |
108 | <div class="seealso"> | |
109 | <p class="heading">See Also:</p> | |
110 | ||
111 | <dl compact="compact" class="seemodule"> | |
112 | <dt>Module <b><tt class="module"><a href="module-parser.html">parser</a></tt>:</b> | |
113 | <dd>The second example for the <tt class="module"><a href="module-parser.html">parser</a></tt> | |
114 | module shows how to use the <tt class="module">symbol</tt> | |
115 | module. | |
116 | </dl> | |
117 | </div> | |
118 | ||
119 | <DIV CLASS="navigation"> | |
120 | <div class='online-navigation'> | |
121 | <p></p><hr /> | |
122 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> | |
123 | <tr> | |
124 | <td class='online-navigation'><a rel="prev" title="18.2 symbol " | |
125 | href="module-symbol.html"><img src='../icons/previous.png' | |
126 | border='0' height='32' alt='Previous Page' width='32' /></A></td> | |
127 | <td class='online-navigation'><a rel="parent" title="18. Python Language Services" | |
128 | href="language.html"><img src='../icons/up.png' | |
129 | border='0' height='32' alt='Up One Level' width='32' /></A></td> | |
130 | <td class='online-navigation'><a rel="next" title="18.4 keyword " | |
131 | href="module-keyword.html"><img src='../icons/next.png' | |
132 | border='0' height='32' alt='Next Page' width='32' /></A></td> | |
133 | <td align="center" width="100%">Python Library Reference</td> | |
134 | <td class='online-navigation'><a rel="contents" title="Table of Contents" | |
135 | href="contents.html"><img src='../icons/contents.png' | |
136 | border='0' height='32' alt='Contents' width='32' /></A></td> | |
137 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' | |
138 | border='0' height='32' alt='Module Index' width='32' /></a></td> | |
139 | <td class='online-navigation'><a rel="index" title="Index" | |
140 | href="genindex.html"><img src='../icons/index.png' | |
141 | border='0' height='32' alt='Index' width='32' /></A></td> | |
142 | </tr></table> | |
143 | <div class='online-navigation'> | |
144 | <b class="navlabel">Previous:</b> | |
145 | <a class="sectref" rel="prev" href="module-symbol.html">18.2 symbol </A> | |
146 | <b class="navlabel">Up:</b> | |
147 | <a class="sectref" rel="parent" href="language.html">18. Python Language Services</A> | |
148 | <b class="navlabel">Next:</b> | |
149 | <a class="sectref" rel="next" href="module-keyword.html">18.4 keyword </A> | |
150 | </div> | |
151 | </div> | |
152 | <hr /> | |
153 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> | |
154 | </DIV> | |
155 | <!--End of Navigation Panel--> | |
156 | <ADDRESS> | |
157 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. | |
158 | </ADDRESS> | |
159 | </BODY> | |
160 | </HTML> |