[go: up one dir, main page]

WO2000050988A1 - Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded - Google Patents

Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded Download PDF

Info

Publication number
WO2000050988A1
WO2000050988A1 PCT/JP1999/000849 JP9900849W WO0050988A1 WO 2000050988 A1 WO2000050988 A1 WO 2000050988A1 JP 9900849 W JP9900849 W JP 9900849W WO 0050988 A1 WO0050988 A1 WO 0050988A1
Authority
WO
WIPO (PCT)
Prior art keywords
comment
separator
program
range
setting
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/JP1999/000849
Other languages
French (fr)
Japanese (ja)
Inventor
Koji Sasaki
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to PCT/JP1999/000849 priority Critical patent/WO2000050988A1/en
Priority to JP2000601522A priority patent/JP3886726B2/en
Publication of WO2000050988A1 publication Critical patent/WO2000050988A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/10Requirements analysis; Specification techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Definitions

  • the present invention relates to a technique for creating a program specification from comments inserted into a source program in the field of re-engineering and reverse engineering, and more particularly to a technique for improving the efficiency of creating a program specification.
  • a comment describing the processing contents of a program is generally inserted into a source program.
  • files and comments on symbols.
  • symbol means that if the source program is written in C ++ language, it has one property in common, such as class, member function, external variable, etc. A collection of such elements.
  • comments about files are inserted at the beginning of the file, and comments about symbols are inserted immediately before the symbol.
  • each comment includes a comment item corresponding to the program specification (hereinafter referred to as “item”).
  • item a comment item corresponding to the program specification
  • it is difficult to determine which item belongs to which comment, and it has been impossible to extract the item, or the item has been extracted redundantly. Due to such a defect, even if an attempt was made to create a program specification based on the extracted items, the items could not be used as they were, and manual correction work was indispensable.
  • an object of the present invention is to clarify the comment to which each item belongs, thereby improving the extraction accuracy of the item and improving the efficiency of creating a program specification. Disclosure of the invention
  • a separator setting means for setting a separator for identifying various comments inserted in the source program, and a separator set in the program specification for each separator set by the separator setting means.
  • Key code setting means for setting an extraction key of a corresponding comment item; and comment range extracting means for extracting a range of each comment of the source program based on the separator set by the separator setting means.
  • Comment item extracting means for extracting a comment item from a source program based on the extraction key word set by the key word setting means for each comment range extracted by the comment range extracting means; Based on the comment items extracted by the comment item extraction means, Characterized by being configured to Purodaramu specification creation device includes a Purodaramu specification generator means for generating a beam specifications, the.
  • a separator for identifying the comment type is inserted into the source program. Then, when creating a program specification, if a separator is set by the separator setting means, the range of each comment is extracted based on the set separator. On the other hand, a comment item is extracted from the source program for each range of the extracted comment based on the extraction key set by the keyword setting means. Then, a program specification is generated based on the extracted comment items.
  • each comment range can be accurately and reliably identified by the separator for identifying both. Therefore, it is prevented that comment items are not extracted or comment items are redundantly extracted as in the past, and program specifications should be created using the extracted comment items as they are. Can be. As a result, the accuracy of extracting comment items is improved, and the efficiency of creating program specifications can be improved.
  • the separator is configured to specify a start line and an end line of various comments. You may.
  • the start line and the end line of various comments are reliably identified by the separator. For this reason, the extraction accuracy of the comment range is improved, and the efficiency of creating the program specification can be further improved.
  • the separator setting means may be configured to set at least a separator for identifying a comment on a file and a comment on a symbol.
  • the comment range extracting means extracts, for a comment for which a separator is not set by the separator setting means, a comment range based on a separator of another comment or an executable statement.
  • the configuration may be such that Also, the comment range extracting means inserts between two comments when two comments are inserted adjacently at the beginning of a file and a separator is not set by the separator setting means.
  • a configuration may be adopted in which the range of comments is extracted based on the executed statement.
  • the comment item extracting means may be configured to extract a comment item from which a comment identifier corresponding to a programming language in which a source program is described is removed.
  • a separator setting step for setting a separator for identifying various comments input to the source program, and a comment corresponding to the program specification for each separator set in the separator setting step A keyword setting step of setting an extraction keyword of the item; A comment range extracting step of extracting a range of each comment of the source program based on the W separator; and an extraction set in the keyword setting step for each comment range extracted in the comment range extracting step.
  • the feature is that a method for creating a program specification has been configured.
  • the following can be performed. That is, as a work when describing the source program, a separator for identifying the comment type is inserted into the source program. Then, when creating a program specification, if a separator is set in the separator setting step, the range of each comment is extracted based on the set separator. On the other hand, comment items are extracted from the source program based on the extraction key set in the keyword setting step for each range of the extracted comments. Then, a program specification is generated based on the extracted comment items.
  • each comment range can be accurately and reliably identified by the separator for identifying both. Therefore, it is prevented that comment items are not extracted or comment items are redundantly extracted as in the past, and program specifications should be created using the extracted comment items as they are. Can be. As a result, the accuracy of extracting comment items is improved, and the efficiency of creating a program specification can be improved.
  • a separator setting function for setting a separator for identifying various comments inserted in the source program, and extraction of comment items corresponding to the program specifications for each separator set by the separator setting function
  • a keyword setting function for setting a keyword
  • a comment range extraction function for extracting a range of each comment of the source program based on the separator set by the separator setting function
  • a comment range extraction function for extracting each comment range by the comment range extraction function.
  • the “recording medium” refers to a medium that can reliably record various kinds of information and can reliably retrieve it as necessary. Magnetic tapes, magnetic disks, magnetic drums, IC cards, CD ROM, etc. Of portable recording media.
  • a program specification creation program for realizing the separator setting function, keyword setting function, comment range extraction function, comment item extraction function, and program specification generation function is recorded on the recording medium. Therefore, if such a recording medium is provided, a general-purpose computer can be used to easily construct the program specification creating device according to the present invention.
  • FIG. 1 is an overall configuration diagram of a specification creation device according to the present invention.
  • FIG. 2 is a diagram illustrating a first example of a source program to be processed.
  • FIG. 3 is a diagram illustrating a second example of a source program to be processed.
  • FIG. 4 is a diagram illustrating a third example of a source program to be processed.
  • FIG. 5 is a diagram illustrating a fourth example of a source program to be processed.
  • FIG. 6 is a diagram showing an example of a generated program specification.
  • Fig. 7 is a flowchart showing the flow of the specification creation procedure.
  • FIG. 8 is a diagram showing an example of an extraction keyword setting screen.
  • FIG. 9 is a diagram showing an example of an extraction keyword setting screen.
  • Fig. 10 shows the set extracted keywords, (A) shows comment information on the file, and (B) shows comment information on the class.
  • FIG. 11 is a flowchart of the main routine for extracting comments.
  • FIG. 12 is a flowchart of a subroutine for extracting comments on a file.
  • Figure 13 is a flowchart of a subroutine that extracts comments on symbols. It is.
  • FIG. 14 is a flowchart of a subroutine for obtaining a comment extraction range for a file.
  • FIG. 15 is a flowchart of a subroutine for obtaining a comment extraction range for a symbol.
  • FIG. 16 is a flowchart of a subroutine for extracting comment items necessary for the specification.
  • FIG. 2 to 5 show an example of a source program to be processed by the program specification creator according to the present invention (hereinafter referred to as “specification creator”).
  • Specification creator These source programs are written in the C ++ language as the programming language, with comments beginning with “/ *” and ending with “* /”, and the part after “ ⁇ ” on each line.
  • the number at the beginning of each line in the source program indicates the line number of the program.
  • the configuration of the source program shown in FIG. 2 will be described as follows. That is, the first to sixth lines are comments about the file, and the seventh to 16th lines are classes.
  • Comment on (symbol), line 17 and beyond is the class definition statement.
  • the comment about the file and the comment about the class are provided with separators indicating the start and end of the comment, respectively.
  • “************” in the first and sixth comment lines is Seno.
  • “” included in the comment lines on lines 7 and 16 functions as a separator.
  • the source program shown in Fig. 3 is an example in which no comment is provided for the class and no separator is provided.
  • comments regarding files and classes are not provided with a separator, and an executable statement "#include ⁇ stdio.h>" that functions as a separator is inserted between the comments. It is an example.
  • the source program shown in Figure 5 is an example without a comment on the class.
  • Figure 1 shows the overall configuration of the specification creation device.
  • the specification creator includes a display device 10, an input device 20, an external storage device 30, an arithmetic device 40, and a printing device 60.
  • the display device 10 is configured by a display such as a CRT or an LCD, and provides a GUI (Graphics 1 User Interface) function to a user.
  • the input device 20 is constituted by a pointing device such as a keyboard and a mouse, and provides a data input function to the GUI.
  • the external storage device 30 is configured by a hard disk or the like, and provides a function of saving a source program.
  • the arithmetic unit 40 is configured to include at least a central processing unit (CPU) and a memory, and controls the entire specification creating apparatus by a program loaded in the memory.
  • the printing device 60 is configured by a printer or the like, and provides a printing function of the created program specification.
  • the arithmetic unit 40 includes an extraction keyword setting unit 42, a comment range extraction unit 44, a comment item extraction unit 46, a specification generation unit 48, and a specification printing unit 50. Implemented programmatically.
  • GUI is provided in cooperation with the display device 10 and the input device 20, and an extraction keyword corresponding to the type of comment is set.
  • “comment type” refers to an identifier such as a comment on a file or a comment on a class when the source program is described in the C ++ language.
  • the extracted keyword setting unit 42 functions as a separator setting means, a separator setting step, a separator setting function, a keyword setting means, a keyword setting step, and a keyword setting function.
  • the comment range extraction unit 44 reads the source program file 32 from the external storage device 30, and extracts the comment extraction range over the entire file based on the set extraction keyword. Taking the source program shown in Fig. 2 as an example, lines 1 to 6 are extracted as comments for files, and lines 7 to 16 are extracted as comments for classes. It goes without saying that the range of extracted comments includes not only the beginning of the file but also comments after that.
  • the comment range extracting section 44 functions as a comment range extracting means, a comment range extracting step, and a comment range extracting function.
  • the comment item extraction section 46 extracts comment items included in each comment based on the set extraction keyword. Taking the comments on the source program file shown in Fig. 2 as an example, based on the extraction keywords "1. Overview", the keywords "Car class declaration” and "2. "Koji Sasaki" is extracted.
  • the comment item extractor 46 functions as a comment item extracting means, a comment item extracting step, and a comment item extracting function.
  • the specification generator 48 generates a program specification as shown in FIG. 6 based on the extracted comment items.
  • the specification generation unit 48 operates as a program specification generation means, a program specification generation process, and a program specification generation function.
  • the generated program specification data is transmitted to the printing device 60, and the printing device 60 prints the program specification.
  • Figure 7 shows a flowchart of the procedure for creating a program specification.
  • step 1 extraction keywords for extracting comments from the source program are set. That is, when the “set extraction keyword” command is executed, the extraction keyword setting section 42 is selectively activated, and an extraction keyword setting screen as shown in FIGS. 8 and 9 (hereinafter referred to as “setting screen”). "100" is displayed. Then, on this setting screen 100, an extraction keyword is set for each type of comment.
  • the extracted keywords include separator information indicating the start and end of the comment and specification information corresponding to the program specification.
  • the type of comment is selected from the type selection unit 102. Then, by appropriately operating the add button 104, the delete button 106, and the change button 108, the user inputs a separator and an extraction key word relating to a comment item. In addition, when setting an extraction keyword related to another comment type continuously, select another comment type from the type selection unit 102 and repeat the same operation. After completing the extraction keyword input, operate the OK button 110. By doing, the extracted keyword is determined. On the other hand, if you want to cancel the setting of the extracted keyword, press the cancel button 1 1 2 at any time to return the extracted keyword to the previous state.
  • FIG. 8 shows a state in which separator information and specification information “1. Outline” and “2. Creator” are set as extracted keywords related to file information (FIG. 9 is also the same). Then, as a result, an extraction keyword as shown in FIG. 10 is set.
  • step 2 comments are extracted from the source program for each type of comment. That is, when the “comment extraction” command is executed, the comment range extraction unit 44 and the comment item extraction unit 46 are selectively activated, and the comments are extracted according to the flowcharts of FIGS. 11 to 16 described later. You.
  • step 3 a program specification as shown in Fig. 6 is generated based on the extracted comments. That is, when the “create program specification” command is executed, the specification generator 48 is selectively activated, and a program specification is generated by its function.
  • step 4 the generated program specification is output from the printing device 60. That is, when the “print program specification” command is executed, the specification printing unit 50 is selectively activated, and the printing device 60 prints the program specification.
  • creation and printing of the program specifications can be arbitrarily selected.For example, if comments are extracted, printing of the program specifications may be performed automatically. ,.
  • FIG. 11 shows a main routine of processing for extracting a comment from a source program.
  • step 10 the source program file 32 is read from the external storage device 30, and the symbol information in the source program is extracted.
  • symbol information refers to line information of a symbol definition statement and symbol type information. Taking the source program shown in FIG. 2 as an example, the line definition is “line 17” and the type information is “class” because there is a class definition statement on line 17.
  • the extracted symbol information is held in ascending order using, for example, row information as a key.
  • a subroutine is called to extract comments about the file.
  • the extracted comments are stored in a table format using, for example, the comment type and the comment item for the specification as a key (the same applies hereinafter).
  • step 12 the next symbol information is read. That is, the first symbol information is read in the first process, and the second, third, and other symbol information is read in the subsequent processes.
  • step 13 a subroutine for extracting a comment on the symbol is called using the symbol information as a parameter.
  • step 14 it is determined whether or not the comment extraction for the symbol has been performed up to the end of the source program file 32, that is, whether or not the comment extraction has been completed. If the extraction of the comment is completed, the process is terminated (Y e s), and if the extraction of the comment is not completed, the process returns to step 12 (No).
  • FIG. 12 shows a subroutine called in step 11, that is, a subroutine for extracting a comment on a file.
  • step 20 a subroutine is called to determine the extent of comment extraction for the file.
  • step 21 a subroutine for extracting a comment item corresponding to the program specification from the comment extraction range obtained in step 20 is called.
  • FIG. 13 shows a subroutine called in step 13, that is, a subroutine for extracting a comment on a symbol.
  • step 30 a subroutine is called for finding the comment extraction range for the symbol.
  • step 31 a subroutine for extracting a comment item corresponding to the program specification from the comment extraction range obtained in step 30 is called.
  • the subroutine called here is the same as the subroutine called in the previous step 21.
  • FIG. 14 shows a subroutine called in step 20, that is, a subroutine for obtaining a comment extraction range of a file.
  • step 40 the contents of the first line of the source program are extracted.
  • step 41 it is determined whether or not the content of the extracted first line is an executable statement.
  • executable statement refers to a statement other than a comment line.
  • a statement to be processed by the preprocessor such as a “#define” statement, Definition statements, class definition statements, etc. correspond.
  • the content of the first line is an executable statement, it is determined that there is no comment on the file in the source program, and the process proceeds to step 47 (Yes).
  • the process proceeds to step 42 (No).
  • step 42 it is determined whether or not the content of the first line is a symbol separator.
  • the symbol separator is set on the extraction keyword setting screen 100 shown in FIG. 9 as a reference (the same applies hereinafter). If it is a symbol separator, it can be determined that the first line of the source program is a comment relating to the symbol. Therefore, it is determined that there is no comment relating to the file, and the process proceeds to step 47 (Yes). On the other hand, if it is not a symbol separator, it is determined to be the start line of the comment on the file, and the process proceeds to step 43 (No).
  • step 43 the contents of the next line (hereinafter referred to as "line contents") are extracted.
  • step 44 it is determined whether or not the line content is an executable statement. If the content of the line is an executable statement, the format is that there is no separator indicating the end of the comment on the file (see the source program in Fig. 4). Proceed to (Yes). On the other hand, if the content of the line is not an executable statement, it is determined that the comment on the file continues, and the process proceeds to step 45 (No).
  • step 45 it is determined whether or not the line content is a file separator. If it is a file separator, it is determined that the comment is the end line of the file, and the process proceeds to step 47 (Yes). On the other hand, if it is not a file separator, it is determined that comments regarding the file are continued, and the process proceeds to step 46 (No).
  • step 46 it is determined whether or not the line content is a symbol separator. If it is a symbol separator, the comment on the file ends on the previous line. Then, the process proceeds to step 47 (Yes). On the other hand, if it is not a symbol separator, it is determined that comments about the file are continuing and
  • step 47 the extraction range of the comment on the file is calculated. If it is determined in step 41 or 42 that there is no comment on the file, information indicating that there is no comment line on the file, for example, ⁇ 0 '' is set in the start line and end line .
  • FIG. 15 shows a subroutine called in step 30, that is, a subroutine for obtaining a comment extraction range for a symbol.
  • step 50 the contents one line before the symbol definition line are extracted.
  • the symbol definition line is specified based on the contents of the parameter (symbol information) at the time of calling the subroutine for the symbol (see Fig. 13) in step 13.
  • the definition statement of the symbol (class) is on line 17, so the contents of line 16 are extracted.
  • step 51 it is determined whether the content one line before the symbol definition line is an executable statement. If the content of the line before the symbol definition statement is an executable statement, it is determined that there is no comment on the symbol, and the process proceeds to step 56 (Yes). On the other hand, if the content one line before the symbol definition statement is not an executable statement, the process proceeds to step 52 (No). As shown in Fig. 5, when the comment immediately before the symbol definition statement is a comment of a file, it is desirable to refer to the comment extraction range of the file in order not to extract the overlapping range.
  • step 52 it is determined whether the content of the previous line of the symbol definition statement is another separator, that is, a separator between a file and another symbol. If it is another separator, it judges that there is no comment about the symbol, and
  • step 53 the contents of the previous line are retrieved. That is, In this way, file analysis is performed to search for the start line of the comment on the symbol.
  • step 54 it is determined whether or not the line content is an executable statement. If the content of the line is an executable statement, the format is such that there is no separator indicating the start of a comment on the symbol (see the source program in Figure 3), and the comment on the symbol starts on the next line. Proceed to 6 (Yes). On the other hand, if the content of the line is not an executable statement, it is determined that the comment on the symbol is continued, and the process proceeds to step 55 (No).
  • step 55 it is determined whether or not the line content is another separator. If the content of the line is another separator, it is determined that the comment related to the symbol starts from the next line, with no separator (see the source program in Figure 3) indicating the start of the comment related to the symbol. Then, go to step 56 (Yes). On the other hand, if the line content is not another separator, it is determined that the comment on the symbol is continued, and the process returns to step 53 (No).
  • step 56 the extraction range of comments on the file is calculated. If it is determined in step 51 or 52 that there is no comment on the file, the same information as in step 47 is set.
  • FIG. 16 shows a subroutine called in steps 21 and 31, that is, a subroutine for extracting a comment item necessary for a program specification.
  • step 60 the contents of the first comment line of the file or symbol are extracted.
  • the content to be extracted is a comment identifier indicating a comment line.
  • step 61 it is determined whether or not the content of the comment line is specification information. If it is the specification information, the process proceeds to step 62 (Yes), and if it is not the specification information, the process proceeds to step 64 (No).
  • step 62 the element number, pointer, etc. of the array storing the comment items according to the specification information are changed.
  • step 63 it is determined whether or not the next line is the extraction range of the comment item. If it is within the comment item extraction range, the process returns to step 60 (Y es), If it is not within the comment item extraction range, the process ends (No).
  • step 64 it is determined whether or not the storage location of the comment item has been set. That is, it is determined whether or not the storage destination has been changed (set) in the process of step 62. To make such a determination, if the storage destination has not been set, “NULL” may be set as the storage destination. If the storage destination has been set, the process proceeds to step 65 (Yes), and if the storage destination has not been set, the process proceeds to step 63 (No).
  • an example of a case where the storage destination is not set is a case where the first line of the comment line is being processed and the line is a separator.
  • step 65 the comment item is stored in a predetermined storage location.
  • a separator for identifying a comment type is inserted when describing the source program. Then, when creating the program specification, if the inserted separator information is set, the range of each comment is extracted based on the separator information. At this time, even if the comment about the file and the comment about the symbol are adjacent to each other at the beginning of the file, the range is accurately and reliably identified by the separator that identifies the two. Then, within the extracted range, each comment item corresponding to each comment is extracted, and a program specification is generated.
  • the source program described in the C ++ language is to be processed as a programming language.
  • other programming languages for example, BAS IC, COBOL, FORTRAN, Java, etc. May be targeted for processing.
  • a program for realizing such a function is recorded on a recording medium such as a magnetic tape, a magnetic disk, a magnetic drum, an IC card, a CD-ROM, etc.
  • the program specification creating program according to the present invention can be marketed Can be distributed. Soshi
  • a person who has obtained such a recording medium can easily construct the program specification creator according to the present invention using, for example, a general computer.
  • the program specification creating apparatus and the program specification creating method according to the present invention are extremely useful because the accuracy of extracting comment items is improved. Further, the recording medium on which the program specification creating program according to the present invention is recorded is extremely useful because a program specification creating device can be easily constructed using a general computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Stored Programmes (AREA)

