JPS61160139A - Automatic stepping editor of program list - Google Patents

Automatic stepping editor of program list

Info

Publication number
JPS61160139A
JPS61160139A JP28145684A JP28145684A JPS61160139A JP S61160139 A JPS61160139 A JP S61160139A JP 28145684 A JP28145684 A JP 28145684A JP 28145684 A JP28145684 A JP 28145684A JP S61160139 A JPS61160139 A JP S61160139A
Authority
JP
Japan
Prior art keywords
block structure
source program
list
sentence
editing
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
JP28145684A
Other languages
Japanese (ja)
Inventor
Isao Takano
高野 功
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP28145684A priority Critical patent/JPS61160139A/en
Publication of JPS61160139A publication Critical patent/JPS61160139A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To form a stepped list rapidly and precisely by analyzing a block structure, and while stepping respective blocks in accordance with the hierarchical levels of respective blocks, editing and outputting data. CONSTITUTION:The block structure analyzing part 12 of an automatic stepping editor 1 reads out a source program 2 temporally stored in a reading part 11 in each sentence, and if the read sentence is a starting sentence or an end sentence, the hierarchical level is increased by one step or reduced by one step respectively to form a block structure information table and hold the table in a structure information holding part 13. After the analysis of the block structure, a list editing part 14 executes the stepping edition of the list for a source program received from the source program reading part 11 while referring a block structure information table held in an information holding part 13. A list output part 15 receiving the edited result outputs a stepped source program list 3.

Description

【発明の詳細な説明】 発明の目的 産業上の利用分野 本発明は、電子計算機システムで使用するソース・プロ
グラムリストの自動段付は編集装置に関するものである
DETAILED DESCRIPTION OF THE INVENTION Object of the Invention Industrial Field of Application The present invention relates to an editing apparatus for automatically grading a source program list used in an electronic computer system.

従来の技術 ソース・プログラムのリストは、プログラムの開発や保
守を行う上で不可欠のものであり、プログラムの内容を
容易に把握できるように編集されることが望ましい。
A list of conventional technology source programs is essential for program development and maintenance, and it is desirable that the list be edited in such a way that the contents of the program can be easily understood.

ALGOL等の高水準言語で記述されるソース・プログ
ラムは、BEGTN等の開始文とEND等の終了文で区
切られるブロックの集合から構成されており、その内容
を理解するにはブロック構造を把握することが重要であ
る。ブロック構造の把握を容易にする上で、ブロックの
階層レベルに応じて記述文の開始列位置を下げたいわゆ
る段付はリストを作成するのが有効である。
A source program written in a high-level language such as ALGOL is composed of a set of blocks separated by a start statement such as BEGTN and an end statement such as END, and in order to understand its contents, it is necessary to grasp the block structure. This is very important. In order to make it easier to understand the block structure, it is effective to create a so-called stepped list in which the starting column position of the descriptive sentence is lowered according to the hierarchical level of the block.

発明が解決しようとする問題点 従来は、上記ソース・プログラム・リストの段付けをソ
ース・プログラムの作成者が人手で行っていたため、繁
雑であり、また段付けに間違いを生じ易いため内容の把
握がかえって困難になりかねないという問題があった。
Problems to be Solved by the Invention Conventionally, the creator of the source program manually arranged columns in the source program list, which was tedious and easy to make mistakes, making it difficult to understand the contents. The problem was that it could actually become more difficult.

発明の構成 問題点を解決するための手段 上記従来技術の問題点を解決する本発明の自動段付は編
集装置は、ブロック構造のソース・プログラムについて
、開始文を読取るたびに階層レベルを増加させ、終了文
を読取るたびに階層レベルを減少させつつ、ブロック構
造を解析するブロック構造解析手段と、各ブロックに対
しその階層レベルに応じた段付けを行いつつ編集出力す
る手段とを備えることにより、迅速・確実に段付はリス
トを作成できるように構成されている。
Means for Solving the Constituent Problems of the Invention The automatic indentation editing device of the present invention, which solves the problems of the prior art described above, increases the hierarchy level each time a start sentence is read for a block-structured source program. , by providing a block structure analysis means for analyzing the block structure while decreasing the hierarchical level each time an end sentence is read, and a means for editing and outputting each block while grading each block according to its hierarchical level, The system is structured so that you can quickly and reliably create a list.

