JP2002132544A - Output method for information of program variable - Google Patents

Output method for information of program variable

Info

Publication number
JP2002132544A
JP2002132544A JP2000332109A JP2000332109A JP2002132544A JP 2002132544 A JP2002132544 A JP 2002132544A JP 2000332109 A JP2000332109 A JP 2000332109A JP 2000332109 A JP2000332109 A JP 2000332109A JP 2002132544 A JP2002132544 A JP 2002132544A
Authority
JP
Japan
Prior art keywords
variable
program
analysis target
variable name
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.)
Pending
Application number
JP2000332109A
Other languages
Japanese (ja)
Inventor
Hideyuki Arai
秀之 荒井
Makoto Kogai
眞 小貝
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 JP2000332109A priority Critical patent/JP2002132544A/en
Publication of JP2002132544A publication Critical patent/JP2002132544A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To solve the problem, in a conventional system, that it is difficult to extract names of other variables necessary to change simultaneously to detect dropouts, to find errors and to prevent errors of variables if there are other variables necessary to change simultaneously together with changes of variable names specified by the variables that are not having nothing to do with transmitting relations, not having similar names and not existing on the same lines. SOLUTION: An output method for information of program variable comprises a means to specify the variable names of analyzing objects by inputting a source program, a means to specify a range to extract the names of other variables, a means to extract using points of the names of the objects, a means to extract other variable names used within the specified range and a means to output the extracted other variable names.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、プログラム作成に
おける論理抜け判定、間違いを指摘・防止する方式に係
り、特に変数に関する抜け、間違いを防止するプログラ
ム変数情報出力方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a system for judging a logic omission in program creation and for indicating and preventing errors, and more particularly to a system for outputting program variable information for preventing omissions and errors relating to variables.

【0002】[0002]

【従来の技術】プログラム開発に於いて、既存のプログ
ラムの一部を修正して仕様変更や機能追加を行い、新規
で開発するより、低コストで開発する傾向が強くなって
きている。このため、既存プログラムを理解し、修正に
おける論理抜け判定、間違いを指摘・防止することが重
要になってきた。
2. Description of the Related Art In program development, there is an increasing tendency to develop a program at a lower cost than modifying a part of an existing program to change specifications and add functions. For this reason, it has become important to understand existing programs, determine logic omissions in corrections, and point out and prevent errors.

【0003】従来の方法としては、特開平5−1199
8号公報では、プログラムの仕様変更や機能追加の修正
時に、影響を受ける他の変数を調べるため、解析対象の
ソースプログラムで使用している、変数名を指定して、
当該変数の伝播(代入、比較、演算)関係にある他の変数
を抽出する方法である。
A conventional method is disclosed in Japanese Patent Laid-Open No. 5-1199.
In Japanese Patent Publication No.8, when a program specification change or a function addition is corrected, in order to check other variables affected, a variable name used in a source program to be analyzed is specified.
This is a method of extracting another variable that has a propagation (assignment, comparison, operation) relationship of the variable.

【0004】また、特開平11−327879号公報で
は、変数名が類似した変数を関連する他の変数と見なし
たり、同一行に存在する変数を関連する他の変数と見な
したりする方法である。
Japanese Patent Application Laid-Open No. H11-327879 discloses a method in which a variable having a similar variable name is regarded as another related variable, or a variable existing on the same line is regarded as another related variable.

【0005】[0005]

【発明が解決しようとする課題】従来の方式では、指定
した変数名との当該変数の伝播(代入、比較、演算)関係
にある他の変数を抽出したり、変数名が類似した変数を
関連する他の変数と見なしたり、同一行に存在する変数
を関連する他の変数と見なしたりして、影響を受ける他
の変数名の抽出は可能であるが、伝播関係がない変数や
類似名でない変数や同一行に存在しない変数が、指定し
た変数名の変更と合わせて変更が必要な他の変数があっ
た場合、変数に関する抜けの判定、間違いの発見・防止
する為、合わせて変更が必要な他の変数名の抽出は困難
であった。
In the conventional method, another variable having a propagation (assignment, comparison, operation) relationship of the variable with a designated variable name is extracted, or a variable having a similar variable name is related. It is possible to extract the names of other affected variables by considering other variables that are related to each other or as variables related to the same line, but it is not a variable or similar name that has no propagation relation If a variable or a variable that does not exist on the same line has another variable that needs to be changed along with the change of the specified variable name, it needs to be changed together to judge whether the variable is missing or to detect and prevent mistakes. Extraction of other variable names was difficult.

