Extensible type system for representing and checking consistency of program components during the process of compilation
First Claim
1. A method of type-checking a programming language in a compiler according to one or more rule sets comprising:
- selecting one or more of the rule sets based upon the present stage of compilation; and
type-checking the programming language based on the selected one or more rule sets;
wherein the one or more rule sets comprise one rule set corresponding to strong type-checking, one corresponding to weak type-checking, and one corresponding to representation type-checking.
2 Assignments
0 Petitions
Accused Products
Abstract
A representation of types, type-checker, and compiler are provided for checking consistency in various forms of an intermediate language. Type-checking a programming language in a compiler is accomplished by taking one or more rule sets as input to a type-checker, which selects one or more of the rule sets based upon any one, or combination of two or more, of numerous criteria. Among them are stage of compilation, source language, architecture, and level of typing present in the language being type-checked. The language is then type-checked using the selected one or more rule sets. The rule sets can include one rule set corresponding to strong type-checking, one rule set corresponding to weak type-checking, and one rule set corresponding to representation type-checking. In the alternative, a compiler can be provided with a type-checker that constructs the one or more sets of rules at runtime from a larger set of rules based on any one, or combination of two or more, of the previously mentioned criteria.
-
Citations
11 Claims
-
1. A method of type-checking a programming language in a compiler according to one or more rule sets comprising:
-
selecting one or more of the rule sets based upon the present stage of compilation; and type-checking the programming language based on the selected one or more rule sets; wherein the one or more rule sets comprise one rule set corresponding to strong type-checking, one corresponding to weak type-checking, and one corresponding to representation type-checking. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A compiler for compiling source code written in a source language comprising:
-
a plurality of type rules; and a type-checker that selects a subset of type rules from the plurality of type rules based upon the source language to construct a rule set; wherein three rule sets are constructed;
one corresponding to strong type-checking, one corresponding to weak type-checking, and one corresponding to representation type-checking. - View Dependent Claims (10, 11)
-
Specification