以下9本発明の作用を実施例によって詳細に説明する。Hereinafter, the effects of the present invention will be explained in detail using nine examples.

実施例 第1図は1本発明の一実施例の自動段付は編集装置の構
成を示すブロック図である。
Embodiment FIG. 1 is a block diagram showing the configuration of an automatic indentation and editing apparatus according to an embodiment of the present invention.

この自動段付は編集装置1は、ブロックの集合から成る
ブロック構造を有するソース・プログラム1を読取って
一時蓄積するソース・プログラム読取部11と、読取部
11からソース・プログラムを1文ずつ受取ってそのブ
ロック構造を解析するブロック構造解析部12と、解析
されたブロック構造に関する情報を保持する構造情報保
持部13と、この構造情報に基づきソース・プログラム
のリストを編集するリスト編集部14と1編集済みリス
トをソース・プログラム・リスト3として出力するリス
ト出力部15を備えている。
The editing device 1 has a source program reading section 11 that reads and temporarily stores a source program 1 having a block structure consisting of a set of blocks, and receives the source program one sentence at a time from the reading section 11. A block structure analysis section 12 that analyzes the block structure, a structure information holding section 13 that holds information regarding the analyzed block structure, and a list editing section 14 that edits a source program list based on this structure information. The program includes a list output section 15 that outputs a completed list as a source program list 3.

この自動段付は装置lは、コンパイラの一部として構成
されていてもよいし、独立の装置として構成されていて
もよい。
This automatic indentation device 1 may be configured as a part of the compiler, or may be configured as an independent device.

自動段付は編集の対象となるソース・プログラム2は、
第2回の段付は編集前のリストで例示するように、BE
GIN、IF、LOOP等の開始文とEND等の終了文
で区切られたブロックから構成されている。
The source program 2 to be edited with automatic indentation is
The second step is BE
It consists of blocks separated by starting statements such as GIN, IF, LOOP, etc. and ending statements such as END.

自動段付は編集装置1のブロック構造解析部12は、読
取部11に一時蓄積されたソース・プログラム2を1文
ずつ読取り、読取った文が開始文であれば階層レベルを
1ステツプ増加させ、終了文であれば階層レベルを1ス
テツプだけ減少させることにより、ブロック構造情報テ
ーブルを作成しこれを構造情報保持部13に保持させる
For automatic paragraphing, the block structure analysis unit 12 of the editing device 1 reads the source program 2 temporarily stored in the reading unit 11 one sentence at a time, and if the read sentence is the start sentence, increases the hierarchy level by one step, If it is an end sentence, the hierarchy level is decreased by one step to create a block structure information table and this is held in the structure information holding section 13.

上記ブロック構造情報テーブルは、第3図に例示するよ
うに、レコード番号(R)フィールドとブロック構造情
報フィールドから成り、後者は更に階層レベル(L)フ
ィールドと、この階層レベルに属する単一の文又は一連
の大群の開始行及び終了行のそれぞれを表示するフィー
ルドから成っている。
The block structure information table, as illustrated in FIG. or fields for displaying each of the starting and ending rows of a series of swarms.

すなわち、第2図に例示したソース・プログラムの場合
、ブロック構造解析部12の処理によって、レコード番
号(R)■のブロック構造情報フィールドには、1行目
が最初の開始文BIGINであることに対応して9階層
レベル0とそれぞれlである開始行と終了行が記録され
る。また、レコード番号2のブロック構造情報フィール
ドには。
That is, in the case of the source program illustrated in FIG. 2, the block structure information field of record number (R) ■ indicates that the first line is the first start statement BIGIN through the processing of the block structure analysis unit 12. Correspondingly, nine hierarchy levels 0 and a start line and an end line, respectively l, are recorded. Also, in the block structure information field of record number 2.