【0006】[0006]

【課題を解決するための手段】前述した課題を解決する
ために、本発明は、解析対象の変数の使用の前後で使用
される変数の頻度によって関連性を見出す。このため、
伝播関係等には制約されないで関連する変数を抽出し、
伝播関係がないが同時に変更が必要な変数についても抽
出が可能である。
In order to solve the above-mentioned problem, the present invention finds relevance by the frequency of a variable used before and after the use of a variable to be analyzed. For this reason,
Extract related variables without being restricted by propagation relations, etc.
It is possible to extract variables that do not have a propagation relationship but need to be changed at the same time.

【0007】本発明は、ソースプログラムを入力して解
析対象の変数名を指定する手段と、他変数名を抽出する
範囲を指定する手段と、解析対象の変数名の使用箇所を
抽出する手段と、抽出された使用箇所から、指定された
他変数名を抽出する範囲内で、使用されている他変数名
を抽出する手段と抽出された他変数名を出力する手段を
有する。
According to the present invention, there is provided a means for inputting a source program to specify a variable name to be analyzed, a means for specifying a range from which other variable names are to be extracted, and a means for extracting a use location of a variable name to be analyzed. And a means for extracting a used other variable name and a means for outputting the extracted other variable name within a range in which a specified other variable name is extracted from the extracted use location.

【0008】抽出された他変数名について、出現回数、
出現確率等の情報を合わせて出力することにより、関連
する他の変数名の確認を容易にする。
For the extracted other variable names, the number of appearances,
By outputting information such as the appearance probability together, it is easy to confirm other related variable names.

【0009】[0009]

【発明の実施の形態】本発明の実施の形態を図1に基づ
いて詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described in detail with reference to FIG.

【0010】図1は、本発明によるプログラム変数情報
出力方式のを示す図である。ここでは、解析対象変数名
指定手段1と、他変数名抽出範囲指定手段2と、解析対
象変数名使用箇所抽出手段3と、他変数名抽出手段4
と、他変数名出力手段5とから構成されている。
FIG. 1 is a diagram showing a program variable information output method according to the present invention. Here, analysis target variable name specifying means 1, other variable name extraction range specifying means 2, analysis target variable name use location extraction means 3, and other variable name extraction means 4
And other variable name output means 5.

【0011】図1に於いて、解析対象変数名使用箇所抽
出手段3は、ソースプログラム6を入力して、解析対象
変数名指定手段1で指定された解析対象変数名8をソー
スプログラム6から、該解析対象変数名を使用している
関数内行又は文の位置を抽出し、対象変数名使用箇所リ
スト9を生成する。他変数名抽出手段4は、生成された
対象変数名使用箇所リスト9を入力して、他変数名抽出
範囲指定手段2で指定された抽出範囲7が、解析対象変
数名の使用箇所を起点とする行の前後行の行数か、解析
対象変数名の使用箇所を起点とする文の前後文の文数
か、解析対象変数名の使用箇所の関数内の行数または文
数によって、使用している他変数名を抽出して、他変数
名出力手段5により、他変数名リスト10を出力した
り、他変数名リスト10をCRT11に表示したりす
る。他変数名リスト10の内容によって、同時に変更が
必要な変数と判断する。
In FIG. 1, an analysis target variable name use point extracting means 3 inputs a source program 6 and converts an analysis target variable name 8 specified by the analysis target variable name specifying means 1 from the source program 6. The position of a line or statement in the function using the analysis target variable name is extracted, and a target variable name use location list 9 is generated. The other variable name extracting means 4 inputs the generated target variable name use location list 9, and the extraction range 7 specified by the other variable name extraction range designation means 2 defines the use location of the analysis target variable name as a starting point. Depending on the number of lines before and after the line to be analyzed, the number of statements before and after the statement starting from the location where the analysis target variable name is used, or the number of lines or statements in the function where the analysis target variable name is used. The other variable name is extracted and the other variable name output means 5 outputs the other variable name list 10 or displays the other variable name list 10 on the CRT 11. Based on the contents of the other variable name list 10, it is determined that the variables need to be changed at the same time.

【0012】〈実施例1〉図1で、示したソースプログ
ラム6として、図2の解析対象ソースプログラムfc2
1と、図3の解析対象ソースプログラムgc31を用い
て処理の流れを説明する。
<Embodiment 1> The source program 6 shown in FIG.
1 and the flow of processing will be described using the analysis target source program gc31 in FIG.

