Enumeration classes
AssigneeThe MathWorks, Inc.
InventorsDavid Foti, Paul Jackson
Life of this patent
Estimating the term…
Abstract
In an embodiment, a technique for acquiring a class definition of a class, the class associated with an enumeration, the enumeration enumerating a partial list of instances of the class; generating a data structure based on the class definition, the data structure associating one or more identifiers with an instance enumerated in the enumeration; and storing the data structure in a computer storage.
Claims46
A method comprising:
- acquiring a class definition associated with a class,
- the class definition including:
- first information associated with an enumeration,
- the enumeration listing one or more instances of the class, and
- second information associated with one or more superclasses to which the one or more instances belong;
- transforming the class definition into a data structure that includes information associated with the class,
- transforming the class definition including:
- generating a plurality of tokens based on the first information and the second information,
- identifying, in the plurality of tokens, at least one token that corresponds to at least one allowable expression, and
- forming the data structure based on the at least one token;
- associating, respectively, at least one instance, of the one or more instances listed in the enumeration, with at least one identifier in the data structure;
- generating, based on the data structure, metadata associated with the enumeration;
- generating a constructor function for the enumeration,
- the constructor function being used to construct an instance of the class;
- and
- associating the constructor function with the metadata associated with the enumeration,
- the acquiring, the transforming, the associating the at least one instance, the generating the metadata, generating the constructor function, and the associating the constructor function being performed by one or more processors.
A non-transitory computer-readable medium to store instructions, the instructions comprising:
- one or more instructions executable by at least one processor to:
- acquire a class definition of a class,
- the class definition including:
- first information associated with an enumeration,
- the enumeration identifying one or more instances of the class, and
- second information associated with one or more superclasses to which the one or more instances belong;
- transform the class definition into data that represents the class definition;
- store the data;
- generate, based on the stored data, metadata associated with the enumeration;
- generate a constructor function for the enumeration,
- the constructor function being used to construct an instance of the class;
- and
- associate the constructor function with the metadata associated with the enumeration,
- the one or more instructions, to transform the class definition, further comprising:
- at least one instruction to:
- form a token stream based on the first information and the second information,
- identify at least one token from the token stream,
- the at least one token corresponding to one or more allowable expressions, and
- transform the class definition into the data based on the at least one token.
A system comprising:
- a memory;
- and
- a processor to:
- acquire a class definition that defines a class,
- the class definition including:
- an enumeration listing one or more instances of the class, and
- a specification of one or more superclasses to which the one or more instances belong,
- transform the class definition into a data structure that includes information associated with the class,
- store the data structure in the memory,
- generate, based on the data structure, metadata associated with the enumeration,
- generate a constructor function for the enumeration,
- the constructor function being used to construct an instance of the class, and
- associate the constructor function with the metadata associated with the enumeration,
- the processor, when transforming the class definition into the data structure, being further to:
- generate a plurality of tokens based on the enumeration and the specification,
- identify, from the plurality of tokens, at least one token,
- each of the at least one token corresponding to at least one allowable expression, and
- form the data structure based on the at least one token.
A non-transitory computer-readable medium to store instructions, the instructions comprising:
- one or more instructions executable by at least one processor to:
- acquire a class definition that defines an enumeration class,
- the class definition including information:
- enumerating one or more instances of the enumeration class, and
- specifying one or more superclasses to which the one or more instances belong;
- generate, based on the class definition, a hierarchical data structure that includes a plurality of nodes;
- store the hierarchical data structure;
- generate, based on the hierarchical data structure, metadata associated with the enumeration class;
- store the metadata;
- generate a constructor function for the enumeration class,
- the constructor function being used to construct an instance of the class;
- and
- associate, in the stored metadata, the constructor function with the enumeration class,
- the one or more instructions, to generate the hierarchical data structure, including:
- at least one instruction to:
- include, in the hierarchical data structure, a first node, of the plurality of nodes, that represents an attribute associated with the enumeration class,
- include, in the hierarchical data structure, a second node, of the plurality of nodes, that represents a particular instance of the one or more instances, and
- include, in the hierarchical data structure, a third node, of the plurality of nodes, that represents an identifier, in the class definition, that is associated with the particular instance represented by the second node.
A non-transitory computer-readable medium to store instructions, the instructions comprising:
- one or more instructions executable by at least one processor to:
- acquire a class definition that defines an enumeration class,
- the class definition including information:
- enumerating one or more instances of the enumeration class, and
- specifying one or more respective access levels associated with the one or more instances;
- generate a hierarchical data structure based on the class definition,
- the hierarchical data structure indicating the one or more respective access levels associated with the one or more instances;
- store the hierarchical data structure;
- generate, based on the hierarchical data structure, metadata associated with the enumeration class;
- generate a constructor function for the enumeration class,
- the constructor function being used to construct an instance of the class;
- and
- associate the constructor function with the metadata,
- the one or more instructions, to generate the hierarchical data structure, further including:
- at least one instruction to:
- include, in the hierarchical data structure, a first node that represents the access level for the one or more instances, and
- include, in the hierarchical data structure, a second node that represents a particular instance of the one or more instances.
A system comprising:
- a memory;
- and
- a processor to:
- acquire a class definition that defines an enumeration class,
- the class definition including information:
- enumerating one or more instances of the enumeration class, and
- specifying one or more superclasses to which the one or more instances belong,
- generate, based on the class definition, a hierarchical data structure that includes a plurality of nodes,
- store the hierarchical data structure in the memory,
- generate, based on the hierarchical data structure, metadata associated with the enumeration class,
- generate a constructor function for the enumeration class,
- the constructor function being used to construct an instance of the class, and
- associate, in the data structure, the constructor function with the metadata associated with the enumeration class,
- the processor, when generating the hierarchical data structure, being further to:
- include, in the hierarchical data structure, a first node that represents an attribute associated with the enumeration class,
- include, in the hierarchical data structure, a second node that represents a particular instance of the one or more instances, and
- include, in the hierarchical data structure, a third node that represents an identifier, in the class definition, that is associated with the particular instance represented by the second node.
A method comprising:
- acquiring a class definition that defines an enumeration class,
- the class definition including information:
- enumerating one or more instances of the enumeration class, and
- specifying one or more superclasses to which the one or more instances belong;
- generating, based on the class definition, a hierarchical data structure that includes a plurality of nodes,
- generating the hierarchical data structure including:
- storing, in the hierarchical data structure, a first node that represents an attribute associated with the enumeration class,
- storing, in the hierarchical data structure, a second node that represents a particular instance of the one or more instances;
- storing the hierarchical data structure;
- generating, based on the hierarchical data structure, metadata associated with the enumeration class;
- generating a constructor function for the enumeration class,
- the constructor function being used to construct an instance of the class;
- and
- associating, in the hierarchical data structure, the constructor function with the metadata associated with the enumeration class,
- the acquiring, the generating the hierarchical data structure, the storing,
- the generating the metadata, the generating the constructor function, and the associating being performed by at least one processor.
Dependencies are inferred from the claim text.