Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3886726B2 - PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM - Google Patents
[go: Go Back, main page]

JP3886726B2 - PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM - Google Patents

PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM Download PDF

Info

Publication number
JP3886726B2
JP3886726B2 JP2000601522A JP2000601522A JP3886726B2 JP 3886726 B2 JP3886726 B2 JP 3886726B2 JP 2000601522 A JP2000601522 A JP 2000601522A JP 2000601522 A JP2000601522 A JP 2000601522A JP 3886726 B2 JP3886726 B2 JP 3886726B2
Authority
JP
Japan
Prior art keywords
comment
separator
program
setting
range
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.)
Expired - Fee Related
Application number
JP2000601522A
Other languages
Japanese (ja)
Other versions
JPWO2000050988A1 (en
Inventor
孝次 佐々木
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
Publication of JPWO2000050988A1 publication Critical patent/JPWO2000050988A1/en
Application granted granted Critical
Publication of JP3886726B2 publication Critical patent/JP3886726B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

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

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)

Description

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

従来から、ソースプログラムには、一般的に、プログラムの処理内容等を記述したコメントが挿入される。コメントとしては、ファイルに関するコメント,シンボルに関するコメントがある。ここで、「シンボル」とは、例えば、ソースプログラムがC++言語で記述されている場合には、クラス,メンバ関数,外部変数等のように、1つの特性を共通して持っているような要素の集合体をいう。そして、ファイルに関するコメントはファイルの先頭に、また、シンボルに関するコメントはシンボルの直前に挿入されるのが一般的である。   Conventionally, a comment describing the processing contents of a program is generally inserted into a source program. There are comments about files and comments about symbols. Here, “symbol” means, for example, an element that has one characteristic in common, such as a class, a member function, an external variable, etc., when the source program is written in C ++ language. An aggregate of In general, a comment regarding a file is inserted at the beginning of the file, and a comment regarding a symbol is 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, and there are the following problems. That is, each comment includes a comment item (hereinafter referred to as “item”) corresponding to the program specification. For this reason, when the same item is included in each comment, it is difficult to determine which comment the item belongs to, and the item cannot be extracted or is extracted redundantly. Due to such problems, 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.

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

上記目的達成のため、第1の手段として、ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定手段と、該セパレータ設定手段により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定手段と、前記セパレータ設定手段により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出手段と、該コメント範囲抽出手段により抽出された各コメントの範囲毎に、前記キーワード設定手段により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出手段と、該コメント項目抽出手段により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成手段と、を含んでプログラム仕様書作成装置を構成したことを特徴とする。 To achieve the above object, as a first means, for each source program, a separator for identifying various comments inserted in the source program is set through a graphical user interface , and the separator setting means is used to set the separator. For each separator, the keyword setting means for setting the extracted keyword of the comment item corresponding to the program specification via the graphical user interface, and each comment of the source program based on the separator set by the separator setting means Comment range extracting means for extracting a range of comments, and for each comment range extracted by the comment range extracting means, a comment item is extracted from the source program based on the extracted keyword set by the keyword setting means. And a comment specification extraction unit configured to generate a program specification based on the comment item extracted by the comment item extraction unit. To do.

かかる構成によれば、ソースプログラムに挿入されたコメントからプログラム仕様書を効率良く作成するには、次のようにすればよい。即ち、ソースプログラムを記述する際の作業として、コメント種別を識別するセパレータを、ソースプログラムに挿入する。そして、プログラム仕様書を作成するときに、セパレータ設定手段により、グラフィカルユーザインタフェースを介してセパレータを設定すると、設定されたセパレータに基づいて各コメントの範囲が抽出される。一方、抽出された各コメントの範囲毎に、キーワード設定手段によりグラフィカルユーザインタフェースを介して設定された抽出キーワードに基づいてソースプログラムからコメント項目が抽出される。そして、抽出されたコメント項目に基づいてプログラム仕様書が生成される。 According to such a configuration, a program specification can be efficiently created from comments inserted in the source program as follows. That is, as an operation for describing the source program, a separator for identifying the comment type is inserted into the source program. When the separator specification unit sets the separator via the graphical user interface when creating the program specification, the range of each comment is extracted based on the set separator. On the other hand, for each extracted comment range, a comment item is extracted from the source program based on the extracted keyword set by the keyword setting means through the graphical user interface . Then, a program specification is generated based on the extracted comment item.

このとき、ファイルの先頭において、種別が異なるコメントが隣接していても、両者を識別するセパレータにより、夫々のコメント範囲が正確かつ確実に識別される。従って、従来のように、コメント項目が抽出されなかったり、また、コメント項目が重複して抽出されることが防止され、抽出されたコメント項目をそのまま利用してプログラム仕様書を作成することができる。もって、コメント項目の抽出精度が向上し、プログラム仕様書の作成効率を向上することができる。   At this time, even if comments of different types are adjacent to each other at the beginning of the file, each comment range is accurately and reliably identified by the separator for identifying both. Accordingly, it is possible to prevent the comment item from being extracted or the comment item from being extracted twice as in the conventional case, and the program specification can be created by using the extracted comment item as it is. . Accordingly, the accuracy of extracting comment items can be improved, and the efficiency of creating a program specification can be improved.

また、前記セパレータは、各種コメントの開始行と終了行を特定する構成としてもよい。
かかる構成によれば、各種コメントの開始行及び終了行は、セパレータにより確実に識別される。このため、コメント範囲の抽出精度が向上し、プログラム仕様書の作成効率をより向上することができる。
The separator may be configured to identify the start line and end line of various comments.
According to this 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 creation efficiency of the program specification can be further improved.

