JPH04370829A - Source code editing system - Google Patents

Source code editing system

Info

Publication number
JPH04370829A
JPH04370829A JP14842591A JP14842591A JPH04370829A JP H04370829 A JPH04370829 A JP H04370829A JP 14842591 A JP14842591 A JP 14842591A JP 14842591 A JP14842591 A JP 14842591A JP H04370829 A JPH04370829 A JP H04370829A
Authority
JP
Japan
Prior art keywords
source code
comment
flow diagram
process flow
text
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.)
Pending
Application number
JP14842591A
Other languages
Japanese (ja)
Inventor
Hiroshi Ishii
浩 石井
Kiyoshi Okubo
清 大久保
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP14842591A priority Critical patent/JPH04370829A/en
Publication of JPH04370829A publication Critical patent/JPH04370829A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To offer source codes which are rich in reliability, productivity, and maintainability by inserting the text of a process flow chart as a comment of the source codes. CONSTITUTION:The process flow chart and source codes are edited at a process flow chart editing part 3 and a source code editing part 4 by using an internal memory 7 and stored in an external storage device 8. A source code comment editing part 6 stores the process flow chart and source codes stored in the external storage device, or a source code translation result in an internal memory and inserts the text in the process flow chart at its corresponding position in the source codes when the number of a key for retrieval in the process flow chart matches the number of a key for correspondence in the source codes. The result is outputted on a display terminal or printer 9.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明は、処理フロー記号に記述
されたテキストをソースコード中に自動的に出力するソ
ースコード編集方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a source code editing method for automatically outputting text written in processing flow symbols into source code.

【0002】0002

【従来の技術】C、PL/1等のプログラミング言語で
は、注釈としてコメントが記述可能である。これを利用
して、処理手順毎の処理内容をコメントに記述すれば、
プログラムを理解するために役立つ。しかし、従来はソ
ースコード編集手段等を用いて、文章を直接ソースコー
ドのコメント中に入力しており、コーディングの効率が
非常に悪かった。
2. Description of the Related Art In programming languages such as C and PL/1, comments can be written as annotations. If you use this and write the processing content for each processing step in a comment,
Helpful for understanding the program. However, in the past, sentences were input directly into source code comments using source code editing means, resulting in very poor coding efficiency.

【0003】これを解決するために、コーディングの前
工程の生産物(処理フロー図等)から文章を抽出して、
ソースコードにコメントとして挿入する手段があるが、
特開昭63−81528号公報に記載のように、処理フ
ロー図にプログラミング言語のキーワード(PL/1で
は、IF、WHEN、DO等の制御キーワード等)と、
説明文(テキスト)を記述しておき、ソースコードを作
成する際にキーワード部のテキストをコメントとしてソ
ースコードに挿入するものであった。
[0003] In order to solve this problem, sentences are extracted from the products of the pre-coding process (processing flow diagrams, etc.) and
There is a way to insert it as a comment in the source code, but
As described in Japanese Unexamined Patent Publication No. 63-81528, programming language keywords (in PL/1, control keywords such as IF, WHEN, DO, etc.) are included in the processing flow diagram.
An explanatory text (text) was written in advance, and when the source code was created, the text of the keyword part was inserted into the source code as a comment.

【0004】0004

【発明が解決しようとする課題】上記従来技術は、処理
フロー図を作成する段階で、キーワードを始めとして、
プログラミング言語に関する相当な知識を必要とする。 また、PL/1言語で開発したプログラムをC言語で書
き替える場合等、プログラミング言語を変えてプログラ
ムを書き替える場合、処理フロー図中のキーワードの書
き替えが必要となり、ソースコードだけでなく処理フロ
ー図等の作り直しも必要になる。本来、処理フロー図等
はプログラミング言語に依存しないものであり、処理フ
ロー図中にプログラミング言語特有のキーワードを記述
するのは好ましくない。
[Problem to be Solved by the Invention] In the above-mentioned conventional technology, at the stage of creating a process flow diagram, starting with keywords,
Requires considerable knowledge of programming languages. In addition, when rewriting a program by changing the programming language, such as when rewriting a program developed in PL/1 language in C language, it is necessary to rewrite the keywords in the processing flow diagram, and it is necessary to rewrite not only the source code but also the processing flow. It will also be necessary to redraw the diagrams, etc. Originally, processing flow diagrams and the like do not depend on programming languages, and it is not desirable to write keywords specific to programming languages in processing flow diagrams.

