Source code annotation language
First Claim
1. In a computer system comprising a computer, a method of annotating computer program code stored on a computer-readable medium, the method comprising:
- inserting, by the computer, one or more in-line code annotations at one or more annotation targets in source code;
wherein the one or more in-line code annotations comprise at least one annotation on a first pointer to a buffer, wherein the at least one annotation comprises a property that indicates a characteristic of the buffer, wherein the property that indicates the characteristic of the buffer takes a size argument, and wherein the size argument comprises a location of a second pointer associated with the buffer; and
wherein the at least one annotation on the first pointer is placed in an argument list to a function call that uses the first pointer as a parameter.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques and tools for implementing a source code annotation language are described. In one aspect, keywords are added to a function interface to define a contract for the function independent of function call context. In another aspect, annotations are inserted at global variables, formal parameters, return values, or user-defined types. The annotations include, for example, properties and qualifiers. A property can indicate, for example, a characteristic of a buffer. In another aspect, an annotation indicates that a value has usability properties sufficient to allow a function to rely on the value, where the usability properties depend on value type.
-
Citations
24 Claims
-
1. In a computer system comprising a computer, a method of annotating computer program code stored on a computer-readable medium, the method comprising:
-
inserting, by the computer, one or more in-line code annotations at one or more annotation targets in source code; wherein the one or more in-line code annotations comprise at least one annotation on a first pointer to a buffer, wherein the at least one annotation comprises a property that indicates a characteristic of the buffer, wherein the property that indicates the characteristic of the buffer takes a size argument, and wherein the size argument comprises a location of a second pointer associated with the buffer; and wherein the at least one annotation on the first pointer is placed in an argument list to a function call that uses the first pointer as a parameter. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. In a computer system comprising a computer, a method of annotating computer program code stored on a computer-readable medium, wherein the computer program code is operable to cause computer execution to perform according to instructions in the computer program code, the method comprising:
-
inserting, by the computer, an annotation at a first value having a first value type in the computer program code; wherein the annotation comprises a first instance of a keyword, the first instance of the keyword indicating that the first value satisfies all usability properties necessary to allow a first function to rely on the first value, wherein other instances of the keyword identical to the first instance are operable to indicate that other values having different respective value types satisfy all usability properties necessary to allow functions to rely on the respective other values, wherein use of the keyword associates a pre-determined set of usability properties with a value type, and wherein the usability properties depend on the value type. - View Dependent Claims (11, 12, 13, 14, 15, 16)
-
-
17. In a computer system comprising a computer, a method of annotating computer program code stored on a computer-readable medium, the method comprising:
-
inserting, by the computer, an annotation having an annotation argument comprising a second value type in the computer program code, wherein the annotation annotates a variable having a first value type; wherein the annotation changes the first value type of the variable to the second value type of the annotation argument. - View Dependent Claims (18, 19, 20)
-
-
21. In a computer system comprising a computer, a method of annotating computer-executable program code stored on a computer-readable medium, the method comprising:
-
adding, by the computer, an annotation to a pointer in the computer-executable program code, wherein the annotation describes transferring buffer properties from a second pointer to the pointer; and including a location parameter with the annotation, wherein the location parameter describes a logical buffer pointed to by the pointer.
-
-
22. One or more computer-readable storage media having encoded thereon computer-executable instructions for performing a method of annotating computer program source code, the method comprising:
-
inserting, by a computer, one or more in-line code annotations at one or more annotation targets in the computer program source code; wherein the one or more in-line code annotations comprise at least one annotation on a first pointer to a buffer, wherein the at least one annotation comprises a property that indicates a characteristic of the buffer, wherein the property that indicates the characteristic of the buffer takes a size argument, and wherein the size argument comprises a location of a second pointer associated with the buffer; and wherein the at least one annotation on the first pointer is placed in an argument list to a function call that uses the first pointer as a parameter.
-
-
23. One or more computer-readable storage media having encoded thereon computer-executable instructions for performing a method of annotating computer program source code, the method comprising:
-
inserting, by a computer, an annotation at a first value having a first value type in the computer program source code; wherein the annotation comprises a first instance of a keyword, the first instance of the keyword indicating that the first value satisfies all usability properties necessary to allow a first function to rely on the first value, wherein other instances of the keyword identical to the first instance are operable to indicate that other values having different respective value types satisfy all usability properties necessary to allow functions to rely on the respective other values, wherein use of the keyword associates a pre-determined set of usability properties with a value type, and wherein the usability properties depend on the value type.
-
-
24. One or more computer-readable storage media having encoded thereon computer-executable instructions for performing a method of annotating computer program source code stored on a computer-readable medium, the method comprising:
-
inserting, by a computer, an annotation having an annotation argument comprising a second value type in the computer program source code, wherein the annotation annotates a variable having a first value type; wherein the annotation changes the first value type of the variable to the second value type of the annotation argument.
-
Specification