boa.code.module.Module¶
What follows are the details of the Module implementation.
-
class
boa.code.module.Module(path: str, module_name='', to_import=['*'])[source]¶ -
-
abi_entry_point= None¶
-
abi_methods= {}¶
-
actions= None¶
-
all_vm_tokens= {}¶
-
app_call_registrations= None¶
-
bc= None¶
-
blocks= None¶
-
cfg= None¶
-
extra_instructions¶
-
local_methods¶
-
main¶ Return the default method in this module.
Returns: the default method in this module Return type: boa.code.method.Method
-
method_by_name(method_name)[source]¶ Look up a method by its name from the module
methodslist. :param method_name: the name of the method to look up :type method_name: strReturns: the method ( if it is found) Return type: boa.code.method.Method
-
methods= None¶
-
module_name= ''¶
-
orderered_methods¶ An ordered list of methods
Returns: A list of ordered methods is this module Return type: list
-
path= None¶
-
to_import= None¶
-
to_s()[source]¶ this method is used to print the output of the executable in a readable/ tokenized format. sample usage:
>>> from boa.compiler import Compiler >>> module = Compiler.load('./boa/tests/src/LambdaTest.py').default >>> module.write() >>> print(module.to_s()) 12 3 LOAD_CONST 9 [data] 4 STORE_FAST j [data] 22 11 LOAD_FAST j [data] 17 CALL_FUNCTION Main.<locals>.q_1 [<boa.code.pytoken.PyToken object at 0x10cb53c50>] [data] 22 20 STORE_FAST m [data] 24 27 243 b' ' [data] 3 30 LOAD_FAST m [data] 35 NOP [data] 36 241 [data] 37 242 [data] 38 RETURN_VALUE [data] 20 49 243 b' ' [data] 3 52 LOAD_FAST x [data] 57 LOAD_CONST 1 [data] 58 BINARY_ADD [data] 59 NOP [data] 60 241 [data] 61 242 [data] 62 RETURN_VALUE [data]
-