さらに、前記セパレータ設定手段は、少なくとも、ファイルに関するコメントとシンボルに関するコメントとを識別するセパレータを設定させる構成としてもよい。
かかる構成によれば、ファイルの先頭における隣接したコメントの識別を確実に行うことができる。即ち、一般的に、ファイルの先頭部分には、ファイルに関するコメントとシンボルに関するコメントとが隣接して挿入されている。このため、少なくとも両者を識別するセパレータを設定するようにすれば、ファイルの先頭部分におけるコメントの範囲の抽出が確実に行われるようになる。
Further, the separator setting means may be configured to set at least a separator for identifying a comment relating to a file and a comment relating to a symbol.
With this configuration, it is possible to reliably identify adjacent comments at the beginning of the file. That is, generally, a comment related to a file and a comment related to a symbol are inserted adjacent to each other at the beginning of the file. For this reason, if at least a separator for identifying both is set, the extraction of the comment range at the beginning of the file can be reliably performed.

この他には、前記コメント範囲抽出手段は、前記セパレータ設定手段によりセパレータが設定されていないコメントに対しては、他のコメントのセパレータ又は実行文に基づいて、コメントの範囲を抽出する構成としてもよい。また、前記コメント範囲抽出手段は、ファイルの先頭部分において2つのコメントが隣接して挿入され、かつ、前記セパレータ設定手段によりセパレータが設定されていないときには、前記2つのコメントの間に挿入された実行文に基づいて、コメントの範囲を抽出する構成としてもよい。
かかる構成によれば、種々のコメント記述方式に対応することができる。
In addition to this, the comment range extraction unit may extract a comment range based on a separator or an executable statement of another comment for a comment for which no separator is set by the separator setting unit. Good. Further, the comment range extracting unit inserts between two comments when two comments are inserted adjacent to each other at the beginning of the file and no separator is set by the separator setting unit. A range of comments may be extracted based on the sentence.
According to such a configuration, various comment description methods can be supported.

また、前記コメント項目抽出手段は、ソースプログラムを記述したプログラム言語に応じたコメント識別子を取り除いたコメント項目を抽出する構成としてもよい。
かかる構成によれば、プログラム仕様書を生成する際に、不要であるコメント識別子が取り除かれるので、見易いプログラム仕様書を作成することができる。
In addition, the comment item extraction unit may extract a comment item from which a comment identifier corresponding to a program language describing a source program is removed.
According to such a configuration, an unnecessary comment identifier is removed when generating a program specification, so that an easy-to-read program specification can be created.

第2の手段として、ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定工程と、該セパレータ設定工程により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定工程と、前記セパレータ設定工程により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出工程と、該コメント範囲抽出工程により抽出された各コメントの範囲毎に、前記キーワード設定工程により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出工程と、該コメント項目抽出工程により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成工程と、をコンピュータに実行させるプログラム仕様書作成方法を構成したことを特徴とする。 As a second means, for each source program, a separator setting step for setting various types of comments inserted in the source program via a graphical user interface, and for each separator set by the separator setting step, A keyword setting step for setting a comment item extraction keyword corresponding to the program specification via a graphical user interface, and a comment for extracting a range of each comment of the source program based on the separator set by the separator setting step A comment item extraction for extracting a comment item from the source program based on the extracted keyword set by the keyword setting step for each range of the comment extracted by the range extracting step and the comment range extracting step. A step, on the basis of the comment items extracted by the comment item extraction process, a program specification generation step of generating a program specifications, characterized in that the configured program specification creation process to be executed by a computer.

かかる構成によれば、ソースプログラムに挿入されたコメントからプログラム仕様書を効率良く作成するには、次のようにすればよい。即ち、ソースプログラムを記述する際の作業として、コメント種別を識別するセパレータをソースプログラムに挿入する。そして、プログラム仕様書を作成するときに、セパレータ設定工程によりグラフィカルユーザインタフェースを介してセパレータを設定すると、設定されたセパレータに基づいて各コメントの範囲が抽出される。一方、抽出された各コメントの範囲毎に、キーワード設定工程によりグラフィカルユーザインタフェースを介して設定された抽出キーワードに基づいてソースプログラムからコメント項目が抽出される。そして、抽出されたコメント項目に基づいてプログラム仕様書が生成される。 According to such a configuration, a program specification can be efficiently created from comments inserted in the source program as follows. That is, as an operation 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 via a graphical user interface in the separator setting step, the range of each comment is extracted based on the set separator. On the other hand, for each extracted comment range, a comment item is extracted from the source program based on the extracted keyword set through the graphical user interface by the keyword setting step. Then, a program specification is generated based on the extracted comment item.

このとき、ファイルの先頭において、種別が異なるコメントが隣接していても、両者を識別するセパレータにより、夫々のコメント範囲が正確かつ確実に識別される。従って、従来のように、コメント項目が抽出されなかったり、また、コメント項目が重複して抽出されることが防止され、抽出されたコメント項目をそのまま利用してプログラム仕様書を作成することができる。もって、コメント項目の抽出精度が向上し、プログラム仕様書の作成効率を向上することができる。   At this time, even if comments of different types are adjacent to each other at the beginning of the file, each comment range is accurately and reliably identified by the separator for identifying both. Accordingly, it is possible to prevent the comment item from being extracted or the comment item from being extracted twice as in the conventional case, and the program specification can be created by using the extracted comment item as it is. . Accordingly, the accuracy of extracting comment items can be improved, and the efficiency of creating a program specification can be improved.

