1
<?xml version="1.0" encoding="iso-8859-1"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
"DTD/xhtml1-transitional.dtd">
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
<title>parserFwk.pyparsing.Keyword</title>
7
<link rel="stylesheet" href="epydoc.css" type="text/css"></link>
9
<body bgcolor="white" text="black" link="blue" vlink="#204080"
12
<!-- =========== START OF NAVBAR =========== -->
13
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
15
<th class="navbar"> <a class="navbar" href="parserFwk.pyparsing-module.html">Home</a> </th>
16
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
17
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
18
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
19
<th class="navbar" align="right" width="100%">
20
<table border="0" cellpadding="0" cellspacing="0">
21
<tr><th class="navbar" align="center">
24
</p></th></tr></table>
28
<table width="100%" cellpadding="0" cellspacing="0">
31
<font size="-1"><b class="breadcrumbs">
32
Package parserFwk ::
33
<a href="parserFwk.pyparsing-module.html">Module pyparsing</a> ::
37
<td><table cellpadding="0" cellspacing="0">
38
<tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a> | <a href="parserFwk.pyparsing.Keyword-class.html" target="_top">no frames</a>]</font></td></tr>
42
<!-- =========== START OF CLASS DESCRIPTION =========== -->
43
<h2 class="class">Type Keyword</h2>
45
<pre class="base-tree">
46
<a href="__builtin__.object-class.html"><code>object</code></a> --+
48
<a href="parserFwk.pyparsing.ParserElement-class.html"><code>ParserElement</code></a> --+
50
<a href="parserFwk.pyparsing.Token-class.html"><code>Token</code></a> --+
55
<dl><dt><b>Known Subclasses:</b></dt>
57
<a href="parserFwk.pyparsing.CaselessKeyword-class.html"><code>CaselessKeyword</code></a></dd></dl>
61
Token to exactly match a specified string as a keyword, that is, it
62
must be immediately followed by a non-keyword character. Compare with
64
<pre class="literalblock">
65
Literal("if") will match the leading 'if' in 'ifAndOnlyIf'.
66
Keyword("if") will not; it will only match the leading 'if in 'if x=1', or 'if(y==2)'
68
Accepts two optional constructor arguments in addition to the keyword
69
string: identChars is a string of characters that would be valid
70
identifier characters, defaulting to all alphanumerics + "_"
71
and "$"; caseless allows case-insensitive matching, default is
76
<!-- =========== START OF METHOD SUMMARY =========== -->
77
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
78
<tr bgcolor="#70b0f0" class="summary">
79
<th colspan="2">Method Summary</th></tr>
80
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
81
<td><code><a name="__init__"></a><span class="summary-sig"><span class="summary-sig-name">__init__</span>(<span class=summary-sig-arg>self</span>,
82
<span class=summary-sig-arg>matchString</span>,
83
<span class=summary-sig-arg>identChars</span>,
84
<span class=summary-sig-arg>caseless</span>)</span></code>
86
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
87
<td><code><span class="summary-sig"><a href="parserFwk.pyparsing.Keyword-class.html#copy" class="summary-sig-name"><code>copy</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
89
Make a copy of this ParserElement.</td></tr>
90
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
91
<td><code><a name="parseImpl"></a><span class="summary-sig"><span class="summary-sig-name">parseImpl</span>(<span class=summary-sig-arg>self</span>,
92
<span class=summary-sig-arg>instring</span>,
93
<span class=summary-sig-arg>loc</span>,
94
<span class=summary-sig-arg>doActions</span>)</span></code>
96
<tr><td align="right" valign="top" width="15%"><font size="-1"> </font></td>
97
<td><code><span class="summary-sig"><a href="parserFwk.pyparsing.Keyword-class.html#setDefaultKeywordChars" class="summary-sig-name"><code>setDefaultKeywordChars</code></a>(<span class=summary-sig-arg>chars</span>)</span></code>
99
Overrides the default Keyword chars <i>(Static method)</i>
102
<b>Inherited from <a href="parserFwk.pyparsing.Token-class.html"><code>Token</code></a>:</b>
103
<a href="parserFwk.pyparsing.Token-class.html#setName"><code>setName</code></a>
105
<b>Inherited from <a href="parserFwk.pyparsing.ParserElement-class.html"><code>ParserElement</code></a>:</b>
106
<a href="parserFwk.pyparsing.ParserElement-class.html#__add__"><code>__add__</code></a>,
107
<a href="parserFwk.pyparsing.ParserElement-class.html#__and__"><code>__and__</code></a>,
108
<a href="parserFwk.pyparsing.ParserElement-class.html#__call__"><code>__call__</code></a>,
109
<a href="parserFwk.pyparsing.ParserElement-class.html#__getattr__"><code>__getattr__</code></a>,
110
<a href="parserFwk.pyparsing.ParserElement-class.html#__invert__"><code>__invert__</code></a>,
111
<a href="parserFwk.pyparsing.ParserElement-class.html#__or__"><code>__or__</code></a>,
112
<a href="parserFwk.pyparsing.ParserElement-class.html#__radd__"><code>__radd__</code></a>,
113
<a href="parserFwk.pyparsing.ParserElement-class.html#__rand__"><code>__rand__</code></a>,
114
<a href="parserFwk.pyparsing.ParserElement-class.html#__repr__"><code>__repr__</code></a>,
115
<a href="parserFwk.pyparsing.ParserElement-class.html#__ror__"><code>__ror__</code></a>,
116
<a href="parserFwk.pyparsing.ParserElement-class.html#__rxor__"><code>__rxor__</code></a>,
117
<a href="parserFwk.pyparsing.ParserElement-class.html#__str__"><code>__str__</code></a>,
118
<a href="parserFwk.pyparsing.ParserElement-class.html#__xor__"><code>__xor__</code></a>,
119
<a href="parserFwk.pyparsing.ParserElement-class.html#addParseAction"><code>addParseAction</code></a>,
120
<a href="parserFwk.pyparsing.ParserElement-class.html#checkRecursion"><code>checkRecursion</code></a>,
121
<a href="parserFwk.pyparsing.ParserElement-class.html#enablePackrat"><code>enablePackrat</code></a>,
122
<a href="parserFwk.pyparsing.ParserElement-class.html#getException"><code>getException</code></a>,
123
<a href="parserFwk.pyparsing.ParserElement-class.html#ignore"><code>ignore</code></a>,
124
<a href="parserFwk.pyparsing.ParserElement-class.html#leaveWhitespace"><code>leaveWhitespace</code></a>,
125
<a href="parserFwk.pyparsing.ParserElement-class.html#normalizeParseActionArgs"><code>normalizeParseActionArgs</code></a>,
126
<a href="parserFwk.pyparsing.ParserElement-class.html#parseFile"><code>parseFile</code></a>,
127
<a href="parserFwk.pyparsing.ParserElement-class.html#parseString"><code>parseString</code></a>,
128
<a href="parserFwk.pyparsing.ParserElement-class.html#parseWithTabs"><code>parseWithTabs</code></a>,
129
<a href="parserFwk.pyparsing.ParserElement-class.html#postParse"><code>postParse</code></a>,
130
<a href="parserFwk.pyparsing.ParserElement-class.html#preParse"><code>preParse</code></a>,
131
<a href="parserFwk.pyparsing.ParserElement-class.html#resetCache"><code>resetCache</code></a>,
132
<a href="parserFwk.pyparsing.ParserElement-class.html#scanString"><code>scanString</code></a>,
133
<a href="parserFwk.pyparsing.ParserElement-class.html#searchString"><code>searchString</code></a>,
134
<a href="parserFwk.pyparsing.ParserElement-class.html#setBreak"><code>setBreak</code></a>,
135
<a href="parserFwk.pyparsing.ParserElement-class.html#setDebug"><code>setDebug</code></a>,
136
<a href="parserFwk.pyparsing.ParserElement-class.html#setDebugActions"><code>setDebugActions</code></a>,
137
<a href="parserFwk.pyparsing.ParserElement-class.html#setDefaultWhitespaceChars"><code>setDefaultWhitespaceChars</code></a>,
138
<a href="parserFwk.pyparsing.ParserElement-class.html#setFailAction"><code>setFailAction</code></a>,
139
<a href="parserFwk.pyparsing.ParserElement-class.html#setParseAction"><code>setParseAction</code></a>,
140
<a href="parserFwk.pyparsing.ParserElement-class.html#setResultsName"><code>setResultsName</code></a>,
141
<a href="parserFwk.pyparsing.ParserElement-class.html#setWhitespaceChars"><code>setWhitespaceChars</code></a>,
142
<a href="parserFwk.pyparsing.ParserElement-class.html#skipIgnorables"><code>skipIgnorables</code></a>,
143
<a href="parserFwk.pyparsing.ParserElement-class.html#streamline"><code>streamline</code></a>,
144
<a href="parserFwk.pyparsing.ParserElement-class.html#suppress"><code>suppress</code></a>,
145
<a href="parserFwk.pyparsing.ParserElement-class.html#transformString"><code>transformString</code></a>,
146
<a href="parserFwk.pyparsing.ParserElement-class.html#tryParse"><code>tryParse</code></a>,
147
<a href="parserFwk.pyparsing.ParserElement-class.html#validate"><code>validate</code></a>
149
<b>Inherited from <a href="__builtin__.object-class.html"><code>object</code></a>:</b>
150
<a href="__builtin__.object-class.html#__delattr__"><code>__delattr__</code></a>,
151
<a href="__builtin__.object-class.html#__getattribute__"><code>__getattribute__</code></a>,
152
<a href="__builtin__.object-class.html#__hash__"><code>__hash__</code></a>,
153
<a href="__builtin__.object-class.html#__new__"><code>__new__</code></a>,
154
<a href="__builtin__.object-class.html#__reduce__"><code>__reduce__</code></a>,
155
<a href="__builtin__.object-class.html#__reduce_ex__"><code>__reduce_ex__</code></a>,
156
<a href="__builtin__.object-class.html#__setattr__"><code>__setattr__</code></a>
161
<!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
162
<table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
163
<tr bgcolor="#70b0f0" class="summary">
164
<th colspan="2">Class Variable Summary</th></tr>
165
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
166
<td><b><a href="parserFwk.pyparsing.Keyword-class.html#DEFAULT_KEYWORD_CHARS"><code>DEFAULT_KEYWORD_CHARS</code></a></b> = <span title="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'"><code><span class="variable-quote">'</span>abcdefghijklmnopqrstuvwxyzABCDE<span class="variable-ellipsis">...</span></code>
169
<b>Inherited from <a href="parserFwk.pyparsing.ParserElement-class.html"><code>ParserElement</code></a>:</b>
170
<a href="parserFwk.pyparsing.ParserElement-class.html#DEFAULT_WHITE_CHARS"><code>DEFAULT_WHITE_CHARS</code></a>
175
<!-- =========== START OF INSTANCE METHOD DETAILS =========== -->
176
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
177
<tr bgcolor="#70b0f0" class="details">
178
<th colspan="2">Instance Method Details</th></tr>
182
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
183
<h3><span class="sig"><span class="sig-name">copy</span>(<span class=sig-arg>self</span>)</span>
185
Make a copy of this ParserElement. Useful for defining different
186
parse actions for the same parsing pattern, using copies of the
187
original parse element.
189
<dl><dt><b>Overrides:</b></dt>
190
<dd><a href="parserFwk.pyparsing.ParserElement-class.html#copy"><code>parserFwk.pyparsing.ParserElement.copy</code></a> <i>(inherited documentation)</i>
198
<!-- =========== START OF STATIC METHOD DETAILS =========== -->
199
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
200
<tr bgcolor="#70b0f0" class="details">
201
<th colspan="2">Static Method Details</th></tr>
204
<a name="setDefaultKeywordChars"></a>
205
<table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
206
<h3><span class="sig"><span class="sig-name">setDefaultKeywordChars</span>(<span class=sig-arg>chars</span>)</span>
208
Overrides the default Keyword chars
215
<!-- =========== START OF CLASS VARIABLE DETAILS =========== -->
216
<table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
217
<tr bgcolor="#70b0f0" class="details">
218
<th colspan="2">Class Variable Details</th></tr>
220
<table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
221
<a name="DEFAULT_KEYWORD_CHARS"></a>
222
<h3>DEFAULT_KEYWORD_CHARS</h3>
227
<dt><b>Type:</b></dt>
232
<span title="'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'"> <dt><b>Value:</b></dt>
234
<pre class="variable">
235
<span class="variable-quote">'</span>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$<span class="variable-quote">'</span> </pre>
236
</td></tr></table></dd>
239
</dl></td></tr></table>
243
<!-- =========== START OF NAVBAR =========== -->
244
<table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
246
<th class="navbar"> <a class="navbar" href="parserFwk.pyparsing-module.html">Home</a> </th>
247
<th class="navbar"> <a class="navbar" href="trees.html">Trees</a> </th>
248
<th class="navbar"> <a class="navbar" href="indices.html">Index</a> </th>
249
<th class="navbar"> <a class="navbar" href="help.html">Help</a> </th>
250
<th class="navbar" align="right" width="100%">
251
<table border="0" cellpadding="0" cellspacing="0">
252
<tr><th class="navbar" align="center">
255
</p></th></tr></table>
260
<table border="0" cellpadding="0" cellspacing="0" width="100%">
262
<td align="left"><font size="-2">Generated by Epydoc 2.1 on Sun Jul 22 09:32:59 2007</font></td>
263
<td align="right"><a href="http://epydoc.sourceforge.net"
264
><font size="-2">http://epydoc.sf.net</font></a></td>