Module generating apparatus, module generating method, and computer product
First Claim
1. A module generating apparatus comprising:
- a parsing unit that, by a processor, performs syntax analysis of a source code for a program and outputs information concerning the syntax analysis;
a macroblocking analyzing unit that based on syntax analysis information output from the parsing unit, segments the program into a plurality of blocks through structural analysis of the program and outputs block structure information obtained as a result of the segmentation and appendant information for virtualizing a calculation pattern of each block;
a junction-node restructuring unit that based on the block structure information and the appendant information output from the macroblocking analyzing unit, focuses on one block, defined as a subroutine, extracts a node directly related to the block of focus by tracing back a processing sequence to a node that is in an ancestor block upstream in the processing sequence from the block of focus and from which the block of focus is reached as a result of sequential processing, and by tracing the processing sequence to a node that is in a descendant block downstream in the processing sequence from the block of focus and that is processed after the block of focus;
an identical portion merging/restructuring unit that, with respect to a plurality of portions that use the block of focus extracted from the program by the junction-node restructuring unit, compares nodes in ancestor blocks of the block of focus to merge the ancestor blocks, compares nodes in descendant blocks of the block of focus to merge the descendant blocks, and outputs merged-block information obtained as a result of merging the ancestor blocks and merging the descendant blocks;
a similar portion merging/restructuring unit that with respect to a second block of focus extracted from the program by the junction-node restructuring unit, compares the merged-block information to define, as subroutines of an identical type, a plurality of blocks of focus that have similar or identical merged block information, further merges similar or identical merged block information, and outputs abstracted code information obtained as a result of the merging; and
an intermediate language restructuring unit that outputs information of a commonized component, based on the abstracted code information and the syntax analysis information.
1 Assignment
0 Petitions
Accused Products
Abstract
A computer is caused to function as a parsing unit, a macroblocking analyzing unit, a junction-node restructuring unit, an identical portion merging/restructuring unit, a similar portion merging/restructuring unit, and an intermediate language restructuring unit. The parsing unit performs syntax analysis of a source code. The macroblocking analyzing unit segments the program written in the source code into blocks and appends a virtual portion representing a unique number in a statement, to a number for identifying a variable for the statement in each block to virtualize a calculation pattern. The junction-node restructuring unit extracts a node directly related to a subroutine block. The identical portion merging/restructuring unit merges pre-processing together and post-processing together for a subroutine called up at a multiple portions in the program. The similar portion merging/restructuring unit integrates subroutines having similar structures into a related subroutine.
-
Citations
16 Claims
-
1. A module generating apparatus comprising:
-
a parsing unit that, by a processor, performs syntax analysis of a source code for a program and outputs information concerning the syntax analysis; a macroblocking analyzing unit that based on syntax analysis information output from the parsing unit, segments the program into a plurality of blocks through structural analysis of the program and outputs block structure information obtained as a result of the segmentation and appendant information for virtualizing a calculation pattern of each block; a junction-node restructuring unit that based on the block structure information and the appendant information output from the macroblocking analyzing unit, focuses on one block, defined as a subroutine, extracts a node directly related to the block of focus by tracing back a processing sequence to a node that is in an ancestor block upstream in the processing sequence from the block of focus and from which the block of focus is reached as a result of sequential processing, and by tracing the processing sequence to a node that is in a descendant block downstream in the processing sequence from the block of focus and that is processed after the block of focus; an identical portion merging/restructuring unit that, with respect to a plurality of portions that use the block of focus extracted from the program by the junction-node restructuring unit, compares nodes in ancestor blocks of the block of focus to merge the ancestor blocks, compares nodes in descendant blocks of the block of focus to merge the descendant blocks, and outputs merged-block information obtained as a result of merging the ancestor blocks and merging the descendant blocks; a similar portion merging/restructuring unit that with respect to a second block of focus extracted from the program by the junction-node restructuring unit, compares the merged-block information to define, as subroutines of an identical type, a plurality of blocks of focus that have similar or identical merged block information, further merges similar or identical merged block information, and outputs abstracted code information obtained as a result of the merging; and an intermediate language restructuring unit that outputs information of a commonized component, based on the abstracted code information and the syntax analysis information. - View Dependent Claims (2, 3, 4)
-
-
5. A module generating method comprising:
-
parsing involving syntax analysis of a source code for a program and obtaining information concerning the syntax analysis, by using a processor; macroblocking-analyzing involving segmentation of the program into a plurality of blocks through structural analysis of the program based on syntax analysis information obtained from the parsing, obtaining block structure information as a result of the segmentation, and obtaining appendant information for virtualizing a calculation pattern of each block; commonizing a component, based on the block structure information and the appendant information. - View Dependent Claims (6, 7, 8, 9, 10, 11, 12)
-
-
13. A computer-readable recording medium storing therein a module generating program that causes a computer to execute:
-
parsing involving syntax analysis of a source code for a program and obtaining information concerning the syntax analysis; macroblocking-analyzing involving segmentation of the program into a plurality of blocks through structural analysis of the program based on syntax analysis information obtained from the parsing, obtaining block structure information as a result of the segmentation, and obtaining appendant information for virtualizing a calculation pattern of each block; junction-node-restructuring based on the block structure information and the appendant information and involving, focusing on one block defined as a subroutine, extracting a node directly related to the block of focus by tracing back a processing sequence to a node that is in an ancestor block upstream in the processing sequence from the block of focus and from which the block of focus is reached as a result of sequential processing, and by tracing the processing sequence to a node that is in a descendant block downstream in the processing sequence from the block of focus and that is processed after the block of focus; identical-portion-merging that, with respect to a plurality of portions that use the block of focus extracted from the program at the junction-node-restructuring, involves comparing nodes in ancestor blocks of the block of focus, merging the ancestor blocks, comparing nodes in descendant blocks of the block of focus, merging the descendant blocks, and obtaining merged-block information as a result of the merging of the ancestor blocks and of the descendant blocks; similar-portion-merging that, with respect to a second block of focus extracted from the program at the junction-node restructuring, involves comparing the merged-block information to define, as subroutines of an identical type, a plurality of blocks of focus that have similar or identical merged block information, further merging similar or identical merged block information, and obtaining abstracted code information as a result of the merging; and intermediate-language-restructuring that obtains information concerning a commonized component, based on the abstracted code information and the syntax analysis information. - View Dependent Claims (14, 15, 16)
-
Specification