第3の手段として、ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定機能と、該セパレータ設定機能により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定機能と、前記セパレータ設定機能により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出機能と、該コメント範囲抽出機能により抽出された各コメントの範囲毎に、前記キーワード設定機能により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出機能と、該コメント項目抽出機能により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成機能と、をコンピュータに実現させるためのプログラム仕様書作成プログラムをコンピュータ読取可能な記録媒体に記録した。 As a third means, for each source program, a separator setting function for setting various types of comments inserted in the source program via a graphical user interface, and for each separator set by the separator setting function, A keyword setting function for setting a keyword for extracting a comment item corresponding to the program specification via a graphical user interface, and a comment for extracting a range of each comment of the source program based on the separator set by the separator setting function A comment item extraction that extracts a comment item from the source program based on the extracted keyword set by the keyword setting function for each comment range extracted by the range extracting function and the comment range extracting function. Features and, on the basis of the comment items extracted by the comment entry extractor, program specifications computer-readable recording medium a program specification generation program for implementing a program specification generation function of generating, to computer Recorded.

ここで、「記録媒体」とは、各種情報を確実に記録でき、かつ、必要に応じて確実に取り出し可能なものをいい、磁気テープ、磁気ディスク、磁気ドラム、ICカード、CD−ROM等の可搬記録媒体が該当する。   Here, the “recording medium” refers to a medium that can reliably record various kinds of information and can be reliably removed as necessary, such as a magnetic tape, a magnetic disk, a magnetic drum, an IC card, and a CD-ROM. This applies to portable recording media.

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

本発明をより詳細に説述するために、添付の図面に従ってこれを説明する。   In order to describe the present invention in more detail, it will be described with reference to the accompanying drawings.

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

図2に示すソースプログラムの構成について説明すると、次のようになる。即ち、1行目〜6行目がファイルに関するコメント、7行目〜16行目がクラス(シンボル)に関するコメント、17行目以降がクラスの定義文である。また、ファイルに関するコメントとクラスに関するコメントには、夫々、コメントの開始及び終了を表すセパレータが設けられる。ファイルに関するコメントでは、1行目及び6行目のコメント行に含まれる「************」がセパレータとして機能し、クラスに関するコメントでは、7行目及び16行目のコメント行に含まれる「−−−−−−−−−−−−」がセパレータとして機能する。   The configuration of the source program shown in FIG. 2 will be described as follows. That is, the first to sixth lines are comments regarding the file, the seventh to sixteenth lines are comments regarding the class (symbol), and the 17th and subsequent lines are class definition statements. In addition, a separator indicating the start and end of a comment is provided for each comment relating to a file and each comment relating to a class. In the comments regarding the file, “*******” included in the first and sixth comment lines functions as a separator, and in the comments regarding the class, the seventh and sixteenth lines "------------" included in the comment line of "" functions as a separator.

また、図3に示すソースプログラムは、クラスに関するコメントにセパレータが設けられていない例である。図4に示すソースプログラムは、ファイル及びクラスに関するコメントにセパレータが設けられておらず、両コメント間にセパレータとして機能する実行文「#include〈stdio.h〉」が挿入されている例である。図5に示すソースプログラムは、クラスに関するコメントがない例である。   In addition, the source program shown in FIG. 3 is an example in which no separator is provided for comments related to classes. The source program shown in FIG. 4 is an example in which no comment is provided for comments relating to files and classes, and an executable statement “#include <stdio.h>” that functions as a separator is inserted between the comments. The source program shown in FIG. 5 is an example in which there is no comment regarding the class.

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

また、演算装置40には、抽出キーワード設定部42と、コメント範囲抽出部44と、コメント項目抽出部46と、仕様書生成部48と、仕様書印刷部50と、がプログラムにより実装される。   In addition, 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 are mounted on the arithmetic device 40 by a program.

抽出キーワード設定部42では、表示装置10及び入力装置20と連携してGUIが提供され、コメントの種別に対応した抽出キーワードが設定される。ここで、「コメントの種別」とは、例えば、ソースプログラムがC++言語で記述されている場合、ファイルに関するコメント、クラスに関するコメント等の識別子をいう。なお、抽出キーワード設定部42が、セパレータ設定手段,セパレータ設定工程,セパレータ設定機能,キーワード設定手段,キーワード設定工程及びキーワード設定機能として作用する。   In the extraction keyword setting unit 42, a 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, the “comment type” refers to an identifier such as a comment about a file or a comment about a class when the source program is described in C ++ language. The extracted keyword setting unit 42 functions as a separator setting means, a separator setting process, a separator setting function, a keyword setting means, a keyword setting process, and a keyword setting function.

コメント範囲抽出部44では、外部記憶装置30からソースプログラムファイル32が読み込まれ、設定された抽出キーワードに基づいて、ファイル全体に亘るコメントの抽出範囲が抽出される。図2に示すソースプログラムを例にとって説明すると、ファイルに関するコメントの範囲として1行目〜6行目、クラスに関するコメントの範囲として7行目〜16行目が抽出される。なお、抽出されるコメントの範囲は、ファイルの先頭部分だけではなく、それ以降のコメントも含まれることは言うまでもない。また、コメント範囲抽出部44が、コメント範囲抽出手段,コメント範囲抽出工程及びコメント範囲抽出機能として作用する。   The comment range extraction unit 44 reads the source program file 32 from the external storage device 30 and extracts the extraction range of comments over the entire file based on the set extraction keyword. If the source program shown in FIG. 2 is described as an example, the first to sixth lines are extracted as the comment range regarding the file, and the seventh to sixteenth lines are extracted as the comment range regarding the class. Needless to say, the range of comments to be extracted includes not only the head portion of the file but also subsequent comments. The comment range extraction unit 44 functions as a comment range extraction means, a comment range extraction step, and a comment range extraction function.