Abstract

A separator for identifying various comments inserted in a source program is set up, and a keyword for extracting the comment item corresponding to the program specifications is set up for every comment. Therefore, it is made clear that the comment item belongs to which comment, and the range of the comment is correctly and reliably recognized. By extracting the comment item from the range of each comment, manual correction of the extracted comment item is dispensed with, and the efficiency of preparing program specifications is improved.

Description

明 細 書 プログラム仕様書作成装置及びプログラム仕様書作成方法並びにプログラム仕様 書作成プログラムを記録した記録媒体  Description Program specification creation device, program specification creation method, and recording medium on which program specification creation program is recorded

技術分野 Technical field

本発明は、 リエンジニアリング, リバースエンジニアリング分野において、 ソ ースプログラムに挿入されたコメントからプロダラム仕様書を作成する技術に関 し、 特に、 プログラム仕様書の作成効率を向上させる技術に関する。  The present invention relates to a technique for creating a program specification from comments inserted into a source program in the field of re-engineering and reverse engineering, and more particularly to a technique for improving the efficiency of creating a program specification.

背景技術 Background art

従来から、 ソースプログラムには、 一般的に、 プログラムの処理内容等を記述 したコメントが挿入される。 コメントとしては、 ファイルに関するコメント, シ ンボルに関するコメントがある。 ここで、 「シンボル」 とは、 例えば、 ソースプ ログラムが C + +言語で記述されている場合には、 クラス, メンバ関数, 外部変 数等のように、 1つの特性を共通して持っているような要素の集合体をいう。 そ して、 ファイルに関するコメントはファイルの先頭に、 また、 シンボルに関する コメントはシンボルの直前に挿入されるのが一般的である。  Conventionally, a comment describing the processing contents of a program is generally inserted into a source program. There are comments on files and comments on symbols. Here, “symbol” means that if the source program is written in C ++ language, it has one property in common, such as class, member function, external variable, etc. A collection of such elements. In general, comments about files are inserted at the beginning of the file, and comments about symbols are inserted immediately before the symbol.

