Esempio n. 1
0
 def load_shell_class(self, stmt):
     # Load the class from a stream and return the loaded class
     result = sourcecode_compiler.compile_class_from_string(stmt, None, self)
     if self._dump_bytecodes:
         from som.compiler.disassembler import Disassembler
         Disassembler.dump(result)
     return result
Esempio n. 2
0
 def load_shell_class(self, stmt):
     # Load the class from a stream and return the loaded class
     result = sourcecode_compiler.compile_class_from_string(
         stmt, None, self)
     if self._dump_bytecodes:
         from som.compiler.disassembler import Disassembler
         Disassembler.dump(result)
     return result
Esempio n. 3
0
    def _load_class(self, name, system_class):
        # Try loading the class from all different paths
        for cpEntry in self._classpath:
            try:
                # Load the class from a file and return the loaded class
                result = sourcecode_compiler.compile_class_from_file(cpEntry, name.get_string(), system_class, self)
                if self._dump_bytecodes:
                    from som.compiler.disassembler import Disassembler
                    Disassembler.dump(result.get_class())
                    Disassembler.dump(result)

                return result
            except IOError:
                # Continue trying different paths
                pass

        # The class could not be found.
        return None
Esempio n. 4
0
    def _load_class(self, name, system_class):
        # Try loading the class from all different paths
        for cpEntry in self._classpath:
            try:
                # Load the class from a file and return the loaded class
                result = sourcecode_compiler.compile_class_from_file(
                    cpEntry, name.get_string(), system_class, self)
                if self._dump_bytecodes:
                    from som.compiler.disassembler import Disassembler
                    Disassembler.dump(result.get_class())
                    Disassembler.dump(result)

                return result
            except IOError:
                # Continue trying different paths
                pass

        # The class could not be found.
        return None