コメント項目抽出部46では、設定された抽出キーワードに基づいて、各コメントに含まれるコメント項目が抽出される。図2に示すソースプログラムのファイルに関するコメントを例にとって説明すると、「1.概要」という抽出キーワードに基づいて「Carクラスの宣言」、「2.作成者」という抽出キーワードに基づいて「佐々木 孝次」が抽出される。なお、コメント項目抽出部46が、コメント項目抽出手段,コメント項目抽出工程及びコメント項目抽出機能として作用する。   In the comment item extraction unit 46, comment items included in each comment are extracted based on the set extraction keyword. For example, the comment on the source program file shown in FIG. 2 is described as follows: “1. Summary” based on the extracted keyword “Car class declaration”, “2. Creator” based on the extracted keyword “Koji Sasaki” Is extracted. The comment item extracting unit 46 functions as a comment item extracting means, a comment item extracting step, and a comment item extracting function.

仕様書生成部48では、抽出されたコメント項目に基づいて、図6に示すようなプログラム仕様書が生成される。なお、仕様書生成部48が、プログラム仕様書生成手段,プログラム仕様書生成工程及びプログラム仕様書生成機能として作用する。
仕様書印刷部50では、生成されたプログラム仕様書のデータが印刷装置60に送信され、印刷装置60によりプログラム仕様書が印刷される。
The specification generation unit 48 generates a program specification as shown in FIG. 6 based on the extracted comment item. The specification generation unit 48 functions as a program specification generation unit, a program specification generation process, and a program specification generation function.
In the specification printing unit 50, the generated program specification data is transmitted to the printing device 60, and the printing device 60 prints the program specification.

次に、かかる構成からなる仕様書作成装置の作用について説明する。
図7は、プログラム仕様書を作成する手順のフローチャートを示す。
ステップ1(図では「S1」と略記する。以下同様)では、ソースプログラムからコメントを抽出するための抽出キーワードが設定される。即ち、「抽出キーワードの設定」コマンドを実行すると、抽出キーワード設定部42が選択的に起動され、図8及び図9に示すような抽出キーワードの設定画面(以下「設定画面」という)100が表示される。そして、この設定画面100上で、コメントの種別毎に抽出キーワードが設定される。抽出キーワードとしては、コメントの開始及び終了を表すセパレータ情報とプログラム仕様書と対応させる仕様書情報とがある。
Next, the operation of the specification creation apparatus having such a configuration will be described.
FIG. 7 shows a flowchart of a procedure for creating a program specification.
In step 1 (abbreviated as “S1” in the figure, the same applies hereinafter), an extraction keyword for extracting a comment from the source program is set. That is, when the “extract keyword setting” command is executed, the extraction keyword setting unit 42 is selectively activated, and an extraction keyword setting screen (hereinafter referred to as “setting screen”) 100 as shown in FIGS. 8 and 9 is displayed. Is done. On the setting screen 100, an extraction keyword is set for each comment type. The extracted keyword includes separator information indicating the start and end of a comment and specification information associated with the program specification.

抽出キーワードを設定する手順としては、先ず、種別選択部102からコメントの種別を選択する。そして、追加ボタン104,削除ボタン106及び変更ボタン108を適当に操作して、セパレータ及びコメント項目に関する抽出キーワードを入力する。また、他のコメント種別に関する抽出キーワードを続けて設定する場合には、種別選択部102から他のコメントの種別を選択し、同様な操作を繰り返せばよい。抽出キーワードの入力が完了したら、OKボタン110を操作することで抽出キーワードが確定する。一方、抽出キーワードの設定を中止したい場合には、任意の時点でキャンセルボタン112を押せば、抽出キーワードが直前の状態に戻る。   As a procedure for setting an extraction keyword, first, a comment type 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, an extraction keyword related to the separator and the comment item is input. In addition, when continuously setting extracted keywords related to other comment types, it is only necessary to select another comment type from the type selection unit 102 and repeat the same operation. When the input of the extraction keyword is completed, the extraction keyword is determined by operating the OK button 110. On the other hand, if it is desired to cancel the setting of the extracted keyword, the extracted keyword returns to the previous state by pressing the cancel button 112 at an arbitrary time.

なお、図8では、ファイル情報に関する抽出キーワードとして、セパレータ情報「************」及び仕様書情報「1.概要」,「2.作成者」が設定された様子が示されている(図9も同様)。そして、その結果として、図10に示すような抽出キーワードが設定される。
ステップ2では、コメントの種別毎に、ソースプログラムからコメントが抽出される。即ち、「コメントの抽出」コマンドを実行すると、コメント範囲抽出部44及びコメント項目抽出部46が選択的に起動され、後述する図11〜図16のフローチャートに従ってコメントが抽出される。
In FIG. 8, separator information “*******” and specification information “1. overview” and “2. creator” are set as extraction keywords related to file information. Is shown (the same applies to FIG. 9). As a result, extraction keywords as shown in FIG. 10 are set.
In step 2, a comment is extracted from the source program for each comment type. That is, when the “extract comment” command is executed, the comment range extraction unit 44 and the comment item extraction unit 46 are selectively activated, and comments are extracted according to the flowcharts of FIGS.

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

ステップ4では、生成されたプログラム仕様書が印刷装置60から出力される。即ち、「プログラム仕様書の印刷」コマンドを実行すると、仕様書印刷部50が選択的に起動され、印刷装置60によりプログラム仕様書が印刷される。
なお、以上の手順では、プログラム仕様書の作成及び印刷は任意に選択できる構成であるが、例えば、コメントの抽出を行うと、プログラム仕様書の印刷まで自動的に行われるようにしてもよい。
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, the creation and printing of the program specification can be arbitrarily selected. However, for example, when a comment is extracted, the program specification may be automatically printed.