従って、 ファイルの先頭部分では、 ファイルに関するコメントとシンボルに関 するコメントとが隣接することとなり、 次のような問題点があった。 即ち、 各コ メントには、 プログラム仕様書に対応したコメント項目 (以下 「項目」 という) が含まれる。 このため、 各コメントに同一項目が含まれる場合、 その項目はどち らのコメントに属するものであるかの判断が困難となり、 項目が抽出できなかつ たり又は重複して抽出されていた。 このような不具合があるため、 抽出された項 目に基づいてプログヲム仕様書を作成しようとしても、 項目をそのまま利用する ことができず、 人手による修正作業が不可欠であった。  Therefore, at the beginning of the file, the comment about the file and the comment about the symbol are adjacent to each other, which has the following problems. That is, each comment includes a comment item corresponding to the program specification (hereinafter referred to as “item”). For this reason, when the same item is included in each comment, it is difficult to determine which item belongs to which comment, and it has been impossible to extract the item, or the item has been extracted redundantly. Due to such a defect, even if an attempt was made to create a program specification based on the extracted items, the items could not be used as they were, and manual correction work was indispensable.

そこで、 本発明は従来の問題点に鑑み、 各項目が属するコメントを明確にする ことで、 項目の抽出精度を向上させ、 プログラム仕様書の作成効率を向上させる ことを目的とする。 発明の開示 In view of the foregoing, an object of the present invention is to clarify the comment to which each item belongs, thereby improving the extraction accuracy of the item and improving the efficiency of creating a program specification. Disclosure of the invention

上記目的達成のため、 第 1の手段として、 ソースプログラムに挿入された各種 コメントを識別するセパレ一タを設定するセパレータ設定手段と、 該セパレータ 設定手段により設定されたセパレータ毎に、 プログラム仕様書に対応するコメン ト項目の抽出キ一ヮ一ドを設定するキーヮ一ド設定手段と、 前記セパレータ設定 手段により設定されたセパレータに基づいて、 ソースプログラムの各コメントの 範囲を抽出するコメント範囲抽出手段と、 該コメント範囲抽出手段により抽出さ れた各コメントの範囲毎に、 前記キーヮ一ド設定手段により設定された抽出キー ヮードに基づいて、 ソースプログラムからコメント項目を抽出するコメント項目 抽出手段と、 該コメント項目抽出手段により抽出されたコメント項目に基づいて、 プログラム仕様書を生成するプロダラム仕様書生成手段と、 を含んでプロダラム 仕様書作成装置を構成したことを特徴とする。  In order to achieve the above object, as a first means, a separator setting means for setting a separator for identifying various comments inserted in the source program, and a separator set in the program specification for each separator set by the separator setting means. Key code setting means for setting an extraction key of a corresponding comment item; and comment range extracting means for extracting a range of each comment of the source program based on the separator set by the separator setting means. Comment item extracting means for extracting a comment item from a source program based on the extraction key word set by the key word setting means for each comment range extracted by the comment range extracting means; Based on the comment items extracted by the comment item extraction means, Characterized by being configured to Purodaramu specification creation device includes a Purodaramu specification generator means for generating a beam specifications, the.

かかる構成によれば、 ソースプログラムに揷入されたコメントからプログラム 仕様書を効率良く作成するには、 次のようにすればよい。 即ち、 ソースプログラ ムを記述する際の作業として、 コメント種別を識別するセパレータをソースプロ グラムに挿入する。 そして、 プログラム仕様書を作成するときに、 セパレータ設 定手段によりセパレータを設定すると、 設定されたセパレ一タに基づいて各コメ ントの範囲が抽出される。 一方、 抽出された各コメントの範囲毎に、 キーワード 設定手段により設定された抽出キーヮ一ドに基づいてソースプログラムからコメ ント項目が抽出される。 そして、 抽出されたコメント項目に基づいてプログラム 仕様書が生成される。  According to such a configuration, to efficiently create a program specification from the comments entered in the source program, the following may be performed. That is, as a work for describing the source program, a separator for identifying the comment type is inserted into the source program. Then, when creating a program specification, if a separator is set by the separator setting means, the range of each comment is extracted based on the set separator. On the other hand, a comment item is extracted from the source program for each range of the extracted comment based on the extraction key set by the keyword setting means. Then, a program specification is generated based on the extracted comment items.

このとき、 ファイルの先頭において、 種別が異なるコメントが隣接していても、 両者を識別するセパレータにより、 夫々のコメント範囲が正確かつ確実に識別さ れる。 従って、 従来のように、 コメント項目が抽出されなかったり、 また、 コメ ント項目が重複して抽出されることが防止され、 抽出されたコメント項目をその まま利用してプログラム仕様書を作成することができる。 もって、 コメント項目 の抽出精度が向上し、 プログラム仕様書の作成効率を向上することができる。 また、 前記セパレータは、 各種コメントの開始行と終了行を特定する構成とし てもよい。 At this time, even if comments of different types are adjacent to each other at the beginning of the file, each comment range can be accurately and reliably identified by the separator for identifying both. Therefore, it is prevented that comment items are not extracted or comment items are redundantly extracted as in the past, and program specifications should be created using the extracted comment items as they are. Can be. As a result, the accuracy of extracting comment items is improved, and the efficiency of creating program specifications can be improved. Further, the separator is configured to specify a start line and an end line of various comments. You may.

かかる構成によれば、 各種コメントの開始行及び終了行は、 セパレータにより 確実に識別される。 このため、 コメント範囲の抽出精度が向上し、 プログラム仕 様書の作成効率をより向上することができる。  According to such a configuration, the start line and the end line of various comments are reliably identified by the separator. For this reason, the extraction accuracy of the comment range is improved, and the efficiency of creating the program specification can be further improved.

さらに、 前記セパレータ設定手段は、 少なくとも、 ファイルに関するコメント とシンボルに関するコメントとを識別するセパレータを設定する構成としてもよ い。  Furthermore, the separator setting means may be configured to set at least a separator for identifying a comment on a file and a comment on a symbol.

かかる構成によれば、 ファイルの先頭における隣接したコメントの識別を確実 に行うことができる。 即ち、 一般的に、 ファイルの先頭部分には、 ファイルに関 するコメントとシンボルに関するコメントとが隣接して挿入されている。 このた め、 少なくとも両者を識別するセパレ一タを設定するようにすれば、 ファイルの 先頭部分におけるコメントの範囲の抽出が確実に行われるようになる。  According to such a configuration, it is possible to reliably identify an adjacent comment at the head of the file. That is, in general, a comment on a file and a comment on a symbol are inserted adjacent to each other at the beginning of the file. Therefore, by setting at least a separator that identifies both, the comment range at the beginning of the file can be reliably extracted.

この他には、 前記コメント範囲抽出手段は、 前記セパレータ設定手段によりセ パレータが設定されていないコメントに対しては、 他のコメントのセパレ一タ又 は実行文に基づいて、 コメントの範囲を抽出する構成としてもよい。 また、 前記 コメント範囲抽出手段は、 フアイルの先頭部分において 2つのコメントが隣接し て挿入され、 かつ、 前記セパレ一タ設定手段によりセパレータが設定されていな いときには、 前記 2つのコメントの間に挿入された実行文に基づいて、 コメント の範囲を抽出する構成としてもよい。  In addition, the comment range extracting means extracts, for a comment for which a separator is not set by the separator setting means, a comment range based on a separator of another comment or an executable statement. The configuration may be such that Also, the comment range extracting means inserts between two comments when two comments are inserted adjacently at the beginning of a file and a separator is not set by the separator setting means. A configuration may be adopted in which the range of comments is extracted based on the executed statement.

力、かる構成によれば、 種々のコメント記述方式に対応することができる。 また、 前記コメント項目抽出手段は、 ソースプログラムを記述したプログラム 言語に応じたコメント識別子を取り除いたコメント項目を抽出する構成としても よい。  With such a configuration, it is possible to cope with various comment description methods. Further, the comment item extracting means may be configured to extract a comment item from which a comment identifier corresponding to a programming language in which a source program is described is removed.

かかる構成によれば、 プログラム仕様書を生成する際に、 不要であるコメント 識別子が取り除かれるので、 見易いプロダラム仕様書を作成することができる。 第 2の手段として、 ソースプログラムに揷入された各種コメントを識別するセ パレータを設定するセパレータ設定工程と、 該セパレータ設定工程により設定さ れたセパレ一タ毎に、 プログラム仕様書に対応するコメント項目の抽出キーヮー ドを設定するキーヮード設定工程と、 前記セパレータ設定工程により設定された W セパレータに基づいて、 ソースプログラムの各コメントの範囲を抽出するコメン ト範囲抽出工程と、 該コメント範囲抽出工程により抽出された各コメントの範囲 毎に、 前記キ一ワード設定工程により設定された抽出キーワードに基づいて、 ソ ースプログラムからコメント項目を抽出するコメント項目抽出工程と、 該コメン ト項目抽出工程により抽出されたコメント項目に基づいて、 プログラム仕様書を 生成するプログラム仕様書生成工程と、 を含んでプログラム仕様書作成方法を構 成したことを特徴とする。 According to such a configuration, an unnecessary comment identifier is removed when a program specification is generated, so that an easy-to-read program specification can be created. As a second means, a separator setting step for setting a separator for identifying various comments input to the source program, and a comment corresponding to the program specification for each separator set in the separator setting step A keyword setting step of setting an extraction keyword of the item; A comment range extracting step of extracting a range of each comment of the source program based on the W separator; and an extraction set in the keyword setting step for each comment range extracted in the comment range extracting step. A comment item extracting step of extracting a comment item from the source program based on the keyword; and a program specification generating step of generating a program specification based on the comment item extracted in the comment item extracting step. The feature is that a method for creating a program specification has been configured.