ソース・プログラムの2行目が開始文直後の新たな開始
文BIGINであることに対応して1階層レベルlとそ
れぞれ2である開始行と終了行が記録される。さらに、
レコード番号3のブロック構造情報フィールドには、I
F文の直後の3行目から新たな開始文LOOPの直前の
8行目までの一連の大群に対応して2階層レベル2と、
開始行3及び終了行8が記録される。
Corresponding to the fact that the second line of the source program is a new start statement BIGIN immediately after the start statement, a start line and an end line each having a level 1 and 2 are recorded. moreover,
The block structure information field of record number 3 contains I
Corresponding to the series of large groups from the 3rd line immediately after the F sentence to the 8th line immediately before the new start sentence LOOP, there are 2 hierarchical levels 2,
A start line 3 and an end line 8 are recorded.

以下同様にして、レコード番号3.4.5・・・・・の
ブロック構造情報フィールドには1階層レベル(L )
とこの階層レベルに属する単一の文又は一連の大群の開
始行と終了行が記録される。
In the same way, the block structure information field of record numbers 3, 4, 5, etc. is set to the 1st layer level (L).
and the start and end lines of a single statement or series of groups belonging to this hierarchy level are recorded.

上記ブロック構造の解析が終了すると、リスト編集部1
4は、ソース・プログラム読取り部11から受は取った
ソース・プログラムに対し、情報保持部13に保持され
たブロック構造情報テーブルを参照しつつリストの段付
は編集を行う。これを受取ったリスト出力部15は2段
付は編集されたソース・プログラム・リスト3を出力す
る。段付は編集後のソース・プログラム、リスト3は。
When the analysis of the above block structure is completed, the list editing section 1
4 edits the columnarization of the list for the source program received from the source program reading section 11 while referring to the block structure information table held in the information holding section 13. Upon receiving this, the list output unit 15 outputs the edited source program list 3 with two columns. The steps are the edited source program, List 3.

第4図に例示するように、各ブロックの開始文と終了文
の先頭位置が同一列内に表示され9階層レベルが大きい
ブロックはど大きな字下げが行ねるように表示され、ブ
ロック構造が一目瞭然となっている。
As shown in Figure 4, the beginning positions of the start and end sentences of each block are displayed in the same column, and blocks with nine higher hierarchical levels are displayed with a larger indentation, making the block structure clear at a glance. It becomes.

ブロック構造解析部12の解析動作の一例を。An example of the analysis operation of the block structure analysis section 12.

第5図のフローチャートに基づき説明する。This will be explained based on the flowchart shown in FIG.

ブロック構造解析部12において処理が開始されるとま
ず、ステップ21において、レコード番号Rが1に1階
層レベルLが0に1行数nが1になるように、それぞれ
初期設定が行われる。次のステップ22において、ソー
ス・プログラム読取部11に一時蓄積されているソース
・プログラムの最初の1文が読取られ、これが開始文で
あるか否かが1次のステップ23で判定される。これが
開始文でなければ2次のステップ24において終了文で
あるか否かが判定され、終了文でもなければ、ステップ
25において行数nが歩進されたのち、ステップ22に
おいてソース・プログラム読取部11から次の1文の読
取り・が行われる。
When the process is started in the block structure analysis unit 12, first, in step 21, initial settings are performed such that the record number R becomes 1, the first layer level L becomes 0, and the number of lines n becomes 1. In the next step 22, the first sentence of the source program temporarily stored in the source program reading section 11 is read, and in the first step 23 it is determined whether this is a start sentence. If this is not a start sentence, it is determined in the second step 24 whether or not it is an end sentence, and if it is not an end sentence, the number of lines n is incremented in step 25, and then in step 22 the source program reader The next sentence is read from 11.

