JPH0789318B2 - Program comparison judgment method - Google Patents

Program comparison judgment method

Info

Publication number
JPH0789318B2
JPH0789318B2 JP60052205A JP5220585A JPH0789318B2 JP H0789318 B2 JPH0789318 B2 JP H0789318B2 JP 60052205 A JP60052205 A JP 60052205A JP 5220585 A JP5220585 A JP 5220585A JP H0789318 B2 JPH0789318 B2 JP H0789318B2
Authority
JP
Japan
Prior art keywords
comparison
old
source program
lines
new source
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 - Lifetime
Application number
JP60052205A
Other languages
Japanese (ja)
Other versions
JPS61211737A (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.)
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 JP60052205A priority Critical patent/JPH0789318B2/en
Publication of JPS61211737A publication Critical patent/JPS61211737A/en
Publication of JPH0789318B2 publication Critical patent/JPH0789318B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、ソースプログラム変更において新旧ソースプ
ログラムの変更部分を印刷するに係り、特に、同一部分
と変更部分の判定に好適なプログラム比較判定方法に関
する。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to printing a changed portion of an old and new source program when changing a source program, and more particularly to a program comparison and determination method suitable for determining the same portion and the changed portion. .

〔発明の背景〕[Background of the Invention]

従来のソースプログラム変更チエツクは、特開昭57-123
448号公報で示されるようなソースプログラム編集時の
チエツクがあるが、複数の変更がなされた後の最終チエ
ツクではこの方法を利用できない。複数の変更がなされ
た新ソースプログラムが正しく変更されたかどうかチエ
ツクする方法としては、新旧ソースプログラムを比較し
た結果と変更内容を照合チエツクする方法が有効であ
る。
The conventional source program change check is disclosed in JP-A-57-123.
There is a check at the time of editing a source program as shown in Japanese Patent No. 448, but this method cannot be used in the final check after a plurality of changes have been made. As a method of checking whether or not a new source program that has been changed a plurality of times has been changed correctly, it is effective to check the result of comparing old and new source programs with the changed contents.

しかしながら、第1図で示されるように新旧ソースプロ
グラムの比較判定結果において、実際の変更はaの部分
の削除であるが、比較判定の方法によっては比較結果と
変更箇所が一致しないという問題があった。
However, as shown in FIG. 1, in the comparison judgment result of the old and new source programs, the actual change is the deletion of the portion a, but there is a problem that the comparison result and the changed portion do not match depending on the comparison judgment method. It was

〔発明の目的〕[Object of the Invention]

本発明の目的は、上記問題点を解決するためになされた
もので、内容の全く同じ行が複数ある一般的なソースプ
ログラムに対して任意の変更がなされたとき、その変更
個所を変更前後の新旧ソースプログラムの比較から自動
的に識別するプログラム比較判定方法を提供することに
ある。
The object of the present invention is to solve the above problems, and when an arbitrary change is made to a general source program having a plurality of lines having exactly the same contents, the change points before and after the change are changed. It is to provide a program comparison determination method for automatically identifying from comparison of old and new source programs.

〔発明の概要〕[Outline of Invention]

第1図において、新旧ソースプログラムの比較判定で、
比較結果と変更個所が一致しないのは、DO文やEND文の
様な内容の全く同じ行が複数ありその対応関係を考慮し
てないことに起因する。したがって本発明は連続一致部
分の多い順に同一と判定していくことにより、上記問題
を解決している。即ち、第2図に示されるように比較判
定は最初に9行が連続一致するbの部分を同一と判定
し、次に1行が一致するcの部分を同一と判定する。そ
して残った不一致部分dを新旧ソースプログラムの対応
関係から削除されたと判定する。
In Fig. 1, in the comparison judgment of the old and new source programs,
The reason that the comparison result and the changed part do not match is that there are multiple lines with exactly the same contents such as the DO statement and END statement, and the corresponding relationship is not considered. Therefore, the present invention solves the above-mentioned problem by determining that the areas are the same in descending order of the number of consecutive coincident portions. That is, as shown in FIG. 2, in the comparison determination, first, the portion of b in which 9 rows continuously match is determined to be the same, and then the portion of c in which 1 row matches is determined to be the same. Then, it is determined that the remaining unmatched portion d is deleted from the correspondence between the old and new source programs.

