WO2013154055A1 - 構造解析装置及びプログラム - Google Patents

構造解析装置及びプログラム Download PDF

Info

Publication number
WO2013154055A1
WO2013154055A1 PCT/JP2013/060528 JP2013060528W WO2013154055A1 WO 2013154055 A1 WO2013154055 A1 WO 2013154055A1 JP 2013060528 W JP2013060528 W JP 2013060528W WO 2013154055 A1 WO2013154055 A1 WO 2013154055A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
statement
target
target range
function
Prior art date
Application number
PCT/JP2013/060528
Other languages
English (en)
French (fr)
Inventor
石田 伸一
Original Assignee
松崎 務
アイ・システム株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 松崎 務, アイ・システム株式会社 filed Critical 松崎 務
Priority to US14/391,377 priority Critical patent/US9286062B2/en
Priority to CN201380015262.9A priority patent/CN104169875B/zh
Priority to KR1020147025939A priority patent/KR101578119B1/ko
Publication of WO2013154055A1 publication Critical patent/WO2013154055A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs

Definitions

  • the present invention relates to an apparatus that supports structural analysis of a module (source program) composed of one or more sentences described in a program language.
  • ⁇ Structured programming is strongly recommended when creating a program. Specifically, for example, it is required to create a module by combining processing units composed of a relatively small number of sentences. In addition, in a module, it is required not to use an unconditional branch statement (GOTO statement) but to have a nested structure (that is, a hierarchical structure) by a conditional statement or a repeated statement. Furthermore, it is required to modularize a common process for a plurality of modules. Therefore, for example, a large system in which the total number of lines of a program exceeds one million lines often includes several thousand modules each consisting of several tens of processing units.
  • GOTO statement unconditional branch statement
  • a nested structure that is, a hierarchical structure
  • Hierarchical structure In order to understand the function of the entire module or the function of each processing unit, it is necessary to grasp the hierarchical structure based on conditional statements (hereinafter simply referred to as “hierarchical structure”).
  • modules in a large-scale system often have a deep hierarchical structure (for example, a hierarchical structure having 10 or more hierarchies). In such a case, it is not easy to grasp the hierarchical structure. For this reason, for example, a place similar to the place where maintenance was performed (for example, a place having a similar function) may be overlooked, and thus necessary maintenance may not be performed.
  • Patent Literature 1 and Patent Literature 2 disclose techniques for supporting the understanding of the hierarchical structure.
  • the program development support apparatus disclosed in Patent Document 1 changes the display color of a sentence according to the depth of a nested structure (hierarchical structure) by an IF sentence when displaying a program (module). As a result, the program developer can visually grasp the hierarchical structure.
  • the structured program editing apparatus disclosed in Patent Document 2 when a program (module) is displayed, a sentence including a keyword indicating a hierarchy (for example, if or case) is displayed, while other sentences are not displayed. Or it can display simply. As a result, the program developer can grasp the hierarchical structure relatively easily.
  • an object of the present invention is to provide a structural analysis device that detects a portion having the same hierarchical structure in a module and thereby supports the grasp of the hierarchical structure.
  • One aspect of the present invention provides a structural analysis apparatus that performs structural analysis of a module composed of one or more sentences described in a program language.
  • a conditional sentence that is one of the sentences can be described.
  • the conditional statement includes an execution statement when established and / or an execution statement when not established.
  • the execution statement when satisfied is the statement that is executed when the conditional expression of the conditional statement is satisfied.
  • the unexecuted execution statement is the statement that is executed when the conditional expression is not satisfied.
  • At least one of the conditional statements may further include the conditional statement as the execution statement when established and / or the execution statement when not established, and thus the statement can be hierarchized by the conditional statement. .
  • the structural analysis apparatus includes a storage unit and an analysis unit.
  • the storage means stores one or more modules.
  • the analysis unit is configured to perform a structural analysis of a predetermined target module among the modules stored in the storage unit.
  • the analysis means has an acquisition function and an analysis function.
  • the acquisition function is a function of acquiring the target module from the storage unit.
  • the analysis function creates similarity notification information in association with the first target range and / or the second target range when the hierarchical structure of the first target range and the hierarchical structure of the second target range are the same. It is a function to do.
  • the first target range and the second target range are the target ranges that are different from each other in the target range of the acquired target module.
  • the similarity notification information indicates that the target ranges similar to each other exist in the target module.
  • a program for causing a computer to function as the structural analysis device is obtained.
  • the module when the module includes a portion (target range) similar to each other, similarity notification information associated with the target range is created. Therefore, it is possible to more easily find target ranges similar to each other based on the similarity notification information.
  • FIG. 4 It is a block block diagram which shows the structural analysis apparatus by the 1st Embodiment of this invention. It is a figure which shows typically the file structure of the module memorize
  • FIG. 10 is a diagram partially showing an example of the secondary module of FIG. 9.
  • FIG. 10 is a diagram partially showing an example of a flowchart stored in the storage device of FIG. 9. It is a flowchart which shows the function of the conversion means of the structural analysis apparatus of FIG.
  • FIG. 10 is a diagram partially showing another example of the secondary module of FIG. 9.
  • FIG. 18 partially illustrates a flowchart created from the secondary module of FIG. 17.
  • the structural analysis apparatus 10 includes an apparatus body 20, a storage device (storage means) 30, an input device 40, and a display device 50. Yes.
  • the structural analysis apparatus 10 performs structural analysis of a module (source program) composed of one or more sentences described in a program language.
  • the programming language according to this embodiment is COBOL.
  • the present invention is also applicable to programming languages other than COBOL.
  • the module according to the present embodiment can be specified by a module name that combines letters, numbers, symbols, and the like.
  • a module can describe a processing unit consisting of one or more sentences.
  • the processing unit according to this embodiment is a COBOL section.
  • Each section can be specified by a section name (processing unit name).
  • the processing unit may not be a section.
  • the programming language is JAVA (registered trademark in Japan)
  • the processing unit may be a function that can be specified by a function name (processing unit name).
  • a module can call another module or the module itself.
  • a module section can execute another section or the section itself.
  • a module includes a processing unit execution statement for specifying and executing a section by a section name, and a module call statement for specifying and executing one of the modules by a module name.
  • the processing unit execution statement is a PERFORM statement
  • the module call statement is a CALL statement.
  • Each of the processing unit execution statement and the module call statement in other programming languages is a statement specifying a function name, for example.
  • the module call statement is a statement specifying a function name
  • the specified function portion (that is, a part of the module) of the module is executed by the module call statement.
  • the module name may not be explicitly described in the module call statement. That is, the module name may be indirectly specified by the function name.
  • conditional statement that is one of the statements can be described in the module.
  • the conditional statement includes a conditional expression, and an executable statement when satisfied and / or an executable statement when not satisfied can be described in the conditional statement.
  • the conditional statement can include an execution statement when established and / or an execution statement when not established.
  • the execution statement when satisfied is a statement that is executed when the conditional expression of the conditional statement is satisfied.
  • the unexecuted execution statement is a statement that is executed when the conditional expression is not satisfied.
  • the conditional statements according to the present embodiment are an IF statement and an EVALUATE statement.
  • the execution statement when established is a statement described in the THEN clause, and the execution statement when not established is a statement described in the ELSE clause.
  • the execution statement when established is a statement described in the WHEN clause.
  • At least one of the conditional statements according to the present embodiment can further include a conditional statement as an executed statement when established and / or an executed statement when not established, thereby enabling a hierarchical structure of statements based on the conditional statement.
  • a conditional statement can be further described as an execution statement when the IF statement is established.
  • the module includes one or more sentences that can be hierarchized by a conditional sentence, and thus has a predetermined hierarchical structure (that is, a hierarchical structure by a conditional sentence).
  • the hierarchical structure by hierarchization can be specified for each of a plurality of locations (target ranges) consisting of continuous sentences in the module.
  • the storage device 30 is, for example, a magnetic disk device.
  • the storage device 30 can store various files hierarchized by folders (not shown), for example.
  • the storage device 30 is communicably connected to the device main body 20 and can read (acquire) and write (store) files in accordance with instructions from the device main body 20.
  • One or more modules 31 are stored in the storage device 30 according to the present embodiment. Further, the storage device 30 can store hierarchical structure data 36.
  • the module 31 is created using a programming tool (not shown), for example.
  • Each of the modules 31 may be a single file.
  • a plurality of modules 31 may be stored as one file.
  • the hierarchical structure data 36 stores the hierarchical structure of one or more target ranges included in the module 31. According to the present embodiment, hierarchical structure data 36 is created for each module 31.
  • the input device 40 is, for example, a keyboard or a mouse.
  • the input device 40 is communicably connected to the device main body 20 and can notify the device main body 20 of a character or a position designated by the mouse.
  • the display device 50 is, for example, a display or a printer.
  • the display device 50 is communicably connected to the device main body 20 and can display or print data (for example, characters and graphics) transferred from the device main body 20.
  • the apparatus main body 20 is, for example, a PC (Personal Computer) main body.
  • the device main body 20 includes a CPU (Central Processing Unit), a main storage device, and the like (not shown).
  • the storage device 30 stores execution format files of various programs (not shown).
  • the CPU implements various functions by loading the execution format file into the main storage device and executing the instructions in the execution format file.
  • a predetermined file stored in the storage device 30 is read into the program variable area via the buffer area in the main storage device.
  • the contents of the file read in the variable area of the program are written into the storage device 30 via the buffer area in the main storage device as necessary.
  • each of the storage device 30 and the main storage device functions as a readable and writable storage unit in the present embodiment.
  • the storage unit according to the present embodiment may be one of the storage device 30 and the main storage device, or both.
  • the storage device 30 is used as storage means.
  • the storage device 30 stores various programs such as an analysis program (not shown).
  • the above program is loaded into the main storage device and executed by the CPU, whereby the computer functions as various means (that is, as a device).
  • the analysis program causes the computer to function as an analysis unit 27 (structure analysis device 10) that performs a structure analysis of a predetermined target module 31 among the modules 31 stored in the storage device 30.
  • the apparatus main body 20 of the structural analysis apparatus 10 according to the present embodiment includes the analysis means 27.
  • the module 31 according to the present embodiment includes n (n ⁇ 1) rows 310.
  • the module 31 according to the present embodiment is a text file.
  • the module 31 may be, for example, a worksheet of MICROSOFT EXCEL (registered trademark).
  • the analysis unit 27 can be realized by, for example, an EXCEL macro.
  • the line 310 includes at least a serial number (line identification) 311 and a sentence 312.
  • the serial number 311 is for specifying the row 310 and determining the arrangement order of the row 310.
  • the serial number 311 may include not only numbers but also letters and symbols.
  • the sentence 312 describes a sentence (for example, a data definition sentence, an execution sentence, and a comment sentence).
  • the sentence 312 may describe one complete sentence as a whole. A part of one sentence may be described in the sentence 312.
  • the MOVE sentence may be described separately in the sentence 312 of two lines 310.
  • the hierarchical structure data 36 according to the present embodiment is composed of m (m ⁇ 1) rows 360.
  • the hierarchical structure data 36 according to the present embodiment is a MICROSOFT EXCEL (registered trademark) worksheet.
  • the hierarchical structure data 36 may be a text file, for example.
  • the hierarchical structure data 36 is created by the analysis unit 27 analyzing the hierarchical structure of the module 31 and stored in association with the module 31.
  • the file name of the hierarchical structure data 36 is the same as the file name of the corresponding module 31.
  • the modules 31 and the hierarchical structure data 36 corresponding to each other may be different worksheets of the same workbook.
  • the row 360 of the hierarchical structure data 36 includes a serial number (line identification) 361, a hierarchical pattern 362, an end line (serial number) 363, and similarity notification information 364.
  • the similar notification information 364 includes a similar row (serial number) 364n.
  • the serial number 361 the serial number 311 of the corresponding module 31 is set.
  • the end row 363 the serial number 311 of the row 310 where the target range starting from the serial number 361 in the module 31 (that is, the range to be subjected to the analysis of the hierarchical structure) ends is set.
  • the hierarchical pattern 362 data that can specify the hierarchical structure of the target range from the serial number 361 to the end row 363 is set.
  • Data indicating that similar target ranges exist in the module 31 is set in the similarity notification information 364. More specifically, the serial number 361 of the row 360 having the same hierarchical pattern 362 as the hierarchical pattern 362 of the row 360 is set in the similar row 364n according to the present embodiment.
  • the analyzing means 27 includes an acquisition function (S400, S402), an analysis function (S404 to S416), a writing function (S418), and a display function (S420). And have.
  • the acquisition function is a function for acquiring the target module 31 to be processed among the modules 31 from the storage device 30 (or main storage device).
  • the analysis function is a function for analyzing the hierarchical structure of the target module 31.
  • the writing function is a function of associating the target module 31 with the hierarchical structure data 36 (accordingly, the similarity notification information 364) and storing it in the storage device 30.
  • the display function is a function for displaying the target module 31 and the similar notification information 364 in association with each other on the display device 50.
  • the analysis unit 27 is activated by, for example, an activation instruction input from the input device 40, and acquires a target module name for identifying the target module 31 (S400).
  • the target module name may be input as part of the activation instruction, for example.
  • the analysis unit 27 reads the target module 31 specified by the acquired target module name from the storage device 30 (S402). At this time, for example, only the module 31 stored in a predetermined folder may be a reading target. If the target module 31 is not stored in the storage device 30, the analysis unit 27 ends the process (not shown).
  • the analysis means 27 specifies the hierarchical level of each sentence of the target module 31 (S404). Specifically, the analysis unit 27 sequentially acquires the row 310 of the target module 31 from the first row to the last row, and assigns a hierarchical level to each row 310. At this time, the analysis unit 27 sets the hierarchy level of the first row to 1, and adds the hierarchy level every time the THEN phrase of the IF statement is detected. On the other hand, the analysis unit 27 subtracts the hierarchy level every time it detects the END-IF of the IF statement (that is, the end of the IF statement). If it is possible to omit the THEN clause and END-IF, it is sufficient to analyze the sequence of sentences in the IF statement and add / subtract hierarchical levels.
  • the hierarchical level of the first sentence 312 (the sentence 312 whose serial number 311 is 0001) is 1, and the hierarchical level of the next THEN phrase is 2.
  • the hierarchy level is a numerical value
  • the analysis unit 27 increases the hierarchy level by 1 each time the THEN phrase is detected, and decreases the hierarchy level by 1 each time the END-IF is detected.
  • the hierarchy level may not be a numerical value as long as the depth of the hierarchy level can be compared.
  • the hierarchy level updated by the detection of the THEN phrase may be designed to return to the value before the update by detecting the corresponding END-IF.
  • the hierarchy level may be assigned to the executable statement.
  • the hierarchy level may be given to the first line and the end line of the IF statement and the line in which the THEN phrase or ELSE phrase is described. Therefore, the analysis unit 27 may assign a hierarchical level to the range from the first executed part of the target module 31 to the last executed statement.
  • the analysis unit 27 extracts a target range (that is, a target range for analyzing the hierarchical structure) (S406). Specifically, the analysis unit 27 detects the start line and the end line for each of the conditional statements included in the target module 31. The analysis unit 27 uses the range between the detected start line and end line as the target range. On the other hand, when the target module 31 does not include a conditional statement or when the target module 31 includes only one conditional statement, the analyzing unit 27 ends the process (not shown). As can be understood from the above description, according to the present embodiment, the target range includes at least one conditional statement. Furthermore, the entire target range from the start to the end of each conditional statement included in the target range is included in the target range. However, the target range may start from before the conditional sentence or from the middle of the conditional sentence.
  • the IF statement (conditional statement) starts from a line 310 having serial numbers 311 of 0001, 0003, 0005, 0011, and 0014, respectively.
  • the IF statement ends at a line 310 with a serial number 311 of 0020, 0010, 0008, 0018, and 0017.
  • the start line and the end line detected as described above are used as the start line and the end line of the target range, respectively.
  • the analyzing unit 27 creates a hierarchical pattern for each of the extracted target ranges (S406). Specifically, the analysis means 27 creates a hierarchical pattern (before compression) by connecting the hierarchical levels from the start line to the end line for each conditional statement. Further, the analysis unit 27 compresses the same hierarchical level that is continuous in the hierarchical pattern (before compression) to create a hierarchical pattern (after compression).
  • 2, 1 (refer to the hierarchical level in FIG. 5) are sequentially connected to create a hierarchical pattern (before compression). Further, the same hierarchical level that continues in the hierarchical pattern (before compression) is compressed into one hierarchical level, thereby creating a hierarchical pattern (after compression).
  • the hierarchy level in the present embodiment indicates the depth of the hierarchy specified with reference to the head sentence of the target range.
  • the hierarchical structure in the target range can be identified by a hierarchical pattern in which the hierarchical levels included in the target range are connected.
  • the analysis unit 27 displays the start row, the hierarchical pattern (after compression), and the end row of the target range detected as described above, the serial number 361 of the hierarchical structure data 36, and the hierarchical pattern 362. And the end line 363 respectively (part of the processing of S406).
  • the hierarchy pattern 362 is converted to indicate the depth of the hierarchy specified with reference to the head sentence (ie, IF sentence) of the target range. Specifically, for example, “2 3 4 3 2” is converted to “1 2 3 2 1”.
  • each of the hierarchical levels connected to the hierarchical pattern 362 indicates a relative height based on a mountain foot.
  • the analysis unit 27 sorts the row 360 of the created hierarchical structure data 36 in descending order of the length of the hierarchical pattern 362 (that is, the number of hierarchical levels connected to the hierarchical pattern 362) (S408).
  • the analysis unit 27 sorts them in ascending order of the serial numbers 361, for example.
  • the hierarchical structure data 36 after sorting is illustrated. Referring to the example in the lower part of FIG. 6, for example, the length of the hierarchical pattern 362 of “1 2 3 4 3 2 3 4 3 2 1” is 11. Since this hierarchical pattern 362 has the maximum length among the five hierarchical patterns 362, it is arranged in the first row of the hierarchical structure data 36 by sorting.
  • the analysis unit 27 selects two different target ranges (that is, the first target range and the second target range) from the target ranges of the created hierarchical structure data 36 (that is, the target ranges of the target module 31). To do.
  • the analyzing unit 27 creates the similarity notification information 364 in association with the second target range (S410 to S416). More specifically, the analysis unit 27 determines whether or not the same hierarchical pattern 362 exists for each row 360 of the created hierarchical structure data 36 (S410 to S416).
  • the analysis unit 27 first obtains the first hierarchical pattern 362 (in the first row 360) as the hierarchical pattern of the first target range (S410). Referring to the example in the lower part of FIG. 6, “1 2 3 4 3 2 3 4 3 2 1” is acquired.
  • the analysis unit 27 determines whether or not the same hierarchical pattern 362 as the acquired hierarchical pattern 362 exists in the hierarchical structure data 36 (S412). In other words, the analysis unit 27 searches for a second target range that is different from the first target range and has the same hierarchical pattern as the first target range. When the second target range exists, the analysis unit 27 sets the first target range serial number 361 in the similar row 364n of the similarity notification information 364 of the second target range (S412). Referring to the lower example in FIG. 6, since there is no hierarchical pattern 362 identical to “1” 2 3 4 3 2 3 4 3 2 1 ”, no similar row 364n of any row 360 is set (ie, the initial value). Remains).
  • the analysis means 27 determines whether or not all the hierarchical patterns 362 have been processed (S414), and if the processing has been completed (YES in S414), the processing of S418 is performed. On the other hand, when there is an unprocessed hierarchical pattern 362 (NO in S414), the analysis unit 27 acquires the hierarchical pattern 362 of the next row 360 in the hierarchical structure data 36. Referring to the example in the lower part of FIG. 6, “1 2 3 2 1” is acquired as understood from the above description.
  • the analysis unit 27 sorts the hierarchical pattern 362 in descending order of length in the analysis function, and thereby, a plurality of target ranges are connected to the hierarchical level 362. Are used as the first target range in descending order.
  • the hierarchical level can be compared without shifting the row 310 of the target module 31 one by one without creating the hierarchical pattern 362.
  • the analysis function of the analyzing means 27 is that the first target range hierarchical pattern 362 and the second target range hierarchical pattern 362 are the same. It is determined that the hierarchical structure of the range and the hierarchical structure of the second target range are the same (that is, the first target range and the second target range are similar).
  • the hierarchical structure can be compared by a method different from the above method. For example, the hierarchical structures may be compared by the hierarchical pattern (before compression) shown in FIG. By doing so, the hierarchical structures can be compared more strictly.
  • a hierarchy level is also assigned to a statement other than the IF statement, THEN clause, ELSE clause, and END-IF (for example, MOVE statement) and linked to the hierarchical pattern (before compression). May be. By doing in this way, the similarity of two object ranges can be compared more strictly.
  • Similarity between two target ranges can be compared by other than hierarchical patterns.
  • the evaluation score can be calculated from the type and number of executable statements used in two target ranges, the type and number of functions used, and the type and number of item names used. In this case, when the hierarchical pattern is the same and the calculated evaluation score is a predetermined score or more, it may be determined that the two target ranges are similar.
  • the analysis unit 27 Upon completion of the analysis process (S404 to S416), the analysis unit 27 writes the similarity notification information 364 in the storage device 30 (S418). More specifically, the analysis unit 27 writes the created hierarchical structure data 36 in the storage device 30. As described above, the hierarchical structure data 36 is stored in association with the target module 31. Therefore, by referring to the similar row 364n of the hierarchical structure data 36 (that is, the similarity notification information 364 associated with the target range), it is possible to easily find target ranges similar to each other in the target module 31.
  • the analysis means 27 displays the target module 31 on the display device 50 so that a similar part can be identified (S420), and ends the process. More specifically, the analysis unit 27 displays the target module 31 as shown in FIG. 7, for example. As shown in FIG. 7, each of the target ranges similar to each other among the target modules 31 is displayed surrounded by a frame. Further, a similarity identification code (a number surrounded by a circle in FIG. 7) indicating which target range is similar is displayed inside the frame. However, it is also possible to indicate which target range is similar to the target range by changing the attributes (color, thickness, etc.) of the frame without displaying the similarity identification code.
  • a target range that is close to the beginning of the target module 31 may be displayed.
  • a target range that is close to the beginning of the target module 31 may be displayed.
  • the analysis unit 27 may display the created hierarchical structure data 36 instead of displaying the target module 31. In other words, the analysis unit 27 may display the target module 31 and the similar notification information 364 in association with each other on the display device 50.
  • the analyzing means 27 has a writing function (S418) and a display function (S420), but the analyzing means 27 is one of the writing function (S418) and the display function (S420). As long as it has. Furthermore, it does not have either of the above two functions, but instead may have a function of associating the target module 31 with the similar notification information 364 and transmitting it to another device or means.
  • the target module 31 may include a conditional statement other than the IF statement.
  • the analysis unit 27 may update the hierarchy level each time a WHEN phrase is detected, and return the hierarchy level to the level before the update every time a corresponding END-EVALUATE is detected.
  • the same processing can be applied to conditional statements other than IF statements and EVALUATE statements.
  • the function / operation of the analyzing means 27 after the hierarchical level is given is the same as the case where the target module 31 includes only the IF sentence as the conditional sentence.
  • the analyzing means 27 according to this embodiment can be variously modified as will be described below.
  • the analysis unit 27 sets the serial number 361 of the first target range (that is, the comparison target range) in the similar row 364n of the second target range (that is, the comparison target range).
  • the serial number 361 of the second target range may be set in the similar row 364n of the first target range.
  • the serial numbers 361 of the second target range and the first target range may be set in the similar rows 364n of the first target range and the second target range, respectively.
  • the analysis unit 27 may create the similarity notification information 364 in association with the first target range and / or the second target range.
  • the analysis unit 27 first determines that the similar row 364n is similar. A serial number 361 of the detected second target range (or first target range) may be set. On the other hand, the analysis means 27 may set the serial numbers 361 of all the second target ranges (or first target ranges) that are detected to be similar to the similar row 364n.
  • the similar target ranges are further included in the similar target ranges.
  • the number of rows 360 in which the similar rows 364n are set becomes unnecessarily large, and the number of investigation and examination man-hours as to whether maintenance is necessary or not is increased. May increase.
  • the target range for similarity determination is narrowed down, there is a possibility that investigation / examination as to whether maintenance is necessary will be missed. Therefore, it is better to adjust the detection accuracy of the similar target range in accordance with the content of maintenance or the like.
  • the analysis unit 27 sets the target range (row 360) satisfying a predetermined condition in the analysis function (S404 to S416 in FIG. 4). What is necessary is just not to use it as 1 object range.
  • a predetermined condition for example, a condition based on the number of hierarchical levels connected to the hierarchical pattern 362 in the row 360 may be adopted. More specifically, when the number of hierarchical levels connected to the hierarchical pattern 362 is smaller than a predetermined number (for example, 10), the target range may not be used as the first target range. Alternatively, when the maximum value of the hierarchy level in the target range is smaller than a predetermined number (for example, 4), the target range may not be used as the first target range.
  • a module obtained by connecting a plurality of modules 31 may be used.
  • a plurality of modules 31 may be simply connected in order from the start line to the end line to be the target module 31. In this way, similar target ranges in the entire system can be collectively detected. It is also possible to connect a plurality of modules 31 as in the second embodiment described below.
  • the structural analysis device 10 ′ As shown in FIG. 9, the structural analysis device 10 ′ according to the second embodiment of the present invention includes a device main body 20 ′, a storage device (storage means) 30 ′, an input device 40, a display device 50, and the like. It has. Similar to the structure analysis apparatus 10 according to the first embodiment, the structure analysis apparatus 10 'performs a structure analysis of a module (source program) composed of one or more sentences described in a program language. The program language, the module, the input device 40, and the display device 50 according to the second embodiment are configured similarly to the first embodiment.
  • a module source program
  • the program language, the module, the input device 40, and the display device 50 according to the second embodiment are configured similarly to the first embodiment.
  • the storage device 30 ′ is a magnetic disk device similar to the storage device 30.
  • one or more modules 31 are stored in the storage device 30 ′.
  • the storage device 30 ′ stores a secondary module (module) 32 and a flowchart 33.
  • the secondary module 32 according to the present embodiment is created by connecting and converting the modules 31. Also, the flowchart 33 is created from the secondary module 32.
  • the apparatus main body 20 ′ is, for example, the main body of a PC, like the apparatus main body 20.
  • a storage device 30 ' is exemplified.
  • the storage device 30 ′ stores a conversion program, a machining program, a flowchart creation program, and an analysis program (not shown).
  • the above program is loaded into the main storage device and executed by the CPU, whereby the computer functions as the conversion means 21, the processing means 22, the flowchart creation means 25, and the analysis means 27 '. That is, the above-described program is for causing the computer to function as the structural analysis apparatus 10 'that supports the structural analysis of the module.
  • the apparatus main body 20 ′ of the structural analysis apparatus 10 ′ according to the present embodiment includes the conversion means 21, the processing means 22, the flowchart creation means 25, and the analysis means 27 ′.
  • the conversion means 21 converts a predetermined target module 31 among the modules 31 stored in the storage device 30 'into a secondary module 32 and stores it in the storage device 30'.
  • the processing means 22 processes the secondary module 32 stored in the storage device 30 '.
  • the flowchart creation means 25 creates a tabular flowchart 33 from the secondary module 32 stored in the storage device 30 '.
  • the analysis unit 27 ′ performs a structural analysis of the module 31 stored in the storage device 30 ′, similarly to the analysis unit 27 of the first embodiment. However, the analysis unit 27 ′ according to the present embodiment does not directly analyze the module 31 but performs the structure analysis of a predetermined target module 32 among the secondary modules 32.
  • a module 31 (XXX module) whose module name is XXX, a module 31 (AAA module) whose module name is AAA, and a module name is BBB.
  • a module 31 (BBB module) and a module 31 (CCC module) whose module name is CCC are stored.
  • Each of the modules 31 includes a plurality of rows 310 each having a serial number 311 and a sentence 312.
  • the structure of the module 31 will be described more specifically with reference to this example.
  • the XXX module is a main module (that is, a module that is a starting point of processing).
  • the XXX module has lines 310 in which CALL statements for specifying and calling the AAA module and the BBB module by the module name are described.
  • the AAA module has a line 310 in which a CALL statement for calling the CCC module is described.
  • Each of the modules 31 illustrated in FIG. 10 includes one or more sections.
  • the XXX module has a main section (that is, a main processing unit as a starting point of processing in the module) and a subordinate section (subordinate processing unit).
  • the main section is composed of lines 310 from the line 310 next to the line 310 in which “PROCEDURE DIVISION.” Is described to the line 310 in which “STOP RUN.” Is described.
  • Subordinate sections (subsections) are composed of lines 310 from line 310 in which “AAA-SUB SECTION.” Is described to line 310 in which “EXIT.” Is described.
  • the section name (processing unit name) of the above-mentioned subsection is AAA-SUB.
  • the main section includes a line 310 that identifies and executes the AAA-SUB section by section name. More specifically, the main section includes a line 310 in which “PERFORM AAA-SUB.” Is described.
  • Part of the section illustrated in FIG. 10 includes a line 310 in which a conditional statement is described.
  • the main section of the XXX module includes a line 310 describing an EVALUATE statement having five WHEN phrases and a line 310 describing an IF statement having THEN and ELSE.
  • the main section of the CCC module includes a line 310 in which the IF statement is further described in the EL statement of the IF statement, and thereby the statement 312 is hierarchized by the conditional statement.
  • the secondary module 32 includes p (m ⁇ 1) secondary rows (rows) 320.
  • the secondary module 32 according to the present embodiment is a worksheet of MICROSOFT EXCEL (registered trademark in Japan). However, the secondary module 32 may be a text file, for example.
  • the line 320 includes at least a module identification 321, a line number 322, a hierarchy identification 323, an instruction identification 324, a serial number (line identification) 326, a secondary sentence 327, and a hierarchical structure 329. Consists of The hierarchical structure 329 includes a hierarchical pattern 329p and similarity notification information 329r.
  • the similarity notification information 329r according to the present embodiment includes a similarity presence / absence 329f.
  • the secondary module 32 is generated by collecting and processing lines 310 in which executable statements and the like are described from one or more modules 31.
  • the secondary module 32 according to the present embodiment is generated by the converting means 21 and processed by the processing means 22 and the analyzing means 27 ′.
  • the hierarchical structure 329 of the secondary module 32 is set by the analyzing means 27 ′, similarly to the hierarchical structure data 36 in the first embodiment.
  • the secondary module 32 is obtained by collecting and processing PROCEDURE DIVISION rows 310 of, for example, an XXX module, an AAA module, a BBB module, and a CCC module.
  • the CALL sentence described in the sentence 312 in the line 310 is commented (that is, changed to a comment sentence). ).
  • the AAA module's PROCEDURE DIVISION statement 312 called by the CALL statement is expanded as a secondary statement 327 in row 320 (ie, expanded to produce a secondary statement 327 in row 320).
  • the PROCEDURE DIVISION statement 312 of the CCC module called by the CALL statement from the AAA module is expanded as the secondary statement 327 of the line 320.
  • the PERFORM statement described in the statement 312 in the line 310 is commented out in the secondary sentence 327 in the line 320.
  • the AAA-SUB section statement 312 executed by the PERFORM statement is expanded as a secondary statement 327 in the row 320.
  • a conditional statement other than the IF statement (EVALUATE statement in the present embodiment) is converted into an IF statement in the secondary statement 327.
  • the three sentences 312 in which “EVALUATEKWK-AO”, “WHEN CS-1”, and “MOVE CS-1 TO WK-BI” are described are “* # E EVALUATE WK-AO” (comment sentence).
  • the following sentence 327 has been converted.
  • a secondary sentence 327 is generated to compensate for the missing of THEN, ELSE, and END IF in the IF sentence.
  • a negative conditional expression is converted into a positive conditional expression.
  • IF statements with conditional expressions connected by AND and OR are decomposed into multiple IF statements, and simple secondary conditional expressions that evaluate the relationship between two operands to be evaluated using only one logical operator. Is converted to an IF statement with However, a part of the above conversion (for example, decomposition of conditional expressions connected by AND or OR) may not be performed.
  • a MOVE sentence or the like divided into a plurality of sentences 312 is collected into one secondary sentence 327. That is, each row 320 of the secondary module 32 is generated based on the row 310 of the module 31. More specifically, the secondary sentence 327 is a copy of the sentence 312 as it is, or is generated by processing and expanding the sentence 312.
  • the module identification 321 indicates which module 31 each row 320 is based on. More specifically, a module name (for example, XXX) is set in the module identification 321. However, a number or the like that can uniquely identify the module 31 may be set instead of the module name.
  • the serial number 311 is set to the serial number 311 of the copy source line 310 in the line 320 where the secondary sentence 327 is a copy of the sentence 312.
  • the serial number 311 of the corresponding line 310 is set in the serial number 326.
  • an identifier for example, a combination of symbols
  • the lines 320 and 310 can be easily associated with each other.
  • serial numbers starting from 1 are set in the order in which the lines 320 are arranged.
  • the line number 322 may not be a serial number as long as the size relationship of the line numbers 322 can be compared.
  • the line number 322 may be a combination of characters and symbols.
  • the hierarchy identification 323 includes a branch hierarchy and a branch depth.
  • the branch hierarchy is used to identify a hierarchy by a conditional statement.
  • the branch hierarchy according to the present embodiment is set by using 1 as the starting value in the first row 320. In other words, the branch hierarchy of the first row 320 is 1.
  • the branch hierarchy is changed to 1.1 in line 320 in which THEN of the IF statement is described, and is changed to 1.2 in line 320 in which ELSE is described.
  • the branch hierarchy returns to 1 from the line following line 320 in which END IF of the IF statement is described.
  • the branch depth according to the present embodiment is set by using 1 as the starting value in the first row 320, similarly to the branch hierarchy.
  • the branch depth of the first row 320 is 1.
  • the depth of the branch is changed to 1.1 in the line 320 in which THEN of the IF statement is described, and returns to 1 from the line next to the line 320 in which END IF is described. Further, it is changed to 1.2 in the line 320 where the THEN of the subsequent IF statement is described, and returns to 1 from the line next to the line 320 where the END IF is described.
  • the branch depth starts at 1, and a digit of “.q” (q is an integer of 1 or more) is added to the end of the line 320 in which THEN is described, and END IF is described.
  • the last digit “.q” is deleted in the next line of the line 320.
  • the value of q in “.q” starts from 1 for each digit.
  • the value of q in the first digit “.q” (for example, “0.2” in 1.2) starts with 1 and is incremented each time it is added.
  • the value of q in “.q” after the second digit is a range in which rows 320 having the same branch depth excluding the digit are continuous. 1 is a starting value and is incremented every time it is added in the continuous range.
  • the instruction identification 324 indicates the type of sentence described in the secondary sentence 327.
  • the instruction identification 324 includes an instruction name, a classification indicating whether it is a conditional instruction (conditional instruction success / failure: simply described as “conditional instruction” in FIG. 12), and whether it is a processing instruction. This is composed of the following categories (processing instruction validity / non-permission: simply described as “processing instruction” in FIG. 12).
  • processing instruction validity / non-permission simply described as “processing instruction” in FIG. 12.
  • O is set to the processing instruction success / failure.
  • the instruction name IF, THEN, END-IF, MOVE, etc.
  • the hierarchical pattern 329p is for specifying the hierarchical structure of the target range, as in the first embodiment. Specifically, as in the first embodiment, a hierarchical pattern in which hierarchical levels are connected is set in the hierarchical pattern 329p of the row 320 where the IF statement starts (that is, the target range starts). As understood from the portion indicated by the broken line A in FIG. 12, according to the present embodiment, the length of the hierarchy identification 323 (for example, the number of digits of the branch depth) indicates the hierarchy level.
  • similar notification information 329r data indicating that similar target ranges exist in the secondary module 32 is set as in the first embodiment.
  • a flag indicating whether or not there is a row 320 having the same hierarchical pattern 329p as the hierarchical pattern 329p of the row 320 is set in the similarity 329f.
  • the row 320 can include various items in addition to the items described above. For example, when the row 320 includes the section name of the corresponding row 310, the correspondence between the row 320 and the row 310 can be grasped more easily.
  • various files can be created based on the secondary module 32 stored in the storage device 30 ′.
  • the created file can be displayed / printed on the display device 50 as data for supporting the syntax analysis of the module 31. More specifically, for example, the flowchart 33 can be created based on the secondary module 32.
  • the flowchart 33 is a worksheet of MICROSOFT EXCEL (registered trademark in Japan). However, the flowchart 33 may be a file of another format. According to the present embodiment, the flowchart 33 is generated from the secondary module 32.
  • Flowchart 33 is a compilation of secondary sentence 327 of secondary module 32 in a flowchart-like manner. More specifically, the secondary sentence 327 not related to the IF sentence is arranged in the second column (column in which “2” is displayed in the header) according to the arrangement order of the rows 320 in the secondary module 32. It has been.
  • the secondary sentence 327 related to the IF sentence (that is, the secondary sentence 327 in which the sentence from IF to END-IF is described) is a secondary sentence executed when the conditional expression in the IF sentence is satisfied.
  • the target sentence 327 and the secondary sentence 327 executed when the conditional expression in the IF sentence is not satisfied are arranged separately on the left and right.
  • the row number 322 of the secondary sentence 327 arranged in the second column is set in the first column of the flowchart 33, and thereby the row of the flowchart 33 is associated with the row 320 of the secondary module 32, respectively. be able to. Not only the line number 322 but also any item in the line 320 can be set in the flowchart 33.
  • the columns of the flowchart 33 increase as the hierarchy of IF statements increases.
  • a portion of the secondary module 32 where a more complicated conditional statement is described is displayed so as to extend in the column direction of the table. Accordingly, by displaying the flowchart 33 on the display device 50 and comparing the executable statements displayed side by side in the left and right columns, it is possible to grasp the difference in processing due to the success or failure of the conditional expression.
  • the processing blocks in the flowchart 33 can be colored and displayed on the display device 50.
  • a predetermined background color A is set in the field where IF and END-IF are set
  • a predetermined background color B is set in the secondary sentence 327 executed in the case of THEN
  • a predetermined background color C can be set in the secondary sentence 327 executed at the same time.
  • the conversion means 21 includes a control information acquisition function (S1400), a read function (S1402, S1404), a conversion function (S1406 to S1412), and a write function ( S1414).
  • the control information acquisition function is a function for acquiring expansion control information.
  • the read function is a function of reading the target module 31 to be processed among the modules 31 from the storage device 30 ′.
  • the conversion function is a function for converting the target module 31 into the secondary module 32.
  • the write function is a function for storing the secondary module 32 in the storage device 30 '.
  • the conversion unit 21 when the conversion unit 21 is activated by, for example, an activation instruction input from the input device 40, for example, obtains development control information input as part of the activation instruction.
  • the deployment control information can include a deployment restriction instruction.
  • the expansion restriction instruction instructs to restrict the expansion of a sentence described in the sentence 312 of the section to be executed or the module 31 to be called only to the first time.
  • the conversion means 21 acquires a target module name for specifying the target module 31 (S1402).
  • the target module name can be acquired by the same method as the expansion control information.
  • the conversion means 21 reads the target module 31 specified by the acquired target module name from the storage device 30 '(S1404). At this time, for example, only the module 31 stored in a predetermined folder may be a reading target. If the target module 31 is not stored in the storage device 30 ′, the conversion means 21 ends the process (not shown).
  • the conversion means 21 acquires the sentence 312 of the processing start location of the target module 31 (S1406).
  • the processing start location according to the present embodiment is the top of the main section.
  • the conversion means 21 performs a secondary sentence output process for the acquired sentence 312 (S1408).
  • the conversion means 21 determines whether the sentence 312 at the end of processing has been processed (S1410).
  • the processing end point according to the present embodiment is the end of the main section. If the processing has been completed (YES in S1410), the conversion means 21 writes the created secondary module 32 in the storage device 30 ′ (S1414), and the processing ends. On the other hand, if the processing has not been completed (NO in S1410), the conversion means 21 acquires the next sentence 312 to be processed (the sentence 312 in the subsequent line 310) (S1412). Next sentence output processing is performed (S1408).
  • FIG. 15 is a flowchart showing the secondary sentence output process (S1408) in more detail among the processes (functions) of the conversion means 21 shown in FIG.
  • the conversion means 21 outputs the sentence 312 as the secondary sentence 327 in the secondary sentence output process (S1500). More specifically, according to the present embodiment, the executable statement or the like described in the statement 312 is copied to a predetermined row / column of the worksheet. At this time, as described above, processing such as changing the PERFORM statement into a comment statement is performed. Further, the conversion means 21 sets the above-described values for the module identification 321, the line number 322, and the serial number 326.
  • the conversion means 21 determines whether a conditional statement is described in the statement 312 (S1502).
  • the conversion unit 21 performs processing such as converting a conditional statement other than the IF statement into an IF statement as described above. More specifically, the conversion means 21 generates a secondary sentence 327 in which a secondary conditional sentence (IF sentence) that is one of the secondary sentences is described based on the conditional expression of the conditional sentence. Then, the secondary sentence 327 is hierarchized by the secondary conditional sentence and output to the secondary module (S1504), and the secondary sentence output process is terminated.
  • IF sentence secondary conditional sentence
  • the above-mentioned secondary conditional statement selects the secondary statement 327 to be executed depending on whether or not the secondary conditional expression that evaluates the relationship between the two operands to be evaluated by only one logical operator is satisfied. Is a conditional statement (secondary statement 327).
  • the conversion unit 21 determines whether the determination target statement is a processing unit execution statement (PERFORM statement). (S1506). If the determination target statement is a processing unit executable statement (YES in step S1506), the conversion unit 21 acquires the statement 312 at the processing start point of the processing unit to be executed (section according to the present embodiment). . In the present embodiment, the processing start location of the processing unit is the head of the section.
  • the conversion unit 21 determines whether the determination target statement is a module call statement (CALL statement according to the present embodiment) (S1510). .
  • the determination target statement is a module call statement (YES in S1510)
  • the conversion unit 21 reads the call target module 31 specified by the CALL statement from the storage device 30 '(S1512), and calls the call target module 31.
  • the sentence 312 of the processing start location is acquired (S1514). According to the present embodiment, the processing start location of the module 31 to be called is the head of the main section of the module 31.
  • the conversion unit 21 ends the secondary sentence output process.
  • the conversion means 21 performs a secondary sentence output process recursively on the sentence 312 of the section to be executed or the sentence 312 of the module 31 to be called (S1516).
  • the conversion means 21 determines whether the sentence 312 at the end of processing has been processed (S1518).
  • the processing end point according to the present embodiment is the end of the section for the section to be executed, and the end of the main section for the module 31 to be called. If the process has been completed (YES in S1518), conversion means 21 ends the secondary sentence output process. On the other hand, if the processing has not ended (NO in S1518), the conversion means 21 acquires the next sentence 312 to be processed (the sentence 312 in the subsequent line 310) (S1520) and recursively acquires the acquired sentence 312. Then, a secondary sentence output process is performed (S1516).
  • the conversion means 21 does not expand the sentence 312 of the section to be executed for the recursive PERFORM statement (executes itself). Similarly, the conversion means 21 does not expand the statement 312 of the module 31 to be called for a recursive CALL statement (calling itself). Further, when the expansion restriction instruction is specified in the expansion control information, the conversion means 21 uses the secondary for the PERFORM statement that executes the section having the same section name as the section that has already been subjected to the secondary sentence output processing. The target sentence output process is not performed (S1506). Similarly, when the expansion restriction information is specified in the expansion control information, the conversion unit 21 uses the CALL statement that calls the module 31 having the same module name as the module 31 that has already performed the secondary sentence output process. Secondary sentence output processing is not performed (S1510).
  • the conversion function of the conversion means 21 is obtained by converting each of the sentences 312 described from the predetermined processing start position to the predetermined processing end position of the target module 31 as a secondary sentence 327. Output sequentially to the next module.
  • the statement 312 is a processing unit execution statement or a module call statement
  • the conversion function of the conversion means 21 is expanded by expanding the statement 312 described in the processing unit to be executed or the module 31 to be called.
  • a target sentence 327 is generated and output to the secondary module 32.
  • the conversion function of the conversion means 21 further expands the processing unit execution statement or the module call statement in the expanded statement 312 (that is, expands recursively).
  • the predetermined processing start location and the predetermined processing end location for the module 31 are the beginning and the end of the main section, respectively.
  • the predetermined processing start location and the predetermined processing end location for the module 31 may be the beginning and end of PROCRDURE DIVISON, respectively.
  • at least one of a predetermined process start position and a predetermined process end position can be set in the middle of the main section.
  • the conversion function of the conversion means 21 is the same as the processing unit to be executed when the expansion control instruction is specified in the expansion control information.
  • the described statement 312 is expanded only once for the first time (that is, the same processing unit is expanded only once), and for the same module 31, the statement 312 described in the module 31 to be called Expansion is performed only once for the first time (that is, the same module 31 is expanded only once).
  • the conversion function of the conversion means 21 may expand the same processing unit or the same module 31 only once regardless of whether or not the expansion restriction instruction is designated.
  • the conversion function of the conversion means 21 may repeatedly expand the same processing unit or the same module 31 regardless of whether or not an expansion restriction instruction is specified.
  • the conversion module 21 stores the secondary module 32 including the secondary sentence 327 in the storage device 30 ′.
  • the processing means 22 includes a read function (S1600, S1602), a layer identification addition function (S1606), a command identification addition function (S1608), and a writing function (S1014). ).
  • the read function is a function for reading the secondary module 32 to be processed from the storage device 30 '.
  • the hierarchy identification adding function is a function for adding a hierarchy identification 323 to at least a part of the secondary sentence 327 of the secondary module 32.
  • the hierarchy identification 323 indicates in which hierarchy the secondary sentence 327 is located.
  • the instruction identification adding function is a function for adding an instruction identification 324 to at least a part of the secondary sentence 327 of the secondary module 32.
  • the instruction identification 324 indicates the type of sentence described in the secondary sentence 327.
  • the writing function is a function of storing the secondary module 32 including the secondary sentence 327 to which the hierarchy identification 323 and the instruction identification 324 are added in the storage device 30 ′.
  • a secondary module name for identifying the secondary module 32 to be processed is specified.
  • the processing means 22 reads the secondary module 32 specified by the acquired secondary module name from the storage device 30 '(S1602). If the secondary module 32 to be processed is not stored in the storage device 30, the processing means 22 ends the process (not shown).
  • the processing means 22 acquires the secondary sentence 327 of the processing start location of the secondary module 32 to be processed (S1604).
  • the processing start location according to this embodiment is the top of the secondary module 32.
  • the processing means 22 adds a hierarchy identification 323 to the acquired secondary sentence 327 (S1606). More specifically, the processing means 22 according to the present embodiment performs a row / column corresponding to the hierarchy identification 323 of the row 320 in the worksheet (that is, the target worksheet) in which the secondary module 32 to be processed is recorded. The branch hierarchy and the branch depth as described above are set. Next, the processing means 22 adds an instruction identification 324 to the acquired secondary sentence 327 (S1608). More specifically, the processing means 22 according to the present embodiment, in the target worksheet, in the row / column corresponding to the instruction identification 324 in the row 320, the instruction name, whether the condition instruction is appropriate, and whether the processing instruction is appropriate And set.
  • the processing means 22 determines whether the secondary sentence 327 at the end of processing has been processed (S1612).
  • the processing end point according to the present embodiment is the end of the secondary module 32. If the processing has been completed (YES in S1612), the processing means 22 writes the processed secondary module 32 in the storage device 30 '(S1614), and ends the processing. On the other hand, when the processing has not been completed (NO in S1612), the processing means 22 acquires the secondary sentence 327 to be processed next (secondary sentence 327 in the subsequent row 320) (S1616), The hierarchy identification 323 is added to the acquired secondary sentence 327 (S1606, S1608).
  • the secondary module 32 composed of the secondary sentence 327 to which the hierarchy identification 323 and the instruction identification 324 are added by the processing means 22 (according to the present embodiment, the hierarchy identification 323 and the like are added.
  • Stored worksheet is stored in the storage device 30 '.
  • the analyzing means 27 ' according to the present embodiment has the same function as the analyzing means 27 according to the first embodiment. The following description will be made with reference to FIG. 4 with reference to the example shown in FIG.
  • the analysis unit 27 ' When the analysis unit 27 'is activated in the same manner as the analysis unit 27, the target module 32 is read from the storage device 30' (or main storage device) (S400, S402). In other words, the analysis means 27 ′ does not analyze the module 31 but the secondary module 32.
  • the analysis unit 27 ′ determines the start and end of the IF statement based on the instruction name of the instruction identification 324 when specifying the hierarchical level of each sentence of the target module 32 (S404). Further, the analyzing means 27 ′ uses the length of the hierarchy identification 323 as the hierarchy level. Referring to the example of FIG. 17, a hierarchical level is assigned to each row 320 as shown in the second column from the right.
  • the analysis unit 27 ′ extracts the target range (that is, the range to be subjected to the analysis of the hierarchical structure) similarly to the analysis unit 27 (S406).
  • the analyzing means 27 ′ does not use the range included in the target range as the target range.
  • two of the IF statements start from the row 320 with the line numbers 322 and 874, respectively.
  • the above IF statement ends at line 320 with line numbers 322 of 921 and 2437, respectively.
  • the analysis means 27 uses the range from the line 320 with the line number 322 of 874 to the line 320 with the line number 322 of 921, and the line 320 with the line number 322 of 2397 to the line 320 with the line number 322 of 2437 as the target range. .
  • the analysis unit 27 ′ does not use, for example, the line 320 having the line number 322 of 882 to the line 320 having the line number 322 of 920 as the target range.
  • the analyzing unit 27 ′ creates a hierarchical pattern in the same manner as the analyzing unit 27 (S406). Referring to the target module 32 illustrated in FIG. 17, for each of the row 320 with the row number 322 of 874 and the row 320 with the row number 322 of 2397, the hierarchical pattern of “1 2 3 4 3 4 5 4 3 2 1” Created and set to the hierarchical pattern 329p.
  • the analysis unit 27 ′ uses two different target ranges (ie, the first target range and the second target range) in the target range of the created hierarchical structure 329 (ie, the target range of the target module 31). Range).
  • the analysis unit 27 ′ creates the similarity notification information 329r (S408 to S416).
  • the analysis unit 27 ′ creates the similarity notification information 329r in association with the first target range and the second target range. More specifically, the analyzing unit 27 ′ determines the presence or absence of the same hierarchical pattern 329p for each row 320 of the target module 32 (S410 to S416).
  • the analysis unit 27 ′ sets a flag indicating “similarity” to each of the similarities 329 f of the detected two rows 320.
  • the second target range (R2) up to the row 320 having the number 322 of 2437 has the same hierarchical pattern 329p. Therefore, “1” (having a similar target range) is set in the similarity 329f of the row 320 with the row number 322 of 874 and the row 320 with the row number 322 of 2397.
  • the analyzing means 27 ′ determines whether or not the processing of all the hierarchical patterns 329p has been completed (S414), and if completed (YES in S414), performs the processing of S418. More specifically, the secondary module 32 in which the hierarchical structure 329 is set is written (updated) in the storage device 30 ′. On the other hand, when there is an unprocessed hierarchical pattern 329p (NO in S414), the hierarchical pattern 329p to be processed next is acquired.
  • the analyzing means 27 ′ can compare the similarity between the two target ranges in the same manner as the analyzing means 27 according to the first embodiment. Furthermore, according to the present embodiment, a plurality of related modules 31 are connected to the target module 32 in the order of processing. Accordingly, similar target ranges in the entire system can be collectively detected in a format that is easier to investigate.
  • the flowchart creating means 25 has a reading function (S1800, S1802), a flowchart creating function (S1804, S1805), and a writing function (S1806). Yes.
  • a secondary module name for specifying the secondary module 32 to be processed is specified. Is acquired (S1800).
  • the flowchart creation means 25 reads the processing target secondary module 32 specified by the acquired secondary module name from the storage device 30 '(S1802). If the secondary module 32 to be processed is not stored in the storage device 30 ', the flowchart creating means 25 ends the processing (not shown).
  • the flowchart creation means 25 creates a table-form flowchart 33 in which secondary sentences 327 respectively corresponding to success or failure of the secondary conditional expression are arranged on the left and right of the table (S1804). More specifically, it is executed when a secondary conditional expression is satisfied for a secondary sentence 327 having the same hierarchy indicated by the hierarchy identification 323 among the secondary sentences 327 of the secondary module 32.
  • a flowchart 33 is created in which the secondary sentence 327 and the secondary sentence 327 executed when the secondary conditional expression is not satisfied are arranged on the left and right of the table, respectively.
  • a line number 322 is set in the flowchart 33 so as to correspond to the secondary sentence 327.
  • the flowchart creation means 25 has the same branch depth of the hierarchy identification 323 and the same part of the branch hierarchy except the last digit (“1” or “2”). In this case, it is determined that the hierarchy indicated by the hierarchy identification 323 is the same.
  • the flowchart creating means 25 marks similar parts (target ranges) in the flowchart (S1805). More specifically, as illustrated in FIG. 19, a portion (target range) where “similarity” is set in the similarity 329 f in the row 320 of the secondary module 32 is surrounded by a frame. Pattern nn "(nn is a serial number, for example) is displayed. The serial number (nn) may be given in order from the top of the flowchart, for example.
  • the flowchart creation means 25 writes the flowchart 33 in the storage means 30 '(S1806) and ends the process.
  • a maintenance omission can be found by visually specifying similar parts (target ranges). For example, when one of the target ranges similar to each other is changed and the other is not changed, it can be recognized that a change to the other is necessary.
  • the flowchart creation means 25 may have the analysis function, the writing function, and the display function of the analysis means 27 ′.
  • the flowchart creation unit 25 may be an analysis unit.
  • the structural analysis apparatus 10 ′′ includes an apparatus main body 20 ′′, a storage device (storage means) 30 ′′, an input device 40, and a display device 50.
  • the storage device 30 ′′ according to the present embodiment is a main storage device of the device main body 20 ′′.
  • the device main body 20 ′′ is similar to the device main body 20 ′ according to the second embodiment, and is a conversion unit. 21, processing means 22, analysis means 27 ′, and flowchart creation means 25.
  • the structural analysis apparatus 10 ′′ is communicably connected to the file server 60 via a communication line 80.
  • the communication line 80 may be, for example, a LAN (Local Area Network) or the Internet.
  • the file server 60 includes a storage device (storage means) 70.
  • the storage device 70 can store the module 31, the secondary module 32, and the flowchart 33. Therefore, the structural analysis is performed.
  • the device 10 ′′ can read the module 31 and the like from the storage device 70 and write the module 31 and the like into the storage device 70.
  • a similar part can be found in the module 31 as in the first and second embodiments. Furthermore, the found similar part can be shared by a plurality of structural analysis apparatuses 10 ′′.
  • the present invention is based on Japanese Patent Application No. 2012-088098 filed with the Japan Patent Office on April 9, 2012, the contents of which are incorporated herein by reference.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Document Processing Apparatus (AREA)