ステップ23において開始文であることが判定されると
、ステップ26において、ブロック構造テーブル内のレ
コード番号(R)に対応するブロック構造情報フィール
ド内に、レコード番号とブロック構造情報が書込まれる
。すなわち2階層レベルフィールド内には現在の階層レ
ベルLが書込まれ、開始行フィールド内には現在の行数
nが書込まれる。この書込みが終了すると9次のステッ
プ27において階層レベル(L)が歩進され、更に次の
ステップ30においてレコード番号(R)と行数(n)
がそれぞれ歩進される。次のステップ31において、処
理の未終了が判定されると。
If it is determined in step 23 that it is a start sentence, the record number and block structure information are written in the block structure information field corresponding to the record number (R) in the block structure table in step 26. That is, the current hierarchy level L is written in the 2nd hierarchy level field, and the current number of rows n is written in the start row field. When this writing is completed, the hierarchy level (L) is incremented in the ninth step 27, and the record number (R) and the number of lines (n) are further incremented in the next step 30.
are each incremented. In the next step 31, it is determined that the process has not been completed.

処理がステップ22に戻り、ソース・プログラム読取部
11から次の1文が読取られる。
The process returns to step 22, and the next sentence is read from the source program reading section 11.

ステップ24において終了文であることが判定されると
、ステップ28において、一つ前のレコード番号(R−
1)に対応する終了行フィールド内に現在の行数nが書
込まれる。この書込みが終了すると、ステップ29にお
いて階層レベル1、が1だけ減少され、ステップ30と
31を経てステップ22に戻り2次の1文が読取られる
If it is determined in step 24 that it is an end sentence, in step 28 the previous record number (R-
The current number of lines n is written in the end line field corresponding to 1). When this writing is completed, the hierarchy level 1 is decreased by 1 in step 29, and the process returns to step 22 via steps 30 and 31 to read the next sentence.

ステップ31において、ソース・プログラム読取部11
に蓄積されているソース・プログラムの全文について解
析が終了したことが判定されるまで、上述の処理が繰り
返され、第3図に例示したようなブロック構造情報テー
ブルが作成される。
In step 31, the source program reading section 11
The above-described process is repeated until it is determined that the analysis of the entire text of the source program stored in the source program has been completed, and a block structure information table as illustrated in FIG. 3 is created.

発明の効果 以上詳細に説明したように9本発明の自動段付は編集装
置は、開始文を読取るたびに階層レベルを増加させ、終
了文を読取るたびに階層レベルを減少させつつ、ブロッ
ク構造を解析するブロック構造解析手段と、各ブロック
に対しその階層レベルに応じた段付けを行いつつ編集出
力する手段とを備えているので、従来と異なり繁雑な手
間をかけることなく、また作業者の錯誤に基づく誤編集
を伴うこともなく迅速・確実に段付はリストを編集し出
力できる。
Effects of the Invention As explained in detail above, the automatic indentation editing device of the present invention increases the hierarchy level each time it reads a start sentence, decreases the hierarchy level each time it reads an end sentence, and improves the block structure. Since it is equipped with a block structure analysis means for analyzing and a means for editing and outputting each block while grading it according to its hierarchical level, unlike conventional methods, it does not require complicated labor and eliminates operator errors. It is possible to quickly and reliably edit and output a list with columns without any editing errors based on the above.

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

第1図は本発明の一実施例の構成を示すブロック図、第
2図は段付は編集前のソース・プログラム・リストを例
示する概念図、第3図は第1図の構造情報保持部13に
保持されるブロック構造情報テーブルの一例を示す概念
図、第4図は段付は編集済みソース・プログラム・リス
トを例示する概念図、第5図は第1図のブロック構造解
析部12の動作の一例を説明するフローチャートである
。 1・・自動段付は編集装置、2・・ソース・プログラム
、3・・ソース・プログラム・リスト。 11・・ソース・プログラム読取部、12・・ブロック
構造解析部、13・・構造情報保持部、14・・リスト
編集部、15・・リスト出力部。
FIG. 1 is a block diagram showing the configuration of an embodiment of the present invention, FIG. 2 is a conceptual diagram illustrating a source program list before editing, and FIG. 3 is a structural information holding section of FIG. 1. 4 is a conceptual diagram illustrating an example of an edited source program list, and FIG. It is a flowchart explaining an example of operation. 1. Automatic columnar editing device, 2. Source program, 3. Source program list. 11: Source program reading unit, 12: Block structure analysis unit, 13: Structure information holding unit, 14: List editing unit, 15: List output unit.