【0005】本発明の目的は、上記の問題を解決するた
めに、プログラミング言語を意識しない処理フロー図を
作成し、かつ処理フロー図中のテキストをソースコード
中に自動的に挿入できるソースコード編集方式によって
、理解しやすいソースコードを提供することである。
SUMMARY OF THE INVENTION In order to solve the above-mentioned problems, it is an object of the present invention to create a process flow diagram without being aware of the programming language, and to provide a source code editor that can automatically insert text in the process flow diagram into the source code. The objective is to provide source code that is easy to understand.

【0006】[0006]

【課題を解決するための手段】上記目的を達成するため
に必要となるシステム構成例を、図1に示す。
[Means for Solving the Problems] An example of a system configuration required to achieve the above object is shown in FIG.

【0007】処理フロー図入力又はソースコード入力を
行うディスプレイ端末(1)から入力された処理フロー
図又はソースコードは、処理フロー図編集部(3)又は
ソースコード編集部(4)で内部メモリ(7)を用いて
編集され、外部記憶装置(8)に記憶される。ソースコ
ード翻訳部(5)では、外部記憶装置に記憶されたソー
スコードを翻訳する。ソースコードコメント編集部(6
)では、外部記憶装置に記憶された処理フロー図、ソー
スコード又はソースコード翻訳結果を内部メモリに格納
し、処理フロー図中のテキストをソースコード又はソー
スコード翻訳結果中のコメントに挿入する。この結果は
、ディスプレイ端末(1)又はプリンタ(9)に出力で
きる。
[0007] The processing flow diagram or source code input from the display terminal (1) for inputting the processing flow diagram or source code is stored in the internal memory ( 7) and stored in the external storage device (8). The source code translation unit (5) translates the source code stored in the external storage device. Source code comment editorial department (6
), the processing flow diagram, source code, or source code translation result stored in the external storage device is stored in the internal memory, and the text in the processing flow diagram is inserted into the comment in the source code or source code translation result. This result can be output to a display terminal (1) or a printer (9).

【0008】[0008]

【作用】処理フロー図編集部3、ソースコード編集部4
及びソースコードコメント編集部6の働きを図2、図3
、図4、図5を用いて説明する。
[Operation] Processing flow diagram editing section 3, source code editing section 4
The functions of the source code comment editing section 6 are shown in Figures 2 and 3.
, will be explained using FIGS. 4 and 5.

【0009】図2は、処理フロー図の例である。処理フ
ロー図には、フローチャート、SPD(Structu
red Programming Diagram)、
PAD(Problem Analysis Diag
ram)等があるが、ここではPADを用いて説明する
。この例は、数値を入力してそのうちの最大値を求める
プログラムである。処理フロー図編集部3において、こ
のPADを、PADの構造等を表す特殊な言語であるP
AD記述言語に変換し、編集する。この時、PAD記号
それぞれに検索用キーとなるユニークな番号(ここでは
TEXT001等)を割り当てる。この番号は、ソース
コードの対応用キーとの対応をとるためのものであり、
プログラムの処理順でなくても良い。
FIG. 2 is an example of a processing flow diagram. The processing flow diagram includes flowcharts, SPD (Struct.
red Programming Diagram),
PAD (Problem Analysis Diag)
ram), but here we will explain using PAD. This example is a program that inputs numerical values and calculates the maximum value. The processing flow diagram editing unit 3 converts this PAD into PAD, which is a special language expressing the structure of PAD.
Convert to AD description language and edit. At this time, a unique number (such as TEXT001 in this case) is assigned to each PAD symbol as a search key. This number is to correspond with the corresponding key in the source code.
It does not have to be in the order of program processing.