図11は、ソースプログラムからコメントを抽出する処理のメインルーチンを示す。
ステップ10では、外部記憶装置30からソースプログラムファイル32が読み込まれ、ソースプログラム中のシンボル情報が抽出される。ここで、「シンボル情報」とは、シンボル定義文の行情報及びシンボルの種別情報をいう。図2に示すソースプログラムを例にとって説明すると、17行目にクラスの定義文があるため、行情報が「17行目」、種別情報が「クラス」となる。なお、抽出されたシンボル情報は、例えば、行情報をキーとして昇順に保持される。
FIG. 11 shows a main routine of processing for extracting a comment from the source program.
In step 10, the source program file 32 is read from the external storage device 30, and symbol information in the source program is extracted. Here, “symbol information” refers to line information and symbol type information of a symbol definition sentence. Taking the source program shown in FIG. 2 as an example, since there is a class definition statement on the 17th line, the line information is “17th line” and the type information is “class”. Note that the extracted symbol information is held in ascending order using, for example, line information as a key.

ステップ11では、ファイルに関するコメントを抽出するサブルーチンがコールされる。抽出されたコメントは、例えば、コメントの種別,仕様書に対するコメント項目をキーとしてテーブル形式で保持される(以下同様)。
ステップ12では、次のシンボル情報が読み込まれる。即ち、最初の処理においては1番目のシンボル情報が読み込まれ、それ以降の処理においては2番目,3番目,・・・・・…のシンボル情報が読み込まれる。
In step 11, a subroutine for extracting comments regarding the file is called. The extracted comments are held in a table format using, for example, comment types and comment items for specifications as keys (the same applies hereinafter).
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,... Symbol information is read in the subsequent processes.

ステップ13では、シンボル情報をパラメータとして、シンボルに関するコメントを抽出するサブルーチンがコールされる。
ステップ14では、シンボルに関するコメントの抽出が、ソースプログラムファイル32の終端まで行われたか否か、即ち、コメントの抽出が完了したか否かが判定される。そして、コメントの抽出が完了したならば処理を終了し(Yes)、コメントの抽出が完了していなければステップ12へと戻る(No)。
In step 13, a subroutine for extracting a comment regarding the symbol is called using the symbol information as a parameter.
In step 14, it is determined whether or not the extraction of the comment regarding the symbol has been performed up to the end of the source program file 32, that is, whether or not the extraction of the comment has been completed. If the comment extraction is completed, the process is terminated (Yes). If the comment extraction is not completed, the process returns to Step 12 (No).

図12は、ステップ11においてコールされるサブルーチン、即ち、ファイルに関するコメントを抽出するサブルーチンを示す。
ステップ20では、ファイルに関するコメントの抽出範囲を求めるサブルーチンがコールされる。
ステップ21では、ステップ20において求められたコメントの抽出範囲から、プログラム仕様書に対応するコメント項目を抽出するサブルーチンがコールされる。
FIG. 12 shows a subroutine called in step 11, that is, a subroutine for extracting a comment relating to a file.
In step 20, a subroutine for obtaining the extraction range of the comment regarding the file is called.
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.

図13は、ステップ13においてコールされるサブルーチン、即ち、シンボルに関するコメントを抽出するサブルーチンを示す。
ステップ30では、シンボルに関するコメントの抽出範囲を求めるサブルーチンがコールされる。
ステップ31では、ステップ30において求められたコメントの抽出範囲から、プログラム仕様書に対応するコメント項目を抽出するサブルーチンがコールされる。なお、ここでコールされるサブルーチンは、先のステップ21でコールされるサブルーチンと同一である。
FIG. 13 shows a subroutine called in step 13, that is, a subroutine for extracting a comment related to the symbol.
In step 30, a subroutine for obtaining a comment extraction range for the symbol is called.
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.

図14は、ステップ20でコールされるサブルーチン、即ち、ファイルに関するコメントの抽出範囲を求めるサブルーチンを示す。
ステップ40では、ソースプログラムの1行目の内容が取り出される。
ステップ41では、取り出された1行目の内容が実行文であるか否かが判定される。ここで、「実行文」とは、コメント行以外の文をいい、例えば、ソースプログラムがC++言語で記述されている場合、「#define」文等のプリプロセッサの処理対象文,変数の定義文,クラスの定義文等が該当する。そして、1行目の内容が実行文であれば、ソースプログラム中にはファイルに関するコメントがないと判断し、ステップ47へと進む(Yes)。一方、1行目の内容が実行文でなければ(即ち、コメント行)ステップ42へと進む(No)。
FIG. 14 shows a subroutine called in step 20, that is, a subroutine for obtaining a comment extraction range for a file.
In step 40, the contents of the first line of the source program are fetched.
In step 41, it is determined whether or not the content of the first line taken out is an executable statement. Here, the “executed statement” means a statement other than a comment line. For example, when the source program is written in the C ++ language, a preprocessor processing target statement such as a “#define” statement, a variable definition statement, This applies to class definition statements. If the content of the first line is an executable statement, it is determined that there is no comment about 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 (ie, a comment line), the process proceeds to step 42 (No).

