Additional top-level classes in compilation unit: PyIntegerConstant, PyFloatConstant, PyComplexConstant, PyStringConstant, PyUnicodeConstant, PyLongConstant, PyCodeConstant, PyBytecodeConstant.
| Modifier and Type | Field and Description |
|---|---|
| private static final char[] | base64enc
Look-up table for |
| pack-priv ClassFile | |
| pack-priv List | |
| pack-priv Hashtable | constants
The pool of Python Constants |
| private static String | |
| pack-priv Constant | |
| pack-priv Future | |
| private static String | |
| pack-priv boolean | |
| pack-priv Constant | |
| private static final int | |
| private static final int | |
| pack-priv long | |
| protected Hashtable | oversized_methods
Table of oversized methods represented as CPython bytecode. |
| private static String | |
| pack-priv Hashtable | |
| private int | |
| pack-priv String | |
| private static String | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected static void | |
| public void | |
| pack-priv void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private static String | Returns: the string encoding the datato encode data)Implement a simplified base64 encoding compatible with the decoding in BytecodeLoader. |
| pack-priv Constant | codeConstant(mod tree, String name, boolean fast_locals, String className, boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope, CompilerFlags cflags)
|
| pack-priv Constant | codeConstant(mod tree, String name, boolean fast_locals, String className, Str classDoc, boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope, CompilerFlags cflags)
|
| public static void | compile(mod node, OutputStream ostream, String name, String filename, boolean linenumbers, boolean printResults, CompilerFlags cflags)
|
| public static void | compile(mod
AST of the module to write node, OutputStream stream onto which to write it ostream, String name, String filename, boolean linenumbers, boolean printResults, CompilerFlags cflags, long mtime)Create and write a Python module as a Java class file. |
| pack-priv Constant | |
| public void | |
| public boolean | |
| public void | |
| public void | error(String msg, boolean err, PythonTree node)
Implements org.
|
| private Constant | |
| pack-priv Constant | |
| public String | |
| public Future | |
| public ScopeInfo | |
| private static void | insert_code_str_to_classfile(String
of the method or function being generated name, String Base64 encoded CPython byte code code_str, Module currently being defined as a class file module)This method stores Base64 encoded Python byte code in one or more String literals. |
| pack-priv Constant | |
| private static PyBytecode | |
| pack-priv Constant | |
| private static String | |
| pack-priv Constant | |
| pack-priv Constant | |
| public void |
| base64enc | back to summary |
|---|---|
| private static final char[] base64enc Look-up table for | |
| classfile | back to summary |
|---|---|
| pack-priv ClassFile classfile | |
| codes | back to summary |
|---|---|
| pack-priv List<PyCodeConstant> codes | |
| constants | back to summary |
|---|---|
| pack-priv Hashtable<Constant, Constant> constants The pool of Python Constants | |
| CPYTHON_CMD_MSG | back to summary |
|---|---|
| private static String CPYTHON_CMD_MSG | |
| filename | back to summary |
|---|---|
| pack-priv Constant filename | |
| futures | back to summary |
|---|---|
| pack-priv Future futures | |
| LARGE_METHOD_MSG | back to summary |
|---|---|
| private static String LARGE_METHOD_MSG | |
| linenumbers | back to summary |
|---|---|
| pack-priv boolean linenumbers | |
| mainCode | back to summary |
|---|---|
| pack-priv Constant mainCode | |
| MAX_SETTINGS_PER_SETTER | back to summary |
|---|---|
| private static final int MAX_SETTINGS_PER_SETTER | |
| maxLiteral | back to summary |
|---|---|
| private static final int maxLiteral | |
| mtime | back to summary |
|---|---|
| pack-priv long mtime | |
| oversized_methods | back to summary |
|---|---|
| protected Hashtable<String, String> oversized_methods Table of oversized methods represented as CPython bytecode. | |
| PLEASE_PROVIDE_MSG | back to summary |
|---|---|
| private static String PLEASE_PROVIDE_MSG | |
| scopes | back to summary |
|---|---|
| pack-priv Hashtable<PythonTree, ScopeInfo> scopes | |
| setter_count | back to summary |
|---|---|
| private int setter_count | |
| sfilename | back to summary |
|---|---|
| pack-priv String sfilename | |
| TRIED_CREATE_PYC_MSG | back to summary |
|---|---|
| private static String TRIED_CREATE_PYC_MSG | |
| USE_SETTERS_LIMIT | back to summary |
|---|---|
| private static final int USE_SETTERS_LIMIT | |
| Module | back to summary |
|---|---|
| public Module(String name, String filename, boolean linenumbers) | |
| Module | back to summary |
|---|---|
| public Module(String name, String filename, boolean linenumbers, long mtime) | |
| Module | back to summary |
|---|---|
| public Module(String name) | |
| _module_init | back to summary |
|---|---|
| protected static void _module_init(mod node, Module module, boolean printResults, CompilerFlags cflags) throws Exception | |
| addBootstrap | back to summary |
|---|---|
| public void addBootstrap() throws IOException | |
| addConstants | back to summary |
|---|---|
| pack-priv void addConstants(Code c) throws IOException | |
| addFunctions | back to summary |
|---|---|
| public void addFunctions() throws IOException | |
| addInit | back to summary |
|---|---|
| public void addInit() throws IOException This block of code writes out the various standard methods | |
| addMain | back to summary |
|---|---|
| public void addMain() throws IOException | |
| addRunnable | back to summary |
|---|---|
| public void addRunnable() throws IOException | |
| base64encodeToString | back to summary |
|---|---|
| private static String base64encodeToString(byte[] data) Implement a simplified base64 encoding compatible with the decoding in BytecodeLoader. This
encoder adds no '=' padding or line-breaks. equivalent to
| |
| codeConstant | back to summary |
|---|---|
| pack-priv Constant codeConstant(mod tree, String name, boolean fast_locals, String className, boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope, CompilerFlags cflags) throws Exception | |
| codeConstant | back to summary |
|---|---|
| pack-priv Constant codeConstant(mod tree, String name, boolean fast_locals, String className, Str classDoc, boolean classBody, boolean printResults, int firstlineno, ScopeInfo scope, CompilerFlags cflags) throws Exception | |
| compile | back to summary |
|---|---|
| public static void compile(mod node, OutputStream ostream, String name, String filename, boolean linenumbers, boolean printResults, CompilerFlags cflags) throws Exception | |
| compile | back to summary |
|---|---|
| public static void compile(mod node, OutputStream ostream, String name, String filename, boolean linenumbers, boolean printResults, CompilerFlags cflags, long mtime) throws Exception Create and write a Python module as a Java class file.
| |
| complexConstant | back to summary |
|---|---|
| pack-priv Constant complexConstant(double value) | |
| emitNum | back to summary |
|---|---|
| public void emitNum(Num node, Code code) throws Exception | |
| emitPrimitiveArraySetters | back to summary |
|---|---|
| public boolean emitPrimitiveArraySetters(List<? extends PythonTree> nodes, Code code) throws Exception | |
| emitStr | back to summary |
|---|---|
| public void emitStr(Str node, Code code) throws Exception | |
| error | back to summary |
|---|---|
| public void error(String msg, boolean err, PythonTree node) throws Exception Implements org.
| |
| findConstant | back to summary |
|---|---|
| private Constant findConstant(Constant c) | |
| floatConstant | back to summary |
|---|---|
| pack-priv Constant floatConstant(double value) | |
| getFilename | back to summary |
|---|---|
| public String getFilename() Implements org.
| |
| getFutures | back to summary |
|---|---|
| public Future getFutures() Implements org.
| |
| getScopeInfo | back to summary |
|---|---|
| public ScopeInfo getScopeInfo(PythonTree node) Implements org.
| |
| insert_code_str_to_classfile | back to summary |
|---|---|
| private static void insert_code_str_to_classfile(String name, String code_str, Module module) throws IOException This method stores Base64 encoded Python byte code in one or more String literals. While Java String objects are limited only by the address range of arrays, the class file standard only supports literals representable in at most 65535 bytes of modified UTF-8. This method us used only with base64 Strings (therefore ASCII without nulls) and so each character occupies exactly 1 byte in the class file after encoding to UTF-8.
To work within the 65535 byte limitation, the
| |
| integerConstant | back to summary |
|---|---|
| pack-priv Constant integerConstant(int value) | |
| loadPyBytecode | back to summary |
|---|---|
| private static PyBytecode loadPyBytecode(String filename, boolean try_cpython) throws RuntimeException | |
| longConstant | back to summary |
|---|---|
| pack-priv Constant longConstant(String value) | |
| serializePyBytecode | back to summary |
|---|---|
| private static String serializePyBytecode(PyBytecode btcode) throws IOException | |
| stringConstant | back to summary |
|---|---|
| pack-priv Constant stringConstant(String value) | |
| unicodeConstant | back to summary |
|---|---|
| pack-priv Constant unicodeConstant(String value) | |
| write | back to summary |
|---|---|
| public void write(OutputStream stream) throws IOException | |