力、かる構成によれば、 ソースプログラムに挿入されたコメントからプログラム 仕様書を効率良く作成するには、 次のようにすればよい。 即ち、 ソースプロダラ ムを記述する際の作業として、 コメント種別を識別するセパレータをソースプロ グラムに挿入する。 そして、 プログラム仕様書を作成するときに、 セパレータ設 定工程によりセパレータを設定すると、 設定されたセパレ一タに基づいて各コメ ントの範囲が抽出される。 一方、 抽出された各コメントの範囲毎に、 キ一ワード 設定工程により設定された抽出キ一ヮ一ドに基づいてソースプログラムからコメ ント項目が抽出される。 そして、 抽出されたコメント項目に基づいてプログラム 仕様書が生成される。  According to this configuration, to efficiently create a program specification from the comments inserted in the source program, the following can be performed. That is, as a work when describing the source program, a separator for identifying the comment type is inserted into the source program. Then, when creating a program specification, if a separator is set in the separator setting step, the range of each comment is extracted based on the set separator. On the other hand, comment items are extracted from the source program based on the extraction key set in the keyword setting step for each range of the extracted comments. Then, a program specification is generated based on the extracted comment items.

このとき、 ファイルの先頭において、 種別が異なるコメントが隣接していても、 両者を識別するセパレータにより、 夫々のコメント範囲が正確かつ確実に識別さ れる。 従って、 従来のように、 コメント項目が抽出されなかったり、 また、 コメ ント項目が重複して抽出されることが防止され、 抽出されたコメント項目をその まま利用してプログラム仕様書を作成することができる。 もって、 コメント項目 の抽出精度が向上し、 プロダラム仕様書の作成効率を向上することができる。 第 3の手段として、 ソースプログラムに挿入された各種コメントを識別するセ パレータを設定するセパレータ設定機能と、 該セパレータ設定機能により設定さ れたセパレータ毎に、 プログラム仕様書に対応するコメント項目の抽出キーヮー ドを設定するキーワード設定機能と、 前記セパレータ設定機能により設定された セパレータに基づいて、 ソースプログラムの各コメントの範囲を抽出するコメン ト範囲抽出機能と、 該コメント範囲抽出機能により抽出された各コメントの範囲 毎に、 前記キーワード設定機能により設定された抽出キ一ワードに基づいて、 ソ —スプログラムからコメント項目を抽出するコメント項目抽出機能と、 該コメン ト項目抽出機能により抽出されたコメント項目に基づいて、 プログラム仕様書を 生成するプログラム仕様書生成機能と、 を実現するためのプロダラム仕様書作成 プロダラムを記録媒体に記録した。 At this time, even if comments of different types are adjacent to each other at the beginning of the file, each comment range can be accurately and reliably identified by the separator for identifying both. Therefore, it is prevented that comment items are not extracted or comment items are redundantly extracted as in the past, and program specifications should be created using the extracted comment items as they are. Can be. As a result, the accuracy of extracting comment items is improved, and the efficiency of creating a program specification can be improved. As a third means, a separator setting function for setting a separator for identifying various comments inserted in the source program, and extraction of comment items corresponding to the program specifications for each separator set by the separator setting function A keyword setting function for setting a keyword; a comment range extraction function for extracting a range of each comment of the source program based on the separator set by the separator setting function; and a comment range extraction function for extracting each comment range by the comment range extraction function. For each comment range, based on the extracted keywords set by the keyword setting function, —A program for realizing a comment item extracting function for extracting comment items from a source program, and a program specification generating function for generating a program specification based on the comment items extracted by the comment item extracting function. Preparation of specifications The program was recorded on a recording medium.

ここで、 「記録媒体」 とは、 各種情報を確実に記録でき、 かつ、 必要に応じて 確実に取り出し可能なものをいい、 磁気テープ、 磁気ディスク、 磁気ドラム、 I Cカード、 C D— R OM等の可搬記録媒体が該当する。  Here, the “recording medium” refers to a medium that can reliably record various kinds of information and can reliably retrieve it as necessary. Magnetic tapes, magnetic disks, magnetic drums, IC cards, CD ROM, etc. Of portable recording media.

かかる構成によれば、 セパレータ設定機能, キ一ワード設定機能, コメント範 囲抽出機能, コメント項目抽出機能及びプログラム仕様書生成機能を実現するた めのプログラム仕様書作成プログラムが記録媒体に記録される。 従って、 かかる 記録媒体があれば、 一般的な電子計算機を利用して、 本発明に係るプログラム仕 様書作成装置を容易に構築することができる。 図面の簡単な説明  According to this configuration, a program specification creation program for realizing the separator setting function, keyword setting function, comment range extraction function, comment item extraction function, and program specification generation function is recorded on the recording medium. . Therefore, if such a recording medium is provided, a general-purpose computer can be used to easily construct the program specification creating device according to the present invention. BRIEF DESCRIPTION OF THE FIGURES

図 1は、 本発明に係る仕様書作成装置の全体構成図である。  FIG. 1 is an overall configuration diagram of a specification creation device according to the present invention.

図 2は、 処理対象となるソースプログラムの第 1例を示す図である。  FIG. 2 is a diagram illustrating a first example of a source program to be processed.

図 3は、 処理対象となるソースプログラムの第 2例を示す図である。  FIG. 3 is a diagram illustrating a second example of a source program to be processed.

図 4は、 処理対象となるソースプログラムの第 3例を示す図である。  FIG. 4 is a diagram illustrating a third example of a source program to be processed.

図 5は、 処理対象となるソースプログラムの第 4例を示す図である。  FIG. 5 is a diagram illustrating a fourth example of a source program to be processed.

図 6は、 生成されるプログラム仕様書の一例を示す図である。  FIG. 6 is a diagram showing an example of a generated program specification.

図 7は、 仕様書作成手順の流れを示すフローチヤ一トである。  Fig. 7 is a flowchart showing the flow of the specification creation procedure.

図 8は、 抽出キーヮードの設定画面の一例を示す図である。  FIG. 8 is a diagram showing an example of an extraction keyword setting screen.

図 9は、 抽出キーヮードの設定画面の一例を示す図である。  FIG. 9 is a diagram showing an example of an extraction keyword setting screen.

図 10は、 設定された抽出キーワードを示し、 (A) はファイルに関するコメン ト情報、 (B ) はクラスに関するコメント情報を示す。  Fig. 10 shows the set extracted keywords, (A) shows comment information on the file, and (B) shows comment information on the class.

図 11は、 コメントを抽出するメインルーチンのフローチヤ一トである。  FIG. 11 is a flowchart of the main routine for extracting comments.

図 12は、 ファイルに関するコメントを抽出するサブルーチンのフロ一チヤ一ト である。  FIG. 12 is a flowchart of a subroutine for extracting comments on a file.

図 13は、 シンボルに関するコメントを抽出するサブルーチンのフローチヤ一ト である。 Figure 13 is a flowchart of a subroutine that extracts comments on symbols. It is.

図 14は、 ファイルに関するコメントの抽出範囲を求めるサブルーチンのフロ一 チヤ一トである。  FIG. 14 is a flowchart of a subroutine for obtaining a comment extraction range for a file.

図 15は、 シンボルに関するコメントの抽出範囲を求めるサブルーチンのフロー チヤ一トである。  FIG. 15 is a flowchart of a subroutine for obtaining a comment extraction range for a symbol.

図 16は、 仕様書に必要なコメント項目を抽出するサブルーチンのフローチヤ一 トである。 発明を実施するための最良の形態  FIG. 16 is a flowchart of a subroutine for extracting comment items necessary for the specification. BEST MODE FOR CARRYING OUT THE INVENTION

本発明をより詳細に説述するために、 添付の図面に従ってこれを説明する。 図 2〜図 5は、 本発明に係るプログラム仕様書作成装置 (以下 「仕様書作成装 置」 という) の処理対象となるソースプログラムの一例を示す。 これらのソース プログラムは、 プログラム言語として C + +言語により記述され、 そのコメント は、 「/*」 で始まり 「*/」 で終わる部分、 及び、 各行における 「〃」 以降の部分 である。 なお、 ソースプログラムにおける各行の先頭に付された数字は、 プログ ラムの行番号を表す。  The present invention will be described in more detail with reference to the accompanying drawings. 2 to 5 show an example of a source program to be processed by the program specification creator according to the present invention (hereinafter referred to as “specification creator”). These source programs are written in the C ++ language as the programming language, with comments beginning with “/ *” and ending with “* /”, and the part after “〃” on each line. The number at the beginning of each line in the source program indicates the line number of the program.

図 2に示すソースプログラムの構成について説明すると、 次のようになる。 即 ち、 1行目〜 6行目がファイルに関するコメント、 7行目〜 1 6行目がクラス The configuration of the source program shown in FIG. 2 will be described as follows. That is, the first to sixth lines are comments about the file, and the seventh to 16th lines are classes.

(シンボル) に関するコメント、 1 7行目以降がクラスの定義文である。 また、 ファイルに関するコメントとクラスに関するコメントには、 夫々、 コメントの開 始及び終了を表すセパレータが設けられる。 ファイルに関するコメントでは、 1 行目及び 6行目のコメント行に含まれる 「************」 がセノ、。レータとして機 能し、 クラスに関するコメントでは、 7行目及び 1 6行目のコメント行に含まれ る 「 」 がセパレータとして機能する。 Comment on (symbol), line 17 and beyond is the class definition statement. The comment about the file and the comment about the class are provided with separators indicating the start and end of the comment, respectively. In comments about the file, “************” in the first and sixth comment lines is Seno. In comments related to classes, “” included in the comment lines on lines 7 and 16 functions as a separator.

また、 図 3に示すソースプログラムは、 クラスに関するコメントにセパレータ が設けられていない例である。 図 4に示すソースプログラムは、 ファイル及びク ラスに関するコメントにセパレータが設けられておらず、 両コメント間にセパレ ータとして機能する実行文 「#include く stdio. h〉」 が揷入されている例である。 図 5に示すソースプログラムは、 クラスに関するコメントがない例である。 図 1は、 仕様書作成装置の全体構成を示す。 The source program shown in Fig. 3 is an example in which no comment is provided for the class and no separator is provided. In the source program shown in Fig. 4, comments regarding files and classes are not provided with a separator, and an executable statement "#include <stdio.h>" that functions as a separator is inserted between the comments. It is an example. The source program shown in Figure 5 is an example without a comment on the class. Figure 1 shows the overall configuration of the specification creation device.