Abstract

 構造解析装置は、モジュールが記憶された記憶手段と、記憶手段に記憶されたモジュールのうちの所定の対象モジュールの構造解析を行う解析手段とを備えている。解析手段は、対象モジュールの第1対象範囲の階層構造と第2対象範囲の階層構造とが同一である場合、類似通知情報を、第1対象範囲及び/又は第2対象範囲と関連付けて作成する。第1対象範囲及び第2対象範囲は、記憶手段から取得した対象モジュールの対象範囲のうち互いに異なる対象範囲である。類似通知情報は、対象モジュール内に互いに類似する対象範囲が存在することを示す。

Description

構造解析装置及びプログラム
 本発明は、プログラム言語によって記述された1以上の文からなるモジュール(ソースプログラム)の構造解析を支援する装置に関する。
 プログラムを作成する場合、構造化プログラミングが強く推奨される。具体的には、例えば、比較的少数の文からなる処理単位を組み合わせることでモジュールを作成するように求められる。また、モジュール内においては、無条件分岐文(GOTO文)を使用するのでなく、条件文や繰り返し文によるネスト構造(即ち、階層構造)を備えることが求められる。更に、複数のモジュールについての共通的な処理については、モジュール化することが求められる。従って、例えばプログラムの合計行数が100万行を超すような大きなシステムは、夫々が数十の処理単位からなる数千のモジュールを備えていることも多い。
 上述のような大規模なシステムは、開発後しばらくの間は、開発に携わった担当者、即ちモジュール間の関連及び夫々のモジュールの構造を熟知した者がシステムのメンテナンスを行うことが多い。しかしながら、このようなシステムは数十年に亘ってメンテナンスを繰り返しながら使用されることも多い。時が経つにつれて開発に携わった担当者がいなくなり、モジュールの構造を知らない者がシステムのメンテナンスを行うことになる。このような場合、構造化プログラミングがなされていることに起因して、膨大なモジュールに分散して記述されている機能を把握しなければならず、メンテナンスは困難を極める。即ち、モジュールの構造解析が困難になる。
 モジュール全体の機能又は各処理単位の機能を理解するためには、条件文による階層構造(以下、単に「階層構造」という。)を把握する必要がある。しかしながら、大規模なシステムにおけるモジュールは、多くの場合、深い階層構造(例えば10階層以上の階層構造)を有している。このような場合、階層構造を把握することは容易ではない。このため、例えば、メンテナンスを行った箇所と類似する箇所(例えば、類似する機能を有する箇所)を見落とし、これにより必要なメンテナンスが行われない場合がある。
 以上の説明から理解されるように、階層構造を容易に把握できれば、システムのメンテナンスを、より容易かつより適切に行うことができる。更に、階層構造が同一の箇所を見つけることで、類似する箇所に対するメンテナンスの漏れを防止することができる。例えば、特許文献1及び特許文献2には、階層構造の把握を支援するための技術が開示されている。
 特許文献1に開示されたプログラム開発支援装置は、プログラム(モジュール)を表示する際、IF文によるネスト構造(階層構造)の深さに応じて文の表示色を変更する。これにより、プログラム開発者は階層構造を視覚的に把握することができる。特許文献2に開示された構造化プログラム編集装置によれば、プログラム(モジュール)を表示する際、階層を示すキーワード(例えば、ifやcase)を含む文を表示する一方、その他の文を表示しない又は簡易表示することができる。これにより、プログラム開発者は階層構造を比較的容易に把握することができる。
