Method and apparatus for expressing and checking relationships between types
    1.
    发明授权
    Method and apparatus for expressing and checking relationships between types 有权
    用于表达和检查类型之间的关系的方法和装置

    公开(公告)号:US08225294B2

    公开(公告)日:2012-07-17

    申请号:US11412662

    申请日:2006-04-27

    IPC分类号: G06F9/44

    CPC分类号: G06F8/437

    摘要: One embodiment of the present invention provides a system for generating executable code. During operation, the system receives source code, wherein the source code can include declarations for types and operations, wherein the type declarations may be parameterized, and wherein the source code may specify subtyping relationships between declared types. Next, the system compiles or interprets the source code to produce executable code, wherein the type parameters may be instantiated by different types during execution, and wherein the result of executing operations may depend upon the instantiations of the type parameters. While compiling or interpreting the source code, the system checks the types and operations in the source code to ensure that the executable code generated is type-safe, and hence will not generate type errors during execution.

    摘要翻译: 本发明的一个实施例提供了一种用于生成可执行代码的系统。 在操作期间,系统接收源代码,其中源代码可以包括类型和操作的声明,其中类型声明可以被参数化,并且其中源代码可以指定声明类型之间的子类型关系。 接下来,系统编译或解释源代码以产生可执行代码,其中类型参数可以在执行期间由不同类型实例化,并且其中执行操作的结果可以取决于类型参数的实例。 在编译或解释源代码时,系统将检查源代码中的类型和操作,以确保生成的可执行代码是类型安全的,因此在执行期间不会生成类型错误。