【0010】図3は、ソースコードの例である。プログ
ラミング言語には、C、COBOL、FORTRAN、
PL/1等があるが、ここではPL/1を用いて説明す
る。コーディングの前工程の生産物である処理フロー図
(ここでは図2に示したPAD)を参考にして、PL/
1でコーディングし、ソースコード編集部において編集
する。この時、コメント記号(PL/1では’/*’ま
たは’*/’)中に対応用キー(ここではTEXT00
1等)を記述する。この位置にPADのテキストが挿入
されるため、コメントが読みやすい位置を考慮して、コ
メントの開始カラム位置及びコメントの終了カラム位置
をきめる。
FIG. 3 is an example of source code. Programming languages include C, COBOL, FORTRAN,
Although there are PL/1 and the like, PL/1 will be used for explanation here. PL/
1 and edit it in the source code editor. At this time, the corresponding key (here TEXT00) is inserted in the comment symbol ('/*' or '*/' in PL/1)
1st class). Since the PAD text will be inserted at this position, the comment start column position and comment end column position are determined in consideration of the position where the comment is easy to read.

【0011】図4は、図2で示したPADのテキストを
図3で示したソースコード中に挿入した例である。PA
D中の検索用キーとソースコード中の対応用キーが一致
した場合、一致した検索用キーを持つPAD記号のテキ
ストを、対応する対応用キーがあるソースコード中のコ
メントに出力する。
FIG. 4 is an example in which the text of the PAD shown in FIG. 2 is inserted into the source code shown in FIG. P.A.
When the search key in D matches the corresponding key in the source code, the text of the PAD symbol having the matched search key is output to the comment in the source code that has the corresponding corresponding key.

【0012】図5は、図2、図3、図4のそれぞれ一部
を抽出し、その対応関係を示した例である。PADの検
索用キー(TEXT003)に対応するソースコード中
の対応用キー(TEXT003)の位置に、PADのテ
キストを挿入している。
FIG. 5 is an example in which parts of each of FIGS. 2, 3, and 4 are extracted and their correspondence relationships are shown. The PAD text is inserted at the position of the corresponding key (TEXT003) in the source code corresponding to the PAD search key (TEXT003).

【0013】[0013]

【実施例】以下、図6および図7を用いて本発明の実施
例について説明する。
[Embodiment] An embodiment of the present invention will be described below with reference to FIGS. 6 and 7.

【0014】ソースコード及び処理フロー図を内部メモ
リに入力する(601、602)。ソースコードのかわ
りにソースコード翻訳結果でも良い。
The source code and processing flow diagram are input into internal memory (601, 602). A source code translation result may be used instead of the source code.

【0015】まず、ソースコードを1レコード入力し(
604)、コメント中の対応用キーの有無を判定する(
606)。もし対応用キーが無ければ、さらにソースコ
ードを1レコード入力する。
First, input one record of the source code (
604), determine whether there is a corresponding key in the comment (
606). If there is no corresponding key, input one more record of the source code.

【0016】コメント中の対応用キーがあった場合は、
処理フロー図を1レコード入力し(607)、対応用キ
ーと同じ番号を持つ検索用キーを検索する(610)。 もし処理フロー図のレコード中に、コメント中の対応用
キーと同じ番号を持つ検索用キーがなければ、さらに処
理フロー図を1レコード入力する。処理フロー図の最後
まで検索し、処理フロー図中に対応用キーに対応する検
索用キーを持つレコードが無ければ、エラーメッセージ
を出力し(608、609)、次のソースコードを入力
する。
[0016] If there is a corresponding key in the comment,
One record of the processing flow diagram is input (607), and a search key having the same number as the corresponding key is searched (610). If there is no search key with the same number as the corresponding key in the comment in the record of the process flow diagram, one more record of the process flow diagram is input. If the process flow diagram is searched to the end and there is no record in the process flow diagram that has the search key corresponding to the corresponding key, an error message is output (608, 609) and the next source code is input.

【0017】処理フロー図中に、コメント中の対応用キ
ーと同じ番号を持つ検索用キーがあれば、該当するコメ
ント中に処理フロー図のテキストを挿入する。
If there is a search key with the same number as the corresponding key in the comment in the process flow diagram, the text of the process flow diagram is inserted into the corresponding comment.