特開平7-219756号公報 特開2001-154835号公報
 しかしながら、特許文献1及び特許文献2に開示された技術のいずれを使用しても、最終的にはプログラム開発者が、モジュールの階層構造を把握しなければならない。より具体的には、メンテナンスを行う必要がある箇所の階層構造を把握し、膨大なモジュールから類似する箇所を見つけ出すという困難かつ手間のかかる作業を行わなければならない。
 そこで、本発明は、モジュールにおいて同一の階層構造を備える箇所を検出し、これによって階層構造の把握を支援する構造解析装置を提供することを目的とする。
 本発明の一の側面は、プログラム言語によって記述された1以上の文からなるモジュールの構造解析を行う構造解析装置を提供する。前記モジュールには、前記文の一つである条件文を記述することが可能である。前記条件文は、成立時実行文及び/又は不成立時実行文を含んでいる。前記成立時実行文は、前記条件文の条件式が成立する場合に実行される前記文である。前記不成立時実行文は、前記条件式が成立しない場合に実行される前記文である。前記条件文のうちの少なくとも1つは、前記成立時実行文及び/又は前記不成立時実行文として更に前記条件文を含むことができ、これにより前記条件文による前記文の階層化が可能である。前記モジュールにおける連続する前記文からなる複数の対象範囲について、前記階層化による階層構造を夫々特定することが可能である。前記構造解析装置は、記憶手段と、解析手段とを備えている。前記記憶手段には、1以上の前記モジュールが記憶されている。前記解析手段は、前記記憶手段に記憶された前記モジュールのうちの所定の対象モジュールの構造解析を行うように構成されている。前記解析手段は、取得機能と解析機能とを有している。前記取得機能は、前記対象モジュールを前記記憶手段から取得する機能である。前記解析機能は、第1対象範囲の前記階層構造と第2対象範囲の前記階層構造とが同一である場合、前記第1対象範囲及び/又は前記第2対象範囲と関連付けて類似通知情報を作成する機能である。前記第1対象範囲及び前記第2対象範囲は、取得した前記対象モジュールの前記対象範囲のうち互いに異なる前記対象範囲である。前記類似通知情報は、前記対象モジュール内に互いに類似する前記対象範囲が存在することを示す。
 また、本発明の他の側面によれば、コンピュータを、前記構造解析装置として機能させるためのプログラムが得られる。
 本発明によれば、モジュールが互いに類似する箇所(対象範囲)を含んでいる場合、対象範囲と関連付けられた類似通知情報が作成される。従って、類似通知情報によって、互いに類似する対象範囲を、より容易に見つけることができる。
 更に、システムにおける複数のモジュールを連結して解析する場合、膨大なモジュールにおける類似する対象範囲を、より容易に把握することができる。
 添付の図面を参照しながら下記の最良の実施の形態の説明を検討することにより、本発明の目的が正しく理解され、且つその構成についてより完全に理解されるであろう。