【0013】解析対象変数名指定手段1は、解析対象変
数名8を指定する。
The analysis target variable name specifying means 1 specifies an analysis target variable name 8.

【0014】ここで、解析対象変数名8をx22(42)
とする。
Here, the analysis target variable name 8 is x22 (42)
And

【0015】解析対象変数名指定手段1で指定された解
析対象変数名x22(42)について、ソースプログラム
21、31を入力とし、該解析対象変数名を使用してい
る関数内行及び文の位置を抽出する。このとき該解析対
象変数名を抽出する位置として、関数内の行又は文の位
置は、変数や関数の宣言文は除いた代入文や、条件文や
繰り返し文や関数呼出し文等の実行行とする。
With respect to the analysis target variable name x22 (42) specified by the analysis target variable name specifying means 1, the source programs 21 and 31 are input and the positions of function lines and statements using the analysis target variable name are determined. Extract. At this time, the position of the line or statement in the function as the position for extracting the analysis target variable name is the same as the assignment statement excluding the variable or function declaration statement, or the execution line of the conditional statement, repetition statement, function call statement, etc. I do.

【0016】抽出された結果を対象変数名使用箇所リス
トとして生成する。図4にx22(32)についての対象
変数名使用箇所リスト41を示す。
The extracted result is generated as a target variable name use location list. FIG. 4 shows a target variable name use point list 41 for x22 (32).

【0017】本実施例では、他変数名抽出範囲指定手段
2指定された他変数抽出範囲7が、解析対象変数名の使
用箇所を起点とする行の前後行の行数の場合について説
明する。
In the present embodiment, a description will be given of a case where the other variable extraction range 7 specified by the other variable name extraction range designating means 2 is the number of lines before and after the line starting from the location where the analysis target variable name is used.

【0018】他変数名抽出範囲指定手段2へ、他変数抽
出範囲7を指定する。例えば、解析対象変数名x22
(42)の行数で抽出、抽出範囲として、前後行5行を指
定する。
The other variable extraction range 7 is designated to the other variable name extraction range designating means 2. For example, analysis target variable name x22
(42) Extraction is performed using the number of lines, and five lines before and after are specified as an extraction range.

【0019】指定された範囲で使用されている他変数名
について、関数内の行又は文の位置は、変数や関数の宣
言文は除いた代入文や、条件文や繰り返し文や関数呼出
し文等の実行とする。
For other variable names used in the specified range, the position of the line or statement in the function is determined by the assignment statement excluding the variable or function declaration statement, conditional statement, repetition statement, function call statement, etc. And execution.

【0020】図5では、前後行5行を指定した場合の対
象ソースプログラムの解析対象範囲内での他変数名5
1、及び図6では、前後行5行を指定した場合の対象ソ
ースプログラムの解析対象範囲内での他変数名61の様
に抽出する。
In FIG. 5, another variable name 5 within the analysis range of the target source program when five lines before and after are specified
In FIG. 1 and FIG. 6, extraction is performed like other variable names 61 within the analysis target range of the target source program when five lines before and after are specified.

【0021】図7は、図5、図6の情報に基づき、他変
数名出力手段5により、行数によって抽出した他の変数
名の出力例である。
FIG. 7 shows an output example of another variable name extracted by the other variable name output means 5 based on the number of lines based on the information shown in FIGS.

【0022】〈実施例2〉実施例1の抽出範囲を行数で
抽出範囲を指定した場合に於いて、抽出された他の変数
の出現回数を合わせて出力する場合について説明する。
<Embodiment 2> A description will be given of a case where the extraction range of the first embodiment is specified by the number of rows and the number of appearances of other extracted variables is output together.

【0023】図5、図6の情報に基づき、他変数名出力
手段5により、出現回数を図8変数名及び出現回数出力
例、解析対象ソースプログラム(fc、gc両方)におけ
る解析対象変数名xについての他の変数名と出現回数計
測例81の様に計測する。
Based on the information shown in FIGS. 5 and 6, the other variable name output means 5 calculates the number of appearances as shown in FIG. 8 and the output example of the variable name and the number of appearances, and the analysis target variable name x in the analysis target source program (both fc and gc). Is measured as in the other variable name and appearance count measurement example 81 for.