【0018】まず、コメント記号間(PL/1では、’
/*’から対応する’*/’まで)に入力可能なコメン
トの文字数をカウントし(611)し、処理フロー図中
のテキストの入力開始位置を初期設定する(612)。 次に処理フロー図のテキストレコードを入力する(61
3)。テキストレコード中には、処理フロー図編集部に
より、テキストの文字数がデータとしてあらかじめ格納
されている。
First, between comment symbols (in PL/1, '
/*' to the corresponding '*/') is counted (611), and the text input start position in the process flow diagram is initialized (612). Next, input the text record of the processing flow diagram (61
3). In the text record, the number of characters of the text is stored in advance as data by the processing flow diagram editing section.

【0019】コメント1行で処理フロー図のテキストが
全て納まる場合は、コメントに処理フロー図のテキスト
を挿入する(615、619)。
If the entire text of the process flow diagram can fit in one line of the comment, the text of the process flow diagram is inserted into the comment (615, 619).

【0020】コメント1行に収まらない場合は、テキス
トの折り曲げが発生する。まず、入力可能な文字数分だ
けコメントに挿入する(615、616)。次に、ソー
スレコードを新規に1行追加し、コメント記号も追加す
る(617)。この1行は、コメントだけの行となる。 この時、コメント記号の開始カラム位置、終了カラム位
置は、1レコード前のレコードの、コメント記号の開始
カラム位置、終了カラム位置にあわせる。処理フロー図
中のテキストの入力開始カラム位置を、入力済みテキス
トの次の文字に更新し(618)、再度コメントの入力
を行う。これを処理フロー図中のテキストを全て挿入す
るまで繰り返す(614)。
[0020] If the comment does not fit on one line, the text will be folded. First, as many characters as can be input are inserted into the comment (615, 616). Next, one new line is added to the source record and a comment symbol is also added (617). This one line is a comment only line. At this time, the start column position and end column position of the comment symbol are set to match the start column position and end column position of the comment symbol in the record one record before. The text input start column position in the process flow diagram is updated to the next character of the input text (618), and the comment is input again. This is repeated until all the text in the process flow diagram is inserted (614).

【0021】以上の処理をソースコードがなくなるまで
繰返す(605)。
The above process is repeated until there is no more source code (605).

【0022】ソースコードがなくなった場合、処理フロ
ー図に未処理の検索用キーがあれば、エラーメッセージ
を出力する(620、621)。
If the source code is lost and there is an unprocessed search key in the processing flow diagram, an error message is output (620, 621).

【0023】[0023]

【発明の効果】本発明によれば、ソースコード中のコメ
ントとして、処理フロー図に記述されたテキストが挿入
されるため、プログラムの処理内容を理解しやすくなる
。これは、テスト工程における不良原因調査や、当該プ
ログラムを開発母体として改造を加える場合等において
、プログラムの処理詳細をつかむ上で効果が高い。さら
に、対応用キーだけをコメントに記述するだけで読みや
すいソースコードが得られるため、コメントの記述にか
かるコーディング工数の削減も期待できる。このように
、プログラムの信頼性、生産性、保守性を高めることが
できる。  また、プログラミング言語に固有なキーワ
ード等を処理フロー図内に記述する必要がない。すなわ
ち、処理フロー図自体は、どのプログラミング言語にも
依存していない。従って、プログラミング言語への依存
性の低い、独立性の高い処理フロー図を得る事ができる
According to the present invention, the text described in the processing flow diagram is inserted as a comment in the source code, making it easier to understand the processing contents of the program. This is highly effective in grasping the processing details of a program when investigating the cause of defects in the testing process or when modifying the program as a development base. Furthermore, because easy-to-read source code can be obtained by simply writing only the corresponding keys in comments, it can be expected to reduce the amount of coding man-hours required to write comments. In this way, the reliability, productivity, and maintainability of the program can be improved. Further, there is no need to describe keywords specific to the programming language in the processing flow diagram. That is, the processing flow diagram itself does not depend on any programming language. Therefore, a highly independent processing flow diagram with low dependence on programming language can be obtained.

【図面の簡単な説明】[Brief explanation of drawings]

【図1】本発明を構成するシステムの一実施例を示す構
成図である。
FIG. 1 is a configuration diagram showing an embodiment of a system constituting the present invention.