仕様書作成装置は、 表示装置 1 0と、 入力装置 2 0と、 外部記憶装置 3 0と、 演算装置 4 0と、 印刷装置 6 0と、 を含んで構成される。 表示装置 1 0は、 C R T , L C D等のディスプレイにより構成され、 ユーザに対する G U I (Graphics 1 User Interface) 機能を提供する。 入力装置 2 0は、 キーボード及びマウス等 のポインティングデバイスにより構成され、 G U Iに対するデータ入力機能を提 供する。 外部記憶装置 3 0は、 ハードディスク等により構成され、 ソースプログ ラムの保存機能を提供する。 演算装置 4 0は、 少なくとも、 中央処理装置 (C P U) とメモリとを含んで構成され、 メモリにロードされたプログラムにより仕様 書作成装置全体の制御を行う。 印刷装置 6 0は、 プリンタ等により構成され、 作 成されたプログラム仕様書の印刷機能を提供する。  The specification creator includes a display device 10, an input device 20, an external storage device 30, an arithmetic device 40, and a printing device 60. The display device 10 is configured by a display such as a CRT or an LCD, and provides a GUI (Graphics 1 User Interface) function to a user. The input device 20 is constituted by a pointing device such as a keyboard and a mouse, and provides a data input function to the GUI. The external storage device 30 is configured by a hard disk or the like, and provides a function of saving a source program. The arithmetic unit 40 is configured to include at least a central processing unit (CPU) and a memory, and controls the entire specification creating apparatus by a program loaded in the memory. The printing device 60 is configured by a printer or the like, and provides a printing function of the created program specification.

また、 演算装置 4 0には、 抽出キーワード設定部 4 2と、 コメント範囲抽出部 4 4と、 コメント項目抽出部 4 6と、 仕様書生成部 4 8と、 仕様書印刷部 5 0と、 がプログラムにより実装される。  In addition, the arithmetic unit 40 includes an extraction keyword setting unit 42, a comment range extraction unit 44, a comment item extraction unit 46, a specification generation unit 48, and a specification printing unit 50. Implemented programmatically.

抽出キーヮード設定部 4 2では、 表示装置 1 0及び入力装置 2 0と連携して G U Iが提供され、 コメントの種別に対応した抽出キーワードが設定される。 ここ で、 「コメントの種別」 とは、 例えば、 ソースプログラムが C + +言語で記述さ れている場合、 ファイルに関するコメント、 クラスに関するコメント等の識別子 をいう。 なお、 抽出キーワード設定部 4 2が、 セパレータ設定手段, セパレータ 設定工程, セパレータ設定機能, キーワード設定手段, キーワード設定工程及び キーヮード設定機能として作用する。  In the extraction keyword setting section 42, GUI is provided in cooperation with the display device 10 and the input device 20, and an extraction keyword corresponding to the type of comment is set. Here, "comment type" refers to an identifier such as a comment on a file or a comment on a class when the source program is described in the C ++ language. The extracted keyword setting unit 42 functions as a separator setting means, a separator setting step, a separator setting function, a keyword setting means, a keyword setting step, and a keyword setting function.

コメント範囲抽出部 4 4では、 外部記憶装置 3 0からソースプログラムフアイ ル 3 2が読み込まれ、 設定された抽出キーワードに基づいて、 ファイル全体に亘 るコメントの抽出範囲が抽出される。 図 2に示すソースプログラムを例にとって 説明すると、 ファイルに関するコメントの範囲として 1行目〜 6行目、 クラスに 関するコメントの範囲として 7行目〜 1 6行目が抽出される。 なお、 抽出される コメントの範囲は、 ファイルの先頭部分だけではなく、 それ以降のコメントも含 まれることは言うまでもない。 また、 コメント範囲抽出部 4 4が、 コメント範囲 抽出手段, コメント範囲抽出工程及びコメント範囲抽出機能として作用する。 コメント項目抽出部 4 6では、 設定された抽出キーワードに基づいて、 各コメ ントに含まれるコメント項目が抽出される。 図 2に示すソースプログラムのファ ィルに関するコメントを例にとって説明すると、 「1 .概要」 という抽出キーヮ ードに基づいて 「Carクラスの宣言」 、 「2 .作成者」 という抽出キーワードに基 づいて 「佐々木 孝次」 が抽出される。 なお、 コメント項目抽出部 4 6力 コメ ント項目抽出手段, コメント項目抽出工程及びコメント項目抽出機能として作用 する。 The comment range extraction unit 44 reads the source program file 32 from the external storage device 30, and extracts the comment extraction range over the entire file based on the set extraction keyword. Taking the source program shown in Fig. 2 as an example, lines 1 to 6 are extracted as comments for files, and lines 7 to 16 are extracted as comments for classes. It goes without saying that the range of extracted comments includes not only the beginning of the file but also comments after that. The comment range extracting section 44 functions as a comment range extracting means, a comment range extracting step, and a comment range extracting function. The comment item extraction section 46 extracts comment items included in each comment based on the set extraction keyword. Taking the comments on the source program file shown in Fig. 2 as an example, based on the extraction keywords "1. Overview", the keywords "Car class declaration" and "2. "Koji Sasaki" is extracted. The comment item extractor 46 functions as a comment item extracting means, a comment item extracting step, and a comment item extracting function.

仕様書生成部 4 8では、 抽出されたコメント項目に基づいて、 図 6に示すよう なプログラム仕様書が生成される。 なお、 仕様書生成部 4 8が、 プログラム仕様 書生成手段, プログラム仕様書生成工程及びプログラム仕様書生成機能として作 用する。  The specification generator 48 generates a program specification as shown in FIG. 6 based on the extracted comment items. The specification generation unit 48 operates as a program specification generation means, a program specification generation process, and a program specification generation function.

仕様書印刷部 5 0では、 生成されたプログラム仕様書のデータが印刷装置 6 0 に送信され、 印刷装置 6 0によりプログラム仕様書が印刷される。  In the specification printing section 50, the generated program specification data is transmitted to the printing device 60, and the printing device 60 prints the program specification.

次に、 かかる構成からなる仕様書作成装置の作用について説明する。  Next, the operation of the specification creating apparatus having the above configuration will be described.

図 7は、 プログラム仕様書を作成する手順のフローチャートを示す。  Figure 7 shows a flowchart of the procedure for creating a program specification.

ステップ 1 (図では 「S 1」 と略記する。 以下同様) では、 ソースプログラム からコメントを抽出するための抽出キーワードが設定される。 即ち、 「抽出キー ワードの設定」 コマンドを実行すると、 抽出キ一ワード設定部 4 2が選択的に起 動され、 図 8及び図 9に示すような抽出キーワードの設定画面 (以下 「設定画 面」 とレ、う) 1 0 0が表示される。 そして、 この設定画面 1 0 0上で、 コメント の種別毎に抽出キーワードが設定される。 抽出キーワードとしては、 コメントの 開始及び終了を表すセパレ一タ情報とプロダラム仕様書と対応させる仕様書情報 とがある。  In step 1 (abbreviated as "S1" in the figure; the same applies hereinafter), extraction keywords for extracting comments from the source program are set. That is, when the “set extraction keyword” command is executed, the extraction keyword setting section 42 is selectively activated, and an extraction keyword setting screen as shown in FIGS. 8 and 9 (hereinafter referred to as “setting screen”). "100" is displayed. Then, on this setting screen 100, an extraction keyword is set for each type of comment. The extracted keywords include separator information indicating the start and end of the comment and specification information corresponding to the program specification.

抽出キーワードを設定する手順としては、 先ず、 種別選択部 1 0 2からコメン トの種別を選択する。 そして、 追加ボタン 1 0 4, 削除ボタン 1 0 6及び変更ボ タン 1 0 8を適当に操作して、 セパレータ及びコメント項目に関する抽出キーヮ ードを入力する。 また、 他のコメント種別に関する抽出キーワードを続けて設定 する場合には、 種別選択部 1 0 2から他のコメントの種別を選択し、 同様な操作 を繰り返せばよレ、。 抽出キ一ワードの入力が完了したら、 O Kボタン 1 1 0を操 作することで抽出キーワードが確定する。 一方、 抽出キーワードの設定を中止し たい場合には、 任意の時点でキャンセルボタン 1 1 2を押せば、 抽出キーワード が直前の状態に戻る。 As a procedure for setting the extracted keyword, first, the type of comment is selected from the type selection unit 102. Then, by appropriately operating the add button 104, the delete button 106, and the change button 108, the user inputs a separator and an extraction key word relating to a comment item. In addition, when setting an extraction keyword related to another comment type continuously, select another comment type from the type selection unit 102 and repeat the same operation. After completing the extraction keyword input, operate the OK button 110. By doing, the extracted keyword is determined. On the other hand, if you want to cancel the setting of the extracted keyword, press the cancel button 1 1 2 at any time to return the extracted keyword to the previous state.

なお、 図 8では、 ファイル情報に関する抽出キーワードとして、 セパレータ情 報 及び仕様書情報 「1 .概要」 , 「2 .作成者」 が設定された様 子が示されている (図 9も同様) 。 そして、 その結果として、 図 1 0に示すよう な抽出キーヮードが設定される。  Note that FIG. 8 shows a state in which separator information and specification information “1. Outline” and “2. Creator” are set as extracted keywords related to file information (FIG. 9 is also the same). Then, as a result, an extraction keyword as shown in FIG. 10 is set.

ステップ 2では、 コメントの種別毎に、 ソースプログラムからコメントが抽出 される。 即ち、 「コメントの抽出」 コマンドを実行すると、 コメント範囲抽出部 4 4及びコメント項目抽出部 4 6が選択的に起動され、 後述する図 1 1〜図 1 6 のフローチヤ一トに従ってコメントが抽出される。  In step 2, comments are extracted from the source program for each type of comment. That is, when the “comment extraction” command is executed, the comment range extraction unit 44 and the comment item extraction unit 46 are selectively activated, and the comments are extracted according to the flowcharts of FIGS. 11 to 16 described later. You.

ステップ 3では、 抽出されたコメントに基づいて、 図 6に示すようなプロダラ ム仕様書が生成される。 即ち、 「プログラム仕様書の作成」 コマンドを実行する と、 仕様書生成部 4 8が選択的に起動され、 その機能によりプログラム仕様書が 生成される。  In step 3, a program specification as shown in Fig. 6 is generated based on the extracted comments. That is, when the “create program specification” command is executed, the specification generator 48 is selectively activated, and a program specification is generated by its function.

ステップ 4では、 生成されたプログラム仕様書が印刷装置 6 0から出力される。 即ち、 「プログラム仕様書の印刷」 コマンドを実行すると、 仕様書印刷部 5 0が 選択的に起動され、 印刷装置 6 0によりプログラム仕様書が印刷される。  In step 4, the generated program specification is output from the printing device 60. That is, when the “print program specification” command is executed, the specification printing unit 50 is selectively activated, and the printing device 60 prints the program specification.

なお、 以上の手順では、 プログラム仕様書の作成及び印刷は任意に選択できる 構成であるが、 例えば、 コメントの抽出を行うと、 プログラム仕様書の印刷まで 自動的に行われるようにしてもよレ、。  In the above procedure, creation and printing of the program specifications can be arbitrarily selected.For example, if comments are extracted, printing of the program specifications may be performed automatically. ,.