本発明の第1の実施の形態による構造解析装置を示すブロック構成図である。 図1の構造解析装置の記憶装置に記憶されているモジュールのファイル構成を模式的に示す図である。 図1の記憶装置に記憶されている階層構造データのファイル構成を模式的に示す図である。 図1の構造解析装置の解析手段の機能を示すフローチャートである。 図4の解析手段による解析プロセスの前半を、一例を使用して示す図である。 図4の解析手段による解析プロセスの後半を、一例を使用して示す図である。 図4の解析手段による表示結果を、一例を使用して示す図である。 図4の解析手段による解析プロセスの前半を、他の一例を使用して示す図である。 本発明の第2の実施の形態による構造解析装置を示すブロック構成図である。 図9の記憶装置に記憶されているモジュールの一例を示す図である。 図9の記憶装置に記憶されている二次的モジュールのファイル構成を模式的に示す図である。 図9の二次的モジュールの一例を部分的に示す図である。 図9の記憶装置に記憶されているフローチャートの一例を部分的に示す図である。 図9の構造解析装置の変換手段の機能を示すフローチャートである。 図14の変換手段の機能の一部をより詳細に示すフローチャートである。 図9の構造解析装置の加工手段の機能を示すフローチャートである。 図9の二次的モジュールの他の一例を部分的に示す図である。 図9の構造解析装置のフローチャート作成手段の機能を示すフローチャートである。 図17の二次的モジュールから作成されたフローチャートを部分的に示す図である。 本発明の第3の実施の形態による構造解析装置を示すシステム構成図である。
 本発明については多様な変形や様々な形態にて実現することが可能であるが、その一例として、図面に示すような特定の実施の形態について、以下に詳細に説明する。図面及び実施の形態は、本発明をここに開示した特定の形態に限定するものではなく、添付の請求の範囲に明示されている範囲内においてなされる全ての変形例、均等物、代替例をその対象に含むものとする。