【図2】処理フロー図の例としてのPAD図である。FIG. 2 is a PAD diagram as an example of a processing flow diagram.

【図3】ソースコードの記述例である。FIG. 3 is an example of source code description.

【図4】処理フロー図のテキストをソースコード中のコ
メントに挿入した実施例である。
FIG. 4 is an example in which text of a processing flow diagram is inserted into a comment in the source code.

【図5】図2、図3、図4の一部を抽出してPAD、ソ
ースコード、テキスト挿入後のソースコードの関係の例
を示す図である。
FIG. 5 is a diagram showing an example of the relationship between the PAD, the source code, and the source code after text is inserted by extracting a part of FIGS. 2, 3, and 4;

【図6】図1に示した実施例の処理フローを示すフロー
チャートである。
FIG. 6 is a flowchart showing the processing flow of the embodiment shown in FIG. 1;

【図7】図6に続くフローチャートである。FIG. 7 is a flowchart following FIG. 6;

【符号の説明】[Explanation of symbols]

1…ディスプレイ端末、 2…本システムの主処理部、 3…処理フロー図編集部、 4…ソースコード編集部、 5…ソースコード編集部、 6…ソースコードコメント編集部、 7…内部メモリ、 8…外部記憶装置、 9…プリンタ。 1...Display terminal, 2...Main processing section of this system, 3...Processing flow chart editorial department, 4... Source code editorial department, 5... Source code editorial department, 6... Source code comment editorial department, 7...Internal memory, 8...External storage device, 9...Printer.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】検索用記号を持つ処理フロー記号を編集す
る処理フロー図編集部と、コメント中に対応用キーを持
つソースコードを編集するソースコード編集部と、ソー
スコードを翻訳するソースコード翻訳部と、ソースコー
ドの対応用キーと一致する検索用キーを持つ処理フロー
記号のテキストをソースコードのコメントに挿入するソ
ースコードコメント編集部を持つことを特徴とするソー
スコード編集方式。
Claim 1: A processing flow diagram editing section that edits a processing flow symbol that has a search symbol; a source code editing section that edits source code that has a corresponding key in a comment; and a source code translator that translates the source code. and a source code comment editing section for inserting text of a processing flow symbol having a search key that matches a corresponding key in the source code into a source code comment.
JP14842591A 1991-06-20 1991-06-20 Source code editing system Pending JPH04370829A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14842591A JPH04370829A (en) 1991-06-20 1991-06-20 Source code editing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14842591A JPH04370829A (en) 1991-06-20 1991-06-20 Source code editing system

Publications (1)

Publication Number Publication Date
JPH04370829A true JPH04370829A (en) 1992-12-24

Family

ID=15452511

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14842591A Pending JPH04370829A (en) 1991-06-20 1991-06-20 Source code editing system

Country Status (1)

Country Link
JP (1) JPH04370829A (en)

Similar Documents

Publication Publication Date Title
JP4924976B2 (en) Software development support system
US5338976A (en) Interactive language conversion system
JP3476881B2 (en) Specification generator
JPH04370829A (en) Source code editing system
JP3003459B2 (en) Program creation support device
JPH03233670A (en) Text data conversion system
JPH0157812B2 (en)
US20040205666A1 (en) System and method for anticipated file editing
CN115454414B (en) Code processing method and device and computer readable storage medium
JPS61211738A (en) Source program comment managing system
JP3417960B2 (en) Sentence correction support method and device
JPH0540638A (en) Vocabulary analyzing/editing system
JP3419483B2 (en) Natural language processing apparatus and method
JPH04195529A (en) Comment sentence adding system
JPH10283375A (en) Device and method for full-text retrieval
JPH02214935A (en) Production processing method for source program
JPH02116963A (en) Document data processing device
JPS6381528A (en) Program automatic synthesizer
JPH03186933A (en) Symbol processing system for language processing system
JPH0264737A (en) Multilanguage generator
JPH09222999A (en) System and method for tree structure chart conversion
JPH03110630A (en) Module specification generating device for computer program
JPH0816594A (en) Automatic document marking device
JPH1031585A (en) Automatic programming generating system by inputting specification
JPH0546373A (en) Flow chart generation processor