図 1 1は、 ソースプログラムからコメントを抽出する処理のメインルーチンを 示す。  FIG. 11 shows a main routine of processing for extracting a comment from a source program.

ステップ 1 0では、 外部記憶装置 3 0からソースプログラムファイル 3 2が読 み込まれ、 ソースプログラム中のシンボル情報が抽出される。 ここで、 「シンポ ル情報」 とは、 シンボル定義文の行情報及びシンボルの種別情報をいう。 図 2に 示すソースプログラムを例にとって説明すると、 1 7行目にクラスの定義文があ るため、 行情報が 「1 7行目」 、 種別情報が 「クラス」 となる。 なお、 抽出され たシンボル情報は、 例えば、 行情報をキーとして昇順に保持される。 ステップ 1 1では、 ファイルに関するコメントを抽出するサブルーチンがコー ルされる。 抽出されたコメントは、 例えば、 コメントの種別, 仕様書に対するコ メント項目をキーとしてテーブル形式で保持される (以下同様) 。 In step 10, the source program file 32 is read from the external storage device 30, and the symbol information in the source program is extracted. Here, “symbol information” refers to line information of a symbol definition statement and symbol type information. Taking the source program shown in FIG. 2 as an example, the line definition is “line 17” and the type information is “class” because there is a class definition statement on line 17. The extracted symbol information is held in ascending order using, for example, row information as a key. In step 11, a subroutine is called to extract comments about the file. The extracted comments are stored in a table format using, for example, the comment type and the comment item for the specification as a key (the same applies hereinafter).

ステップ 1 2では、 次のシンボル情報が読み込まれる。 即ち、 最初の処理にお いては 1番目のシンボル情報が読み込まれ、 それ以降の処理においては 2番目, 3番目, のシンボル情報が読み込まれる。  In step 12, the next symbol information is read. That is, the first symbol information is read in the first process, and the second, third, and other symbol information is read in the subsequent processes.

ステップ 1 3では、 シンボル情報をパラメータとして、 シンボルに関するコメ ントを抽出するサブルーチンがコールされる。  In step 13, a subroutine for extracting a comment on the symbol is called using the symbol information as a parameter.

ステップ 1 4では、 シンボルに関するコメントの抽出が、 ソースプログラムフ アイル 3 2の終端まで行われたか否か、 即ち、 コメントの抽出が完了したか否か が判定される。 そして、 コメントの抽出が完了したならば処理を終了し (Y e s ) 、 コメントの抽出が完了していなければステップ 1 2へと戻る (N o ) 。 図 1 2は、 ステップ 1 1においてコールされるサブルーチン、 即ち、 ファイル に関するコメントを抽出するサブルーチンを示す。  In step 14, it is determined whether or not the comment extraction for the symbol has been performed up to the end of the source program file 32, that is, whether or not the comment extraction has been completed. If the extraction of the comment is completed, the process is terminated (Y e s), and if the extraction of the comment is not completed, the process returns to step 12 (No). FIG. 12 shows a subroutine called in step 11, that is, a subroutine for extracting a comment on a file.

ステップ 2 0では、 ファイルに関するコメントの抽出範囲を求めるサブル一チ ンがコールされる。  In step 20, a subroutine is called to determine the extent of comment extraction for the file.

ステップ 2 1では、 ステップ 2 0において求められたコメントの抽出範囲から、 プログラム仕様書に対応するコメント項目を抽出するサブルーチンがコールされ る。  In step 21, a subroutine for extracting a comment item corresponding to the program specification from the comment extraction range obtained in step 20 is called.

図 1 3は、 ステップ 1 3においてコールされるサブルーチン、 即ち、 シンボル に関するコメントを抽出するサブルーチンを示す。  FIG. 13 shows a subroutine called in step 13, that is, a subroutine for extracting a comment on a symbol.

ステップ 3 0では、 シンボルに関するコメントの抽出範囲を求めるサブルーチ ンがコ一ルされる。  In step 30, a subroutine is called for finding the comment extraction range for the symbol.

ステップ 3 1では、 ステップ 3 0において求められたコメントの抽出範囲から、 プログラム仕様書に対応するコメント項目を抽出するサブルーチンがコールされ る。 なお、 ここでコールされるサブルーチンは、 先のステップ 2 1でコールされ るサブルーチンと同一である。  In step 31, a subroutine for extracting a comment item corresponding to the program specification from the comment extraction range obtained in step 30 is called. The subroutine called here is the same as the subroutine called in the previous step 21.

図 1 4は、 ステップ 2 0でコールされるサブルーチン、 即ち、 ファイルに関す るコメントの抽出範囲を求めるサブルーチンを示す。 ステップ 4 0では、 ソースプログラムの 1行目の内容が取り出される。 FIG. 14 shows a subroutine called in step 20, that is, a subroutine for obtaining a comment extraction range of a file. In step 40, the contents of the first line of the source program are extracted.

ステップ 4 1では、 取り出された 1行目の内容が実行文であるか否かが判定さ れる。 ここで、 「実行文」 とは、 コメント行以外の文をいい、 例えば、 ソースプ ログラムが C + +言語で記述されている場合、 「#define」 文等のプリプロセッ サの処理対象文, 変数の定義文, クラスの定義文等が該当する。 そして、 1行目 の内容が実行文であれば、 ソースプログラム中にはファイルに関するコメントが ないと判断し、 ステップ 4 7へと進む (Y e s ) 。 一方、 1行目の内容が実行文 でなければ (即ち、 コメント行) ステップ 4 2へと進む (N o ) 。  In step 41, it is determined whether or not the content of the extracted first line is an executable statement. Here, “executable statement” refers to a statement other than a comment line. For example, if the source program is written in C ++ language, a statement to be processed by the preprocessor such as a “#define” statement, Definition statements, class definition statements, etc. correspond. If the content of the first line is an executable statement, it is determined that there is no comment on the file in the source program, and the process proceeds to step 47 (Yes). On the other hand, if the content of the first line is not an executable statement (that is, a comment line), the process proceeds to step 42 (No).

ステップ 4 2では、 1行目の内容がシンボルのセパレータであるか否かが判定 される。 ここで、 シンボルのセパレ一タは、 図 9に示す抽出キーワードの設定画 面 1 0 0で設定されたものが基準となる (以下同様) 。 そして、 シンボルのセパ レ一タであれば、 ソースプログラムの 1行目はシンボルに関するコメントである と判断できるので、 ファイルに関するコメントがないと判断して、 ステップ 4 7 へと進む (Y e s ) 。 一方、 シンボルのセパレータでなければ、 ファイルに関す るコメントの開始行であると判断し、 ステップ 4 3へと進む (N o ) 。  In step 42, it is determined whether or not the content of the first line is a symbol separator. Here, the symbol separator is set on the extraction keyword setting screen 100 shown in FIG. 9 as a reference (the same applies hereinafter). If it is a symbol separator, it can be determined that the first line of the source program is a comment relating to the symbol. Therefore, it is determined that there is no comment relating to the file, and the process proceeds to step 47 (Yes). On the other hand, if it is not a symbol separator, it is determined to be the start line of the comment on the file, and the process proceeds to step 43 (No).

ステップ 4 3では、 次の行の内容 (以下 「行内容」 という) が取り出される。 ステップ 4 4では、 行内容が実行文であるか否かが判定される。 そして、 行内 容が実行文であれば、 ファイルに関するコメントの終了を表すセパレータがない 形式 (図 4のソースプログラム参照) であり、 前行でファイルに関するコメント が終了したと判断して、 ステップ 4 7へと進む (Y e s ) 。 一方、 行内容が実行 文でなければ、 ファイルに関するコメントが続いていると判断して、 ステップ 4 5へと進む (N o ) 。  In step 43, the contents of the next line (hereinafter referred to as "line contents") are extracted. In step 44, it is determined whether or not the line content is an executable statement. If the content of the line is an executable statement, the format is that there is no separator indicating the end of the comment on the file (see the source program in Fig. 4). Proceed to (Yes). On the other hand, if the content of the line is not an executable statement, it is determined that the comment on the file continues, and the process proceeds to step 45 (No).

ステップ 4 5では、 行内容がファイルのセパレータであるか否かが判定される。 そして、 ファイルのセパレ一タであれば、 ファイルに関するコメントの終了行で あると判断して、 ステップ 4 7へと進む (Y e s ) 。 一方、 ファイルのセパレー タでなければ、 ファイルに関するコメントが続いていると判断して、 ステップ 4 6へと進む (N o ) 。  In step 45, it is determined whether or not the line content is a file separator. If it is a file separator, it is determined that the comment is the end line of the file, and the process proceeds to step 47 (Yes). On the other hand, if it is not a file separator, it is determined that comments regarding the file are continued, and the process proceeds to step 46 (No).

ステップ 4 6では、 行内容がシンボルのセパレ一タであるか否かが判定される。 そして、 シンボルのセパレ一タであれば、 前行でファイルに関するコメントが終 了したと判断して、 ステップ 4 7へと進む (Y e s ) 。 一方、 シンボルのセパレ ータでなければ、 ファイルに関するコメントが続いていると判断して、 ステップIn step 46, it is determined whether or not the line content is a symbol separator. If it is a symbol separator, the comment on the file ends on the previous line. Then, the process proceeds to step 47 (Yes). On the other hand, if it is not a symbol separator, it is determined that comments about the file are continuing and

4 3へと戻る (N o ) 。 ここで、 このような判定を行っているのは、 例えば、 フ アイルに関するコメントの終了を表すセパレータがない場合を考慮したものであ る。 4 Return to 3 (No). Here, such determination is made, for example, in consideration of the case where there is no separator indicating the end of the comment on the file.

ステップ 4 7では、 ファイルに関するコメントの抽出範囲が算出される。 なお、 ステップ 4 1又はステップ 4 2でファイルに関するコメントがないと判断された 場合には、 ファイルに関するコメント行がない旨を表す情報、 例えば、 開始行及 び終了行に 「0」 が設定される。  In step 47, the extraction range of the comment on the file is calculated. If it is determined in step 41 or 42 that there is no comment on the file, information indicating that there is no comment line on the file, for example, `` 0 '' is set in the start line and end line .

図 1 5は、 ステップ 3 0でコールされるサブルーチン、 即ち、 シンボルに関す るコメントの抽出範囲を求めるサブルーチンを示す。  FIG. 15 shows a subroutine called in step 30, that is, a subroutine for obtaining a comment extraction range for a symbol.

ステップ 5 0では、 シンボル定義行の 1行前の内容が取り出される。 ここで、 シンボル定義行は、 ステップ 1 3でシンボルに関するサブルーチン (図 1 3参 照) をコールしたときのパラメータ (シンボル情報) の内容に基づき特定される。 例えば、 図 2のソースプログラムの場合には、 シンボル (クラス) の定義文が 1 7行目にあるため、 1 6行目の内容が取り出される。  In step 50, the contents one line before the symbol definition line are extracted. Here, the symbol definition line is specified based on the contents of the parameter (symbol information) at the time of calling the subroutine for the symbol (see Fig. 13) in step 13. For example, in the case of the source program in Figure 2, the definition statement of the symbol (class) is on line 17, so the contents of line 16 are extracted.

ステップ 5 1では、 シンボル定義行の 1行前の内容が実行文であるか否かが判 定される。 そして、 シンボル定義文の 1行前の内容が実行文であれば、 シンボル に関するコメントがないと判断して、 ステップ 5 6へと進む (Y e s ) 。 一方、 シンボル定義文の 1行前の内容が実行文でなければ、 ステップ 5 2へと進む (N o ) 。 なお、 図 5に示すように、 シンボル定義文の直前のコメントがファイルの コメントである場合には、 重複した範囲を抽出しないようにするため、 ファイル に関するコメントの抽出範囲を参照することが望ましい。  In step 51, it is determined whether the content one line before the symbol definition line is an executable statement. If the content of the line before the symbol definition statement is an executable statement, it is determined that there is no comment on the symbol, and the process proceeds to step 56 (Yes). On the other hand, if the content one line before the symbol definition statement is not an executable statement, the process proceeds to step 52 (No). As shown in Fig. 5, when the comment immediately before the symbol definition statement is a comment of a file, it is desirable to refer to the comment extraction range of the file in order not to extract the overlapping range.

ステップ 5 2では、 シンボル定義文の 1行前の内容が他のセパレータ、 即ち、 ファイル及び他のシンボルのセパレータであるか否かが判定される。 そして、 他 のセパレータであれば、 シンボルに関するコメントがないと判断して、 ステップ In step 52, it is determined whether the content of the previous line of the symbol definition statement is another separator, that is, a separator between a file and another symbol. If it is another separator, it judges that there is no comment about the symbol, and

5 6へと進む (Y e s ) 。 一方、 他のセパレータでなければ、 シンボルに関する コメントの終了行であると判断して、 ステップ 5 3へと進む (N o ) 。 Proceed to 5 6 (Y e s). On the other hand, if it is not another separator, it is determined to be the end line of the comment on the symbol, and the process proceeds to step 53 (No).

ステップ 5 3では、 前の行の内容が取り出される。 即ち、 ファイルの先頭に向 かってファイル解析を行い、 シンボルに関するコメントの開始行を探索する。 ステップ 5 4では、 行内容が実行文であるか否かが判定される。 そして、 行内 容が実行文であれば、 シンボルに関するコメントの開始を表すセパレータがない 形式 (図 3のソースプログラム参照) であり、 次の行からシンボルに関するコメ ントが始まると判断して、 ステップ 5 6へと進む (Y e s ) 。 一方、 行内容が実 行文でなければ、 シンボルに関するコメントが続いていると判断して、 ステップ 5 5へと進む (N o ) 。 In step 53, the contents of the previous line are retrieved. That is, In this way, file analysis is performed to search for the start line of the comment on the symbol. In step 54, it is determined whether or not the line content is an executable statement. If the content of the line is an executable statement, the format is such that there is no separator indicating the start of a comment on the symbol (see the source program in Figure 3), and the comment on the symbol starts on the next line. Proceed to 6 (Yes). On the other hand, if the content of the line is not an executable statement, it is determined that the comment on the symbol is continued, and the process proceeds to step 55 (No).

ステップ 5 5では、 行内容が他のセパレ一タであるか否かが判定される。 そし て、 行内容が他のセパレ一タであれば、 シンボルに関するコメントの開始を表す セパレータがない形式 (図 3のソースプログラム参照) であり、 次の行からシン ボルに関するコメントが始まると判断して、 ステップ 5 6へと進む (Y e s ) 。 一方、 行内容が他のセパレ一タでなければ、 シンボルに関するコメントが続いて いると判断して、 ステップ 5 3へと戻る (N o ) 。  In step 55, it is determined whether or not the line content is another separator. If the content of the line is another separator, it is determined that the comment related to the symbol starts from the next line, with no separator (see the source program in Figure 3) indicating the start of the comment related to the symbol. Then, go to step 56 (Yes). On the other hand, if the line content is not another separator, it is determined that the comment on the symbol is continued, and the process returns to step 53 (No).

ステップ 5 6では、 ファイルに関するコメントの抽出範囲が算出される。 なお、 ステップ 5 1又はステップ 5 2でファイルに関するコメントがないと判断された 場合には、 ステップ 4 7と同様な情報が設定される。  In step 56, the extraction range of comments on the file is calculated. If it is determined in step 51 or 52 that there is no comment on the file, the same information as in step 47 is set.

図 1 6は、 ステップ 2 1及びステップ 3 1でコールされるサブルーチン、 即ち、 プログラム仕様書に必要なコメント項目を抽出するサブルーチンを示す。  FIG. 16 shows a subroutine called in steps 21 and 31, that is, a subroutine for extracting a comment item necessary for a program specification.

ステップ 6 0では、 ファイル又はシンボルに関するコメント行の 1行目の内容 が取り出される。 ここで、 取り出される内容は、 コメント行を表すコメント識別 子、 例えば、 図 2に示すソースプログラムのファイルに関するコメントでは、 「/ 」 ¾_び 「水/」 を レヽた 「*=N==M«M«I«M«M」 力 S り出される。  In step 60, the contents of the first comment line of the file or symbol are extracted. Here, the content to be extracted is a comment identifier indicating a comment line. For example, in the comment on the source program file shown in FIG. 2, “*” and “water /” are indicated by “* = N == M «M« I «M« M ”is output.

ステップ 6 1では、 コメント行の内容が仕様書情報であるか否かが判定される。 そして、 仕様書情報であればステップ 6 2へと進み (Y e s ) 、 仕様書情報でな ければステップ 6 4へと進む (N o ) 。  In step 61, it is determined whether or not the content of the comment line is specification information. If it is the specification information, the process proceeds to step 62 (Yes), and if it is not the specification information, the process proceeds to step 64 (No).

ステップ 6 2では、 仕様書情報に応じたコメント項目を格納する配列の要素番 号、 ポインタ等が変更される。  In step 62, the element number, pointer, etc. of the array storing the comment items according to the specification information are changed.

ステップ 6 3では、 次の行がコメント項目の抽出範囲であるか否かが判定され る。 そして、 コメント項目の抽出範囲であればステップ 6 0へと戻り (Y e s ) 、 コメント項目の抽出範囲でなければ処理を終了する (No) 。 In step 63, it is determined whether or not the next line is the extraction range of the comment item. If it is within the comment item extraction range, the process returns to step 60 (Y es), If it is not within the comment item extraction range, the process ends (No).

ステップ 64では、 コメント項目の格納先が設定済みであるか否かが判定され る。 即ち、 ステップ 62の処理で格納先が変更 (設定) されたか否かが判定され る。 このような判定を行うためには、 格納先が未設定の場合には、 格納先として 「NULL」 を設定しておけばよい。 そして、 格納先が設定済みであればステップ 6 5へと進み (Y e s) 、 格納先が未設定であればステップ 63へと進む (No) 。 ここで、 格納先が未設定である場合の例としては、 コメント行の 1行目を処理し ているときであって、 その行がセパレータである場合である。  In step 64, it is determined whether or not the storage location of the comment item has been set. That is, it is determined whether or not the storage destination has been changed (set) in the process of step 62. To make such a determination, if the storage destination has not been set, “NULL” may be set as the storage destination. If the storage destination has been set, the process proceeds to step 65 (Yes), and if the storage destination has not been set, the process proceeds to step 63 (No). Here, an example of a case where the storage destination is not set is a case where the first line of the comment line is being processed and the line is a separator.

ステップ 65では、 コメント項目が所定の格納先に格納される。  In step 65, the comment item is stored in a predetermined storage location.

以上説明した処理によれば、 ソースプログラムに揷入されたコメントからプロ グラム仕様書を効率良く作成するには、 ソースプログラムを記述する際に、 コメ ント種別を識別するセパレータを揷入する。 そして、 プログラム仕様書を作成す るときに、 挿入したセパレータ情報を設定すると、 そのセパレータ情報に基づい て各コメントの範囲が抽出される。 このとき、 ファイルの先頭において、 フアイ ルに関するコメントとシンボルに関するコメントとが隣接していても、 両者を識 別するセパレータにより、 その範囲が正確かつ確実に識別される。 その後、 抽出 された範囲内において、 各コメントに応じた夫々のコメント項目が抽出され、 プ 口グラム仕様書が生成される。  According to the processing described above, in order to efficiently create a program specification from comments entered in a source program, a separator for identifying a comment type is inserted when describing the source program. Then, when creating the program specification, if the inserted separator information is set, the range of each comment is extracted based on the separator information. At this time, even if the comment about the file and the comment about the symbol are adjacent to each other at the beginning of the file, the range is accurately and reliably identified by the separator that identifies the two. Then, within the extracted range, each comment item corresponding to each comment is extracted, and a program specification is generated.

従って、 ファイルの先頭におけるコメント種別の混同が防止でき、 抽出された コメント項目をそのまま用いてプログラム仕様書を作成することができる。 この ため、 プログラム仕様書の作成効率が大幅に向上し、 例えば、 プログラム開発期 間の短縮, 開発コストの削減等を図ることができる。  Therefore, confusion of comment types at the beginning of the file can be prevented, and a program specification can be created using the extracted comment items as they are. For this reason, the efficiency of creating program specifications is greatly improved, and, for example, the program development period can be shortened, and development costs can be reduced.

なお、 以上説明した仕様書作成装置では、 プログラム言語として C + +言語に より記述されたソースプログラムを処理対象としたが、 他のプログラム言語、 例 えば、 BAS I C, COBOL, FORTRAN, J a v a等を処理対象として あよい。  In the above-described specification creator, the source program described in the C ++ language is to be processed as a programming language. However, other programming languages, for example, BAS IC, COBOL, FORTRAN, Java, etc. May be targeted for processing.

このような機能を実現するプログラムを、 例えば、 磁気テープ, 磁気ディスク, 磁気ドラム, I Cカード, CD— ROM等の記録媒体に記録しておけば、 本発明 に係るプロダラム仕様書作成プログラムを市場に流通させることができる。 そし て、 かかる記録媒体を取得した者は、 例えば、 一般的な電子計算機を利用して、 本発明に係るプロダラム仕様書作成装置を容易に構築することができる。 産業上の利用可能性 If a program for realizing such a function is recorded on a recording medium such as a magnetic tape, a magnetic disk, a magnetic drum, an IC card, a CD-ROM, etc., the program specification creating program according to the present invention can be marketed Can be distributed. Soshi Thus, a person who has obtained such a recording medium can easily construct the program specification creator according to the present invention using, for example, a general computer. Industrial applicability