【0024】例えば、抽出された他変数としてaについ
て見ると、fcソースプログラムの関数f( )内では、
2回出現している。gcソースプログラムの関数g( )
内では、0回出現している。解析対象ソースプログラム
fc、gcにおけるaの出現回数は、2+0=2で2回
となる。
For example, looking at a as another extracted variable, in the function f () of the fc source program,
Appeared twice. gc source program function g ()
It appears 0 times in. The number of appearances of “a” in the analysis target source programs fc and gc is 2 + 2 = 2.

【0025】その結果を、他変数名出力手段5は、解析
対象ソースプログラム(fc、gc両方)における解析対
象変数名xについての他の変数名と出現回数出力例82
として出力する。
Based on the result, the other variable name output means 5 outputs another variable name and the number of appearances for the analysis target variable name x in the analysis target source program (both fc and gc).
Output as

【0026】〈実施例3〉実施例1の抽出範囲を行数で
抽出範囲を指定した場合に於いて、抽出された他の変数
の出現確率を合わせて出力する場合について説明する。
<Embodiment 3> A description will be given of a case where the extraction range of the first embodiment is specified by the number of lines and the appearance probability of another extracted variable is also output.

【0027】図5、図6の情報に基づき、他変数名出力
手段5により、出現確率を図9解析対象変数名xについ
ての他の変数名と出現確率算出例91の様に出現確率を
算出する。出現確率は、解析対象変数名に対して解析対
象ソースプログラム内での出現の有無によって、同時に
使用している確率とする。出現確率算出式は、Σ(他の
変数出現有無(有=1、無=0)/解析対象変数出現回
数)となる。
Based on the information shown in FIGS. 5 and 6, the other variable name output means 5 calculates the appearance probability as shown in FIG. I do. The appearance probability is defined as the probability that the analysis target variable name is used simultaneously depending on whether or not the analysis target variable name appears in the analysis target source program. The appearance probability calculation formula is Σ (presence / absence of other variables (presence = 1, absence = 0) / number of appearances of analysis target variable).

【0028】例えば、解析対象変数名xの出現回数は、
ソースプログラムfcの関数f( )に於いて1回、ソー
スプログラムgcの関数g( )に於いて1回となり、解
析対象ソースプログラムfc、gcでの出現回数は、2
回となる。抽出された他の変数名pについて見ると、ソ
ースプログラムfcの関数f( )において1回、ソース
プログラムgcの関数g( )において1回、出現が有っ
た。よって他変数pの出現確率は、Σ(1/2+1/2)=
1.0となる。
For example, the number of appearances of the analysis target variable name x is
Once in the function f () of the source program fc and once in the function g () of the source program gc, the number of appearances in the analysis target source programs fc and gc is 2
Times. Looking at the extracted other variable name p, it appears once in the function f () of the source program fc and once in the function g () of the source program gc. Therefore, the appearance probability of the other variable p is Σ (1/2 + 1/2) =
1.0.

【0029】その結果を、他変数名出力手段5は、図1
0では、変数名及び出現確率出力例、解析対象ソースプ
ログラム(fc、gc両方)における解析対象変数名xに
ついての、他の変数名と出現確率出力例101として出
力する。
The result is output to the other variable name output means 5 as shown in FIG.
In the case of 0, the variable name and the appearance probability output example, and another variable name and the appearance probability output example 101 for the analysis target variable name x in the analysis target source program (both fc and gc) are output.

【0030】解析対象変数名xについての他の変数名と
出現確率出力例101に於いて、1.0となった他の変
数名、p、q、yは、解析対象変数名xと非常に関連性
が高く、xの変更と合わせて変更すべき可能性が高いと
考える。
In the output example 101, the other variable names, p, q, and y of the analysis target variable name x are very different from the analysis target variable name x. It is highly relevant, and it is highly likely that it should be changed along with the change of x.

【0031】〈実施例4〉実施例1、実施例2及び実施
例3の行数による指定の別の実施例である、文数による
指定の場合について説明する。
<Embodiment 4> Another embodiment in which designation by the number of lines in Embodiments 1, 2, and 3 will be described.

【0032】本実施例では、他変数名抽出範囲指定手段
2で指定された他変数抽出範囲7が、解析対象変数名の
使用箇所を起点とする文の前後文の文数の場合について
説明する。
In this embodiment, a case will be described in which the other variable extraction range 7 specified by the other variable name extraction range designating means 2 is the number of sentences before and after the sentence starting from the use location of the analysis target variable name. .