ステップ42では、1行目の内容がシンボルのセパレータであるか否かが判定される。ここで、シンボルのセパレータは、図9に示す抽出キーワードの設定画面100で設定されたものが基準となる(以下同様)。そして、シンボルのセパレータであれば、ソースプログラムの1行目はシンボルに関するコメントであると判断できるので、ファイルに関するコメントがないと判断して、ステップ47へと進む(Yes)。一方、シンボルのセパレータでなければ、ファイルに関するコメントの開始行であると判断し、ステップ43へと進む(No)。   In step 42, it is determined whether or not the content of the first line is a symbol separator. Here, the symbol separator is based on the one set on the extraction keyword setting screen 100 shown in FIG. 9 (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 related to the symbol, so that it is determined that there is no comment related 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 that the comment is a start line for the file, and the process proceeds to step 43 (No).

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

ステップ45では、行内容がファイルのセパレータであるか否かが判定される。そして、ファイルのセパレータであれば、ファイルに関するコメントの終了行であると判断して、ステップ47へと進む(Yes)。一方、ファイルのセパレータでなければ、ファイルに関するコメントが続いていると判断して、ステップ46へと進む(No)。   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 it is the end line of a comment relating to 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 relating to the file continue, and the process proceeds to step 46 (No).

ステップ46では、行内容がシンボルのセパレータであるか否かが判定される。そして、シンボルのセパレータであれば、前行でファイルに関するコメントが終了したと判断して、ステップ47へと進む(Yes)。一方、シンボルのセパレータでなければ、ファイルに関するコメントが続いていると判断して、ステップ43へと戻る(No)。ここで、このような判定を行っているのは、例えば、ファイルに関するコメントの終了を表すセパレータがない場合を考慮したものである。   In step 46, it is determined whether the line content is a symbol separator. If it is a symbol separator, it is determined that the comment on the file has been completed in the previous line, and the process proceeds to step 47 (Yes). On the other hand, if it is not a symbol separator, it is determined that comments relating to the file continue, and the process returns to step 43 (No). Here, such a determination is made in consideration of, for example, a case where there is no separator indicating the end of a comment related to a file.

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

図15は、ステップ30でコールされるサブルーチン、即ち、シンボルに関するコメントの抽出範囲を求めるサブルーチンを示す。
ステップ50では、シンボル定義行の1行前の内容が取り出される。ここで、シンボル定義行は、ステップ13でシンボルに関するサブルーチン(図13参照)をコールしたときのパラメータ(シンボル情報)の内容に基づき特定される。例えば、図2のソースプログラムの場合には、シンボル(クラス)の定義文が17行目にあるため、16行目の内容が取り出される。
FIG. 15 shows a subroutine called in step 30, that is, a subroutine for obtaining a comment extraction range regarding symbols.
In step 50, the contents one line before the symbol definition line are fetched. Here, the symbol definition line is specified based on the content of the parameter (symbol information) when the subroutine related to the symbol (see FIG. 13) is called in step 13. For example, in the case of the source program of FIG. 2, since the definition statement of the symbol (class) is on the 17th line, the contents on the 16th line are extracted.

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

ステップ52では、シンボル定義文の1行前の内容が他のセパレータ、即ち、ファイル及び他のシンボルのセパレータであるか否かが判定される。そして、他のセパレータであれば、シンボルに関するコメントがないと判断して、ステップ56へと進む(Yes)。一方、他のセパレータでなければ、シンボルに関するコメントの終了行であると判断して、ステップ53へと進む(No)。   In step 52, it is determined whether or not the content of the symbol definition sentence one line before is another separator, that is, a separator of a file and another symbol. If it is another separator, it is determined that there is no comment regarding the symbol, and the process proceeds to step 56 (Yes). On the other hand, if it is not another separator, it is determined that it is the end line of the comment related to the symbol, and the process proceeds to step 53 (No).

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

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

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

図16は、ステップ21及びステップ31でコールされるサブルーチン、即ち、プログラム仕様書に必要なコメント項目を抽出するサブルーチンを示す。
ステップ60では、ファイル又はシンボルに関するコメント行の1行目の内容が取り出される。ここで、取り出される内容は、コメント行を表すコメント識別子、例えば、図2に示すソースプログラムのファイルに関するコメントでは、「/*」及び「*/」を除いた「************」が取り出される。
FIG. 16 shows a subroutine called in step 21 and step 31, that is, a subroutine for extracting comment items necessary for the program specification.
In step 60, the contents of the first line of the comment line relating to the file or symbol are retrieved. Here, the content to be extracted is a comment identifier representing a comment line, for example, “***” except “/ *” and “* /” in the comment relating to the source program file shown in FIG. “***” is taken out.

ステップ61では、コメント行の内容が仕様書情報であるか否かが判定される。そして、仕様書情報であればステップ62へと進み(Yes)、仕様書情報でなければステップ64へと進む(No)。
ステップ62では、仕様書情報に応じたコメント項目を格納する配列の要素番号、ポインタ等が変更される。
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).
In step 62, the element number, pointer, etc. of the array for storing the comment items according to the specification information are changed.

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

ステップ64では、コメント項目の格納先が設定済みであるか否かが判定される。即ち、ステップ62の処理で格納先が変更(設定)されたか否かが判定される。このような判定を行うためには、格納先が未設定の場合には、格納先として「NULL」を設定しておけばよい。そして、格納先が設定済みであればステップ65へと進み(Yes)、格納先が未設定であればステップ63へと進む(No)。ここで、格納先が未設定である場合の例としては、コメント行の1行目を処理しているときであって、その行がセパレータである場合である。   In step 64, it is determined whether or not the comment item storage destination has been set. That is, it is determined whether or not the storage destination has been changed (set) in the process of step 62. In order to make such a determination, if the storage destination is not 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 the case where the storage destination is not set is when the first 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 inserted in a source program, a separator for identifying a comment type is inserted when the source program is described. When the inserted separator information is set when creating the program specification, the range of each comment is extracted based on the separator information. At this time, even if a comment related to the file and a comment related to the symbol are adjacent to each other at the beginning of the file, the range is accurately and reliably identified by the separator for identifying both. Thereafter, in the extracted range, each comment item corresponding to each comment is extracted, and a program specification is generated.

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

