Automatic source code generation
First Claim
Patent Images
1. A computer-implemented method, the method comprising:
- configuring a profile to generate one or more source code statements automatically, the profile including one or more variable code elements, one or more methods, and at least one rule, a variable code element comprising an element of a source code statement that takes on different values in different contexts, individual methods of the one or more methods including programmable instructions that generate the one or more source code statements using values of the variable code elements, the one or more source code statements based on corresponding source code statements from an existing code base of a software application, the at least one rule is used to match syntax of a text string to determine one or more variable code elements, the at least one rule includes one or more regular expressions and/or one or more logical statements, the one or more regular expressions used to match syntax of the text string to a rule, the one or more logical statements used to invoke one or more of the methods to generate the one or more source code statements;
searching for a rule that closely matches the syntax of the text string;
using a regular expression associated with the closely matching rule to obtain the one or more variable code elements;
obtaining values for the variable code elements;
applying the values of the variable code elements in the logical statements to invokemethods to generate the one or more source code statements.
3 Assignments
0 Petitions
Accused Products
Abstract
Source code statements are automatically generated from a profile including variable code elements and methods. The profile is built from an existing code base that has identified variable code elements that differ when used in different versions of the source code statements. A developer may define values for the variable code elements which are then used by the methods in the profile to automatically generate corresponding source code statements.
-
Citations
20 Claims
-
1. A computer-implemented method, the method comprising:
-
configuring a profile to generate one or more source code statements automatically, the profile including one or more variable code elements, one or more methods, and at least one rule, a variable code element comprising an element of a source code statement that takes on different values in different contexts, individual methods of the one or more methods including programmable instructions that generate the one or more source code statements using values of the variable code elements, the one or more source code statements based on corresponding source code statements from an existing code base of a software application, the at least one rule is used to match syntax of a text string to determine one or more variable code elements, the at least one rule includes one or more regular expressions and/or one or more logical statements, the one or more regular expressions used to match syntax of the text string to a rule, the one or more logical statements used to invoke one or more of the methods to generate the one or more source code statements; searching for a rule that closely matches the syntax of the text string; using a regular expression associated with the closely matching rule to obtain the one or more variable code elements; obtaining values for the variable code elements; applying the values of the variable code elements in the logical statements to invoke methods to generate the one or more source code statements. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A device, comprising:
-
at least one processor and a memory; the memory including; a profile including one or more variable code elements, one or more methods, and at least one rule, at least one variable code element associated with an element of the source code that takes on different values, at least one method used to generate at least one source code statement using at least one value of the at least one variable code element, the at least one source code statement based on corresponding source code statements from an existing code base, the at least one rule used to match syntax of a text string to determine one or more variable code elements, the at least one rule includes one or more regular expressions and/or one or more logical statements, the one or more regular expressions used to match syntax of a text string to a rule, the one or more logical statements used to invoke one or more of the methods to generate the one or more source code statements; and a first set of instructions, that when executed on the at least one processor, searches for a rule that closely matches the syntax of a text string, uses a regular expression associated with the closely matching rule to obtain the one or more variable code elements, obtains values for the variable code elements, applies the values of the variable code elements to the logical statements to invoke one or more methods that generate the one or more source code statements. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A computer-implemented system, comprising:
-
at least one processor and a memory; the at least one processor configured to; obtain a profile, the profile including one or more variable code elements, at least one rule, and one or more methods, at least one variable code element associated with an element of the source code that takes on different values, at least one method used to generate the one or more source code statements using at least one value for the at least one variable code element, the one or more source code statements based on corresponding source code statements from an existing code base, the at least one rule is used to match syntax of a text string to determine one or more variable code elements, the at least one rule includes one or more regular expressions and/or one or more logical statements, the one or more regular expressions used to match syntax of a text string to a rule, the one or more logical statements used to invoke one or more of the methods to generate the one or more source code statements; search for a rule that closely matches syntax of a text string; employ a regular expression associated with the closely matching rule to obtain the one or more variable code elements; obtain values for the variable code elements; and apply the values of the variable code elements in the logical statements to invoke one or more methods that generate the one or more source code statements. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification