Component-based source code generator
First Claim
1. A method for generating computer source code in an object-oriented programming language or a programming language supporting components, comprising the steps of:
- providing a set of generation instructions comprising;
definitions of at least two nodes and at least two corresponding node identifiers;
target source code parameterized with at least two context variables, wherein each said at least two context variables points to one of said nodes and said corresponding node identifiers and wherein said at least two context variables indicate at least two different nodes, wherein said target source code is a valid syntax statement for said programming language;
at least two filter instructions each comprising a selection criterion for selecting at least one of said nodes according to said definitions; and
automatically generating, in response to said at least two filter instructions, a plurality of code segments in said programming language by replacing, in said parameterized target source code, said at least two context variables with a value of selected ones of said node identifiers.
5 Assignments
0 Petitions
Accused Products
Abstract
The component-based source code generator uses a set of generation instructions and a set of parameters to generate nearly-repetitive and repetitive source code. The developer specifies to the code generator what to generate through the use of generation instructions. Within a set of generation instructions, the developer specifies the target components and the code that should be generated. The generation process uses information contained in the modeling tool. Consequently, the generated code never has to be modified directly by the developer, greatly reducing maintenance time, minimizing errors, and improving code consistency.
-
Citations
25 Claims
-
1. A method for generating computer source code in an object-oriented programming language or a programming language supporting components, comprising the steps of:
-
providing a set of generation instructions comprising;
definitions of at least two nodes and at least two corresponding node identifiers;
target source code parameterized with at least two context variables, wherein each said at least two context variables points to one of said nodes and said corresponding node identifiers and wherein said at least two context variables indicate at least two different nodes, wherein said target source code is a valid syntax statement for said programming language;
at least two filter instructions each comprising a selection criterion for selecting at least one of said nodes according to said definitions; and
automatically generating, in response to said at least two filter instructions, a plurality of code segments in said programming language by replacing, in said parameterized target source code, said at least two context variables with a value of selected ones of said node identifiers. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
wherein said value of said node identifier in said generating is obtained from said current context of said generating.
-
-
3. A method as claimed in claim 2, wherein said value of said node identifier in said generating is obtained from a parent node of said current context of said generating.
-
4. A method as claimed in claim 1, wherein said generating a plurality of code segments includes generating new components.
-
5. A method as claimed in claim 1, wherein said generating a plurality of code segments includes generating new methods.
-
6. A method as claimed in claim 1, wherein said steps are repeated until a set of code segments is obtained which defines a plurality of components.
-
7. A method as claimed in claim 1, wherein said programming language is JAVA™
- programming language.
-
8. A method as claimed in claim 1, wherein said node is a class.
-
9. A method as claimed in claim 1, wherein said node is an attribute.
-
10. A method as claimed in claim 1, wherein said node identifier is a name.
-
11. A method as claimed in claim 1, wherein said node identifier is a type.
-
12. A method as claimed in claim 1, wherein said step of generating comprises choosing a programming language for said code segments.
-
13. A method as claimed in claim 1, further comprising a step of selecting said at least two context variables from a list of context variables.
-
14. A method as claimed in claim 1, wherein said at least two context variables are expressed in said set of generation instructions using a leading symbol character identifying them as a context variable parameter.
-
15. A method as claimed in claim 1, further comprising:
automatically generating pointer data, for each said code segment, pointing to locations in said set of generation instructions used in said code segment generating step.
-
16. A method as claimed in claim 15, wherein said pointer data is stored in a separate file from said plurality of code segments.
-
17. A method as claimed in claim 15, wherein said pointer data is shown as comment lines throughout said code segments.
-
18. A method as claimed in claim 15, further comprising steps of:
-
finding at least one portion of said source code requiring a change;
using said pointer data from said portion to find locations in said set of generation instructions needing a corresponding change;
changing said set of generation instructions in at least some of said locations; and
repeating said step of automatically generating said plurality of code segments using said set of generation instructions as changed in the previous step.
-
-
19. A computer data signal embodied in a carrier wave comprising a plurality of code segments generated according to claim 15.
-
20. A computer data signal embodied in a carrier wave comprising a set of generation instructions provided according to claim 15.
-
21. A method as claimed in claim 1, further comprising:
at least one of creating, ordering and customizing said set of generation instructions.
-
22. A method as claimed in claim 1, wherein said definitions are generic for a plurality of programming languages.
-
23. A computer data signal embodied in a carrier wave comprising a plurality of code segments generated according to claim 1.
-
24. A computer data signal embodied in a carrier wave comprising a set of generation instructions provided according to claim 1.
-
25. A method as claimed in claim 1, wherein said value of said node identifier in said generating is obtained from a parent node of a current context of said generating.
Specification