Claims (1)

【特許請求の範囲】[Claims] 開始文と終了文で区切られるブロックの集合から成るソ
ース・プログラムを順次読取り、開始文を読取るたびに
階層レベルを増加させ、終了文を読取るたびに階層レベ
ルを減少させつつ、ブロック構造を解析するブロック構
造解析手段と、該ソース・プログラムのリストを、各ブ
ロックに対しその階層レベルに応じた段付けを行いつつ
、編集出力する編集手段とを備えたことを特徴とするプ
ログラムリストの自動段付け編集装置。
A source program consisting of a set of blocks separated by a start statement and an end statement is read sequentially, and the block structure is analyzed by increasing the hierarchy level each time a start statement is read and decreasing the hierarchy level each time an end statement is read. Automatic columnarization of a program list characterized by comprising a block structure analysis means and an editing means for editing and outputting a list of the source program while grading each block according to its hierarchical level. Editing device.
JP28145684A 1984-12-31 1984-12-31 Automatic stepping editor of program list Pending JPS61160139A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP28145684A JPS61160139A (en) 1984-12-31 1984-12-31 Automatic stepping editor of program list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP28145684A JPS61160139A (en) 1984-12-31 1984-12-31 Automatic stepping editor of program list

Publications (1)

Publication Number Publication Date
JPS61160139A true JPS61160139A (en) 1986-07-19

Family

ID=17639433

Family Applications (1)

Application Number Title Priority Date Filing Date
JP28145684A Pending JPS61160139A (en) 1984-12-31 1984-12-31 Automatic stepping editor of program list

Country Status (1)

Country Link
JP (1) JPS61160139A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01106235A (en) * 1987-10-20 1989-04-24 Nec Corp Display system for error position in source program
JPH0264733A (en) * 1988-08-30 1990-03-05 Fujitsu Ltd Processing system for hierarchized information of logic diagram
JPH02281335A (en) * 1989-03-27 1990-11-19 Bull Hn Inf Syst Inc C language program source blocker

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01106235A (en) * 1987-10-20 1989-04-24 Nec Corp Display system for error position in source program
JPH0264733A (en) * 1988-08-30 1990-03-05 Fujitsu Ltd Processing system for hierarchized information of logic diagram
JPH02281335A (en) * 1989-03-27 1990-11-19 Bull Hn Inf Syst Inc C language program source blocker

Similar Documents

Publication Publication Date Title
JP2765969B2 (en) Schematic data-driven program development support system
JPS61160139A (en) Automatic stepping editor of program list
JPS60200346A (en) Production of program test data
EP0404399A2 (en) Audio editing system
JPH03209542A (en) System and device for automatic production of interlocking test data on communication control program
JPS6254337A (en) Specification displaying system for program hierarchy
JP5174648B2 (en) Program development support device, method and program
JPS6191736A (en) Editing and outputting system for main storage history information
JPS62217320A (en) List compilation processing system
JPH0628377A (en) Business form output device
JPH03271949A (en) Automatic generation system for test environment of program test
JPS61211738A (en) Source program comment managing system
JPH01236324A (en) Program design supporting system
CN116363256A (en) Method and device for realizing visual display of code pictures
JPS63101934A (en) Forming system for maintenance information of assembler language program
CN111610969A (en) Method, system, device and storage medium for adding robot off-line program
JPH01133136A (en) Copyright display system for source program
JPH0490026A (en) Processing flow chart editing device
JPH03237562A (en) Output/formation processing method for microfish
JP2001005703A (en) Method and system for generating text type file
JPS62135958A (en) Simulation system
JPH08179938A (en) Device and method for generating automatic specification
JPH05265731A (en) Global job network diagram producer
JPH0594295A (en) Editing device for plural sub files
JPH01152535A (en) Method and device for managing program