なお、以上説明した仕様書作成装置では、プログラム言語としてC++言語により記述されたソースプログラムを処理対象としたが、他のプログラム言語、例えば、RASIC,COBOL,FORTRAN,Java等を処理対象としてもよい。   In the specification creating apparatus described above, the source program written in the C ++ language is the processing target, but other program languages, for example, RASIC, COBOL, FORTRAN, Java, etc. may be the processing target. .

このような機能を実現するプログラムを、例えば、磁気テープ,磁気ディスク,磁気ドラム,ICカード,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, or a CD-ROM, the program for creating a program specification according to the present invention is put on the market. It can be distributed. And the person who acquired such a recording medium can construct | assemble the program specification preparation apparatus based on this invention easily using a general electronic computer, for example.

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

本発明に係る仕様書作成装置の全体構成図である。It is a whole block diagram of the specification preparation apparatus which concerns on this invention. 処理対象となるソースプログラムの第1例を示す図である。It is a figure which shows the 1st example of the source program used as a process target. 処理対象となるソースプログラムの第2例を示す図である。It is a figure which shows the 2nd example of the source program used as a process target. 処理対象となるソースプログラムの第3例を示す図である。It is a figure which shows the 3rd example of the source program used as a process target. 処理対象となるソースプログラムの第4例を示す図である。It is a figure which shows the 4th example of the source program used as a process target. 生成されるプログラム仕様書の一例を示す図である。It is a figure which shows an example of the program specification produced | generated. 仕様書作成手順の流れを示すフローチャートである。It is a flowchart which shows the flow of a specification preparation procedure. 抽出キーワードの設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of an extraction keyword. 抽出キーワードの設定画面の一例を示す図である。It is a figure which shows an example of the setting screen of an extraction keyword. 設定された抽出キーワードを示し、(A)はファイルに関するコメント情報、(B)はクラスに関するコメント情報を示す。A set extraction keyword is shown, (A) shows comment information about a file, and (B) shows comment information about a class. コメントを抽出するメインルーチンのフローチャートである。It is a flowchart of the main routine which extracts a comment. ファイルに関するコメントを抽出するサブルーチンのフローチャートである。It is a flowchart of the subroutine which extracts the comment regarding a file. シンボルに関するコメントを抽出するサブルーチンのフローチャートである。It is a flowchart of the subroutine which extracts the comment regarding a symbol. ファイルに関するコメントの抽出範囲を求めるサブルーチンのフローチャートである。It is a flowchart of the subroutine which calculates | requires the extraction range of the comment regarding a file. シンボルに関するコメントの抽出範囲を求めるサブルーチンのフローチャートである。It is a flowchart of the subroutine which calculates | requires the extraction range of the comment regarding a symbol. 仕様書に必要なコメント項目を抽出するサブルーチンのフローチャートである。It is a flowchart of the subroutine which extracts the comment item required for a specification.