従って、本発明は、修正前の旧ソースプログラムと修正
後の新ソースプログラムの比較判定を行いその判定結果
を印刷する方法において、連続する複数行の一致に基づ
く比較判定基準を設け該比較判定基準の行数を順次減少
させながら連続一致行数の多い部分から順に同一部分を
抽出し、残る部分を追加、削除、置換の修正行と判定す
ることを特徴とする。
Therefore, according to the present invention, in the method of comparing and judging the old source program before correction and the new source program after correction and printing the judgment result, the comparison judgment criterion based on the coincidence of a plurality of consecutive lines is provided. It is characterized in that the same part is sequentially extracted from the part having the largest number of consecutively matching lines while the number of lines is sequentially reduced, and the remaining part is determined as a corrected line for addition, deletion, or replacement.

〔発明の実施例〕Example of Invention

以下、本発明の一実施例につき図面に従って詳細に説明
する。第3図は本発明を適用した電子計算機システムの
構成を示すブロツク図、第4図は比較処理手順を示すフ
ローチャート、第5図は新旧ソースプログラムおよび判
定結果を格納する記憶域のテーブルを示す図である。
An embodiment of the present invention will be described in detail below with reference to the drawings. FIG. 3 is a block diagram showing a configuration of an electronic computer system to which the present invention is applied, FIG. 4 is a flowchart showing a comparison processing procedure, and FIG. 5 is a diagram showing a storage area table for storing old and new source programs and judgment results. Is.

第3図において、1,2は新旧ソースプログラム格納外部
記憶装置、3は中央処理装置、4は比較処理ブロツク、
5,6は比較処理ブロツクで処理する為の新旧ソースプロ
グラムおよび判定結果を格納するテーブル、7は比較結
果を印刷するプリンタ装置である。
In FIG. 3, reference numerals 1 and 2 denote external storage devices for storing old and new source programs, 3 denotes a central processing unit, 4 denotes a comparison processing block,
Reference numerals 5 and 6 are tables for storing old and new source programs and determination results for processing by the comparison processing block, and 7 is a printer device for printing the comparison results.

次に、第4図のフローチャートにより比較処理手順を示
す。最初に新旧ソースプログラム1,2を新旧ソースプロ
グラム格納テーブル5,6にロードし、比較判定基準であ
る連続一致行数Nとして数値16を設定する(ステップ
8)。つぎに新旧ソースプログラム格納テーブルを比較
走査し、N行以上連続一致部分を抽出する(ステップ
9)。N行以上連続一致部分がある場合は一致したこと
を示すフラツグを新旧ソースプログラム格納テーブル5,
6の比較結果エリア12に設定する(ステップ10)。比較
対象が残っている場合はステップ9に戻り、比較対象が
無くなった場合はNの値を1減じる(ステップ11)。N
が0以下でなければステップ9に戻り、Nが0以下なら
ば比較結果エリア12を参照して比較結果をプリンタ装置
7へ出力し印刷する。
Next, the comparison processing procedure will be described with reference to the flowchart of FIG. First, the old and new source programs 1 and 2 are loaded into the old and new source program storage tables 5 and 6, and a numerical value 16 is set as the number N of consecutive coincident lines which is a comparison judgment criterion (step 8). Next, the old and new source program storage tables are compared and scanned, and consecutive matching portions of N lines or more are extracted (step 9). If there is a continuous matching part for N lines or more, a flag indicating the matching is added to the old and new source program storage table 5,
The comparison result area 12 of 6 is set (step 10). When the comparison target remains, the process returns to step 9, and when the comparison target disappears, the value of N is decremented by 1 (step 11). N
Is 0 or less, the process returns to step 9, and if N is 0 or less, the comparison result area 12 is referred to and the comparison result is output to the printer device 7 for printing.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明によれば内容の全く同じ行
が複数行あるソースプログラムに対して任意の変更がな
されたとき、その変更個所を変更前後の新旧ソースプロ
グラムの比較から自動的に識別することができるという
効果が得られる。
As described above, according to the present invention, when an arbitrary change is made to a source program having a plurality of lines having exactly the same contents, the changed portion is automatically identified by comparing the old and new source programs. The effect of being able to do is obtained.

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