以上説明したように、 本発明に係るプログラム仕様書作成装置及びプログラム 仕様書作成方法は、 コメント項目の抽出精度が向上するので、 極めて有用なもの である。 また、 本発明に係るプログラム仕様書作成プログラムを記録した記録媒 体は、 一般的な電子計算機を利用してプログラム仕様書作成装置を容易に構築で きるので、 極めて有用なものである。  As described above, the program specification creating apparatus and the program specification creating method according to the present invention are extremely useful because the accuracy of extracting comment items is improved. Further, the recording medium on which the program specification creating program according to the present invention is recorded is extremely useful because a program specification creating device can be easily constructed using a general computer.

Claims

請 求 の 範 囲 The scope of the claims 1 - ソースプログラムに挿入された各種コメントを識別するセパレ一タを設定す るセパレータ設定手段と、 1-separator setting means for setting a separator for identifying various comments inserted in the source program, 該セパレータ設定手段により設定されたセパレータ毎に、 プログラム仕様書に 対応するコメント項目の抽出キーヮードを設定するキーヮード設定手段と、 前記セパレータ設定手段により設定されたセパレータに基づいて、 ソースプロ グラムの各コメントの範囲を抽出するコメント範囲抽出手段と、  A keyword setting means for setting a keyword for extracting comment items corresponding to the program specifications for each of the separators set by the separator setting means; and a comment for each source program based on the separator set by the separator setting means. Comment range extracting means for extracting a range of 該コメント範囲抽出手段により抽出された各コメントの範囲毎に、 前記キーヮ 一ド設定手段により設定された抽出キーワードに基づいて、 ソースプログラムか らコメント項目を抽出するコメント項目抽出手段と、  Comment item extracting means for extracting a comment item from a source program based on the extracted keyword set by the key word setting means for each comment range extracted by the comment range extracting means; 該コメント項目抽出手段により抽出されたコメント項目に基づいて、 プロダラ ム仕様書を生成するプログラム仕様書生成手段と、  Program specification generating means for generating a program specification based on the comment item extracted by the comment item extracting means; を含んで構成されたことを特徴とするプログラム仕様書作成装置。  A program specification creation device characterized by comprising: 2 . 前記セパレ一タは、 各種コメントの開始行と終了行を特定する構成である請 求の範囲第 1項記載のプログラム仕様書作成装置。  2. The program specification creating device according to claim 1, wherein the separator is configured to specify a start line and an end line of various comments. 3 . 前記セパレータ設定手段は、 少なくとも、 ファイルに関するコメントとシン ボルに関するコメントとを識別するセパレータを設定する構成である請求の範囲 第 1項記載のプロダラム仕様書作成装置。  3. The program specification creating device according to claim 1, wherein the separator setting means is configured to set at least a separator for identifying a comment on a file and a comment on a symbol. 4 . 前記コメント範囲抽出手段は、 前記セパレータ設定手段によりセパレータが 設定されていないコメントに対しては、 他のコメントのセパレータ又は実行文に 基づいて、 コメントの範囲を抽出する構成である請求の範囲第 1項記載のプログ ラム仕様書作成装置。  4. The comment range extracting means is configured to, for a comment for which a separator is not set by the separator setting means, extract a comment range based on a separator of another comment or an executable statement. The program specification creation device described in paragraph 1. 5 ·前記コメント範囲抽出手段は、 ファイルの先頭部分において 2つのコメント が隣接して挿入され、 かつ、 前記セパレータ設定手段によりセパレータが設定さ れていないときには、 前記 2つのコメントの間に挿入された実行文に基づいて、 コメントの範囲を抽出する構成である請求の範囲第 1項記載のプログラム仕様書 作成装置。  5.The comment range extracting means inserts two comments adjacent to each other at the beginning of the file, and inserts between the two comments when no separator is set by the separator setting means. 3. The program specification creating device according to claim 1, wherein the device is configured to extract a comment range based on an executable statement. 6 .前記コメント項目抽出手段は、 ソースプログラムを記述したプログラム言語 に応じたコメント識別子を取り除いたコメント項目を抽出する構成である請求の 範囲第 1項記載のプロダラム仕様書作成装置。 6. The comment item extracting means is a programming language that describes a source program. 2. The program specification creating device according to claim 1, wherein the comment item is obtained by removing a comment identifier corresponding to the comment item. 7 . ソースプログラムに揷入された各種コメントを識別するセパレータを設定す るセパレータ設定工程と、  7. A separator setting step of setting a separator for identifying various comments entered in the source program; 該セパレータ設定工程により設定されたセパレータ毎に、 プログラム仕様書に 対応するコメント項目の抽出キーヮードを設定するキーヮ一ド設定工程と、 前記セパレータ設定工程により設定されたセパレータに基づいて、 ソースプロ グラムの各コメントの範囲を抽出するコメント範囲抽出工程と、  For each separator set in the separator setting step, a key code setting step for setting an extraction keyword of a comment item corresponding to the program specification, and a source program based on the separator set in the separator setting step. A comment range extracting step of extracting a range of each comment; 該コメント範囲抽出工程により抽出された各コメントの範囲毎に、 前記キ一ヮ ード設定工程により設定された抽出キーワードに基づいて、 ソースプログラムか らコメント項目を抽出するコメント項目抽出工程と、  A comment item extracting step of extracting a comment item from a source program based on the extracted keyword set in the key word setting step for each comment range extracted in the comment range extracting step; 該コメント項目抽出工程により抽出されたコメント項目に基づいて、 プロダラ ム仕様書を生成するプログラム仕様書生成工程と、  A program specification generation step of generating a program specification based on the comment item extracted in the comment item extraction step; を含んで構成されたことを特徴とするプロダラム仕様書作成方法。  A method for preparing a program specification, comprising: 8 . ソースプログラムに挿入された各種コメントを識別するセパレータを設定す るセパレータ設定機能と、  8. Separator setting function to set a separator to identify various comments inserted in the source program, 該セパレ一タ設定機能により設定されたセパレータ毎に、 プログラム仕様書に 対応するコメント項目の抽出キーヮードを設定するキーヮード設定機能と、 前記セパレータ設定機能により設定されたセパレータに基づいて、 ソースプロ グラムの各コメントの範囲を抽出するコメント範囲抽出機能と、  For each separator set by the separator setting function, a keyword setting function for setting an extraction keyword of a comment item corresponding to the program specification, and a source program of the source program based on the separator set by the separator setting function. A comment range extraction function for extracting the range of each comment, 該コメント範囲抽出機能により抽出された各コメントの範囲毎に、 前記キーヮ 一ド設定機能により設定された抽出キーワードに基づいて、 ソースプログラムか らコメント項目を抽出するコメント項目抽出機能と、  A comment item extraction function for extracting a comment item from a source program based on the extraction keyword set by the keypad setting function for each comment range extracted by the comment range extraction function; 該コメント項目抽出機能により抽出されたコメント項目に基づいて、 プロダラ ム仕様書を生成するプログラム仕様書生成機能と、  A program specification generation function for generating a program specification based on the comment item extracted by the comment item extraction function; を実現するためのプログラム仕様書作成プログラムを記録した記録媒体。  Recording medium storing a program specification creation program for realizing the above.
PCT/JP1999/000849 1999-02-24 1999-02-24 Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded Ceased WO2000050988A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP1999/000849 WO2000050988A1 (en) 1999-02-24 1999-02-24 Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded
JP2000601522A JP3886726B2 (en) 1999-02-24 1999-02-24 PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP1999/000849 WO2000050988A1 (en) 1999-02-24 1999-02-24 Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded

Publications (1)

Publication Number Publication Date
WO2000050988A1 true WO2000050988A1 (en) 2000-08-31

Family

ID=14235009

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1999/000849 Ceased WO2000050988A1 (en) 1999-02-24 1999-02-24 Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded

Country Status (2)

Country Link
JP (1) JP3886726B2 (en)
WO (1) WO2000050988A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007013418A1 (en) * 2005-07-28 2007-02-01 National Institute Of Advanced Industrial Science And Technology System for writing software documentation in natural languages

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0425935A (en) * 1990-05-21 1992-01-29 Dainippon Printing Co Ltd Program routine specification creation device
JPH05298081A (en) * 1992-04-20 1993-11-12 Omron Corp Specification extracting device
JPH0667872A (en) * 1992-08-20 1994-03-11 Nec Software Ltd Commnet extracting system in source program
JPH06139061A (en) * 1992-10-28 1994-05-20 Hitachi Ltd Program specification reverse generation method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0425935A (en) * 1990-05-21 1992-01-29 Dainippon Printing Co Ltd Program routine specification creation device
JPH05298081A (en) * 1992-04-20 1993-11-12 Omron Corp Specification extracting device
JPH0667872A (en) * 1992-08-20 1994-03-11 Nec Software Ltd Commnet extracting system in source program
JPH06139061A (en) * 1992-10-28 1994-05-20 Hitachi Ltd Program specification reverse generation method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007013418A1 (en) * 2005-07-28 2007-02-01 National Institute Of Advanced Industrial Science And Technology System for writing software documentation in natural languages

Also Published As

Publication number Publication date
JP3886726B2 (en) 2007-02-28

Similar Documents

Publication Publication Date Title
JP4924976B2 (en) Software development support system
EP0661650B1 (en) Document editing apparatus
JPH10275093A (en) Program test support device
JP4040764B2 (en) Gene motif extraction processing apparatus, gene motif extraction processing method, and recording medium storing gene motif extraction processing program
WO2000050988A1 (en) Apparatus for preparing program specifications, method for preparing program specifications, and recording medium on which program for preparing program specifications is recorded
JPH11224186A (en) Software analysis device and software analysis method
JP5748118B2 (en) Document creation support method, document creation support device, and document creation support program
WO2001071549A1 (en) Computer-readable recorded medium on which document creating program is recorded, document creating system, and document creating method
JPWO2000050988A1 (en) Program specification creation device, program specification creation method, and recording medium recording a program specification creation program
JP4311327B2 (en) Source code automatic generation device, source code automatic generation method, program, and recording medium
JPH056291A (en) How to create and manage test resources
JP3904430B2 (en) Gaiji font creation system, program recording medium and program
JP4792950B2 (en) Data management device
JP3466792B2 (en) Drawing search method and apparatus
JP3557439B2 (en) Computer operation data search method and apparatus therefor
JP2000339145A (en) Program maintenance support method, apparatus and recording medium
JP4458491B2 (en) Test command file creation system, method and program
US20040199377A1 (en) Information processing apparatus, information processing method and program, and storage medium
JPH03248228A (en) Error detection for software design information
JPH0981377A (en) Automatic generation device for specification of reuse program
JP3237709B2 (en) Document processing apparatus and document processing method
JPH06139061A (en) Program specification reverse generation method
JP2000330844A (en) Method and device for recording data
JP2006039993A (en) Device and program for setting storage class, and device and program for source code generation
Jameson A Software Engineering Environment

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP US

DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
ENP Entry into the national phase

Ref country code: JP

Ref document number: 2000 601522

Kind code of ref document: A

Format of ref document f/p: F