This repository was archived by the owner on Jun 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathreCompiler.html
More file actions
211 lines (153 loc) · 11 KB
/
reCompiler.html
File metadata and controls
211 lines (153 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module reCompiler</title>
<style type="text/css"><!--
TT { font-family: lucidatypewriter, lucida console, courier }
--></style></head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>reCompiler</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C|/documents%20and%20settings/oliver%20steele/my%20documents/projects/fsa/recompiler.py">c:\documents and settings\oliver steele\my documents\projects\fsa\recompiler.py</a></font></td></tr></table>
<p><tt> Module re_compile -- compile a regular expression into an FSA<br>
<br>
To Do<br>
-----<br>
New features:<br>
- add \-, \~<br>
- add remaining metachars<br>
- char set with ^ as first char will print wrong<br>
- figure out when to print spaces between operators</tt></p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="FSA.html">FSA</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="reCompiler.html#CharacterSet">CharacterSet</a>
</font></dt><dt><font face="helvetica, arial"><a href="reCompiler.html#SymbolRECompiler">SymbolRECompiler</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="reCompiler.html#RECompiler">RECompiler</a>
</font></dt></dl>
</dd>
</dl>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="CharacterSet">class <strong>CharacterSet</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2> </td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="CharacterSet-__add__"><strong>__add__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="CharacterSet-__cmp__"><strong>__cmp__</strong></a>(self, other)</dt></dl>
<dl><dt><a name="CharacterSet-__hash__"><strong>__hash__</strong></a>(self)</dt></dl>
<dl><dt><a name="CharacterSet-__init__"><strong>__init__</strong></a>(self, ranges)</dt></dl>
<dl><dt><a name="CharacterSet-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="CharacterSet-__str__"><strong>__str__</strong></a>(self)</dt><dd><tt>>>> print <a href="#CharacterSet">CharacterSet</a>([('a', 'a')])<br>
a<br>
>>> print <a href="#CharacterSet">CharacterSet</a>([('a', 'b')])<br>
[ab]</tt></dd></dl>
<dl><dt><a name="CharacterSet-complement"><strong>complement</strong></a>(self)</dt></dl>
<dl><dt><a name="CharacterSet-convertString"><strong>convertString</strong></a>(self, str)</dt></dl>
<dl><dt><a name="CharacterSet-crep"><strong>crep</strong></a>(self, c)</dt></dl>
<dl><dt><a name="CharacterSet-intersection"><strong>intersection</strong></a>(self, other)</dt></dl>
<dl><dt><a name="CharacterSet-matches"><strong>matches</strong></a>(self, c)</dt></dl>
<dl><dt><a name="CharacterSet-union"><strong>union</strong></a>(self, other)</dt></dl>
<hr>
Data and non-method functions defined here:<br>
<dl><dt><strong>ANY</strong> = <CharacterSet .></dl>
<dl><dt><strong>__doc__</strong> = None</dl>
<dl><dt><strong>__module__</strong> = 'reCompiler'</dl>
</td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="RECompiler">class <strong>RECompiler</strong></a>(<a href="reCompiler.html#SymbolRECompiler">SymbolRECompiler</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2> </td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="RECompiler-_readNextToken"><strong>_readNextToken</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-readCSetInnards"><strong>readCSetInnards</strong></a>(self)</dt></dl>
<hr>
Data and non-method functions defined here:<br>
<dl><dt><strong>__doc__</strong> = None</dl>
<dl><dt><strong>__module__</strong> = 'reCompiler'</dl>
<hr>
Methods inherited from <a href="reCompiler.html#SymbolRECompiler">SymbolRECompiler</a>:<br>
<dl><dt><a name="RECompiler-__init__"><strong>__init__</strong></a>(self, str, recordSourcePositions<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="RECompiler-compileConjunction"><strong>compileConjunction</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-compileExpr"><strong>compileExpr</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-compileItem"><strong>compileItem</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-compileSequence"><strong>compileSequence</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-peekChar"><strong>peekChar</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-peekToken"><strong>peekToken</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-readChar"><strong>readChar</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-readToken"><strong>readToken</strong></a>(self)</dt></dl>
<dl><dt><a name="RECompiler-skipTokens"><strong>skipTokens</strong></a>(self, bag)</dt></dl>
<dl><dt><a name="RECompiler-toFSA"><strong>toFSA</strong></a>(self, minimize<font color="#909090">=1</font>)</dt></dl>
<hr>
Data and non-method functions inherited from <a href="reCompiler.html#SymbolRECompiler">SymbolRECompiler</a>:<br>
<dl><dt><strong>EOF</strong> = -1</dl>
</td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="SymbolRECompiler">class <strong>SymbolRECompiler</strong></a></font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2> </td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="SymbolRECompiler-__init__"><strong>__init__</strong></a>(self, str, recordSourcePositions<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="SymbolRECompiler-_readNextToken"><strong>_readNextToken</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-compileConjunction"><strong>compileConjunction</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-compileExpr"><strong>compileExpr</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-compileItem"><strong>compileItem</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-compileSequence"><strong>compileSequence</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-peekChar"><strong>peekChar</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-peekToken"><strong>peekToken</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-readChar"><strong>readChar</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-readToken"><strong>readToken</strong></a>(self)</dt></dl>
<dl><dt><a name="SymbolRECompiler-skipTokens"><strong>skipTokens</strong></a>(self, bag)</dt></dl>
<dl><dt><a name="SymbolRECompiler-toFSA"><strong>toFSA</strong></a>(self, minimize<font color="#909090">=1</font>)</dt></dl>
<hr>
Data and non-method functions defined here:<br>
<dl><dt><strong>EOF</strong> = -1</dl>
<dl><dt><strong>__doc__</strong> = None</dl>
<dl><dt><strong>__module__</strong> = 'reCompiler'</dl>
</td></tr></table></td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-_printCompiledREs"><strong>_printCompiledREs</strong></a>()</dt><dd><tt># testing</tt></dd></dl>
<dl><dt><a name="-_test"><strong>_test</strong></a>(reset<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="-compileRE"><strong>compileRE</strong></a>(str, minimize<font color="#909090">=1</font>, recordSourcePositions<font color="#909090">=0</font>)</dt></dl>
<dl><dt><a name="-compileSymbolRE"><strong>compileSymbolRE</strong></a>(str)</dt></dl>
</td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>METACHARS</strong> = {'D': <CharacterSet \D>, 'S': <CharacterSet \S>, 'W': <CharacterSet \W>, 'd': <CharacterSet \d>, 's': <CharacterSet \s>, 'w': <CharacterSet \w>}<br>
<strong>__author__</strong> = 'Oliver Steele <steele@osteele.com>'<br>
<strong>__file__</strong> = r'.\reCompiler.py'<br>
<strong>__name__</strong> = 'reCompiler'</td></tr></table>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">Oliver Steele <steele@osteele.com></td></tr></table>
</body></html>