【0033】図1に於いて、他変数名抽出範囲指定手段
2へ、他変数抽出範囲7を指定する。例えば、析対象変
数名x21(2)文数で抽出、抽出範囲として、前後文5
を指定する。
In FIG. 1, the other variable extraction range 7 is designated to the other variable name extraction range designating means 2. For example, the analysis target variable name x21 (2) is extracted by the number of sentences, and the extraction range is
Is specified.

【0034】図11には、前後文5文を指定した場合の
対象ソースプログラムの解析対象範囲内での他変数名1
11、及び図12では、前後文5文を指定した場合の対
象ソースプログラムの解析対象範囲内での他変数名12
1の様に抽出する。抽出された結果に基づき、以降実施
例1、実施例3と同様に他変数名の出力、他変数名と出
現回数、他変数名と出現確率を出力することは容易に実
施可能である。
FIG. 11 shows another variable name 1 in the analysis target range of the target source program when five sentences before and after are specified.
In FIG. 11 and FIG. 12, other variable names 12 within the analysis target range of the target source program when five pre- and post- sentence are specified
Extract as in 1. Based on the extracted result, it is easy to output the output of the other variable name, the output of the other variable name and the number of appearances, and the output of the other variable name and the occurrence probability, similarly to the first and third embodiments.

【0035】〈実施例5〉行数、又は文数で指定する範
囲が、関数の範囲を超える様な場合は、該関数を呼び出
している関数の呼出行、又は文の位置から前であれば呼
出前の指定された範囲数の残りの行、又は文中に使用し
ている他の変数を抽出し、後であれば呼出後の指定され
た範囲数の残りの行、又は文中に使用している他の変数
を抽出することで、関数の範囲を超える様な場合でも、
容易に実施可能である。
<Embodiment 5> When the range specified by the number of lines or the number of statements exceeds the range of a function, if the range is before the call line or statement of the function calling the function, Extract the remaining lines in the specified number of ranges or other variables used in the statement before the call, and then use the remaining lines in the specified number of ranges or the statements in the statement after the call. By extracting other variables that are out of range of the function,
It can be easily implemented.

【0036】但し、解析対象のソースプログラムから、
呼び出し側の関数のソースプログラムが除外されている
場合は、関数を超えた抽出は行わない。
However, from the source program to be analyzed,
If the source program of the calling function is excluded, no extraction beyond the function is performed.

【0037】〈実施例6〉入力するソースプログラム6
について、例えば、fcとソースプログラムの範囲を絞
って指定した場合においても、上記実施例に基づき、容
易に実施可能である。
<Embodiment 6> Source program 6 to be input
Can be easily implemented based on the above embodiment, for example, even when the range of fc and the source program is specified.

【0038】〈実施例7〉また、出力対象のソースプロ
グラムの範囲を指定し、指定されたソースプログラム範
囲内で、使用されている解析対象の変数名によって抽出
された他の変数名を出力する場合については、入力され
た全ソースプログラムを解析し、指定されたソースプロ
グラム範囲内で、使用されている解析対象の変数名によ
って抽出された他の変数名についてのみ、他変数名、出
現回数、出現確率を出力する。指定されたソースプログ
ラム範囲外でのみ使用されている他の変数名は、出力さ
れなくなる。
<Embodiment 7> Further, a range of a source program to be output is specified, and other variable names extracted by the used variable names of the analysis target are output within the specified source program range. In the case, all the input source programs are analyzed, and only the other variable names extracted by the analysis target variable names used within the specified source program range are changed. Outputs the probability of occurrence. Other variable names used only outside the specified source program range will not be output.

【0039】[0039]

【発明の効果】以上、説明してきた様に本発明によれ
ば、伝播関係等解析から抽出し難い、対象とする変数名
の変更と合わせて変更が必要な他の変数名を抽出でき効
率良く、論理抜け判定、間違いを指摘・防止することが
可能である。
As described above, according to the present invention, it is possible to efficiently extract other variable names which are difficult to extract from the analysis of propagation relations and the like and need to be changed together with the change of the target variable name. , Logic omission judgment, and error can be pointed out and prevented.

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

【図1】本発明のプログラム変数情報出力方式の図であ
る。
FIG. 1 is a diagram of a program variable information output method according to the present invention.

【図2】本発明の解析対象ソースプログラムfcを示す
図である。
FIG. 2 is a diagram showing an analysis target source program fc of the present invention.

【図3】本発明の解析対象ソースプログラムgcを示す
図である。
FIG. 3 is a diagram showing an analysis target source program gc of the present invention.