Claims (8)

ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定手段と、
該セパレータ設定手段により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定手段と、
前記セパレータ設定手段により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出手段と、
該コメント範囲抽出手段により抽出された各コメントの範囲毎に、前記キーワード設定手段により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出手段と、
該コメント項目抽出手段により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成手段と、
を含んで構成されたことを特徴とするプログラム仕様書作成装置。
Separator setting means for setting, via a graphical user interface, a separator for identifying various comments inserted in the source program for each source program ;
For each separator set by the separator setting means, keyword setting means for setting an extraction keyword for a comment item corresponding to the program specification via a graphical user interface ;
Comment range extracting means for extracting the 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 extracted keyword set by the keyword 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;
An apparatus for creating a program specification characterized by comprising
前記セパレータは、各種コメントの開始行と終了行を特定する構成である請求の範囲第1項記載のプログラム仕様書作成装置。   2. The program specification creation device according to claim 1, wherein the separator is configured to identify a start line and an end line of various comments. 前記セパレータ設定手段は、少なくとも、ファイルに関するコメントとシンボルに関するコメントとを識別するセパレータを設定させる構成である請求の範囲第1項記載のプログラム仕様書作成装置。 The separator setting means, at least, program specification creation device ranging first claim of claim is configured to set the separator identifies the comments on comments and symbols for files. 前記コメント範囲抽出手段は、前記セパレータ設定手段によりセパレータが設定されていないコメントに対しては、他のコメントのセパレータ又は実行文に基づいて、コメントの範囲を抽出する構成である請求の範囲第1項記載のプログラム仕様書作成装置。   The comment range extraction unit is configured to extract a comment range based on a separator or an executable statement of another comment for a comment for which a separator is not set by the separator setting unit. Program specification creation device described in the section. 前記コメント範囲抽出手段は、ファイルの先頭部分において2つのコメントが隣接して挿入され、かつ、前記セパレータ設定手段によりセパレータが設定されていないときには、前記2つのコメントの間に挿入された実行文に基づいて、コメントの範囲を抽出する構成である請求の範囲第1項記載のプログラム仕様書作成装置。   The comment range extracting means inserts an executable statement inserted between the two comments when two comments are inserted adjacent to each other at the beginning of the file and no separator is set by the separator setting means. The program specification creation device according to claim 1, which is configured to extract a comment range based on the program. 前記コメント項目抽出手段は、ソースプログラムを記述したプログラム言語に応じたコメント識別子を取り除いたコメント項目を抽出する構成である請求の範囲第1項記載のプログラム仕様書作成装置。   2. The program specification creation device according to claim 1, wherein the comment item extraction unit is configured to extract a comment item from which a comment identifier corresponding to a program language describing a source program is removed. ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定工程と、
該セパレータ設定工程により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定工程と、
前記セパレータ設定工程により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出工程と、
該コメント範囲抽出工程により抽出された各コメントの範囲毎に、前記キーワード設定工程により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出工程と、
該コメント項目抽出工程により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成工程と、
をコンピュータに実行させることを特徴とするプログラム仕様書作成方法。
For each source program, a separator setting step for setting a separator for identifying various comments inserted in the source program via a graphical user interface ;
A keyword setting step for setting an extraction keyword of a comment item corresponding to the program specification via a graphical user interface for each separator set by the separator setting step;
Based on the separator set by the separator setting step, a comment range extraction step for extracting the range of each comment of the source program,
For each comment range extracted by the comment range extraction step, a comment item extraction step for extracting a comment item from the source program based on the extracted keyword set by the keyword setting step;
A program specification generation step for generating a program specification based on the comment item extracted by the comment item extraction step;
A program specification creating method characterized in that a computer is executed .
ソースプログラム毎に、ソースプログラムに挿入された各種コメントを識別するセパレータを、グラフィカルユーザインタフェースを介して設定させるセパレータ設定機能と、
該セパレータ設定工程により設定されたセパレータ毎に、プログラム仕様書に対応するコメント項目の抽出キーワードを、グラフィカルユーザインタフェースを介して設定させるキーワード設定機能と、
前記セパレータ設定機能により設定されたセパレータに基づいて、ソースプログラムの各コメントの範囲を抽出するコメント範囲抽出機能と、
該コメント範囲抽出機能により抽出された各コメントの範囲毎に、前記キーワード設定機能により設定された抽出キーワードに基づいて、ソースプログラムからコメント項目を抽出するコメント項目抽出機能と、
該コメント項目抽出機能により抽出されたコメント項目に基づいて、プログラム仕様書を生成するプログラム仕様書生成機能と、
をコンピュータに実現させるためのプログラム仕様書作成プログラムを記録したコンピュータ読取可能な記録媒体。
For each source program, a separator setting function for setting a separator for identifying various comments inserted in the source program via a graphical user interface ;
A keyword setting function for setting an extraction keyword of a comment item corresponding to a program specification via a graphical user interface for each separator set by the separator setting step;
A comment range extracting function for extracting the range of each comment of the source program based on the separator set by the separator setting function;
For each comment range extracted by the comment range extraction function, a comment item extraction function for extracting a comment item from the source program based on the extracted keyword set by the keyword setting function;
A program specification generation function for generating a program specification based on the comment item extracted by the comment item extraction function;
The computer-readable recording medium which recorded the program specification preparation program for making a computer implement | achieve .
JP2000601522A 1999-02-24 1999-02-24 PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM Expired - Fee Related JP3886726B2 (en)

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 (2)

Publication Number Publication Date
JPWO2000050988A1 JPWO2000050988A1 (en) 2002-06-11
JP3886726B2 true JP3886726B2 (en) 2007-02-28

Family

ID=14235009

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000601522A Expired - Fee Related JP3886726B2 (en) 1999-02-24 1999-02-24 PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM

Country Status (2)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007034813A (en) * 2005-07-28 2007-02-08 National Institute Of Advanced Industrial & Technology Software description generation system for multiple natural languages

Family Cites Families (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 extractor
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

Also Published As

Publication number Publication date
WO2000050988A1 (en) 2000-08-31

Similar Documents

Publication Publication Date Title
US6571248B1 (en) Data processing method and apparatus
US7721253B2 (en) Software development support system
US20020062477A1 (en) Program specification generating system
JP2009521026A (en) Method and system for editing text with search and replace functions that leverage derivation of search and replace inputs
JP2973913B2 (en) Input sheet system
JP4833326B2 (en) Code editing program and code editing apparatus
EP0661650B1 (en) Document editing apparatus
JP3886726B2 (en) PROGRAM SPECIFICATION CREATION DEVICE, PROGRAM SPECIFICATION CREATION METHOD, AND RECORDING MEDIUM CONTAINING PROGRAM SPECIFICATION CREATION PROGRAM
JPWO2000050988A1 (en) Program specification creation device, program specification creation method, and recording medium recording a program specification creation program
JPH11143695A (en) External application interlocking method and apparatus and recording medium recording external application interlocking program
JP2007122370A (en) Project information management system
JP2007079906A (en) Source code generator
JP3904430B2 (en) Gaiji font creation system, program recording medium and program
KR100872851B1 (en) WLML-based user interface development device and method
JPH05307472A (en) Program parts information reusing device
JP4458491B2 (en) Test command file creation system, method and program
JP4792950B2 (en) Data management device
JP2990701B2 (en) File editing method
JP2006285754A (en) Automatic program source code generator
JP2010026589A (en) Information processor and program
JP3557439B2 (en) Computer operation data search method and apparatus therefor
JP2001282514A (en) HCP chart generation apparatus, HCP chart generation method, and recording medium recording HCP chart generation program
JP2001350742A (en) Embedded glossary information display device
JPS63226730A (en) Automatic program forming method
JPH096586A (en) Graphical user interface operation device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040908

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060815

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061011

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20061121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061122

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091201

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101201

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111201

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111201

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121201

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121201

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131201

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees