Type system for representing and checking consistency of heterogeneous program components during the process of compilation
First Claim
1. A method of type-checking a code segment written in a programming language comprising:
- translating the code segment from the programming language to one or more representations of an intermediate language; and
type-checking the one or more representations based on a rule set, wherein the rule set comprises rules for type-checking a type that indicates an element of the representation can be one of a plurality of types.
2 Assignments
0 Petitions
Accused Products
Abstract
A representation of types, type-checker, method and compiler are provided for checking consistency in various forms of an intermediate language. Specifically, the typed intermediate language is suitable for use in representing programs written in multiple (heterogeneous) source languages including typed and untyped languages, loosely and strongly typed languages, and languages with and without garbage collection. An unknown type representation indicates that an element of the intermediate language is associated with an unknown type. A method of type-checking a code segment written in a programming language is provided using a rule set that contains rules for type-checking an unknown type. The unknown type allows for selectively retaining type information as the compilation process continues and allows multiple programming languages to be type-checked by the same type system.
110 Citations
29 Claims
-
1. A method of type-checking a code segment written in a programming language comprising:
-
translating the code segment from the programming language to one or more representations of an intermediate language; and
type-checking the one or more representations based on a rule set, wherein the rule set comprises rules for type-checking a type that indicates an element of the representation can be one of a plurality of types. - View Dependent Claims (2, 3, 4, 5, 29)
-
-
6. A method of selectively retaining type information during compilation in a code segment written in a programming language, the method comprising:
-
translating the code segment from the programming language to one or more representations of an intermediate language;
for each representation, determining whether to retain type information for one or more elements of the representation; and
based on the determination, associating one or more elements of the representation with a type indicating the element can be of any type. - View Dependent Claims (7, 8, 9, 10, 11)
-
-
12. A method of translating types associated with a plurality of programming languages to types of an intermediate language, the method comprising:
replacing the types associated with the plurality of programming languages with the types of the intermediate language, wherein the types of the intermediate language comprise general categories of the types associated with the plurality of programming languages and an unknown type. - View Dependent Claims (13)
-
14. A system for type-checking an intermediate representation of source code in a compiler comprising:
-
one or more types associated with elements of the intermediate representation, wherein at least one of the types indicates an element can be one of a plurality of types;
one or more rule sets comprising rules associated with a type indicating an element can be one of a plurality of types; and
a type-checker for applying the one or more rule sets to the elements of the intermediate representation. - View Dependent Claims (15, 16, 17, 18, 19, 20, 21, 22, 23)
-
-
24. A method of representing types in an intermediate language comprising:
defining a plurality of types to be associated with elements of the intermediate language, wherein one of the plurality of types indicates that an element of the intermediate language is associated with an unknown type. - View Dependent Claims (25, 26, 27, 28)
Specification