【図4】本発明の対象変数名使用箇所リストを示す図で
ある。
FIG. 4 is a diagram showing a target variable name use location list according to the present invention;

【図5】本発明の前後行5行を指定した場合の対象ソー
スプログラムの解析対象範囲内での他変数名を示す図で
ある。
FIG. 5 is a diagram showing other variable names within the analysis target range of the target source program when five lines before and after the present invention are specified.

【図6】本発明の前後行5行を指定した場合の対象ソー
スプログラムの解析対象範囲内での他変数名を示す図で
ある。
FIG. 6 is a diagram showing other variable names within the analysis target range of the target source program when five lines before and after the present invention are specified.

【図7】本発明の他変数名の出力例を示す図である。FIG. 7 is a diagram illustrating an output example of another variable name according to the present invention.

【図8】本発明の変数名及び出現回数出力例を示す図で
ある。
FIG. 8 is a diagram showing an example of outputting variable names and appearance counts according to the present invention.

【図9】本発明の解析対象変数名xについての他の変数
名と出現確率算出例を示す図でる。
FIG. 9 is a diagram showing another variable name and an example of appearance probability calculation for the analysis target variable name x of the present invention.

【図10】本発明の変数名及び出現確率出力例を示す図
である。
FIG. 10 is a diagram illustrating an example of output of variable names and appearance probabilities according to the present invention.

【図11】本発明の前後文5文を指定した場合の対象ソ
ースプログラムの解析対象範囲内での他変数名を示す図
である。
FIG. 11 is a diagram illustrating other variable names within the analysis target range of the target source program when five sentences before and after the sentence of the present invention are specified.

【図12】本発明の前後文5文を指定した場合の対象ソ
ースプログラムの解析対象範囲内での他変数名を示す図
である。
FIG. 12 is a diagram showing other variable names within the analysis target range of the target source program when five sentences before and after the sentence of the present invention are specified.

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

1…解析対象変数名指定手段、2…他変数名抽出範囲指
定手段、3…解析対象変数名使用箇所抽出手段、4…他
変数名抽出手段、5…他変数名出力手段、6…ソースプ
ログラム、7…他変数名抽出範囲、8…解析対象変数
名、9…対象変数名使用箇所リスト、10…他変数名リ
スト、11…CRT、21…解析対象ソースプログラ
ム、22…解析対象変数名x、23…関数内行数、24
…関数内文数、31…解析対象ソースプログラム、32
…解析対象変数名x、33…関数内行数、34…関数内
文数、41…対象変数名使用箇所リスト、51…前後行
5行を指定した場合の対象ソースプログラムの解析対象
範囲内での他変数名、61…前後行5行を指定した場合
の対象ソースプログラムの解析対象範囲内での他変数
名、71…解析対象ソースプログラム(fc、gc両方)
における解析対象変数名xについての他の変数名の出力
例、81…解析対象ソースプログラム(fc、gc両方)
における解析対象変数名xについての他の変数名と出現
回数計測例、82…解析対象ソースプログラム(fc、
gc両方)における解析対象変数名xについての他の変数
名と出現回数出力例、91…解析対象変数名xについて
の他の変数名と出現確率算出例、101…解析対象ソー
スプログラム(fc、gc両方)における、解析対象変数
名xについての他の変数名と出現確率出力例、111…
前後文5文を指定した場合の対象ソースプログラムの解
析対象範囲内での他変数名、121…前後文5文を指定
した場合の対象ソースプログラムの解析対象範囲内での
他変数名。
DESCRIPTION OF SYMBOLS 1 ... Analysis target variable name designation means, 2 ... Other variable name extraction range designation means, 3 ... Analysis target variable name use location extraction means, 4 ... Other variable name extraction means, 5 ... Other variable name output means, 6 ... Source program , 7: Other variable name extraction range, 8: Analysis target variable name, 9: Target variable name use location list, 10: Other variable name list, 11: CRT, 21: Analysis target source program, 22: Analysis target variable name x , 23 ... number of lines in the function, 24
... Number of statements in function, 31 ... Source program to be analyzed, 32
... Analyzed variable name x, 33 ... Number of lines in the function, 34 ... Number of statements in the function, 41 ... List of locations where the target variable name is used, 51 ... In the analysis range of the target source program when 5 lines before and after are specified Other variable names, 61: Other variable names within the analysis target range of the target source program when five lines before and after are specified, 71: Source program to be analyzed (both fc and gc)
Output example of other variable names for the analysis target variable name x in 81, source program to be analyzed (both fc and gc)
, Other variable names and occurrence count measurement examples of the analysis target variable name x in 82, the analysis target source program (fc,
gc), an output example of another variable name and the number of appearances for the analysis target variable name x, 91 ... another variable name and an occurrence probability calculation example for the analysis target variable name x, 101 ... an analysis target source program (fc, gc In both cases), output examples of other variable names and appearance probabilities for the analysis target variable name x, 111.
Other variable names in the analysis target range of the target source program when five surrounding sentences are specified, 121... Other variable names in the analysis target range of the target source program when five surrounding sentences are specified.

