An extensible type system for representing and checking consistency of program components during the process of compilation
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.
Claims
exact text as granted — not AI-modified1 . A method of type-checking a programming language in a compiler according to one or more type checking rule sets comprising:
selecting one or more of the type checking rule sets based upon a present stage of compilation; and type-checking the programming language based on the selected one or more type checking rule sets.
2 . (canceled)
3 . (canceled)
4 . The method of claim 1 wherein type-checking the programming language comprises type-checking each of a plurality of intermediate representations of the programming language.
5 . The method of claim 4 wherein the selected one or more rule sets are different for each representation.
6 . (canceled)
7 . The method of claim 1 wherein the programming language includes a type that indicates an element of the programming language can be one of a plurality of types.
8 . The method of claim 7 wherein the one or more rule sets contains rules for type-checking a type that indicates an element of the programming language can be one of a plurality of types.
9 . The method of claim 1 wherein the one or more rule sets comprise a plurality of rules in a hierarchical format.
10 . (canceled)
11 . (canceled)
12 . (canceled)
13 . In one or more computer-readable storage media, 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 one or more criteria to construct a rule set; wherein the criteria comprise one or more selected from the group consisting of: the source language, an intermediate representation of the source code, and a stage of compilation.
14 . (canceled)
15 . (canceled)
16 . (canceled)
17 . (canceled)
18 . (canceled)
19 . A type-checking system for type-checking source code authored in a plurality of source languages comprising:
a plurality of rule sets; and a type-checker, wherein the type-checker selects one or more rule sets to apply to the source code at each of a plurality of representations.
20 . The system of claim 19 wherein the selected one or more rule sets is selected based on one or more characteristics of the source language.
21 . The system of claim 19 wherein the type-checker is part of a compiler.
22 . The system of claim 19 wherein each of the plurality of rule sets corresponds to a specific source language.
23 . The system of claim 19 wherein each of the plurality of rule sets corresponds to a specific strength of type-checking.
24 . (canceled)
25 . (canceled)
26 . (canceled)
27 . (canceled)
28 . (canceled)
29 . (canceled)
30 . (canceled)
31 . (canceled)
32 . (canceled)
33 . (canceled)
34 . A computer-readable medium containing computer-executable instructions for implementing the method of claim 1 .
35 . The compiler of claim 13 wherein the criteria comprise the source language.
36 . The compiler of claim 13 wherein the criteria comprise an intermediate representation of the source code.
37 . The compiler of claim 13 wherein the criteria comprise a stage of compilation.
38 . The compiler of claim 13 wherein it is not the case that the criteria comprise the source language.
39 . The compiler of claim 13 wherein it is not the case that the criteria comprise an intermediate representation of the source code.
40 . The compiler of claim 13 wherein it is not the case that the criteria comprise a stage of compilation.Join the waitlist — get patent alerts
Track US2006242628A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.