Systems and Methods for Role Extensions in Programming Languages
AssigneeZoho Corporation Private Limited
InventorsSridhar Vembu, Akshhayaa S
Life of this patent
Estimating the term…
Abstract
A programming language with compiler-supported type extensions allows the definition of an independent data type, or an element thereof, to be extended by a dependent data type that references the independent data type or the element. The dependent data type can access the independent data type. Compile-time validation restricts the independent data type from accessing the dependent data type, including elements within the definition of the dependent data type, and can generate error messages when an independent data type attempts any such access.
Claims26
A method of compiling source code, the method comprising:
- encountering in the source code a definition of a first data type, the definition of the first data type including a first-data-type element;
- encountering in the source code a definition of a second data type, wherein the second data type is dependent on the first data type, the definition of the second data type including a second-data-type element referencing the first-data-type element;
- and
- determining, based on the second-data-type element referencing the first-data-type element, that the second-data-type element is an extension of the first-data-type element within the definition of the second data type.
A system comprising:
- at least one processor;
- a memory connected to the at least one processor;
- and
- a compiler that when loaded into the at least one processor causes the at least one processor to:
- encounter in source code a definition of a first data type, the definition of the first data type including a first-data-type element;
- encounter in the source code a definition of a second data type, wherein the second data type is dependent on the first data type, the definition of the second data type including a second-data-type element referencing the first-data-type element;
- and
- determine, based on the second-data-type element referencing the first-data-type element, that the second-data-type element is an extension of the first-data-type element within the definition of the second data type.
A non-transitory computer-readable medium having instructions stored thereon, which when executed by at least one processor, causes the at least one processor to:
- encounter, in source code, a definition of a first data type, wherein said definition includes a first-data-type element;
- encounter, in the source code, a definition of a second data type, wherein the second data type is dependent on the first data type, the definition of the second data type including a second-data-type element referencing the first-data-type element;
- and
- determine, based on the second-data-type element referencing the first-data-type element, that the second-data-type element is an extension of the first-data-type element within the definition of the second data type.
A method of compiling source code, the method comprising:
- encountering in the source code, a definition of a first data type;
- encountering in the source code, a definition of a second data type, wherein the second data type is dependent on the first data type, the definition of the second data type including a second-data-type element referencing the first data type;
- and
- determining, based on the second-data-type element referencing the first data type, that the second data type is an extension of the first data type within the definition of the second data type.
Dependencies are inferred from the claim text.