(第1の実施の形態)
 図1に示されるように、本発明の第1の実施の形態による構造解析装置10は、装置本体20と、記憶装置(記憶手段)30と、入力装置40と、表示装置50とを備えている。構造解析装置10は、プログラム言語によって記述された1以上の文からなるモジュール(ソースプログラム)の構造解析を行うものである。
 本実施の形態によるプログラム言語はCOBOLである。しかしながら、本発明はCOBOL以外のプログラム言語にも適用可能である。
 本実施の形態によるモジュールは、文字、数字、記号等を組み合わせたモジュール名によって特定可能である。
 モジュールには、1以上の文から構成される処理単位を記述することができる。本実施の形態による処理単位は、COBOLにおけるセクションである。セクションの夫々は、セクション名(処理単位名)によって特定することができる。但し、処理単位は、セクションでなくてもよい。例えばプログラム言語がJAVA(日本における登録商標)である場合、処理単位は、関数名(処理単位名)によって特定可能な関数であってもよい。
 モジュールは、他のモジュール又は当該モジュール自身を呼び出すことができる。また、モジュールのセクションは、他のセクション又は当該セクション自身を実行することができる。より具体的には、モジュールには、文として、セクションをセクション名によって特定して実行するための処理単位実行文と、モジュールの一つをモジュール名によって特定して実行するためのモジュール呼び出し文とを記述することができる。本実施の形態によれば、処理単位実行文はPERFORM文であり、モジュール呼び出し文はCALL文である。他のプログラム言語における処理単位実行文及びモジュール呼び出し文の夫々は、例えば関数名を指定した文である。モジュール呼び出し文が関数名を指定した文である場合、モジュール呼び出し文によって、モジュールのうちの指定された関数部分(即ち、モジュールの一部)が実行される。この場合、モジュール呼び出し文においてモジュール名が明示的に記述されないことがありうる。即ち、関数名によってモジュール名が間接的に特定されることがありうる。
 更に、モジュールには、文の一つである条件文を記述することができる。条件文は、条件式を備えており、条件文の中に成立時実行文及び/又は不成立時実行文を記述可能である。換言すれば、条件文は、成立時実行文及び/又は不成立時実行文を含むことができる。成立時実行文は、条件文の条件式が成立する場合に実行される文である。不成立時実行文は、条件式が成立しない場合に実行される文である。本実施の形態による条件文は、IF文及びEVALUATE文である。IF文においては、成立時実行文はTHEN句に記述される文であり、不成立時実行文は、ELSE句に記述される文である。同様に、EVALUATE文においては、成立時実行文はWHEN句に記述される文である。
 本実施の形態による条件文のうちの少なくとも1つは、成立時実行文及び/又は不成立時実行文として更に条件文を含むことができ、これにより条件文による文の階層化が可能である。例えば、IF文の成立時実行文として、更にIF文を記述することができる。換言すれば、モジュールは、条件文によって階層化可能な1以上の文からなり、これにより所定の階層構造(即ち、条件文による階層構造)を有している。容易に理解されるように、モジュールにおける連続する文からなる複数の箇所(対象範囲)について、階層化による階層構造を夫々特定することができる。
 図1に示されるように、記憶装置30は、例えば磁気ディスク装置である。記憶装置30は、例えばフォルダ(図示せず)によって階層化された様々なファイルを記憶することができる。記憶装置30は、装置本体20と通信可能に接続されており、装置本体20からの指示に従ってファイルの読込(取得)や書込(記憶)を行うことができる。本実施の形態による記憶装置30には、1以上のモジュール31が記憶されている。また、記憶装置30には、階層構造データ36を記憶することができる。
 モジュール31は、例えばプログラミングツール(図示せず)を使用して作成される。モジュール31の夫々が一つのファイルであってもよい。複数のモジュール31が一つのファイルとして記憶されていてもよい。階層構造データ36は、モジュール31に含まれる1以上の対象範囲の階層構造を、夫々記憶するものである。本実施の形態によれば、モジュール31の夫々について、階層構造データ36が作成される。
 入力装置40は、例えばキーボードやマウスである。入力装置40は、装置本体20と通信可能に接続されており、キーボードから入力された文字やマウスによって指示された位置を装置本体20に通知することができる。
 表示装置50は、例えばディスプレイやプリンタである。表示装置50は、装置本体20と通信可能に接続されており、装置本体20から転送されたデータ(例えば、文字や図形)を表示又は印刷することができる。
 装置本体20は、例えばPC(Personal Computer)の本体である。装置本体20は、CPU(Central Processing Unit)、主記憶装置等を備えている(図示せず)。記憶装置30には様々なプログラムの実行形式ファイルが記憶されている(図示せず)。CPUは、実行形式ファイルを主記憶装置にローディングし、実行形式ファイル内の命令語を実行することで様々な機能を実現する。CPUが命令語を実行する過程において、記憶装置30に記憶された所定のファイルが、主記憶装置内のバッファ領域を経由してプログラムの変数領域に読み込まれる。プログラムの変数領域に読み込まれたファイルの内容は、必要に応じて主記憶装置内のバッファ領域を経由して記憶装置30に書き込まれる。上記の説明から理解されるように、記憶装置30及び主記憶装置の夫々は、本実施の形態における読み込み及び書き込み可能な記憶手段として機能する。換言すれば、本実施の形態による記憶手段は、記憶装置30及び主記憶装置の一方であってもよいし、双方であってもよい。以降の説明においては、記憶手段として記憶装置30を使用する。
 本実施の形態による記憶装置30には、解析プログラム等の様々なプログラムが記憶されている(図示せず)。上記のプログラムは、主記憶装置にローディングされ、CPUによって実行され、これによってコンピュータは、様々な手段として(即ち、装置として)機能する。例えば、解析プログラムは、コンピュータを、記憶装置30に記憶されたモジュール31のうちの所定の対象モジュール31の構造解析を行う解析手段27(構造解析装置10)として機能させる。換言すれば、本実施の形態による構造解析装置10の装置本体20は、解析手段27を備えている。
 図2に示されるように、本実施の形態によるモジュール31は、n個(n≧1)の行310から構成される。本実施の形態によるモジュール31は、テキストファイルである。但し、モジュール31は、例えば、MICROSOFT EXCEL(登録商標)のワークシートであってもよい。モジュール31がワークシートである場合、解析手段27は、例えばEXCELマクロによって実現することができる。行310は、少なくとも一連番号(行識別)311と文312とから構成される。一連番号311は、行310を特定すると共に、行310の並び順を判断するためのものである。一連番号311は、数字だけでなく文字や記号を含んでいてもよい。文312には、文(例えば、データ定義文、実行文、コメント文)が記述されている。文312には、一つの完結した文全体が記述されていてもよい。文312には、一つの文の一部が記述されていてもよい。例えば、MOVE文が2つの行310の文312に分けて記述されていてもよい。
 図3に示されるように、本実施の形態による階層構造データ36は、m個(m≧1)の行360から構成される。本実施の形態による階層構造データ36は、MICROSOFT EXCEL(登録商標)のワークシートである。但し、階層構造データ36は、例えばテキストファイルであってもよい。階層構造データ36は、解析手段27がモジュール31の階層構造を解析することによって作成され、モジュール31と関連付けて記憶される。具体的には、例えば、階層構造データ36のファイル名は、対応するモジュール31のファイル名と同一である。あるいは、互いに対応するモジュール31及び階層構造データ36は、同一のワークブックの異なるワークシートであってもよい。
 階層構造データ36の行360は、一連番号(行識別)361と、階層パターン362と、終了行(一連番号)363と、類似通知情報364とから構成される。本実施の形態による類似通知情報364は、類似行(一連番号)364nを備えている。一連番号361には、対応するモジュール31の一連番号311が設定される。終了行363には、モジュール31における一連番号361から始まる対象範囲(即ち、階層構造の解析を行う対象となる範囲)が終了する行310の一連番号311が設定される。階層パターン362には、一連番号361から終了行363までの対象範囲についての階層構造を特定可能なデータが設定される。類似通知情報364には、モジュール31内に互いに類似する対象範囲が存在することを示すデータが設定される。より具体的には、本実施の形態による類似行364nには、当該行360の階層パターン362と同一の階層パターン362を有する行360の一連番号361が設定される。
 以下、本実施の形態による構造解析装置10の機能及び動作について、図5乃至図8に示される例を参照しつつ、図4を使用して詳細に説明する。まず、IF文のみがモジュール31に含まれる条件文である場合(図5及び図6参照)を例にして説明する。次に、モジュール31にIF文以外の条件文が含まれる例(図8参照)について説明する。
 図4から理解されるように、本実施の形態による解析手段27は、取得機能(S400、S402)と、解析機能(S404~S416)と、書込機能(S418)と、表示機能(S420)とを有している。取得機能は、モジュール31のうち処理対象とする対象モジュール31を記憶装置30(又は主記憶装置)から取得する機能である。解析機能は、対象モジュール31の階層構造を解析する機能である。書込機能は、対象モジュール31と階層構造データ36(従って、類似通知情報364)とを関連付けて記憶装置30に記憶する機能である。表示機能は、対象モジュール31と類似通知情報364とを関連付けて表示装置50に表示する機能である。
 詳しくは、解析手段27は、例えば入力装置40から入力された起動指示によって起動され、対象モジュール31を特定するための対象モジュール名を取得する(S400)。対象モジュール名は、例えば起動指示の一部として入力すればよい。解析手段27は、取得した対象モジュール名によって特定される対象モジュール31を記憶装置30から読み込む(S402)。このとき、例えば所定のフォルダに記憶されたモジュール31のみが読み込み対象であってもよい。対象モジュール31が記憶装置30に記憶されていない場合、解析手段27は処理を終了する(図示せず)。
 次に、解析手段27は、対象モジュール31の各文の階層レベルを特定する(S404)。具体的には、解析手段27は、対象モジュール31の行310を1行目から最終行まで順次取得し、行310の夫々に階層レベルを付与する。このとき、解析手段27は、1行目の階層レベルを1とし、IF文のTHEN句を検出するたびに階層レベルを加算する。一方、解析手段27は、IF文のEND-IF(即ち、IF文の終了)を検出するたびに階層レベルを減算する。なお、THEN句やEND-IFの記述を省略することが可能な場合は、IF文における文の並び等を解析して階層レベルの加減算を行えばよい。
 例えば、図5に例示された対象モジュール31を参照すると、先頭の文312(一連番号311が0001である文312)の階層レベルは1であり、次のTHEN句の階層レベルは2である。上記の例では、階層レベルは数値であり、解析手段27は、THEN句を検出するたびに階層レベルを1アップし、END-IFを検出するたびに階層レベルを1ダウンする。しかしながら、階層レベルは、階層レベルの深さを比較することができる限り、数値でなくてもよい。更に、THEN句の検出によって更新された階層レベルが、対応するEND-IFの検出によって更新前の値に戻るように設計されていればよい。階層レベルは、実行文について付与すればよい。更に、階層レベルは、IF文の先頭行及び終了行と、THEN句又はELSE句が記述された行とに付与すればよい。従って、解析手段27は、対象モジュール31の先頭の実行分から最後の実行文までの範囲について階層レベルを付与すればよい。
 次に、解析手段27は、対象範囲(即ち、階層構造の解析を行う対象とする範囲)を抽出する(S406)。詳しくは、解析手段27は、対象モジュール31に含まれる条件文の夫々について、開始行及び終了行を検出する。解析手段27は、検出した開始行と終了行の間の範囲を対象範囲として使用する。一方、解析手段27は、対象モジュール31に条件文が含まれていない場合、又は対象モジュール31に含まれる条件文が1つのみの場合、処理を終了する(図示せず)。以上の説明から理解されるように、本実施の形態によれば、対象範囲には条件文が少なくとも1つ含まれている。更に、対象範囲には、対象範囲に含まれる条件文の夫々の開始から終了までの全体が含まれている。但し、対象範囲は、条件文より前から又は条件文の途中から開始していてもよい。
 図5に例示する対象モジュール31を参照すると、IF文(条件文)は、一連番号311が0001、0003、0005、0011及び0014の行310から夫々開始している。また、IF文は、一連番号311が0020、0010、0008、0018及び0017の行310で夫々終了している。図6の上段に示されるように、以上のように検出された開始行及び終了行は、対象範囲の開始行及び終了行として、夫々使用される。
 解析手段27は、抽出した対象範囲の夫々について階層パターンを作成する(S406)。具体的には、解析手段27は、条件文の夫々について、開始行から終了行までの階層レベルを連結し、階層パターン(圧縮前)を作成する。更に、解析手段27は、階層パターン(圧縮前)において連続する同一の階層レベルを圧縮して、階層パターン(圧縮後)を作成する。
 図5の対象モジュール31を参照すると、図6の上段に示されるように、例えば開始行が0001、終了行が0020のIF文については、階層レベル:1、2、2、3…3、2、2、1(図5の階層レベル参照)が順次連結され、階層パターン(圧縮前)が作成される。更に、階層パターン(圧縮前)において連続する同一階層レベルは1つの階層レベルに圧縮され、これにより階層パターン(圧縮後)が作成される。
 以上の説明から理解されるように、本実施形態における階層レベルは、対象範囲の先頭の文を基準として特定される階層の深さを示すものである。また、対象範囲における階層構造は、対象範囲に含まれる階層レベルを連結した階層パターンによって識別することができる。
 図6の下段に示されるように、解析手段27は、上述のように検出した対象範囲の開始行、階層パターン(圧縮後)及び終了行を、階層構造データ36の一連番号361、階層パターン362及び終了行363に、夫々設定する(S406の処理の一部)。換言すれば、一連番号361、階層パターン362及び終了行363によって夫々特定される1以上の対象範囲が、階層構造データ36に設定される。このとき階層パターン362は、対象範囲の先頭の文(即ち、IF文)を基準として特定される階層の深さを示すように変換される。具体的には、例えば”2 3 4 3 2”は”1 2 3 2 1”に変換される。図6の下段右の模式図から理解されるように、上記のように作成された階層パターン362は、山岳の地形になぞらえることができる。この場合、階層パターン362に連結された階層レベルの夫々は、山岳の麓を基準にした相対的な高さを示している。
 次に、解析手段27は、作成した階層構造データ36の行360を、階層パターン362の長さ(即ち、階層パターン362に連結された階層レベルの数)の降順にソートする(S408)。階層パターン362の長さが同一の場合、解析手段27は、例えば一連番号361の昇順にソートする。図6の下段には、ソート後の階層構造データ36が例示されている。図6の下段の例を参照すると、例えば、”1 2 3 4 3 2 3 4 3 2 1”の階層パターン362の長さは11である。この階層パターン362は、5つの階層パターン362のうちの最大の長さを有するため、ソートにより階層構造データ36の第1行目に配置される。
 次に、解析手段27は、作成した階層構造データ36の対象範囲(即ち、対象モジュール31の対象範囲)のうち互いに異なる2つの対象範囲(即ち、第1対象範囲と第2対象範囲)を選択する。解析手段27は、第1対象範囲の階層構造と第2対象範囲の階層構造とが同一である場合、類似通知情報364を、第2対象範囲と関連付けて作成する(S410~S416)。より具体的には、解析手段27は、作成した階層構造データ36の行360の夫々について、同一階層パターン362の有無を判定する(S410~S416)。
 詳しくは、解析手段27は、まず、第1対象範囲の階層パターンとして、ソート後の先頭の(1行目の行360の)階層パターン362を取得する(S410)。図6の下段の例を参照すると、”1 2 3 4 3 2 3 4 3 2 1” が取得される。
 次に、解析手段27は、取得した階層パターン362と同一の階層パターン362が、階層構造データ36中に存在するか否か判定する(S412)。換言すれば、解析手段27は、第1対象範囲と異なり、且つ第1対象範囲と同一の階層パターンを有する第2対象範囲を検索する。第2対象範囲が存在する場合は、解析手段27は、第2対象範囲の類似通知情報364の類似行364nに、第1対象範囲の一連番号361を設定する(S412)。図6の下段の例を参照すると、”1 2 3 4 3 2 3 4 3 2 1”と同一の階層パターン362が存在しないため、いずれの行360の類似行364nも設定されない(即ち、初期値のままである)。
 次に、解析手段27は、全ての階層パターン362を処理したか否か判定し(S414)、処理が終了している場合(S414でYESの場合)、S418の処理を行う。一方、未処理の階層パターン362が存在する場合(S414でNOの場合)、解析手段27は、階層構造データ36中の次の行360の階層パターン362を取得する。図6の下段の例を参照すると、以上の説明から理解されるように、”1 2 3 2 1”が取得される。この場合、一連番号361が0011の行360の階層パターン362も” 1 2 3 2 1”であり一致するため、一連番号361が0011の行360の類似行364nに、”0003”が設定される(S412)。
 以上に説明したように、本実施の形態による解析手段27は、解析機能において、階層パターン362を長さの降順にソートし、これにより複数の対象範囲を、階層パターン362に連結された階層レベルの数の降順に第1対象範囲として使用している。しかしながら、ソートすることなく、階層構造を比較することも可能である。更に、階層パターン362を作成せず、対象モジュール31の行310を1行ずつずらしながら階層レベルを比較することもできる。但し、性能を考慮する場合、本実施の形態のように設計することが好ましい。
 以上の説明から理解されるように、本実施の形態による解析手段27の解析機能は、第1対象範囲の階層パターン362と第2対象範囲の階層パターン362とが同一である場合、第1対象範囲の階層構造と第2対象範囲の階層構造とが同一である(即ち、第1対象範囲と第2対象範囲が類似している)と判定する。但し、階層構造は、上記の方法と異なる方法によって比較することができる。例えば、図6に示される階層パターン(圧縮前)によって階層構造を比較してもよい。このようにすることで、階層構造をより厳密に比較することができる。また、階層パターン(圧縮前)を作成する際、IF文、THEN句、ELSE句、END-IF以外の文(例えば、MOVE文)にも階層レベルを付与し、階層パターン(圧縮前)に連結してもよい。このようにすることで、2つの対象範囲の類似性を更に厳密に比較することができる。
 2つの対象範囲の類似性は、階層パターン以外によっても比較することができる。例えば、2つの対象範囲において使用されている実行文の種類や数、使用されている関数の種類や数、使用されている項目名称の種類や数から評価点を算出することもできる。この場合、階層パターンが同一であり、且つ算出した評価点が所定点数以上のときに、2つの対象範囲が類似していると判定すればよい。
 解析手段27は、解析処理(S404~S416)を終了すると、類似通知情報364を記憶装置30に書き込む(S418)。より具体的には、解析手段27は、作成した階層構造データ36を記憶装置30に書き込む。前述したように、階層構造データ36は、対象モジュール31と関連付けて記憶される。従って、階層構造データ36の類似行364n(即ち、対象範囲と関連付けられた類似通知情報364)を参照することで、対象モジュール31における互いに類似する対象範囲を容易に見つけることができる。
 次に、解析手段27は、類似する箇所が識別できるようにして対象モジュール31を表示装置50に表示し(S420)、処理を終了する。より具体的には、解析手段27は、例えば図7に示されるように対象モジュール31を表示する。図7に示されるように、対象モジュール31のうち互いに類似する対象範囲の夫々は、枠で囲まれて表示される。更に、枠の内側に、どの対象範囲と類似しているかを示す類似識別コード(図7においては、丸で囲んだ数字)が表示される。但し、類似識別コードを表示せず、枠の属性(色や太さ等)を変えることで、対象範囲がどの対象範囲と類似しているかを示してもよい。また、対象モジュール31内において、互いに類似する対象範囲が離れている場合、例えば、対象モジュール31の先頭に元も近い対象範囲を表示すればよい。互いに類似する箇所を、視覚的に容易に把握できるように表示することで、メンテナンスが必要な箇所を容易に検出することが可能になる。更に、共通な処理単位にすべき箇所を検出することもできる。
 表示処理(S420)において、解析手段27は、対象モジュール31を表示するのでなく、作成した階層構造データ36を表示してもよい。換言すれば、解析手段27は、対象モジュール31と類似通知情報364とを関連付けて表示装置50に表示すればよい。
 本実施の形態による解析手段27は、書込機能(S418)と、表示機能(S420)とを有しているが、解析手段27は、書込機能(S418)及び表示機能(S420)の一方を有していればよい。更に、上記の2つの機能のいずれも有さず、代わりに、対象モジュール31と類似通知情報364とを関連付けて他の装置や手段に送信する機能を有していてもよい。
 図8に示されるように、対象モジュール31にIF文以外の条件文が含まれていてもよい。例えば、EVALUATE文については、解析手段27は、WHEN句を検出するたびに階層レベルを更新し、対応するEND-EVALUATEを検出するたびに階層レベルを更新前に戻せばよい。IF文、EVALUATE文以外の条件文についても同様に処理することができる。容易に理解されるように、階層レベルを付与した後の解析手段27の機能・動作は、対象モジュール31に条件文としてIF文のみが含まれている場合と同じである。
 本実施の形態による解析手段27は、以下に説明するように、様々に変形することが可能である。
 例えば、解析手段27は、第2対象範囲(即ち、比較される側の対象範囲)の類似行364nに、第1対象範囲(即ち、比較する側の対象範囲)の一連番号361を設定するのでなく、第1対象範囲の類似行364nに、第2対象範囲の一連番号361を設定してもよい。また、第1対象範囲及び第2対象範囲の類似行364nに、第2対象範囲及び第1対象範囲の一連番号361を夫々設定してもよい。換言すれば、解析手段27は、類似通知情報364を、第1対象範囲及び/又は第2対象範囲と関連付けて作成すればよい。
 また、解析手段27は、第1対象範囲(又は第2対象範囲)が複数の第2対象範囲(又は第1対象範囲)と類似する場合、類似行364nに、最初に類似していることを検出した第2対象範囲(又は第1対象範囲)の一連番号361を設定してもよい。一方、解析手段27は、類似行364nに、類似していることを検出した全ての第2対象範囲(又は第1対象範囲)の一連番号361を設定してもよい。
 但し、図7から理解されるように、類似する対象範囲の検出数が大きくなると(即ち、類似する対象範囲の検出精度が高いと)、対象モジュール31と関連付けて表示することが困難になる。また、多くの場合、互いに類似する対象範囲中には、互いに類似する対象範囲が更に含まれている。このような場合、類似する対象範囲全てを階層構造データ36に記憶すると、類似行364nが設定された行360の数が不必要に大きくなり、メンテナンスが必要か否かについての調査・検討工数が増加するおそれがある。一方、類似判断を行う対象範囲を絞ると、メンテナンスの要否についての調査・検討が漏れる可能性がある。従って、類似する対象範囲の検出精度は、メンテナンスの内容等に合わせて調整した方がよい。
 例えば、類似する箇所を検出した後のメンテナンス効率が重要である場合には、解析手段27が、解析機能(図4のS404~S416)において、所定の条件を満たす対象範囲(行360)を第1対象範囲として使用しないようにすればよい。所定の条件として、例えば、行360の階層パターン362に連結された階層レベルの数を基準にした条件を採用すればよい。より具体的には、階層パターン362に連結された階層レベルの数が所定の数(例えば10)より小さい場合、当該対象範囲を第1対象範囲として使用しないようにすればよい。あるいは、対象範囲における階層レベルの最大値が所定の数(例えば4)より小さい場合、当該対象範囲を第1対象範囲として使用しないようにしてもよい。
 対象モジュール31として、複数のモジュール31を連結したものを使用してもよい。例えば、複数のモジュール31を、夫々の開始行から終了行まで単純に順に連結して、対象モジュール31としてもよい。このようにすることで、システム全体における類似する対象範囲を纏めて検出することができる。また、複数のモジュール31を、以下に説明する第2の実施の形態のように連結することも可能である。
