1 import org.python.core.*;
3 public class sre_compile extends java.lang.Object {
4 static String[] jpy$mainProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions"};
5 static String[] jpy$proxyProperties = new String[] {"python.modules.builtin", "exceptions:org.python.core.exceptions", "python.options.showJavaExceptions", "true"};
6 static String[] jpy$packages = new String[] {"java.net", null, "java.lang", null, "org.python.core", null, "java.io", null, "java.util.zip", null};
8 public static class _PyInner extends PyFunctionTable implements PyRunnable {
9 private static PyObject s$0;
10 private static PyObject i$1;
11 private static PyObject i$2;
12 private static PyObject s$3;
13 private static PyObject i$4;
14 private static PyObject i$5;
15 private static PyObject s$6;
16 private static PyObject s$7;
17 private static PyObject s$8;
18 private static PyObject i$9;
19 private static PyObject s$10;
20 private static PyObject s$11;
21 private static PyObject i$12;
22 private static PyObject s$13;
23 private static PyObject s$14;
24 private static PyFunctionTable funcTable;
25 private static PyCode c$0_fixup;
26 private static PyCode c$1_lambda;
27 private static PyCode c$2__compile;
28 private static PyCode c$3_lambda;
29 private static PyCode c$4__compile_charset;
30 private static PyCode c$5__optimize_charset;
31 private static PyCode c$6__simple;
32 private static PyCode c$7__compile_info;
33 private static PyCode c$8__code;
34 private static PyCode c$9_compile;
35 private static PyCode c$10_main;
36 private static void initConstants() {
37 s$0 = Py.newString("SRE module mismatch");
38 i$1 = Py.newInteger(65535);
39 i$2 = Py.newInteger(0);
40 s$3 = Py.newString("internal: unsupported template operator");
41 i$4 = Py.newInteger(1);
42 i$5 = Py.newInteger(2);
43 s$6 = Py.newString("look-behind requires fixed-width pattern");
44 s$7 = Py.newString("unsupported operand type");
45 s$8 = Py.newString("internal: unsupported set operator");
46 i$9 = Py.newInteger(256);
47 s$10 = Py.newString("nothing to repeat");
48 s$11 = Py.newString("");
49 i$12 = Py.newInteger(100);
50 s$13 = Py.newString("sorry, but this version only supports 100 named groups");
51 s$14 = Py.newString("/usr/share/jython/Lib-cpython/sre_compile.py");
52 funcTable = new _PyInner();
53 c$0_fixup = Py.newCode(2, new String[] {"literal", "flags"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "fixup", false, false, funcTable, 0, null, null, 0, 1);
54 c$1_lambda = Py.newCode(1, new String[] {"x"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "<lambda>", false, false, funcTable, 1, null, null, 0, 1);
55 c$2__compile = Py.newCode(3, new String[] {"code", "pattern", "flags", "av", "emit", "skip", "lo", "op", "fixup", "hi", "tail"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_compile", false, false, funcTable, 2, null, null, 0, 1);
56 c$3_lambda = Py.newCode(1, new String[] {"x"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "<lambda>", false, false, funcTable, 3, null, null, 0, 1);
57 c$4__compile_charset = Py.newCode(4, new String[] {"charset", "flags", "code", "fixup", "op", "av", "emit"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_compile_charset", false, false, funcTable, 4, null, null, 0, 1);
58 c$5__optimize_charset = Py.newCode(2, new String[] {"charset", "fixup", "op", "v", "av", "charmap", "p", "n", "m", "runs", "i", "out", "c", "data"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_optimize_charset", false, false, funcTable, 5, null, null, 0, 1);
59 c$6__simple = Py.newCode(1, new String[] {"av", "hi", "lo"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_simple", false, false, funcTable, 6, null, null, 0, 1);
60 c$7__compile_info = Py.newCode(3, new String[] {"code", "pattern", "flags", "hi", "charset", "lo", "op", "av", "emit", "p", "skip", "prefix", "i", "mask", "table", "c", "prefix_skip"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_compile_info", false, false, funcTable, 7, null, null, 0, 1);
61 c$8__code = Py.newCode(2, new String[] {"p", "flags", "code"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "_code", false, false, funcTable, 8, null, null, 0, 1);
62 c$9_compile = Py.newCode(2, new String[] {"p", "flags", "groupindex", "code", "indexgroup", "k", "i", "sre_parse", "pattern"}, "/usr/share/jython/Lib-cpython/sre_compile.py", "compile", false, false, funcTable, 9, null, null, 0, 1);
63 c$10_main = Py.newCode(0, new String[] {}, "/usr/share/jython/Lib-cpython/sre_compile.py", "main", false, false, funcTable, 10, null, null, 0, 0);
67 public PyCode getMain() {
68 if (c$10_main == null) _PyInner.initConstants();
72 public PyObject call_function(int index, PyFrame frame) {
75 return _PyInner.fixup$1(frame);
77 return _PyInner.lambda$2(frame);
79 return _PyInner._compile$3(frame);
81 return _PyInner.lambda$4(frame);
83 return _PyInner._compile_charset$5(frame);
85 return _PyInner._optimize_charset$6(frame);
87 return _PyInner._simple$7(frame);
89 return _PyInner._compile_info$8(frame);
91 return _PyInner._code$9(frame);
93 return _PyInner.compile$10(frame);
95 return _PyInner.main$11(frame);
101 private static PyObject fixup$1(PyFrame frame) {
102 return frame.getglobal("_sre").__getattr__("getlower").__call__(frame.getlocal(0), frame.getlocal(1));
105 private static PyObject lambda$2(PyFrame frame) {
106 return frame.getlocal(0);
109 private static PyObject _compile$3(PyFrame frame) {
110 // Temporary Variables
111 int t$0$int, t$1$int, t$2$int;
112 PyObject[] t$0$PyObject__;
113 PyObject t$0$PyObject, t$1$PyObject, t$2$PyObject, t$3$PyObject, t$4$PyObject, t$5$PyObject;
116 frame.setlocal(4, frame.getlocal(0).__getattr__("append"));
118 t$1$PyObject = frame.getlocal(1);
119 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
120 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
121 frame.setlocal(7, t$0$PyObject__[0]);
122 frame.setlocal(3, t$0$PyObject__[1]);
123 if (frame.getlocal(7)._in(new PyTuple(new PyObject[] {frame.getglobal("LITERAL"), frame.getglobal("NOT_LITERAL")})).__nonzero__()) {
124 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_IGNORECASE")).__nonzero__()) {
125 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("OP_IGNORE").__getitem__(frame.getlocal(7))));
126 frame.getlocal(4).__call__(frame.getglobal("_sre").__getattr__("getlower").__call__(frame.getlocal(3), frame.getlocal(2)));
129 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
130 frame.getlocal(4).__call__(frame.getlocal(3));
133 else if (frame.getlocal(7)._is(frame.getglobal("IN")).__nonzero__()) {
134 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_IGNORECASE")).__nonzero__()) {
135 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("OP_IGNORE").__getitem__(frame.getlocal(7))));
136 frame.setlocal(8, new PyFunction(frame.f_globals, new PyObject[] {frame.getlocal(2)}, c$0_fixup));
139 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
140 frame.setlocal(8, new PyFunction(frame.f_globals, new PyObject[] {}, c$1_lambda));
142 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
143 frame.getlocal(4).__call__(i$2);
144 frame.getglobal("_compile_charset").__call__(new PyObject[] {frame.getlocal(3), frame.getlocal(2), frame.getlocal(0), frame.getlocal(8)});
145 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
147 else if (frame.getlocal(7)._is(frame.getglobal("ANY")).__nonzero__()) {
148 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_DOTALL")).__nonzero__()) {
149 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("ANY_ALL")));
152 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("ANY")));
155 else if (frame.getlocal(7)._in(new PyTuple(new PyObject[] {frame.getglobal("REPEAT"), frame.getglobal("MIN_REPEAT"), frame.getglobal("MAX_REPEAT")})).__nonzero__()) {
156 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_TEMPLATE")).__nonzero__()) {
157 throw Py.makeException(frame.getglobal("error"), s$3);
159 else if (((t$2$PyObject = frame.getglobal("_simple").__call__(frame.getlocal(3))).__nonzero__() ? frame.getlocal(7)._eq(frame.getglobal("MAX_REPEAT")) : t$2$PyObject).__nonzero__()) {
160 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("REPEAT_ONE")));
161 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
162 frame.getlocal(4).__call__(i$2);
163 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$2));
164 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$4));
165 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3).__getitem__(i$5), frame.getlocal(2));
166 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("SUCCESS")));
167 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
170 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("REPEAT")));
171 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
172 frame.getlocal(4).__call__(i$2);
173 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$2));
174 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$4));
175 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3).__getitem__(i$5), frame.getlocal(2));
176 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
177 if (frame.getlocal(7)._eq(frame.getglobal("MAX_REPEAT")).__nonzero__()) {
178 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("MAX_UNTIL")));
181 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("MIN_UNTIL")));
185 else if (frame.getlocal(7)._is(frame.getglobal("SUBPATTERN")).__nonzero__()) {
186 if (frame.getlocal(3).__getitem__(i$2).__nonzero__()) {
187 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("MARK")));
188 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$2)._sub(i$4)._mul(i$5));
190 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3).__getitem__(i$4), frame.getlocal(2));
191 if (frame.getlocal(3).__getitem__(i$2).__nonzero__()) {
192 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("MARK")));
193 frame.getlocal(4).__call__(frame.getlocal(3).__getitem__(i$2)._sub(i$4)._mul(i$5)._add(i$4));
196 else if (frame.getlocal(7)._in(new PyTuple(new PyObject[] {frame.getglobal("SUCCESS"), frame.getglobal("FAILURE")})).__nonzero__()) {
197 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
199 else if (frame.getlocal(7)._in(new PyTuple(new PyObject[] {frame.getglobal("ASSERT"), frame.getglobal("ASSERT_NOT")})).__nonzero__()) {
200 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
201 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
202 frame.getlocal(4).__call__(i$2);
203 if (frame.getlocal(3).__getitem__(i$2)._ge(i$2).__nonzero__()) {
204 frame.getlocal(4).__call__(i$2);
207 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(3).__getitem__(i$4).invoke("getwidth"), 2);
208 frame.setlocal(6, t$0$PyObject__[0]);
209 frame.setlocal(9, t$0$PyObject__[1]);
210 if (frame.getlocal(6)._ne(frame.getlocal(9)).__nonzero__()) {
211 throw Py.makeException(frame.getglobal("error"), s$6);
213 frame.getlocal(4).__call__(frame.getlocal(6));
215 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3).__getitem__(i$4), frame.getlocal(2));
216 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("SUCCESS")));
217 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
219 else if (frame.getlocal(7)._is(frame.getglobal("CALL")).__nonzero__()) {
220 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
221 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
222 frame.getlocal(4).__call__(i$2);
223 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3), frame.getlocal(2));
224 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("SUCCESS")));
225 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
227 else if (frame.getlocal(7)._is(frame.getglobal("AT")).__nonzero__()) {
228 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
229 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_MULTILINE")).__nonzero__()) {
230 frame.setlocal(3, frame.getglobal("AT_MULTILINE").invoke("get", frame.getlocal(3), frame.getlocal(3)));
232 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_LOCALE")).__nonzero__()) {
233 frame.setlocal(3, frame.getglobal("AT_LOCALE").invoke("get", frame.getlocal(3), frame.getlocal(3)));
235 else if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_UNICODE")).__nonzero__()) {
236 frame.setlocal(3, frame.getglobal("AT_UNICODE").invoke("get", frame.getlocal(3), frame.getlocal(3)));
238 frame.getlocal(4).__call__(frame.getglobal("ATCODES").__getitem__(frame.getlocal(3)));
240 else if (frame.getlocal(7)._is(frame.getglobal("BRANCH")).__nonzero__()) {
241 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
242 frame.setlocal(10, new PyList(new PyObject[] {}));
244 t$3$PyObject = frame.getlocal(3).__getitem__(i$4);
245 while ((t$2$PyObject = t$3$PyObject.__finditem__(t$1$int++)) != null) {
246 frame.setlocal(3, t$2$PyObject);
247 frame.setlocal(5, frame.getglobal("len").__call__(frame.getlocal(0)));
248 frame.getlocal(4).__call__(i$2);
249 frame.getglobal("_compile").__call__(frame.getlocal(0), frame.getlocal(3), frame.getlocal(2));
250 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("JUMP")));
251 frame.getlocal(10).invoke("append", frame.getglobal("len").__call__(frame.getlocal(0)));
252 frame.getlocal(4).__call__(i$2);
253 frame.getlocal(0).__setitem__(frame.getlocal(5), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(5)));
255 frame.getlocal(4).__call__(i$2);
257 t$5$PyObject = frame.getlocal(10);
258 while ((t$4$PyObject = t$5$PyObject.__finditem__(t$2$int++)) != null) {
259 frame.setlocal(10, t$4$PyObject);
260 frame.getlocal(0).__setitem__(frame.getlocal(10), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(10)));
263 else if (frame.getlocal(7)._is(frame.getglobal("CATEGORY")).__nonzero__()) {
264 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
265 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_LOCALE")).__nonzero__()) {
266 frame.setlocal(3, frame.getglobal("CH_LOCALE").__getitem__(frame.getlocal(3)));
268 else if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_UNICODE")).__nonzero__()) {
269 frame.setlocal(3, frame.getglobal("CH_UNICODE").__getitem__(frame.getlocal(3)));
271 frame.getlocal(4).__call__(frame.getglobal("CHCODES").__getitem__(frame.getlocal(3)));
273 else if (frame.getlocal(7)._is(frame.getglobal("GROUPREF")).__nonzero__()) {
274 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_IGNORECASE")).__nonzero__()) {
275 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("OP_IGNORE").__getitem__(frame.getlocal(7))));
278 frame.getlocal(4).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(7)));
280 frame.getlocal(4).__call__(frame.getlocal(3)._sub(i$4));
283 throw Py.makeException(frame.getglobal("ValueError"), new PyTuple(new PyObject[] {s$7, frame.getlocal(7)}));
289 private static PyObject lambda$4(PyFrame frame) {
290 return frame.getlocal(0);
293 private static PyObject _compile_charset$5(PyFrame frame) {
294 // Temporary Variables
296 PyObject[] t$0$PyObject__;
297 PyObject t$0$PyObject, t$1$PyObject;
300 frame.setlocal(6, frame.getlocal(2).__getattr__("append"));
301 if (frame.getlocal(3).__not__().__nonzero__()) {
302 frame.setlocal(3, new PyFunction(frame.f_globals, new PyObject[] {}, c$3_lambda));
305 t$1$PyObject = frame.getglobal("_optimize_charset").__call__(frame.getlocal(0), frame.getlocal(3));
306 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
307 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
308 frame.setlocal(4, t$0$PyObject__[0]);
309 frame.setlocal(5, t$0$PyObject__[1]);
310 frame.getlocal(6).__call__(frame.getglobal("OPCODES").__getitem__(frame.getlocal(4)));
311 if (frame.getlocal(4)._is(frame.getglobal("NEGATE")).__nonzero__()) {
314 else if (frame.getlocal(4)._is(frame.getglobal("LITERAL")).__nonzero__()) {
315 frame.getlocal(6).__call__(frame.getlocal(3).__call__(frame.getlocal(5)));
317 else if (frame.getlocal(4)._is(frame.getglobal("RANGE")).__nonzero__()) {
318 frame.getlocal(6).__call__(frame.getlocal(3).__call__(frame.getlocal(5).__getitem__(i$2)));
319 frame.getlocal(6).__call__(frame.getlocal(3).__call__(frame.getlocal(5).__getitem__(i$4)));
321 else if (frame.getlocal(4)._is(frame.getglobal("CHARSET")).__nonzero__()) {
322 frame.getlocal(2).invoke("extend", frame.getlocal(5));
324 else if (frame.getlocal(4)._is(frame.getglobal("CATEGORY")).__nonzero__()) {
325 if (frame.getlocal(1)._and(frame.getglobal("SRE_FLAG_LOCALE")).__nonzero__()) {
326 frame.getlocal(6).__call__(frame.getglobal("CHCODES").__getitem__(frame.getglobal("CH_LOCALE").__getitem__(frame.getlocal(5))));
328 else if (frame.getlocal(1)._and(frame.getglobal("SRE_FLAG_UNICODE")).__nonzero__()) {
329 frame.getlocal(6).__call__(frame.getglobal("CHCODES").__getitem__(frame.getglobal("CH_UNICODE").__getitem__(frame.getlocal(5))));
332 frame.getlocal(6).__call__(frame.getglobal("CHCODES").__getitem__(frame.getlocal(5)));
336 throw Py.makeException(frame.getglobal("error"), s$8);
339 frame.getlocal(6).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("FAILURE")));
343 private static PyObject _optimize_charset$6(PyFrame frame) {
344 // Temporary Variables
345 int t$0$int, t$1$int, t$2$int, t$3$int, t$4$int;
346 PyObject[] t$0$PyObject__;
347 PyException t$0$PyException;
348 PyObject t$0$PyObject, t$1$PyObject, t$2$PyObject, t$3$PyObject, t$4$PyObject, t$5$PyObject, t$6$PyObject, t$7$PyObject, t$8$PyObject, t$9$PyObject;
351 frame.setlocal(11, new PyList(new PyObject[] {}));
352 frame.setlocal(5, new PyList(new PyObject[] {i$2})._mul(i$9));
355 t$1$PyObject = frame.getlocal(0);
356 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
357 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
358 frame.setlocal(2, t$0$PyObject__[0]);
359 frame.setlocal(4, t$0$PyObject__[1]);
360 if (frame.getlocal(2)._is(frame.getglobal("NEGATE")).__nonzero__()) {
361 frame.getlocal(11).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(2), frame.getlocal(4)}));
363 else if (frame.getlocal(2)._is(frame.getglobal("LITERAL")).__nonzero__()) {
364 frame.getlocal(5).__setitem__(frame.getlocal(1).__call__(frame.getlocal(4)), i$4);
366 else if (frame.getlocal(2)._is(frame.getglobal("RANGE")).__nonzero__()) {
368 t$3$PyObject = frame.getglobal("range").__call__(frame.getlocal(1).__call__(frame.getlocal(4).__getitem__(i$2)), frame.getlocal(1).__call__(frame.getlocal(4).__getitem__(i$4))._add(i$4));
369 while ((t$2$PyObject = t$3$PyObject.__finditem__(t$1$int++)) != null) {
370 frame.setlocal(10, t$2$PyObject);
371 frame.getlocal(5).__setitem__(frame.getlocal(10), i$4);
374 else if (frame.getlocal(2)._is(frame.getglobal("CATEGORY")).__nonzero__()) {
375 return frame.getlocal(0);
379 catch (Throwable x$0) {
380 t$0$PyException = Py.setException(x$0, frame);
381 if (Py.matchException(t$0$PyException, frame.getglobal("IndexError"))) {
382 return frame.getlocal(0);
384 else throw t$0$PyException;
387 frame.setlocal(10, t$4$PyObject);
388 frame.setlocal(6, t$4$PyObject);
389 frame.setlocal(7, t$4$PyObject);
390 frame.setlocal(9, new PyList(new PyObject[] {}));
392 t$5$PyObject = frame.getlocal(5);
393 while ((t$4$PyObject = t$5$PyObject.__finditem__(t$2$int++)) != null) {
394 frame.setlocal(12, t$4$PyObject);
395 if (frame.getlocal(12).__nonzero__()) {
396 if (frame.getlocal(7)._eq(i$2).__nonzero__()) {
397 frame.setlocal(6, frame.getlocal(10));
399 frame.setlocal(7, frame.getlocal(7)._add(i$4));
401 else if (frame.getlocal(7).__nonzero__()) {
402 frame.getlocal(9).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(7)}));
403 frame.setlocal(7, i$2);
405 frame.setlocal(10, frame.getlocal(10)._add(i$4));
407 if (frame.getlocal(7).__nonzero__()) {
408 frame.getlocal(9).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(7)}));
410 if (frame.getglobal("len").__call__(frame.getlocal(9))._le(i$5).__nonzero__()) {
412 t$7$PyObject = frame.getlocal(9);
413 while ((t$6$PyObject = t$7$PyObject.__finditem__(t$3$int++)) != null) {
414 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$6$PyObject, 2);
415 frame.setlocal(6, t$0$PyObject__[0]);
416 frame.setlocal(7, t$0$PyObject__[1]);
417 if (frame.getlocal(7)._eq(i$4).__nonzero__()) {
418 frame.getlocal(11).invoke("append", new PyTuple(new PyObject[] {frame.getglobal("LITERAL"), frame.getlocal(6)}));
421 frame.getlocal(11).invoke("append", new PyTuple(new PyObject[] {frame.getglobal("RANGE"), new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(6)._add(frame.getlocal(7))._sub(i$4)})}));
424 if (frame.getglobal("len").__call__(frame.getlocal(11))._lt(frame.getglobal("len").__call__(frame.getlocal(0))).__nonzero__()) {
425 return frame.getlocal(11);
429 frame.setlocal(13, new PyList(new PyObject[] {}));
430 frame.setlocal(8, i$4);
431 frame.setlocal(3, i$2);
433 t$9$PyObject = frame.getlocal(5);
434 while ((t$8$PyObject = t$9$PyObject.__finditem__(t$4$int++)) != null) {
435 frame.setlocal(12, t$8$PyObject);
436 if (frame.getlocal(12).__nonzero__()) {
437 frame.setlocal(3, frame.getlocal(3)._add(frame.getlocal(8)));
439 frame.setlocal(8, frame.getlocal(8)._lshift(i$4));
440 if (frame.getlocal(8)._gt(frame.getglobal("MAXCODE")).__nonzero__()) {
441 frame.getlocal(13).invoke("append", frame.getlocal(3));
442 frame.setlocal(8, i$4);
443 frame.setlocal(3, i$2);
446 frame.getlocal(11).invoke("append", new PyTuple(new PyObject[] {frame.getglobal("CHARSET"), frame.getlocal(13)}));
447 return frame.getlocal(11);
449 return frame.getlocal(0);
452 private static PyObject _simple$7(PyFrame frame) {
453 // Temporary Variables
454 PyObject[] t$0$PyObject__;
455 PyObject t$0$PyObject, t$1$PyObject;
458 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(0).__getitem__(i$5).invoke("getwidth"), 2);
459 frame.setlocal(2, t$0$PyObject__[0]);
460 frame.setlocal(1, t$0$PyObject__[1]);
461 if (((t$0$PyObject = frame.getlocal(2)._eq(i$2)).__nonzero__() ? frame.getlocal(1)._eq(frame.getglobal("MAXREPEAT")) : t$0$PyObject).__nonzero__()) {
462 throw Py.makeException(frame.getglobal("error"), s$10);
464 return (t$0$PyObject = (frame.getlocal(2)._eq(t$1$PyObject = frame.getlocal(1)).__nonzero__() ? t$1$PyObject._eq(i$4) : Py.Zero)).__nonzero__() ? frame.getlocal(0).__getitem__(i$5).__getitem__(i$2).__getitem__(i$2)._ne(frame.getglobal("SUBPATTERN")) : t$0$PyObject;
467 private static PyObject _compile_info$8(PyFrame frame) {
468 // Temporary Variables
469 int t$0$int, t$1$int, t$2$int, t$3$int;
471 PyObject[] t$0$PyObject__;
472 PyObject t$0$PyObject, t$1$PyObject, t$2$PyObject, t$3$PyObject, t$4$PyObject, t$5$PyObject, t$6$PyObject, t$7$PyObject, t$8$PyObject;
475 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(1).invoke("getwidth"), 2);
476 frame.setlocal(5, t$0$PyObject__[0]);
477 frame.setlocal(3, t$0$PyObject__[1]);
478 if (frame.getlocal(5)._eq(i$2).__nonzero__()) {
481 frame.setlocal(11, new PyList(new PyObject[] {}));
482 frame.setlocal(16, i$2);
483 frame.setlocal(4, new PyList(new PyObject[] {}));
484 if (frame.getlocal(2)._and(frame.getglobal("SRE_FLAG_IGNORECASE")).__not__().__nonzero__()) {
486 t$1$PyObject = frame.getlocal(1).__getattr__("data");
487 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
488 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
489 frame.setlocal(6, t$0$PyObject__[0]);
490 frame.setlocal(7, t$0$PyObject__[1]);
491 if (frame.getlocal(6)._is(frame.getglobal("LITERAL")).__nonzero__()) {
492 if (frame.getglobal("len").__call__(frame.getlocal(11))._eq(frame.getlocal(16)).__nonzero__()) {
493 frame.setlocal(16, frame.getlocal(16)._add(i$4));
495 frame.getlocal(11).invoke("append", frame.getlocal(7));
497 else if (((t$2$PyObject = frame.getlocal(6)._is(frame.getglobal("SUBPATTERN"))).__nonzero__() ? frame.getglobal("len").__call__(frame.getlocal(7).__getitem__(i$4))._eq(i$4) : t$2$PyObject).__nonzero__()) {
498 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(7).__getitem__(i$4).__getitem__(i$2), 2);
499 frame.setlocal(6, t$0$PyObject__[0]);
500 frame.setlocal(7, t$0$PyObject__[1]);
501 if (frame.getlocal(6)._is(frame.getglobal("LITERAL")).__nonzero__()) {
502 frame.getlocal(11).invoke("append", frame.getlocal(7));
512 if (((t$2$PyObject = frame.getlocal(11).__not__()).__nonzero__() ? frame.getlocal(1).__getattr__("data") : t$2$PyObject).__nonzero__()) {
513 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(1).__getattr__("data").__getitem__(i$2), 2);
514 frame.setlocal(6, t$0$PyObject__[0]);
515 frame.setlocal(7, t$0$PyObject__[1]);
516 if (((t$2$PyObject = frame.getlocal(6)._is(frame.getglobal("SUBPATTERN"))).__nonzero__() ? frame.getlocal(7).__getitem__(i$4) : t$2$PyObject).__nonzero__()) {
517 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(7).__getitem__(i$4).__getitem__(i$2), 2);
518 frame.setlocal(6, t$0$PyObject__[0]);
519 frame.setlocal(7, t$0$PyObject__[1]);
520 if (frame.getlocal(6)._is(frame.getglobal("LITERAL")).__nonzero__()) {
521 frame.getlocal(4).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(7)}));
523 else if (frame.getlocal(6)._is(frame.getglobal("BRANCH")).__nonzero__()) {
524 frame.setlocal(15, new PyList(new PyObject[] {}));
526 t$3$PyObject = frame.getlocal(7).__getitem__(i$4);
527 while (t$0$boolean=(t$2$PyObject = t$3$PyObject.__finditem__(t$1$int++)) != null) {
528 frame.setlocal(9, t$2$PyObject);
529 if (frame.getlocal(9).__not__().__nonzero__()) {
532 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(9).__getitem__(i$2), 2);
533 frame.setlocal(6, t$0$PyObject__[0]);
534 frame.setlocal(7, t$0$PyObject__[1]);
535 if (frame.getlocal(6)._is(frame.getglobal("LITERAL")).__nonzero__()) {
536 frame.getlocal(15).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(7)}));
543 frame.setlocal(4, frame.getlocal(15));
547 else if (frame.getlocal(6)._is(frame.getglobal("BRANCH")).__nonzero__()) {
548 frame.setlocal(15, new PyList(new PyObject[] {}));
550 t$5$PyObject = frame.getlocal(7).__getitem__(i$4);
551 while (t$0$boolean=(t$4$PyObject = t$5$PyObject.__finditem__(t$2$int++)) != null) {
552 frame.setlocal(9, t$4$PyObject);
553 if (frame.getlocal(9).__not__().__nonzero__()) {
556 t$0$PyObject__ = org.python.core.Py.unpackSequence(frame.getlocal(9).__getitem__(i$2), 2);
557 frame.setlocal(6, t$0$PyObject__[0]);
558 frame.setlocal(7, t$0$PyObject__[1]);
559 if (frame.getlocal(6)._is(frame.getglobal("LITERAL")).__nonzero__()) {
560 frame.getlocal(15).invoke("append", new PyTuple(new PyObject[] {frame.getlocal(6), frame.getlocal(7)}));
567 frame.setlocal(4, frame.getlocal(15));
570 else if (frame.getlocal(6)._is(frame.getglobal("IN")).__nonzero__()) {
571 frame.setlocal(4, frame.getlocal(7));
575 frame.setlocal(8, frame.getlocal(0).__getattr__("append"));
576 frame.getlocal(8).__call__(frame.getglobal("OPCODES").__getitem__(frame.getglobal("INFO")));
577 frame.setlocal(10, frame.getglobal("len").__call__(frame.getlocal(0)));
578 frame.getlocal(8).__call__(i$2);
579 frame.setlocal(13, i$2);
580 if (frame.getlocal(11).__nonzero__()) {
581 frame.setlocal(13, frame.getglobal("SRE_INFO_PREFIX"));
582 if ((frame.getglobal("len").__call__(frame.getlocal(11))._eq(t$6$PyObject = frame.getlocal(16)).__nonzero__() ? t$6$PyObject._eq(frame.getglobal("len").__call__(frame.getlocal(1).__getattr__("data"))) : Py.Zero).__nonzero__()) {
583 frame.setlocal(13, frame.getlocal(13)._add(frame.getglobal("SRE_INFO_LITERAL")));
586 else if (frame.getlocal(4).__nonzero__()) {
587 frame.setlocal(13, frame.getlocal(13)._add(frame.getglobal("SRE_INFO_CHARSET")));
589 frame.getlocal(8).__call__(frame.getlocal(13));
590 if (frame.getlocal(5)._lt(frame.getglobal("MAXCODE")).__nonzero__()) {
591 frame.getlocal(8).__call__(frame.getlocal(5));
594 frame.getlocal(8).__call__(frame.getglobal("MAXCODE"));
595 frame.setlocal(11, frame.getlocal(11).__getslice__(null, frame.getglobal("MAXCODE"), null));
597 if (frame.getlocal(3)._lt(frame.getglobal("MAXCODE")).__nonzero__()) {
598 frame.getlocal(8).__call__(frame.getlocal(3));
601 frame.getlocal(8).__call__(i$2);
603 if (frame.getlocal(11).__nonzero__()) {
604 frame.getlocal(8).__call__(frame.getglobal("len").__call__(frame.getlocal(11)));
605 frame.getlocal(8).__call__(frame.getlocal(16));
606 frame.getlocal(0).invoke("extend", frame.getlocal(11));
607 frame.setlocal(14, new PyList(new PyObject[] {i$4.__neg__()})._add(new PyList(new PyObject[] {i$2})._mul(frame.getglobal("len").__call__(frame.getlocal(11)))));
609 t$7$PyObject = frame.getglobal("range").__call__(frame.getglobal("len").__call__(frame.getlocal(11)));
610 while ((t$6$PyObject = t$7$PyObject.__finditem__(t$3$int++)) != null) {
611 frame.setlocal(12, t$6$PyObject);
612 frame.getlocal(14).__setitem__(frame.getlocal(12)._add(i$4), frame.getlocal(14).__getitem__(frame.getlocal(12))._add(i$4));
613 while (((t$8$PyObject = frame.getlocal(14).__getitem__(frame.getlocal(12)._add(i$4))._gt(i$2)).__nonzero__() ? frame.getlocal(11).__getitem__(frame.getlocal(12))._ne(frame.getlocal(11).__getitem__(frame.getlocal(14).__getitem__(frame.getlocal(12)._add(i$4))._sub(i$4))) : t$8$PyObject).__nonzero__()) {
614 frame.getlocal(14).__setitem__(frame.getlocal(12)._add(i$4), frame.getlocal(14).__getitem__(frame.getlocal(14).__getitem__(frame.getlocal(12)._add(i$4))._sub(i$4))._add(i$4));
617 frame.getlocal(0).invoke("extend", frame.getlocal(14).__getslice__(i$4, null, null));
619 else if (frame.getlocal(4).__nonzero__()) {
620 frame.getglobal("_compile_charset").__call__(frame.getlocal(4), i$2, frame.getlocal(0));
622 frame.getlocal(0).__setitem__(frame.getlocal(10), frame.getglobal("len").__call__(frame.getlocal(0))._sub(frame.getlocal(10)));
626 private static PyObject _code$9(PyFrame frame) {
627 frame.setlocal(1, frame.getlocal(0).__getattr__("pattern").__getattr__("flags")._or(frame.getlocal(1)));
628 frame.setlocal(2, new PyList(new PyObject[] {}));
629 frame.getglobal("_compile_info").__call__(frame.getlocal(2), frame.getlocal(0), frame.getlocal(1));
630 frame.getglobal("_compile").__call__(frame.getlocal(2), frame.getlocal(0).__getattr__("data"), frame.getlocal(1));
631 frame.getlocal(2).invoke("append", frame.getglobal("OPCODES").__getitem__(frame.getglobal("SUCCESS")));
632 return frame.getlocal(2);
635 private static PyObject compile$10(PyFrame frame) {
636 // Temporary Variables
638 PyObject[] t$0$PyObject__;
639 PyObject t$0$PyObject, t$1$PyObject;
642 if (frame.getglobal("type").__call__(frame.getlocal(0))._in(frame.getglobal("STRING_TYPES")).__nonzero__()) {
643 frame.setlocal(7, org.python.core.imp.importOne("sre_parse", frame));
644 frame.setlocal(8, frame.getlocal(0));
645 frame.setlocal(0, frame.getlocal(7).__getattr__("parse").__call__(frame.getlocal(0), frame.getlocal(1)));
648 frame.setlocal(8, frame.getglobal("None"));
650 frame.setlocal(3, frame.getglobal("_code").__call__(frame.getlocal(0), frame.getlocal(1)));
651 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getlocal(0).__getattr__("pattern").__getattr__("groups")._le(i$12), s$13);
652 frame.setlocal(2, frame.getlocal(0).__getattr__("pattern").__getattr__("groupdict"));
653 frame.setlocal(4, new PyList(new PyObject[] {frame.getglobal("None")})._mul(frame.getlocal(0).__getattr__("pattern").__getattr__("groups")));
655 t$1$PyObject = frame.getlocal(2).invoke("items");
656 while ((t$0$PyObject = t$1$PyObject.__finditem__(t$0$int++)) != null) {
657 t$0$PyObject__ = org.python.core.Py.unpackSequence(t$0$PyObject, 2);
658 frame.setlocal(5, t$0$PyObject__[0]);
659 frame.setlocal(6, t$0$PyObject__[1]);
660 frame.getlocal(4).__setitem__(frame.getlocal(6), frame.getlocal(5));
662 return frame.getglobal("_sre").__getattr__("compile").__call__(new PyObject[] {frame.getlocal(8), frame.getlocal(1), frame.getlocal(3), frame.getlocal(0).__getattr__("pattern").__getattr__("groups")._sub(i$4), frame.getlocal(2), frame.getlocal(4)});
665 private static PyObject main$11(PyFrame frame) {
666 frame.setglobal("__file__", s$14);
668 // Temporary Variables
669 PyException t$0$PyException;
672 frame.setlocal("_sre", org.python.core.imp.importOne("_sre", frame));
673 org.python.core.imp.importAll("sre_constants", frame);
674 if (frame.getglobal("__debug__").__nonzero__()) Py.assert(frame.getname("_sre").__getattr__("MAGIC")._eq(frame.getname("MAGIC")), s$0);
675 frame.setlocal("MAXCODE", i$1);
676 frame.setlocal("_compile", new PyFunction(frame.f_globals, new PyObject[] {}, c$2__compile));
677 frame.setlocal("_compile_charset", new PyFunction(frame.f_globals, new PyObject[] {frame.getname("None")}, c$4__compile_charset));
678 frame.setlocal("_optimize_charset", new PyFunction(frame.f_globals, new PyObject[] {}, c$5__optimize_charset));
679 frame.setlocal("_simple", new PyFunction(frame.f_globals, new PyObject[] {}, c$6__simple));
680 frame.setlocal("_compile_info", new PyFunction(frame.f_globals, new PyObject[] {}, c$7__compile_info));
681 frame.setlocal("STRING_TYPES", new PyList(new PyObject[] {frame.getname("type").__call__(s$11)}));
683 frame.getname("STRING_TYPES").invoke("append", frame.getname("type").__call__(frame.getname("unicode").__call__(s$11)));
685 catch (Throwable x$0) {
686 t$0$PyException = Py.setException(x$0, frame);
687 if (Py.matchException(t$0$PyException, frame.getname("NameError"))) {
690 else throw t$0$PyException;
692 frame.setlocal("_code", new PyFunction(frame.f_globals, new PyObject[] {}, c$8__code));
693 frame.setlocal("compile", new PyFunction(frame.f_globals, new PyObject[] {i$2}, c$9_compile));
698 public static void moduleDictInit(PyObject dict) {
699 dict.__setitem__("__name__", new PyString("sre_compile"));
700 Py.runCode(new _PyInner().getMain(), dict, dict);
703 public static void main(String[] args) throws java.lang.Exception {
704 String[] newargs = new String[args.length+1];
705 newargs[0] = "sre_compile";
706 System.arraycopy(args, 0, newargs, 1, args.length);
707 Py.runMain(sre_compile._PyInner.class, newargs, sre_compile.jpy$packages, sre_compile.jpy$mainProperties, "", new String[] {"string", "random", "util", "traceback", "sre_compile", "atexit", "sre", "sre_constants", "StringIO", "javaos", "socket", "yapm", "calendar", "repr", "copy_reg", "SocketServer", "server", "re", "linecache", "javapath", "UserDict", "copy", "threading", "stat", "PathVFS", "sre_parse"});