第1図は比較方法の問題点を説明するための図、第2図
は本発明の比較判定例を示す説明図第3図は本実施例の
システム構成を示すブロック図、第4図は本実施例の比
較判定処理のフローチャート、第5図は本実施例で使用
するテーブルのフォーマットを示す図である。 a……ソースプログラム変更部分(削除) N……比較判定基準の連続一致行数 1……新ソースプログラム格納外部記憶装置 2……旧ソースプログラム格納外部記憶装置 3……中央処理装置 7……プリンタ装置。
FIG. 1 is a diagram for explaining the problems of the comparison method, FIG. 2 is an explanatory diagram showing an example of comparison judgment of the present invention, FIG. 3 is a block diagram showing the system configuration of the present embodiment, and FIG. FIG. 5 is a flow chart of the comparison / determination process of the embodiment, and FIG. 5 is a diagram showing the format of the table used in this embodiment. a ... Source program changed part (deleted) N ... Number of consecutive matching lines of comparison judgment criteria 1 ... New source program storage external storage device 2 ... Old source program storage external storage device 3 ... Central processing unit 7 ... Printer device.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】修正前の旧ソースプログラムと修正後の新
ソースプログラムの比較判定を行い、その判定結果を印
刷する方法において、 比較判定基準として、連続して一致する複数の行数Nを
設定し、該比較判定基準の上記行数Nを基に比較した結
果、上記行数N以上連続して一致する行がある場合は、
一致する行にフラグを立て、さらに該比較判定基準の行
数を順次減少させながら繰返し検索を行い、残る部分を
追加、削除、置換の修正行と判定することを特徴とする
プログラム比較判定方法。
1. A method for comparing and judging an old source program before modification and a new source program after modification, and printing the judgment result, wherein a plurality of consecutively matching lines N are set as a comparison judgment criterion. Then, as a result of comparison based on the number of rows N of the comparison determination criterion, if there is a row that continuously matches the number of rows N or more,
A program comparison / determination method characterized in that a flag is set to a matching line, and a search is repeatedly performed while the number of lines of the comparison determination criterion is sequentially decreased to determine a remaining portion as a corrected row for addition, deletion, or replacement.
JP60052205A 1985-03-18 1985-03-18 Program comparison judgment method Expired - Lifetime JPH0789318B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60052205A JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60052205A JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Publications (2)

Publication Number Publication Date
JPS61211737A JPS61211737A (en) 1986-09-19
JPH0789318B2 true JPH0789318B2 (en) 1995-09-27

Family

ID=12908272

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60052205A Expired - Lifetime JPH0789318B2 (en) 1985-03-18 1985-03-18 Program comparison judgment method

Country Status (1)

Country Link
JP (1) JPH0789318B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0384627A (en) * 1989-08-29 1991-04-10 Nippon Steel Corp Computer program transfer device
JP4614358B2 (en) * 2006-09-04 2011-01-19 株式会社日立情報システムズ Program source comparison system, comparison method, and program

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US3711863A (en) * 1972-01-21 1973-01-16 Honeywell Inf Systems Source code comparator computer program
JPS59135523A (en) * 1983-01-25 1984-08-03 Riyouden Koki Service Eng Kk Content collating system for cassette loader of programmable controller

Also Published As

Publication number Publication date
JPS61211737A (en) 1986-09-19

Similar Documents

Publication Publication Date Title
AU1125792A (en) Apparatus for storing a database for a computer network
DE69706439D1 (en) COMPUTER SORTING SYSTEM FOR DATA COMPRESSION
JPS5622143A (en) Error processing system
CA2053969A1 (en) Method and apparatus for controlling the deferred execution of user requests in a data processing system
WO1994023376B1 (en) Method and apparatus for goal processing memory management
JPH0789318B2 (en) Program comparison judgment method
EP0466447B1 (en) Method and apparatus for detecting and processing abnormal messages
JPS60186920A (en) Starting method of document processing program
JP2000181700A (en) Program analyzing device and recording medium
JP3421994B2 (en) How to patch electronic exchanges
JP2639349B2 (en) Error correction line search device
JP3112628B2 (en) Case-based processing method
JPS613272A (en) Output information determining method based upon priority
JPH11212738A (en) Printing controller
JPH05233313A (en) Symbol table processing system
JPS62144255A (en) Data file saving processor
JPS5635215A (en) Centralized monitor control method
JPH10269311A (en) Slip processing unit designating method
JPS62138924A (en) Table search control system
JPH0388040A (en) Compile list output system
JPH0546666A (en) Information retrieving device
JPH0336842A (en) Automatic decision processing system for data distribution destination
JPH05241921A (en) System for detecting difference for unit of clause in source file
JPH04242840A (en) Execution step distribution calculating system
JPS63298542A (en) Analysis information collecting system after ending abnormality of system

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term