(第2の実施の形態)
 図9に示されるように、本発明の第2の実施の形態による構造解析装置10′は、装置本体20′と、記憶装置(記憶手段)30′と、入力装置40と、表示装置50とを備えている。構造解析装置10′は、第1の実施の形態による構造解析装置10と同様に、プログラム言語によって記述された1以上の文からなるモジュール(ソースプログラム)の構造解析を行うものである。第2の実施の形態によるプログラム言語、モジュール、入力装置40及び表示装置50は、第1の実施の形態と同様に夫々構成されている。
 図9に示されるように、記憶装置30′は、記憶装置30と同様な磁気ディスク装置である。記憶装置30′には、第1の実施の形態と同様に、1以上のモジュール31が記憶されている。また、記憶装置30′には、二次的モジュール(モジュール)32とフローチャート33とが記憶される。本実施の形態による二次的モジュール32は、モジュール31を連結し変換して作成される。また、フローチャート33は、二次的モジュール32から作成される。
 装置本体20′は、装置本体20と同じく、例えばPCの本体である。装置本体20′は、CPU、主記憶装置等を備えている(図示せず)。第1の実施の形態と同様に、記憶装置30′と主記憶装置とは、本実施の形態における読み込み及び書き込み可能な記憶手段として夫々機能する。以降の説明における記憶手段としては記憶装置30′を例示する。
 本実施の形態による記憶装置30′には、変換プログラムと、加工プログラムと、フローチャート作成プログラムと、解析プログラムとが記憶されている(図示せず)。上記のプログラムは、主記憶装置にローディングされ、CPUによって実行され、これによってコンピュータは、変換手段21、加工手段22、フローチャート作成手段25、及び解析手段27′として夫々機能する。即ち、上記のプログラムは、コンピュータをモジュールの構造解析を支援する構造解析装置10′として機能させるためのものである。換言すれば、本実施の形態による構造解析装置10′の装置本体20′は、変換手段21と、加工手段22と、フローチャート作成手段25と、解析手段27′とを備えている。
 本実施の形態による変換手段21は、記憶装置30′に記憶されたモジュール31のうちの所定の対象モジュール31を二次的モジュール32に変換して記憶装置30′に記憶する。加工手段22は、記憶装置30′に記憶された二次的モジュール32を加工する。フローチャート作成手段25は、記憶装置30′に記憶された二次的モジュール32から表形式のフローチャート33を作成する。解析手段27′は、第1の実施の形態の解析手段27と同様に、記憶装置30′に記憶されたモジュール31の構造解析を行う。但し、本実施の形態による解析手段27′は、モジュール31を直接解析するのでなく、二次的モジュール32のうちの所定の対象モジュール32の構造解析を行う。
 図10に示されるように、記憶装置30′には、例えばモジュール名がXXXであるモジュール31(XXXモジュール)と、モジュール名がAAAであるモジュール31(AAAモジュール)と、モジュール名がBBBであるモジュール31(BBBモジュール)と、モジュール名がCCCであるモジュール31(CCCモジュール)とが記憶されている。モジュール31の夫々は、一連番号311と文312とからなる複数の行310から構成されている。以下、この例を参照しつつ、モジュール31の構造をより具体的に説明する。
 XXXモジュールは、メインモジュール(即ち、処理の起点となるモジュール)である。XXXモジュールは、AAAモジュールとBBBモジュールとをモジュール名によって特定して呼び出すためのCALL文が夫々記述された行310を有している。AAAモジュールは、CCCモジュールを呼び出すCALL文が記述された行310を有している。
 図10に例示されたモジュール31の夫々は、1以上のセクションから構成されている。例えば、XXXモジュールは、メインセクション(即ち、モジュールにおける処理の起点となる主たる処理単位)と、従たるセクション(従たる処理単位)を有している。メインセクションは、”PROCEDURE DIVISION.”が記述された行310の次の行310から、”STOP RUN.”が記述された行310までの行310から構成されている。従たるセクション(サブセクション)は、”AAA-SUB SECTION.”が記述された行310から、”EXIT.”が記述された行310までの行310から構成されている。上述のサブセクションのセクション名(処理単位名)はAAA-SUBである。メインセクションは、AAA-SUBセクションをセクション名によって特定して実行する行310を備えている。より具体的には、メインセクションは、”PERFORM AAA-SUB.”が記述された行310を備えている。
 図10に例示されたセクションの一部は、条件文が記述された行310を備えている。例えば、XXXモジュールのメインセクションは、5つのWHEN句を有するEVALUATE文が記述された行310と、THENおよびELSEを有するIF文が記述された行310とを備えている。CCCモジュールのメインセクションは、IF文のELSEにおいて更にIF文が記述された行310を備えており、これによって条件文による文312の階層化が行われている。
 図11に示されるように、本実施の形態による二次的モジュール32は、p個(m≧1)の二次的行(行)320から構成される。本実施の形態による二次的モジュール32は、MICROSOFT EXCEL(日本における登録商標)のワークシートである。但し、二次的モジュール32は、例えばテキストファイルであってもよい。本実施の形態による行320は、少なくともモジュール識別321と、行番号322と、階層識別323と、命令識別324と、一連番号(行識別)326と、二次的文327と、階層構造329とから構成される。階層構造329は、階層パターン329pと、類似通知情報329rとを備えている。本実施の形態による類似通知情報329rは、類似有無329fを備えている。
 二次的モジュール32は、1以上のモジュール31から実行文等が記述された行310を集めて加工することによって生成されている。本実施の形態による二次的モジュール32は、変換手段21によって生成され、加工手段22及び解析手段27′によって加工される。特に、二次的モジュール32の階層構造329は、第1の実施の形態における階層構造データ36と同様に、解析手段27′によって設定される。
 図12に示されるように、本実施の形態による二次的モジュール32は、例えば、XXXモジュール、AAAモジュール、BBBモジュール及びCCCモジュールのPROCEDURE DIVISIONの行310を集めて加工したものである。
 図10及び図12から理解されるように、行320の二次的文327において、行310の文312に記述されているCALL文はコメント化されている(即ち、コメント文に変更されている)。CALL文によって呼び出されるAAAモジュールのPROCEDURE DIVISIONの文312は、行320の二次的文327として展開されている(即ち、展開されて、行320の二次的文327が生成されている)。更に、AAAモジュールからCALL文によって呼び出されるCCCモジュールのPROCEDURE DIVISIONの文312は、行320の二次的文327として展開されている。同様に、行310の文312に記述されているPERFORM文は、行320の二次的文327においてコメント化されている。また、PERFORM文によって実行されるAAA-SUBセクションの文312が、行320の二次的文327として展開されている。
 また、文312に記述された条件文のうちIF文以外の条件文(本実施の形態においてはEVALUATE文)は、二次的文327においてIF文に変換されている。例えば、”EVALUATE WK-A-O”、”WHEN CS-1”、”MOVE CS-1 TO WK-B-I”が夫々記述された3つの文312は、”*#E EVALUATE WK-A-O”(コメント文)、”*#E WHEN CS-1”(コメント文)、”IF ( WK-A-O = CS-1 )”、”THEN”、”MOVE CS-1 TO WK-B-I”が夫々記述された5つの二次的文327に変換されている。本実施の形態によれば、上記の変換に加え、IF文におけるTHEN、ELSE及びEND IFの欠落を補うための二次的文327が生成される。また、否定の条件式は肯定の条件式に変換される。更に、ANDやORで結合された条件式を有するIF文は複数のIF文に分解されて、2つの評価対象オペランド間の関係を1つの論理演算子のみによって評価する単純な二次的条件式を有するIF文に変換される。但し、上記の変換の一部(例えば、ANDやORで結合された条件式の分解)は行わなくてもよい。
 以上に加えて、複数の文312に分かち書きされているMOVE文等は、1つの二次的文327に纏められる。即ち、二次的モジュール32の行320の夫々は、モジュール31の行310に基づいて生成されている。より具体的には、二次的文327は、文312をそのままコピーしたものであるか、又は文312を加工・展開することによって生成されたものである。
 本実施の形態によるモジュール識別321は、夫々の行320がいずれのモジュール31に基づくものであるかを示すものである。より具体的には、モジュール識別321には、モジュール名(例えば、XXX)が設定される。但し、モジュール名に代えて、モジュール31を一意に識別可能な番号等を設定してもよい。
 一連番号326には、二次的文327が文312のコピーである行320においては、コピー元の行310の一連番号311が設定される。行310と1対1に対応する行320(例えば、文312をコメント化した二次的文327の行320)については、一連番号326には、対応する行310の一連番号311が設定される。一方、生成された(追加された)行320の一連番号326には、生成された行320であることを識別可能な識別子(例えば、記号の組み合わせ)が設定される。このようにすることで、システムのメンテナンスを行う際に、行320と行310を容易に対応付けることができる。
 本実施の形態による行番号322には、1から始まる通番が行320の並び順に沿って設定されている。但し、行番号322は、行番号322の大小関係を比較することが可能な限り、通番でなくてもよい。例えば、行番号322は文字や記号の組み合わせであってもよい。
 本実施の形態による階層識別323は、分岐階層と分岐の深さとから構成されている。分岐階層は、条件文による階層を識別するために使用される。本実施の形態による分岐階層は、1行目の行320における出発値として1を使用することにより設定される。換言すれば、1行目の行320の分岐階層は、1である。分岐階層は、IF文のTHENが記述された行320において1.1に変更され、ELSEが記述された行320において1.2に変更される。分岐階層は、IF文のEND IFが記述された行320の次の行から1に戻る。一般化すると、THENが記述された行320においては、直前の行320の分岐階層の末尾に「.1」が加えられ、ELSEが記述された行320においては、直前の行320の分岐階層の末尾「.1」が「.2」に変更され、END IFが記述された行320の次の行においては、END IFが記述された行320の分岐階層の末尾「.2」が削除される。上記の場合を除き、分岐階層には、直前の行320と同一の値が設定される。
 本実施の形態による分岐の深さは、分岐階層と同様に、1行目の行320における出発値として1を使用することにより設定される。換言すれば、1行目の行320の分岐の深さは、1である。分岐の深さは、IF文のTHENが記述された行320において1.1に変更され、END IFが記述された行320の次の行から1に戻る。更に、その後のIF文のTHENが記述された行320において1.2に変更され、END IFが記述された行320の次の行から1に戻る。一般化すると、分岐の深さは、1を出発値としており、THENが記述された行320において末尾に「.q」(qは1以上の整数)なる桁が加えられ、END IFが記述された行320の次の行において末尾の「.q」なる桁が削除される。「.q」におけるqの値は、桁の夫々について1を出発値としている。詳しくは、1桁目の「.q」(例えば1.2の「.2」)におけるqの値は、1を出発値としており、付加される毎にインクリメントされる。一方、2桁目以降の「.q」(例えば1.2.1の「.1」)におけるqの値は、当該桁を除いた分岐の深さが同一値である行320が連続する範囲において1を出発値としており、当該連続する範囲において付加される毎にインクリメントされる。
 命令識別324は、二次的文327に記述されている文の種別を示している。本実施の形態による命令識別324は、命令名と、条件命令であるか否かを示す区分(条件命令当否:図12において単に「条件命令」と記載)と、処理命令であるか否かを示す区分(処理命令当否:図12において単に「処理命令」と記載)とからなる。二次的文327にIF文の要素の一部が記述されている場合(即ち、IF、THEN、ELSE又はEND-IFが記述されている場合)、条件命令当否にOが設定される。二次的文327にIF文以外の実行文が記述されている場合(例えば、MOVE文やCOMPUTE文が記述されている場合)、処理命令当否にOが設定される。条件命令当否又は処理命令当否にOが設定されている場合、命令名には二次的文327に記述されている命令名(IF、THEN、END-IF、MOVE等)が設定される。
 階層パターン329pは、第1の実施の形態と同様に、対象範囲の階層構造を特定するためのものである。詳しくは、第1の実施の形態と同様に、IF文が開始する(即ち、対象範囲が始まる)行320の階層パターン329pに、階層レベルを連結した階層パターンが設定される。図12において破線Aで示した部分から理解されるように、本実施の形態によれば、階層識別323の長さ(例えば、分岐の深さの桁数)が、階層レベルを示している。
 類似通知情報329rにも、第1の実施の形態と同様に、二次的モジュール32内に互いに類似する対象範囲が存在することを示すデータが設定される。本実施の形態によれば、類似有無329fに、当該行320の階層パターン329pと同一の階層パターン329pを有する行320が存在するか否かを示すフラグが設定される。
 行320は、以上に説明した項目に加えて様々な項目を備えることができる。例えば、行320が、対応する行310のセクション名を備える場合、行320と行310との対応を、より容易に把握することができる。
 本実施の形態によれば、記憶装置30′に記憶された二次的モジュール32に基づいて様々なファイルを作成することができる。作成したファイルは、モジュール31の構文解析を支援するための資料として表示装置50に表示・印刷することができる。より具体的には、例えば二次的モジュール32に基づいてフローチャート33を作成することができる。
 図13から理解されるように、本実施の形態によるフローチャート33は、MICROSOFT EXCEL(日本における登録商標)のワークシートである。但し、フローチャート33は他の形式のファイル等であっても構わない。本実施の形態によれば、フローチャート33は、二次的モジュール32から生成される。
 フローチャート33は、二次的モジュール32の二次的文327をフローチャート風に編集したものである。より具体的には、IF文と関連しない二次的文327は、二次的モジュール32における行320の並び順に従って、第2列目(ヘッダに”2”が表示されている列)に並べられている。一方、IF文と関連する二次的文327(即ち、IFからEND-IFまでの文が記述された二次的文327)は、IF文における条件式が成立する場合に実行される二次的文327と、IF文における条件式が成立しない場合に実行される二次的文327とが左右に夫々分けられて並べられている。
 フローチャート33の第1列目には第2列目に並べられた二次的文327の行番号322が設定されており、これによりフローチャート33の行を二次的モジュール32の行320に夫々対応付けることができる。行番号322に限らず、行320の任意の項目をフローチャート33に設定することができる。
 以上の説明から理解されるように、本実施の形態によるフローチャート33の列は、IF文による階層が深くなるにつれて増加する。換言すれば、二次的モジュール32のうち、より複雑な条件文が記述されている箇所は、表の列方向に延びるようにして表示される。従って、フローチャート33を表示装置50に表示させ、左右の列に並べて表示された実行文を見比べることで、条件式の成否による処理の相違を把握することができる。フローチャート33における処理のブロックを色付けして表示装置50に表示させることもできる。例えば、フローチャート33のIF及びEND-IFが設定された欄に所定の背景色Aを設定し、THENの場合に実行される二次的文327に所定の背景色Bを設定し、ELSEの場合に実行される二次的文327に所定の背景色Cを設定することができる。このようにすることで、フローチャート33を表示装置50に表示させた際に、IF文による階層構造を背景色の組み合わせによるパターンとして視覚的に把握することできる。
 以下、本実施の形態による構造解析装置10′の機能及び動作について詳細に説明する。
 図14から理解されるように、本実施の形態による変換手段21は、制御情報取得機能(S1400)と、読込機能(S1402、S1404)と、変換機能(S1406~S1412)と、書込機能(S1414)とを有している。制御情報取得機能は、展開制御情報を取得する機能である。読込機能は、モジュール31のうち処理対象とする対象モジュール31を記憶装置30′から読み込む機能である。変換機能は、対象モジュール31を二次的モジュール32に変換する機能である。書込機能は、二次的モジュール32を記憶装置30′に記憶する機能である。
 より具体的には、図14に示されるように、変換手段21は、例えば入力装置40から入力された起動指示によって起動されると、例えば起動指示の一部として入力された展開制御情報を取得する(S1400)。本実施の形態による展開制御情報には、展開制限指示を含ませることができる。展開制限指示は、実行対象のセクション又は呼び出し対象のモジュール31の文312に記述されている文の展開を初回のみに制限することを指示するものである。
 次に、変換手段21は、対象モジュール31を特定するための対象モジュール名を取得する(S1402)。対象モジュール名は、展開制御情報と同様な方法で取得することができる。変換手段21は、取得した対象モジュール名によって特定される対象モジュール31を記憶装置30′から読み込む(S1404)。このとき、例えば所定のフォルダに記憶されたモジュール31のみが読み込み対象であってもよい。対象モジュール31が記憶装置30′に記憶されていない場合、変換手段21は、処理を終了する(図示せず)。
 次に、変換手段21は、対象モジュール31の処理開始箇所の文312を取得する(S1406)。本実施の形態による処理開始箇所は、メインセクションの先頭である。変換手段21は、取得した文312について二次的文出力処理を行う(S1408)。次に、変換手段21は、処理終了箇所の文312を処理済みであるか判定する(S1410)。本実施の形態による処理終了箇所は、メインセクションの末尾である。処理が終了している場合(S1410においてYESの場合)、変換手段21は、作成した二次的モジュール32を記憶装置30′に書き込み(S1414)、処理を終了する。一方、処理が終了していない場合(S1410においてNOの場合)、変換手段21は、次に処理する文312(後続する行310の文312)を取得し(S1412)、取得した文312について二次的文出力処理を行う(S1408)。
 図15は、図14に示した変換手段21の処理(機能)のうち、二次的文出力処理(S1408)をより詳細に示すフローチャートである。図15に示されるように、変換手段21は、二次的文出力処理において文312を二次的文327として出力する(S1500)。より具体的には、本実施の形態によれば、文312に記述されている実行文等をワークシートの所定の行・列にコピーする。このとき、前述したように、PERFORM文をコメント文にする等の加工が行われる。更に、変換手段21は、モジュール識別321と、行番号322と、一連番号326とに前述したような値を設定する。
 次に、変換手段21は、文312に条件文が記述されているか判定する(S1502)。文312に記述されている実行文が条件文である場合(S1502でYESの場合)、変換手段21は、前述したようにIF文以外の条件文をIF文に変換する等の処理を行う。より具体的には、変換手段21は、条件文の条件式に基づいて、二次的文の一つである二次的条件文(IF文)が記述された二次的文327を生成し、二次的条件文によって二次的文327を階層化して二次的モジュールに出力し(S1504)、二次的文出力処理を終了する。上述の二次的条件文は、2つの評価対象オペランド間の関係を1つの論理演算子のみによって評価する二次的条件式が成立するか成立しないかによって実行すべき二次的文327を選択する条件文(二次的文327)である。
 文312に記述されている実行文(即ち、判定対象文)が条件文でない場合(S1502でNOの場合)、変換手段21は、判定対象文が処理単位実行文(PERFORM文)であるか判定する(S1506)。判定対象文が処理単位実行文である場合(S1506でYESの場合)、変換手段21は、実行対象の処理単位(本実施の形態によれば、セクション)の処理開始箇所の文312を取得する。本実施の形態においては、処理単位の処理開始箇所はセクションの先頭である。
 判定対象文が処理単位実行文でない場合(S1506でNOの場合)、変換手段21は、判定対象文がモジュール呼び出し文(本実施の形態によれば、CALL文)であるか判定する(S1510)。判定対象文がモジュール呼び出し文である場合(S1510でYESの場合)、変換手段21は、CALL文によって特定される呼び出し対象のモジュール31を記憶装置30′から読み込み(S1512)、呼び出し対象のモジュール31の処理開始箇所の文312を取得する(S1514)。本実施の形態によれば、呼び出し対象のモジュール31の処理開始箇所は、当該モジュール31のメインセクションの先頭である。判定対象文がモジュール呼び出し文でない場合(S1510でNOの場合)、変換手段21は二次的文出力処理を終了する。
 変換手段21は、実行対象のセクションの文312又は呼び出し対象のモジュール31の文312について、再帰的に二次的文出力処理を行う(S1516)。次に、変換手段21は、処理終了箇所の文312を処理済みであるか判定する(S1518)。本実施の形態による処理終了箇所は、実行対象のセクションについては当該セクションの末尾であり、呼び出し対象のモジュール31についてはメインセクションの末尾である。処理が終了している場合(S1518においてYESの場合)、変換手段21は、二次的文出力処理を終了する。一方、処理が終了していない場合(S1518においてNOの場合)、変換手段21は、次に処理する文312(後続する行310の文312)を取得し(S1520)、取得した文312について再帰的に二次的文出力処理を行う(S1516)。
 変換手段21は、再帰的な(自分自身を実行する)PERFORM文については、実行対象のセクションの文312の展開を行わない。同様に、変換手段21は、再帰的な(自分自身を呼び出す)CALL文については、呼び出し対象のモジュール31の文312の展開を行わない。更に、変換手段21は、展開制御情報に展開制限指示が指定されている場合、既に二次的文出力処理を行ったセクションとセクション名が同一であるセクションを実行するPERFORM文については、二次的文出力処理を行わない(S1506)。同様に、変換手段21は、展開制御情報に展開制限指示が指定されている場合、既に二次的文出力処理を行ったモジュール31とモジュール名が同一であるモジュール31を呼び出すCALL文については、二次的文出力処理を行わない(S1510)。
 以上の説明から理解されるように、変換手段21の変換機能は、対象モジュール31の所定の処理開始箇所から所定の処理終了箇所までに記述された文312の夫々を二次的文327として二次的モジュールに順次出力する。更に、変換手段21の変換機能は、文312が処理単位実行文又はモジュール呼び出し文である場合、実行対象の処理単位又は呼び出し対象のモジュール31に記述されている文312を展開することで二次的文327を生成して二次的モジュール32に出力する。更に、変換手段21の変換機能は、展開される文312における処理単位実行文又はモジュール呼び出し文についても展開を更に行う(即ち、再帰的に展開する)。従って、多数の処理単位やモジュール31に分散された機能を、対象モジュール31のメインセクションに手繰り寄せるようにして集めることができる。前述したように、本実施形態によれば、モジュール31についての所定の処理開始箇所及び所定の処理終了箇所は、夫々、メインセクションの先頭及び末尾である。但し、モジュール31についての所定の処理開始箇所及び所定の処理終了箇所は、夫々、PROCRDURE DIVISONの先頭及び末尾としてもよい。例えば、所定の処理開始箇所及び所定の処理終了箇所のうちの少なくとも一方を、メインセクションの途中とすることも可能である。但し、不要な展開を避け、且つ十分な展開結果を得るためには本実施の形態のようにするのが好ましい。
 以上の説明から理解されるように、本実施の形態による変換手段21の変換機能は、展開制御情報に展開制限指示が指定されている場合、同一の処理単位については、実行対象の処理単位に記述されている文312の展開を初回の1回のみ行い(即ち、同一の処理単位を1回のみ展開し)、同一のモジュール31については、呼び出し対象のモジュール31に記述されている文312の展開を初回の1回のみ行う(即ち、同一のモジュール31を1回のみ展開する)。但し、変換手段21の変換機能は、展開制限指示が指定されているか否には係らず、同一の処理単位や同一のモジュール31を1回のみ展開してもよい。更に、変換手段21の変換機能は、展開制限指示が指定されているか否には係らず、同一の処理単位や同一のモジュール31を繰り返し展開してもよい。
 以上に説明したように、変換手段21によって、二次的文327からなる二次的モジュール32が記憶装置30′に記憶される。
 図16から理解されるように、本実施の形態による加工手段22は、読込機能(S1600、S1602)と、階層識別付加機能(S1606)と命令識別付加機能(S1608)と、書込機能(S1014)とを有している。読込機能は、処理対象の二次的モジュール32を記憶装置30′から読み込む機能である。階層識別付加機能は、二次的モジュール32の二次的文327の少なくとも一部について階層識別323を付加する機能である。本実施の形態による階層識別323は、二次的文327がいずれの階層に位置しているかを示している。命令識別付加機能は、二次的モジュール32の二次的文327の少なくとも一部について命令識別324を付加する機能である。本実施の形態による命令識別324は、二次的文327に記述されている文の種別を示している。書込機能は、階層識別323及び命令識別324が付加された二次的文327からなる二次的モジュール32を記憶装置30′に記憶する機能である。
 より具体的には、図16に示されるように、加工手段22は、例えば変換手段21と同様に起動されると、処理対象の二次的モジュール32を特定するための二次的モジュール名を取得する(S1600)。加工手段22は、取得した二次的モジュール名によって特定される二次的モジュール32を記憶装置30′から読み込む(S1602)。処理対象の二次的モジュール32が記憶装置30に記憶されていない場合、加工手段22は、処理を終了する(図示せず)。
 次に、加工手段22は、処理対象の二次的モジュール32の処理開始箇所の二次的文327を取得する(S1604)。本実施の形態による処理開始箇所は、二次的モジュール32の先頭である。
 加工手段22は、取得した二次的文327について階層識別323を付加する(S1606)。より具体的には、本実施の形態による加工手段22は、処理対象の二次的モジュール32が記録されたワークシート(即ち、対象ワークシート)において行320の階層識別323と対応する行・列に、前述したような分岐階層と分岐の深さとを設定する。次に、加工手段22は、取得した二次的文327について命令識別324を付加する(S1608)。より具体的には、本実施の形態による加工手段22は、対象ワークシートにおいて行320の命令識別324と対応する行・列に、前述したような命令名と、条件命令当否と、処理命令当否とを設定する。
 次に、加工手段22は、処理終了箇所の二次的文327を処理済みであるか判定する(S1612)。本実施の形態による処理終了箇所は、二次的モジュール32の末尾である。処理が終了している場合(S1612においてYESの場合)、加工手段22は、加工した二次的モジュール32を記憶装置30′に書き込み(S1614)、処理を終了する。一方、処理が終了していない場合(S1612においてNOの場合)、加工手段22は、次に処理する二次的文327(後続する行320の二次的文327)を取得し(S1616)、取得した二次的文327について階層識別323の付加等を行う(S1606、S1608)。
 以上に説明したように、加工手段22によって、階層識別323及び命令識別324が付加された二次的文327からなる二次的モジュール32(本実施の形態によれば、階層識別323等が追記されたワークシート)が記憶装置30′に記憶される。
 本実施の形態による解析手段27′は、第1の実施の形態による解析手段27と同様な機能を備えている。以下、解析手段27と異なる機能を中心に、図17に示される例を参照しつつ、図4を使用して説明する。
 解析手段27′は、解析手段27と同様に起動されると、対象モジュール32を記憶装置30′(又は主記憶装置)から読み込む(S400、S402)。換言すれば、解析手段27′は、モジュール31ではなく、二次的モジュール32を解析対象とする。
 解析手段27′は、対象モジュール32の各文の階層レベルを特定する際(S404)、命令識別324の命令名によって、IF文の開始、終了等を判定する。また、解析手段27′は、階層識別323の長さを、階層レベルとして使用する。図17の例を参照すると、各行320に対して、右から2番目の列に示されるように階層レベルが付与される。
 解析手段27′は、解析手段27と同様に、対象範囲(即ち、階層構造の解析を行う対象とする範囲)を抽出する(S406)。但し、本実施の形態による解析手段27′は、対象範囲に含まれる範囲を対象範囲として使用しない。具体的には、図17に例示する対象モジュール32を参照すると、IF文(条件文)のうちの2つは、行番号322が874及び2397の行320から夫々開始している。また、上記のIF文は、行番号322が921及び2437の行320で夫々終了している。解析手段27′は、行番号322が874の行320から行番号322が921の行320までと、行番号322が2397の行320から行番号322が2437の行320までを対象範囲として使用する。一方、解析手段27′は、例えば、行番号322が882の行320から行番号322が920の行320までを対象範囲として使用しない。
 解析手段27′は、解析手段27と同様に階層パターンを作成する(S406)。図17に例示する対象モジュール32を参照すると、行番号322が874の行320及び行番号322が2397の行320の夫々について、” 1 2 3 4 3 4 5 4 3 2 1”の階層パターンが作成され、階層パターン329pに設定される。
 解析手段27′は、解析手段27と同様に、作成した階層構造329の対象範囲(即ち、対象モジュール31の対象範囲)のうち互いに異なる2つの対象範囲(即ち、第1対象範囲と第2対象範囲)を選択する。解析手段27′は、第1対象範囲の階層構造と第2対象範囲の階層構造とが同一である場合、類似通知情報329rを作成する(S408~S416)。解析手段27′は、類似通知情報329rを、第1対象範囲及び第2対象範囲と関連付けて作成する。より具体的には、解析手段27′は、対象モジュール32の行320の夫々について、同一階層パターン329pの有無を判定する(S410~S416)。解析手段27′は、互いに同一の階層パターン329pを有する2つの行320を検出した場合、検出した2つの行320の夫々の類似有無329fに「類似あり」を意味するフラグを設定する。
 図17に例示する対象モジュール32を参照すると、行番号322が874の行320から行番号322が921の行320までの第1対象範囲(R1)と、行番号322が2397の行320から行番号322が2437の行320までの第2対象範囲(R2)とが同一の階層パターン329pを有している。このため、行番号322が874の行320及び行番号322が2397の行320の類似有無329fに、”1”( 類似対象範囲あり)が夫々設定される。
 次に、解析手段27′は、全ての階層パターン329pの処理が終了したか判定し(S414)、終了した場合(S414でYESの場合)、S418の処理を行う。より具体的には、階層構造329を設定した二次的モジュール32を記憶装置30′に書き込む(更新する)。一方、未処理の階層パターン329pが存在する場合(S414でNOの場合)、次に処理すべき階層パターン329pを取得する。
 以上の説明から理解されるように、本実施の形態による解析手段27′は、第1の実施の形態による解析手段27と同様に2つの対象範囲の類似性を比較することができる。更に、本実施の形態によれば、対象モジュール32には、関連する複数のモジュール31が処理順に連結されている。従って、システム全体における類似する対象範囲を、より調査し易い形式で、纏めて検出することができる。
 図18から理解されるように、本実施の形態によるフローチャート作成手段25は、読込機能(S1800、S1802)と、フローチャート作成機能(S1804、S1805)と、書込機能(S1806)とを有している。
 より具体的には、図18に示されるように、フローチャート作成手段25は、例えば変換手段21と同様に起動されると、処理対象の二次的モジュール32を特定するための二次的モジュール名を取得する(S1800)。フローチャート作成手段25は、取得した二次的モジュール名によって特定される処理対象の二次的モジュール32を記憶装置30′から読み込む(S1802)。処理対象の二次的モジュール32が記憶装置30′に記憶されていない場合、フローチャート作成手段25は、処理を終了する(図示せず)。
 次に、フローチャート作成手段25は、二次的条件式の成否に夫々対応する二次的文327を表の左右に並べた表形式のフローチャート33を作成する(S1804)。より具体的には、二次的モジュール32の二次的文327のうち階層識別323によって示される階層が同一である二次的文327について、二次的条件式が成立した場合に実行される二次的文327と二次的条件式が成立しない場合に実行される二次的文327とを表の左右に夫々並べたフローチャート33を作成する。このとき、フローチャート33に、二次的文327と対応するように行番号322を設定する。本実施の形態によるフローチャート作成手段25は、階層識別323の分岐の深さが同一であり、且つ分岐階層のうち末尾の1桁(”1”又は”2”)を除いた部分が同一である場合、階層識別323によって示される階層が同一であると判定する。
 次に、フローチャート作成手段25は、フローチャート中の互いに類似する箇所(対象範囲)をマークする(S1805)。より具体的には、図19に例示されているように、二次的モジュール32の行320のうち類似有無329fに「類似あり」が設定されている箇所(対象範囲)を枠で囲み、「パターンnn」(nnは、例えば通番)等の表示を行う。通番(nn)は、例えば、フローチャートの先頭から順に付与すればよい。
 次に、フローチャート作成手段25は、フローチャート33を記憶手段30′に書き込み(S1806)、処理を終了する。
 図19から理解されるように、互いに類似する箇所(対象範囲)を視覚的に明示することで、例えば、メンテナンスの漏れを見つけることができる。例えば、互いに類似する対象範囲の一方が変更されており、他方が変更されていない場合、他方に対する変更が必要であることを気づくことができる。
 フローチャート作成手段25は、解析手段27′の解析機能、書込機能及び表示機能を備えていてもよい。換言すれば、フローチャート作成手段25が解析手段であってもよい。
