PyEnv.DataStackIn Python, everything is an object, and the interpreter maintains a stack of references to such objects. Pushing and popping on the stack are always references to objets that leave in a heap. There is no need to model this heap, but the data stack is quite important.
type cell = | Const of FFI.Constant.tconstant from co_consts
| Name of {}reference to a name, from co_names.
| VarName of stringreference to a local name, fromco_varnames
| Temp of T.Ident.tSSA variable
*)| Code of {fun_or_class : bool;code_name : string;code : FFI.Code.t;}code Python object with its name. It can be a function, class, closure, ...
| List of PyBuiltin.builder * cell listLight encoding of raw Python tuples/lists.
*)| Map of (T.Exp.t * cell) listLight encoding of raw Python maps/dicts.
*)| BuiltinBuildClasssee Python's LOAD_BUILD_CLASS
| Import of {import_path : Ident.t;from_list : string list;}imported module path, with optional names of symbols from that module
*)| ImportFrom of {import_path : Ident.t;imported_name : string;}imported symbol from a module. Must have been loaded via Import first
| ImportCall of {id : Ident.t;loc : T.Location.t;}Static call to export definition
*)| MethodCall of {receiver : T.Exp.t;name : T.QualifiedProcName.t;}Virtual call, usually of a method of a class. Could be an access to a closure that is called straight away
*)| StaticCall of {call_name : T.QualifiedProcName.t;receiver : T.Exp.t option;}call to static method in class. Because we turn some method calls into static ones, we have to keep the receiver around, just in case.
*)| Superspecial name to refer to the parent class, like in super().__init__()
| Path of Ident.tQualified path for sequence of imports, attribute accesses, ...
*)| WithContext of T.Ident.tvalue to be used for calling __enter__ and __exit__ with the `with context` statement
*)| NoExceptionSpecial NONE symbol pushed by the exception infra to express that no exception has been raised
*)val pp_cell : Stdlib.Format.formatter -> cell -> unitval as_code : cell -> FFI.Code.t optionval as_name : cell -> string optionval is_path : cell -> boolval is_no_exception : cell -> booltype t = cell list