Representing type information in a compiler and programming tools framework
First Claim
1. A method of representing type information via objects of classes in a class hierarchy, wherein the class hierarchy comprises at least one class and a plurality of sub-classes for representing different type classifications, the method comprising:
- instantiating one or more objects of one or more of the sub-classes of the hierarchy, wherein the one or more sub-classes represent classifications of types; and
storing information in the one or more objects.
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. Additionally, the type checker architecture is extensible to handle new languages with different types and primitive operations. The representation of types can be implemented as a data structure that represents two or more sets of types with one or more sub-structures for representing classifications of types. Alternatively, the type system can be implemented as a base class at the top of a hierarchy and a plurality of classes hierarchically below the base class can be defined to represent a number of types such as pointer types, container types, and function types.
107 Citations
39 Claims
-
1. A method of representing type information via objects of classes in a class hierarchy, wherein the class hierarchy comprises at least one class and a plurality of sub-classes for representing different type classifications, the method comprising:
-
instantiating one or more objects of one or more of the sub-classes of the hierarchy, wherein the one or more sub-classes represent classifications of types; and
storing information in the one or more objects. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
-
-
20. A computer-readable medium having a software program thereon, the program comprising:
-
program code for defining a programming class as ‘
PrimType’
;
program code for associating a size with instances of the ‘
PrimType’
class; and
program code for associating a kind of type with instances of the ‘
PrimType’
class. - View Dependent Claims (21, 22, 23, 24, 25, 26, 27, 28)
-
-
29. A computer-readable medium having computer-executable instructions for implementing a method for representing type classifications, the method comprising:
describing a type classification for representing container types of a plurality of programming languages, wherein the type classification is described as ‘
ContainerType’
.- View Dependent Claims (30)
-
31. A method of programmatically defining a type representation, the method comprising:
-
defining a base class;
defining a plurality of classes hierarchically below the base class, wherein the classes represent at least pointer types, container types and function types of a plurality of programming languages. - View Dependent Claims (32, 33, 34, 35)
-
-
36. A computer-readable medium having a software program thereon, the program comprising:
-
program code for defining a programming class as ‘
ContainerType’
, wherein an object of class ‘
ContainerType’
is a type representation in an intermediate language for container types in a section of code written in one of a plurality of programming languages;
program code for defining a programming class as ‘
PtrType’
, wherein an object of class ‘
PtrType’
is a type representation in an intermediate language for pointer types in a section of code written in one of a plurality of programming languages;
program code for defining a programming class as ‘
FuncType’
, wherein an object of class ‘
FuncType’
is a type representation in an intermediate language for function types in a section of code written in one of a plurality of programming languages;
program code for defining a programming class as ‘
ClassType’
, wherein an object of class ‘
ClassType’
is a type representation in an intermediate language for class types in a section of code written in one of a plurality of programming languages;
program code for defining a programming class as ‘
StructType’
, wherein an object of class ‘
StructType’
is a type representation in an intermediate language for struct types in a section of code written in one of a plurality of programming languages;
program code for defining a programming class as ‘
InterfaceType’
, wherein an object of class ‘
InterfaceType’
is a type representation in an intermediate language for interface types in a section of code written in one of a plurality of programming languages; and
program code for defining a programming class as ‘
EnumType’
, wherein an object of class ‘
EnumType’
is a type representation in an intermediate language for enumerated types in a section of code written in one of a plurality of programming languages. - View Dependent Claims (37, 38, 39)
-
Specification