Claims (8)

【特許請求の範囲】[Claims] 【請求項1】 解析対象のソースプログラムを入力する
手段と、 当該ソースプログラム内の解析対象の変数名を指定する
手段と、 前記指定された変数名の使用箇所を抽出する手段と、 抽出された使用箇所を起点として解析対象の範囲を指定
する手段と、 指定された解析対象範囲で使用している他の変数名を抽
出する手段と、 抽出された他の変数名を出力する手段と、を具備するこ
とを特徴とするプログラム変数情報出力方式。
A means for inputting a source program to be analyzed; a means for specifying a variable name to be analyzed in the source program; a means for extracting a use location of the specified variable name; Means for designating the range of the analysis target starting from the use location, means for extracting other variable names used in the specified analysis target range, and means for outputting the extracted other variable names. A program variable information output method, comprising:
【請求項2】 上記請求項1に記載のプログラム変数情
報出力方式に於いて、 抽出された使用箇所を起点とする解析対象の範囲を指定
する手段は、解析対象範囲を当該使用箇所を起点とする
行の前後行の行数を指定すること、を特徴とするプログ
ラム変数情報出力方式。
2. The program variable information output method according to claim 1, wherein the means for designating a range of an analysis target starting from the extracted use location includes setting the analysis target range as a start point of the use location. A program variable information output method, wherein the number of lines before and after the line to be specified is specified.
【請求項3】 上記請求項1に記載のプログラム変数情
報出力方式に於いて、 抽出された使用箇所を起点とする解析対象の範囲を指定
する手段は、解析対象範囲を当該使用箇所を起点とする
文の前後文の文数を指定すること、を特徴とするプログ
ラム変数情報出力方式。
3. The program variable information output method according to claim 1, wherein the means for designating a range of an analysis target starting from the extracted use location is defined as the analysis target range defined by the use location as a start point. A program variable information output method characterized by designating the number of statements before and after a statement to be executed.
【請求項4】 上記請求項1に記載のプログラム変数情
報出力方式に於いて、 抽出された使用箇所を起点とする解析対象の範囲を指定
する手段は、解析範囲を当該使用箇所の関数内で、且つ
行数、または文数で抽出すること、を特徴とするプログ
ラム変数情報出力方式。
4. The program variable information output method according to claim 1, wherein the means for designating a range of an analysis target starting from the extracted use location includes the analysis range within a function of the use location. And extracting by the number of lines or the number of sentences.
【請求項5】 上記請求項1、又は請求項2、又は請求
項3、又は請求項4のいずれかに記載のプログラム変数
情報出力方式に於いて、 指定された解析対象範囲で使用している他の変数名を抽
出する手段によって、抽出された他の変数名を出力する
手段は、該変数名の出現回数を計測する手段を有し、当
該変数名と当該変数名の出現回数を出力すること、を特
徴とするプログラム変数情報出力方式。
5. The program variable information output method according to any one of claims 1, 2, 3, or 4, wherein the program variable information output method is used within a specified analysis target range. The means for outputting another variable name extracted by the means for extracting another variable name has means for measuring the number of appearances of the variable name, and outputs the variable name and the number of appearances of the variable name. And a program variable information output method.
【請求項6】 上記請求項1、又は請求項2、又は請求
項3、又は請求項4のいずれかに記載のプログラム変数
情報出力方式に於いて、 指定された解析対象範囲で使用している他の変数名を抽
出する手段によって、抽出された他の変数名を出力する
手段は、該変数名の出現確率を算出する手段を有し、当
該変数名と当該変数名の出現確率を出力すること、を特
徴とするプログラム変数情報出力方式。
6. The program variable information output method according to any one of claims 1, 2, 3, or 4, wherein the program variable information output method is used in a designated analysis target range. The means for outputting another variable name extracted by the means for extracting another variable name has means for calculating the occurrence probability of the variable name, and outputs the variable name and the occurrence probability of the variable name. And a program variable information output method.
【請求項7】 上記請求項1に記載のプログラム変数情
報出力方式に於いて、 解析対象のソープログラムを入力する手段は、解析対象
のソースプログラムの範囲を指定し、指定されたソース
プログラムの範囲を入力すること、を特徴とするプログ
ラム変数情報出力方式。
7. The program variable information output method according to claim 1, wherein the means for inputting a source program to be analyzed specifies a range of a source program to be analyzed, and a range of the source program to be specified is specified. , And a program variable information output method.
【請求項8】 上記請求項1、又は請求項2、又は請求
項3、又は請求項4、又は請求項5、又は請求項6のい
ずれかに記載のプログラム変数情報出力方式に於いて、 抽出した他の変数名を出力する手段は、出力対象の範囲
を指定し、指定されたソースプログラム範囲内で、使用
されている解析対象の変数名によって抽出された他の変
数名を出力すること、を特徴とするプログラム変数情報
出力方式。
8. The program variable information output method according to any one of claims 1, 2, 3, or 4, or 5, or 6, Means for outputting the other variable names that have been output, specify the range of the output target, and within the specified source program range, output the other variable names extracted by the used variable names of the analysis target; A program variable information output method characterized by the following.
JP2000332109A 2000-10-25 2000-10-25 Output method for information of program variable Pending JP2002132544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000332109A JP2002132544A (en) 2000-10-25 2000-10-25 Output method for information of program variable

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000332109A JP2002132544A (en) 2000-10-25 2000-10-25 Output method for information of program variable