(第3の実施の形態)
 図20に示されるように、本発明の第3の実施の形態による構造解析装置10″は、装置本体20″と、記憶装置(記憶手段)30″と、入力装置40と、表示装置50とを備えている。本実施の形態による記憶装置30″は、装置本体20″の主記憶装置である。装置本体20″は、第2の実施の形態による装置本体20′と同様に、変換手段21と、加工手段22と、解析手段27′と、フローチャート作成手段25とを備えている。
 構造解析装置10″は、通信回線80を経由して、ファイルサーバ60と通信可能に接続されている。通信回線80は、例えばLAN(Local Area Network)であってもよいし、インターネットであってもよい。ファイルサーバ60は、記憶装置(記憶手段)70を備えている。記憶装置70は、モジュール31と、二次的モジュール32と、フローチャート33とを記憶することができる。従って、構造解析装置10″は、記憶装置70からモジュール31等を読み込み、記憶装置70にモジュール31等を書き込むことができる。
 容易に理解されるように、本実施の形態によれば、第1及び第2の実施の形態と同様に、モジュール31において類似する箇所を見つけることができる。更に見つけた類似箇所を、複数の構造解析装置10″によって共有することができる。
 本発明は2012年4月9日に日本国特許庁に提出された日本特許出願第2012-088098号に基づいており、その内容は参照することにより本明細書の一部をなす。
 本発明の最良の実施の形態について説明したが、当業者には明らかなように、本発明の精神を逸脱しない範囲で実施の形態を変形することが可能であり、そのような実施の形態は本発明の範囲に属するものである。
 10,10′,10″ 構造解析装置
 20,20′,20″ 装置本体
 21         変換手段
 22         加工手段
 25         フローチャート作成手段
 27,27′     解析手段
 30,30′,30″ 記憶装置(記憶手段)
 31         モジュール(ソースプログラム)
 310        行
 311        一連番号(行識別)
 312        文
 32         二次的モジュール(モジュール)
 320        二次的行(行)
 321        モジュール識別
 322        行番号
 323        階層識別
 324        命令識別
 326        一連番号(行識別)
 327        二次的文
 329        階層構造
 329p       階層パターン
 329r       類似通知情報
 329f       類似有無
 33         フローチャート
 36         階層構造データ
 360        行
 361        一連番号(行識別)
 362        階層パターン
 363        終了行(一連番号)
 364        類似通知情報
 364n       類似行(一連番号)
 40         入力装置
 50         表示装置
 60         ファイルサーバ
 70         記憶装置(記憶手段)
 80         通信回線

