Top Inners Fields Constructors Methods
org.python.compiler

public Class CodeCompiler

extends Visitor
implements Opcodes, ClassConstants
Class Inheritance
All Implemented Interfaces
org.python.compiler.ClassConstants, org.objectweb.asm.Opcodes
Imports
java.io.IOException, java.util.ArrayList, .Arrays, .Collection, .ListIterator, .Map, .Stack, .Vector, org.python.antlr.ParseException, .PythonTree, .Visitor, org.python.antlr.ast.Assert, .Assign, .Attribute, .AugAssign, .BinOp, .BoolOp, .Break, .Call, .ClassDef, .Compare, .Continue, .Delete, .Dict, .DictComp, .Ellipsis, .ExceptHandler, .Exec, .Expr, .Expression, .ExtSlice, .For, .FunctionDef, .GeneratorExp, .Global, .If, .IfExp, .Import, .ImportFrom, .Index, .Interactive, .Lambda, .List, .ListComp, .Name, .Num, .Pass, .Print, .Raise, .Repr, .Return, .Set, .SetComp, .Slice, .Str, .Subscript, .Suite, .TryExcept, .TryFinally, .Tuple, .UnaryOp, .While, .With, .Yield, .alias, .cmpopType, .comprehension, .expr_contextType, .keyword, .operatorType, org.python.antlr.base.expr, .mod, .stmt, org.python.core.CompilerFlags, .ContextGuard, .ContextManager, .imp, .Py, .PyCode, .PyComplex, .PyDictionary, .PyException, .PyFloat, .PyFrame, .PyFunction, .PyInteger, .PyList, .PyLong, .PyObject, .PySet, .PySlice, .PyString, .PyTuple, .PyUnicode, .ThreadState, org.objectweb.asm.Label, .Opcodes, .Type, org.objectweb.asm.commons.Method

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class
CodeCompiler.ExceptionHandler

Data about a given exception range whether a try:finally: or a try:except:.

private class

Field Summary

Modifier and TypeField and Description
private expr_contextType
private int
private int
private int
private int
private int
private Stack<Label>
private CompilerFlags
private String
private Code
private Stack<Label>
private Stack<CodeCompiler.ExceptionHandler>
private static final Object
private boolean
private Module
private ScopeInfo
private static final Object
private boolean
private Stack<String>
private Map<String, SymInfo>
private int
private int
private Vector<Label>

Constructor Summary

AccessConstructor and Description
public
CodeCompiler(Module module, boolean print_results)

Method Summary

Modifier and TypeMethod and Description
private void
applyDecorators(List<expr> decorators)

public int
pack-priv static boolean
checkOptimizeGlobals(boolean fast_locals, ScopeInfo scope)

private void
doFinallysDownTo(int level)

Inline the finally handling code for levels down to the levelth parent (0 means all).

public Object
doTest(Label end_of_if, If node, int index)

pack-priv void
private void
endExceptionHandlers()

Close all the open exception handler ranges.

public void
exceptionTest(int exc, Label end_of_exceptions, TryExcept node, int index)

private void
finishComp(expr node, List<expr> args, List<comprehension> generators, String tmp_append)

public void
finishLoop(int savebcf)

public void
freeArray(int array)

public void
freeArrayRef(int array)

public Str
private String
public void
private int
impliedImportLevel(int level)

Return the implied import level, which is different from the argument only if the argument is zero (no leading dots) meaning try relative then absolute (in Python 2), signified by returning level -1.

private void
public Object
public void
loadArray(Code code, List<? extends PythonTree> nodes)

private void
public void
public void
public int
makeArray(List<? extends PythonTree> nodes)

public boolean
pack-priv static int
pack-priv void
parse(mod node, Code code, boolean fast_locals, String className, Str classDoc, boolean classBody, ScopeInfo scope, CompilerFlags cflags)

private void
private void
private void
restoreAugTmps(PythonTree node, int count)

private void
private void
restoreStack(int array)

private void
saveAugTmps(PythonTree node, int count)

private void
private int
public Object
seqDel(List<expr> nodes)

public Object
seqSet(List<expr> nodes)

public void
public void
set(PythonTree node, int tmp)

public void
setLastI(int idx)

public void
setline(int line)

public void
public Object
Slice(Subscript node, Slice slice)

private void
private void
stackConsume(int numItems)

private void
private void
stackProduce(String signature)

public int
public Object
suite(List<stmt> stmts)

protected Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public void
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
private Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
visitReturn(Return node, boolean inEval)

public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
Inherited from org.python.antlr.Visitor:
traversevisitvisit