Publications (1)

Publication Number Publication Date
JP2002132544A true JP2002132544A (en) 2002-05-10

Family

ID=18808354

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000332109A Pending JP2002132544A (en) 2000-10-25 2000-10-25 Output method for information of program variable

Country Status (1)

Country Link
JP (1) JP2002132544A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004145381A (en) * 2002-10-21 2004-05-20 Hitachi Ltd Static analysis system for source program
JP2006018693A (en) * 2004-07-02 2006-01-19 Fujitsu Ltd Similar source code extraction program, similar source code extraction device and similar source code extraction method
JP2016192093A (en) * 2015-03-31 2016-11-10 富士通株式会社 Information processor and program

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004145381A (en) * 2002-10-21 2004-05-20 Hitachi Ltd Static analysis system for source program
JP2006018693A (en) * 2004-07-02 2006-01-19 Fujitsu Ltd Similar source code extraction program, similar source code extraction device and similar source code extraction method
JP2016192093A (en) * 2015-03-31 2016-11-10 富士通株式会社 Information processor and program

Similar Documents

Publication Publication Date Title
JP5775829B2 (en) Software structure visualization program and system
US7711546B2 (en) User interface for machine aided authoring and translation
US7827155B2 (en) System for processing formatted data
US8171462B2 (en) User declarative language for formatted data processing
US20100057667A1 (en) Detection rule-generating facility
KR930016864A (en) Language identification system and method of peripheral device
US8549492B2 (en) Machine declarative language for formatted data processing
CN106155897B (en) Service processing method and device
US20070250528A1 (en) Methods for processing formatted data
JP2003036188A (en) Code verification system
CN110633220A (en) Debugging information display method and device, storage medium and electronic equipment
JP2002132544A (en) Output method for information of program variable
US20120266128A1 (en) Collaborative development support system, collaborative development support method and recording medium
CN108733558B (en) Calculation device, influence output system, and influence determination method
JP5188421B2 (en) Source code analysis method and source code analysis support system
JP2016057715A (en) Graphic type program analyzer
CN109242403B (en) Demand management method and computer equipment
JP4972970B2 (en) Function call abnormal pattern detection program in source program
JP2008071075A (en) Program inspection device, program inspection method, and program inspection program
US20050108426A1 (en) Identifying computer messages that should be revised
JP2004126866A (en) Description output suppression program analysis system and description output suppression program analysis method
CN105389164B (en) Computer-implemented method for generating control device program code and related message management environment
US20180196797A1 (en) Scheme for recognizing and evaluating math content within text in documents and web applications
US20190354819A1 (en) Method for extracting an output data set
CN112000573B (en) Code quality monitoring method and device, computer equipment and medium