Ejemplo n.º 1
0
    def __init__(self,
                 cname,
                 parent_filename,
                 input_type,
                 root_path="",
                 runtime=True):
        self.root_path = root_path
        self.cname = cname
        self.input_type = input_type
        self.runtime = runtime
        if not SourceMap.parent_filename:
            SourceMap.parent_filename = parent_filename
            if input_type == "solidity":
                SourceMap.position_groups = SourceMap._load_position_groups()
            elif input_type == "standard json":
                SourceMap.position_groups = SourceMap._load_position_groups_standard_json(
                )
            else:
                raise Exception("There is no such type of input")
            SourceMap.ast_helper = AstHelper(SourceMap.parent_filename,
                                             input_type)
        self.source = self._get_source()

        self.positions = self._get_positions()
        if not runtime:
            self.positions_init = self._get_positions_init()
        self.instr_positions = {}
        self.var_names = self._get_var_names()
        self.func_call_names = self._get_func_call_names()
        self.callee_src_pairs = self._get_callee_src_pairs()
Ejemplo n.º 2
0
 def __init__(self,
              cname,
              parent_filename,
              input_type,
              root_path="",
              remap="",
              allow_paths=""):
     self.root_path = root_path
     self.cname = cname
     self.input_type = input_type
     if not SourceMap.parent_filename:
         SourceMap.remap = remap
         SourceMap.allow_paths = allow_paths
         SourceMap.parent_filename = parent_filename
         if input_type == "solidity":
             SourceMap.position_groups = SourceMap._load_position_groups()
         elif input_type == "standard json":
             SourceMap.position_groups = SourceMap._load_position_groups_standard_json(
             )
         else:
             raise Exception("There is no such type of input")
         SourceMap.ast_helper = AstHelper(SourceMap.parent_filename,
                                          input_type, SourceMap.remap,
                                          SourceMap.allow_paths)
         SourceMap.func_to_sig_by_contract = SourceMap._get_sig_to_func_by_contract(
         )
     self.source = self._get_source()
     self.positions = self._get_positions()
     self.instr_positions = {}
     self.var_names = self._get_var_names()
     self.func_call_names = self._get_func_call_names()
     self.callee_src_pairs = self._get_callee_src_pairs()
     self.func_name_to_params = self._get_func_name_to_params()
     self.sig_to_func = self._get_sig_to_func()
Ejemplo n.º 3
0
 def __init__(self, cname, parent_filename):
     self.cname = cname
     if not SourceMap.parent_filename:
         SourceMap.parent_filename = parent_filename
         SourceMap.position_groups = SourceMap.__load_position_groups()
         SourceMap.ast_helper = AstHelper(SourceMap.parent_filename)
     self.source = self.__get_source()
     self.positions = self.__get_positions()
     self.instr_positions = {}
     self.var_names = self.__get_var_names()
     self.func_call_names = self.__get_func_call_names()