Claims (11)

  1.  プログラム言語によって記述された1以上の文からなるモジュールの構造解析を行う構造解析装置であって、
     前記モジュールには、前記文の一つである条件文を記述することが可能であり、前記条件文は、成立時実行文及び/又は不成立時実行文を含んでおり、前記成立時実行文は、前記条件文の条件式が成立する場合に実行される前記文であり、前記不成立時実行文は、前記条件式が成立しない場合に実行される前記文であり、前記条件文のうちの少なくとも1つは、前記成立時実行文及び/又は前記不成立時実行文として更に前記条件文を含むことができ、これにより前記条件文による前記文の階層化が可能であり、前記モジュールにおける連続する前記文からなる複数の対象範囲について、前記階層化による階層構造を夫々特定することが可能であり、
     前記構造解析装置は、記憶手段と、解析手段とを備えており、
     前記記憶手段には、1以上の前記モジュールが記憶されており、
     前記解析手段は、前記記憶手段に記憶された前記モジュールのうちの所定の対象モジュールの構造解析を行うように構成されており、前記解析手段は、取得機能と解析機能とを有しており、前記取得機能は、前記対象モジュールを前記記憶手段から取得する機能であり、前記解析機能は、第1対象範囲の前記階層構造と第2対象範囲の前記階層構造とが同一である場合、前記第1対象範囲及び/又は前記第2対象範囲と関連付けて類似通知情報を作成する機能であり、前記第1対象範囲及び前記第2対象範囲は、取得した前記対象モジュールの前記対象範囲のうち互いに異なる前記対象範囲であり、前記類似通知情報は、前記対象モジュール内に互いに類似する前記対象範囲が存在することを示す
    構造解析装置。
  2.  請求項1記載の構造解析装置であって、
     前記対象範囲には前記条件文が少なくとも1つ含まれており、前記対象範囲には、前記対象範囲に含まれる前記条件文の夫々の開始から終了までの全体が含まれている
    構造解析装置。
  3.  請求項1又は請求項2記載の構造解析装置であって、
     前記対象範囲の前記階層構造は、前記対象範囲に含まれる階層レベルを連結した階層パターンによって識別可能であり、前記階層レベルは、前記対象範囲の先頭の前記文を基準として特定される階層の深さを示すものである
    構造解析装置。
  4.  請求項3記載の構造解析装置であって、
     前記解析手段は、前記解析機能において、前記第1対象範囲の前記階層パターンと前記第2対象範囲の前記階層パターンとが同一である場合、前記第1対象範囲の前記階層構造と前記第2対象範囲の前記階層構造とが同一であると判定する
    構造解析装置。
  5.  請求項3又は請求項4記載の構造解析装置であって、
     前記解析手段は、前記解析機能において、複数の前記対象範囲を、前記階層パターンに連結された前記階層レベルの数の降順に前記第1対象範囲として使用する
    構造解析装置。
  6.  請求項5記載の構造解析装置であって、
     前記解析手段は、前記解析機能において、所定の条件を満たす前記対象範囲を前記第1対象範囲として使用しない
    構造解析装置。
  7.  請求項6記載の構造解析装置であって、
     前記所定の条件は、前記対象範囲の前記階層パターンに連結された前記階層レベルの数を基準にした条件である
    構造解析装置。
  8.  請求項1乃至請求項7のいずれかに記載の構造解析装置であって、
     前記対象モジュールは、複数の前記モジュールを連結したものである
    構造解析装置。
  9.  請求項1乃至請求項8のいずれかに記載の構造解析装置であって、
     前記解析手段は、書込機能を更に有しており、前記書込機能は、前記対象モジュールと前記類似通知情報とを関連付けて前記記憶手段に記憶する機能である
    構造解析装置。
  10.  請求項1乃至請求項9のいずれかに記載の構造解析装置であって、
     表示装置を更に備えており、
     前記解析手段は、表示機能を更に有しており、前記表示機能は、前記対象モジュールと前記類似通知情報とを関連付けて前記表示装置に表示する機能である
    構造解析装置。
  11.  コンピュータを、請求項1乃至請求項10のいずれかに記載の構造解析装置として機能させるためのプログラム。
PCT/JP2013/060528 2012-04-09 2013-04-05 構造解析装置及びプログラム WO2013154055A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US14/391,377 US9286062B2 (en) 2012-04-09 2013-04-05 Structure analysis device and program
CN201380015262.9A CN104169875B (zh) 2012-04-09 2013-04-05 结构解析装置以及记录介质
KR1020147025939A KR101578119B1 (ko) 2012-04-09 2013-04-05 구조 해석 장치 및 프로그램

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012088098A JP5273884B1 (ja) 2012-04-09 2012-04-09 構造解析装置及びプログラム
JP2012-088098 2012-04-09

Publications (1)

Publication Number Publication Date
WO2013154055A1 true WO2013154055A1 (ja) 2013-10-17

Family

ID=49179215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2013/060528 WO2013154055A1 (ja) 2012-04-09 2013-04-05 構造解析装置及びプログラム

Country Status (5)

Country Link
US (1) US9286062B2 (ja)
JP (1) JP5273884B1 (ja)
KR (1) KR101578119B1 (ja)
CN (1) CN104169875B (ja)
WO (1) WO2013154055A1 (ja)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6309795B2 (ja) * 2014-03-18 2018-04-11 株式会社東芝 情報処理装置、情報処理方法およびプログラム
JP7073431B2 (ja) * 2020-03-25 2022-05-23 株式会社日立製作所 ソースコード解析システムおよびソースコード解析方法
JP7421137B2 (ja) * 2022-03-04 2024-01-24 キヤノンマーケティングジャパン株式会社 情報処理装置、情報処理方法およびプログラム

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009086922A (ja) * 2007-09-28 2009-04-23 Toshiba Mitsubishi-Electric Industrial System Corp プログラム編集装置
JP2010140434A (ja) * 2008-12-15 2010-06-24 Internatl Business Mach Corp <Ibm> プログラムの解析を支援するための方法、並びにそのコンピュータ・プログラム及びコンピュータ・システム

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07219756A (ja) 1994-02-02 1995-08-18 Matsushita Electric Ind Co Ltd プログラム開発支援方法及びその装置
JP2001154835A (ja) 1999-11-30 2001-06-08 Sharp Corp 構造化プログラム編集装置、及び構造化プログラム編集プログラムを記録した記録媒体
US6918107B2 (en) * 2001-07-02 2005-07-12 Bea Systems, Inc. Programming language extensions for processing data representation language objects and related applications
US7624141B2 (en) * 2004-01-23 2009-11-24 Microsoft Corporation Deterministic rule-based dispatch of objects to code
US7793273B2 (en) * 2004-11-23 2010-09-07 National Instruments Corporation Type propagation for automatic casting of output types in a data flow program
US20070239993A1 (en) * 2006-03-17 2007-10-11 The Trustees Of The University Of Pennsylvania System and method for comparing similarity of computer programs
US8146066B2 (en) * 2006-06-20 2012-03-27 Google Inc. Systems and methods for caching compute kernels for an application running on a parallel-processing computer system
US8578350B2 (en) * 2006-11-30 2013-11-05 Ncr Corporation System and method for interpreting a specification language file to implement a business system
US8191052B2 (en) * 2006-12-01 2012-05-29 Murex S.A.S. Producer graph oriented programming and execution
US9043774B2 (en) * 2008-02-12 2015-05-26 William G. Bently Systems and methods for information flow analysis

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009086922A (ja) * 2007-09-28 2009-04-23 Toshiba Mitsubishi-Electric Industrial System Corp プログラム編集装置
JP2010140434A (ja) * 2008-12-15 2010-06-24 Internatl Business Mach Corp <Ibm> プログラムの解析を支援するための方法、並びにそのコンピュータ・プログラム及びコンピュータ・システム

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YOSHIKI HIGO ET AL.: "Tutorial: An Introduction to Code Clone Refactoring", COMPUTER SOFTWARE, vol. 28, no. 4, 25 October 2011 (2011-10-25), pages 45 - 46 *

Also Published As

Publication number Publication date
KR101578119B1 (ko) 2015-12-16
CN104169875A (zh) 2014-11-26
JP2013218507A (ja) 2013-10-24
JP5273884B1 (ja) 2013-08-28
KR20140126385A (ko) 2014-10-30
CN104169875B (zh) 2017-08-08
US9286062B2 (en) 2016-03-15
US20150128109A1 (en) 2015-05-07

Similar Documents

Publication Publication Date Title
US8972930B2 (en) Generating text manipulation programs using input-output examples
JP5040925B2 (ja) 情報抽出規則作成支援システム、情報抽出規則作成支援方法及び情報抽出規則作成支援プログラム
CN104598635A (zh) 一种基于xml描述的复杂文档自动生成方法
JP4247108B2 (ja) 構造化文書検索方法、構造化文書検索装置、及びプログラム
JP3828379B2 (ja) テスト仕様生成支援装置、方法、プログラム及び記録媒体
WO2013154055A1 (ja) 構造解析装置及びプログラム
JP2010015458A (ja) プログラム修正支援システム、プログラム修正支援方法、およびプログラム修正支援プログラム
JP5747698B2 (ja) 要件管理支援装置
JP2015162004A (ja) 開発ドキュメント間トレースリンク生成支援装置及び方法及びプログラム
US9128807B2 (en) Module structural analysis supporting device and program
CN104598636A (zh) 复杂文档分离组织方法以及复杂文档自动生成方法
KR101705254B1 (ko) 장치 및 프로그램
JP6753190B2 (ja) 文書検索装置及びプログラム
JP5998835B2 (ja) 情報処理装置及びプログラム
JP5504212B2 (ja) テストケース自動生成システム、テストケース自動生成方法、およびテストケース自動生成プログラム
JP4909754B2 (ja) 地名表記辞書作成方法および地名表記辞書作成装置
CN111597323B (zh) 关键字段过滤方法、装置、存储介质及电子设备
Rahman et al. Pattern analysis of TXL programs
JP2009301511A (ja) 索引情報作成装置、索引情報作成方法及びプログラム
CN117669509A (zh) 一种报告生成方法、装置及设备
CN114661725A (zh) 生成数据表结构说明的方法、系统、装置及存储介质
CN118113302A (zh) 一种树状中间表示生成方法、系统、设备、介质、产品
JP2007115139A (ja) 知識分類支援方法、知識分類支援プログラムおよび知識分類支援装置
JP5581894B2 (ja) データ処理プログラム自動生成システム
McLean Creating HTML Slides.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13775633

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 20147025939

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 14391377

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13775633

Country of ref document: EP

Kind code of ref document: A1