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
JP3999949B2 - Alias name search apparatus, alias name search method, and alias name search program - Google Patents
[go: Go Back, main page]

JP3999949B2 - Alias name search apparatus, alias name search method, and alias name search program - Google Patents

Alias name search apparatus, alias name search method, and alias name search program Download PDF

Info

Publication number
JP3999949B2
JP3999949B2 JP2001224412A JP2001224412A JP3999949B2 JP 3999949 B2 JP3999949 B2 JP 3999949B2 JP 2001224412 A JP2001224412 A JP 2001224412A JP 2001224412 A JP2001224412 A JP 2001224412A JP 3999949 B2 JP3999949 B2 JP 3999949B2
Authority
JP
Japan
Prior art keywords
alias
symbol
unit
search
directed graph
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
JP2001224412A
Other languages
Japanese (ja)
Other versions
JP2003036186A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2001224412A priority Critical patent/JP3999949B2/en
Publication of JP2003036186A publication Critical patent/JP2003036186A/en
Application granted granted Critical
Publication of JP3999949B2 publication Critical patent/JP3999949B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)
  • Debugging And Monitoring (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、プログラムを構成する変数や関数といったシンボルについて、シンボル間の関係を解析する技術に関するもので、特に、ある特定のシンボルの別名を検索する別名検索装置及び別名検索方法に関する。
【0002】
【従来の技術】
近年のIT化社会の中で、ITによって提供されるサービスは巨大化、複雑化を増し、それに伴い、IT化社会を実現するプログラムも巨大化、複雑化している。一方、多くの人や会社がグローバルにIT産業に参入するにつれて、プログラムの開発競争が激化している。
【0003】
このような状況においては、プログラムの開発を短期間で効率的に行う必要がある。そのためのひとつの方法としては、過去に作成したプログラムや他者(他社)が作成したプログラムを再利用して、新たなプログラムを開発する方法がある。このように既存のプログラムを再利用する場合、既存のプログラムに変更を加えずにそのまま利用する方法と、なんらかの変更を加えて利用する方法とがある。何も変更を加えずに既存のプログラムを利用することができれば簡単であるが、通常は、新しい機能を追加したり、既存の機能を変更(カスタマイズ)するといった処理が必要となる。
【0004】
このように既存のプログラムを変更するには、変更前にそのプログラムを理解する必要がある。そのためにはそのプログラムの仕様書や設計書を参照してプログラムを理解する必要がある。しかし、仕様書や設計書は、ときにそれらが書かれた後にプログラムが変更され、その記載内容がプログラムと一致していなかったり、仕様書や設計書がそれほど詳細には書かれていなかったりすることもあるため、プログラムを正確に理解するにはプログラムを読む必要がある。
【0005】
ところが、上述したように、プログラムは巨大化、複雑化しており、プログラムすべてに目を通すことは困難である。そこで、プログラムの変更に必要な個所に絞って検討すれば良いのであれば非常に効率的である。プログラムの変更に必要な個所を知るには、まず、全体的な構成の概要が必要であり、その中で変更したい個所がどこであるのかを見つけ出す必要がある。次に、変更したい個所を変更したときに、どこに影響が及ぶのかを確認する必要がある。そのためには、プログラム中に記述されたシンボルにはどのようなものがあるのか、また、各シンボル間にはどのような関係があるのかをあらかじめ解析し、シンボル間の関係をそのプログラムを再利用しようとするユーザに提示することができる環境が必要である。
【0006】
【発明が解決しようとする課題】
このようにシンボル間の関係を解析するに当たっては、あるシンボルが、図5に示したようなポインタによる代入や参照渡しによる代入等により、同じ実体に対して別の名前が付けられるような、いわゆる「別名」の関係にある場合を解析する必要がある。
例えば、特願平5−141078号には、シンボル間の関係のうち、あるシンボルの別名を取得する方法として、ポインタ解析とその結果に対して推移的閉包計算を行うことにより別名を求める方法が提案されている。
【0007】
しかしながら、特願平5−141078号に開示された技術は、プログラム全体に対して別名の関係を持つ可能性のあるシンボルのグループ(以下、別名集合という)を求める方法であり、ある特定のシンボルに対する別名を求めるものではない。そのため、ある特定のシンボルに対する別名を求めるには、効率と精度が非常に悪いものであった。
すなわち、特願平5−141078号のようにプログラム全体に対して別名の集合を求めるのは、ある特定のシンボルの別名だけを求めたい場合には余分な計算が必要となるため効率が非常に悪いものであった。
【0008】
また、特願平5−141078号のような方法で別名集合を求める場合には、ある特定のシンボルが属する別名集合に含まれるシンボルは、その特定のシンボルの別名の候補とはなるが、あるシンボルに注目した場合には、必ずしもその別名集合に含まれるシンボルがすべて注目するシンボルの別名になるとは限らないため、精度も悪いものであった。
【0009】
例えば、図6のようなソースコードがあった場合に、特願平5−141078号の方法では、*pがaを指すことにより*pがaの別名となる可能性があり、且つ、*pがbを指すことにより*pがbの別名となる可能性があるため、a,b,*pは別名集合となる。しかし、ある特定のシンボルとして、例えばaに注目した場合、必ずしもbがaの別名となるとは限らないといった問題が生じていた。
【0010】
本発明は、上述したような従来技術の問題点を解消するために提案されたものであり、その目的は、シンボル間の関係の中で、ある特定のシンボルに対する別名のみを効率良く、高精度に求めることができる別名検索装置及び別名検索方法を提供することにある。
【0011】
【課題を解決するための手段】
上記の目的を達成するため、請求項1に記載の別名検索装置は、データの指定部、格納部、作成部、検索部及び出力部を備えたコンピュータから構成され、ソースファイル中の特定のシンボルとその別名を検索する別名検索装置において、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、を検索する別名検索部と、前記別名検索部によって検索されたシンボルを登録する別名登録部と、前記別名登録部により登録されたシンボルを出力する出力部とを備えることを特徴とする。
また、請求項2に記載の別名検索装置は、データの指定部、格納部、作成部、検索部及び出力部を備えたコンピュータから構成され、ソースファイル中の特定のシンボルとその別名を検索する別名検索装置において、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、を検索する別名検索部と、前記別名検索部によって検索されたシンボルを登録する別名登録部と、前記別名登録部により登録されたシンボルを出力する出力部とを備えることを特徴とする。
【0012】
また、請求項3に記載の別名検索方法は、請求項1に記載の発明を方法の観点から捉えたものであって、コンピュータ上に実現される検索対象指定部、ソースファイル群の格納部、別名有向グラフ作成部、別名検索部、別名登録部及び出力部により、前記ソースファイル群の格納部に格納されているソースファイル中の特定のシンボルと同じ実体に対して別の名前が付けられた前記特定のシンボルと別名の関係にある他のシンボルを検索する別名検索方法において、前記検索対象指定部が、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定ステップを実行し、前記別名有向グラフ作成部が、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成ステップを実行し、前記別名検索部が、前記別名有向グラフ作成部において作成された別名有向グラフ中から、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、を検索する別名検索ステップを実行し、前記別名登録部が、前記別名検索部によって検索されたシンボルを登録する別名登録ステップを実行し、前記出力部が、前記別名登録部により登録されたシンボルを出力する出力ステップを実行することを特徴とする。
また、請求項4に記載の別名検索方法は、請求項2に記載の発明を方法の観点から捉えたものであって、コンピュータ上に実現される検索対象指定部、ソースファイル群の格納部、別名有向グラフ作成部、別名検索部、別名登録部及び出力部により、前記ソースファイル群の格納部に格納されているソースファイル中の特定のシンボルと同じ実体に対して別の名前が付けられた前記特定のシンボルと別名の関係にある他のシンボルを検索する別名検索方法において、前記検索対象指定部が、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定ステップを実行し、前記別名有向グラフ作成部が、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアーク、あるいは一つのシンボルが当該一つのシンボルとは別名の関係にあるシンボルから指される関係を示す負の方向のアークの少なくとも一方により、結んで表現した別名有向グラフを作成する別名有向グラフ作成ステップを実行し、前記別名検索部が、前記別名有向グラフ作成部において作成された別名有向グラフ中から、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、を検索する別名検索ステップを実行し、前記別名登録部が、前記別名検索部によって検索されたシンボルを登録する別名登録ステップを実行し、前記出力部が、前記別名登録部により登録されたシンボルを出力する出力ステップを実行することを特徴とする。
【0013】
また、請求項5に記載の別名検索用プログラムは、請求項1の発明をソフトウェアの観点から捉えたものであって、コンピュータを、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、を検索する別名検索部と、前記別名検索部によって検索されたシンボルを登録する別名登録部として機能させることを特徴とする。
また、請求項6に記載の別名検索用プログラムは、請求項2に記載の発明をソフトウェアの観点から捉えたものであって、コンピュータを、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、(1)前記検索対象指定部において受け付けた特定のシンボルと、(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、を検索する別名検索部と、前記別名検索部によって検索されたシンボルを登録する別名登録部として機能させることを特徴とする。
【0014】
上記のような構成を有する請求項1〜請求項6に記載の発明によれば、ある特定のシンボルについて、別名の関係にあるシンボルを効率良く、高精度に求めることができる。
【0015】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照して具体的に説明する。なお、以下の実施形態はコンピュータ上に実現され、実施形態の各機能は、所定の手順(プログラム)がこのコンピュータを制御することで実現される。また、本明細書における各手段は、実施形態の各機能に対応する概念的なもので、必ずしも特定のハードウェアやソフトウェア・ルーチンに1対1には対応しない。同一のハードウェア要素が、場合によって異なった手段を構成する。例えば、コンピュータは、ある命令を実行するときにある手段となり、別の命令を実行するときは別の手段となりうる。また、一つの手段が、わずか1命令によって実現さる場合もあれば、多数の命令によって実現される場合もある。したがって、本明細書では、以下、実施形態の各機能を有する仮想的回路ブロック(手段)を想定して実施形態を説明する。また、本実施形態における各手順の各ステップは、その性質に反しない限り、実行順序を変更し、複数同時に実行し、また、実行ごとに異なった順序で実行してもよい。このような順序の変更は、例えば、ユーザが実行可能な処理を選択するなどメニュー形式のインターフェース手法によって実現することができる。
【0016】
(1)構成
本実施形態の別名検索装置1には、図1の機能ブロック図に示したように、ソースファイル群11と別名有向グラフ作成部12が設けられている。この別名有向グラフ作成部12では、ソースファイル群11からソースファイルを順次読み込み、既存技術である字句解析、構文解析、意味解析を行うことによって、関数や変数といったシンボルについて、あるシンボルが他のどのシンボルと同じメモリ領域を指す可能性があるかを解析し、別名有向グラフ13として表す。
【0017】
例えば、図2に示したサンプルプログラムを別名有向グラフに表すと図3に示したようになり、関数や変数といった各シンボルを一つのノードで表現し、あるシンボルが他のあるシンボルを指す可能性があることを、ノードとノードを結ぶアークで表現する。このアークには向きがあり、指す可能性のあるシンボルから指される可能性のあるシンボルへ向かう場合を「順方向」あるいは「正の方向」といい、その逆を「逆方向」あるいは「負の方向」ということとする。なお、あるシンボルが他のあるシンボルを指す可能性のある例としては、従来技術の項で示した図5のように、ポインタの代入、参照渡しによる代入や仮想関数等があり、同じ実体に対して別の名前が付けられるような、いわゆる「別名」の関係にあることを意味する。
【0018】
また、本実施形態の別名検索装置1には、別名検索を行いたいある特定のシンボルを指定する検索対象指定部14と、そのシンボルについて上記別名有向グラフ13を参照して、「検索対象として指定されたシンボルが、どのシンボルと同じメモリ領域を指す可能性があるか」という別名検索を行う別名検索部15と、別名検索部15による検索の結果、別名であると判断されたシンボルを別名情報データ16として登録する別名登録部17と、別名検索の結果を出力する出力部18とが設けられている。
なお、本実施形態においては、上記別名検索部15は、別名有向グラフ13を正の向き(順方向)に検索した後、負の向き(逆方向)に検索するように設定されているものとする。
【0019】
(2)作用
続いて、上記のような構成を有する本実施形態の別名検索装置における別名検索処理の流れを、図4に示したフローチャートにより説明する。
まず初めに、別名検索部15における検索順序を順方向→逆方向に行うように設定し(ステップ401)、別名情報データ16を空とする(ステップ402)。そして、ユーザが検索対象指定部14を介して指定したシンボル(検索対象シンボル)を取得し(ステップ403)、その検索対象シンボル自体を別名情報データ16として登録する(ステップ404)。
【0020】
次に、別名情報データ16の中から登録されている別名を1つ選択する(ステップ405)。この別名について、別名有向グラフを参照して、その別名のシンボルから正の向き(順方向)のアークがあるか否かを判断し(ステップ406)、正の向きのアークがあれば、アークの先にあるノードのシンボルをすべて別名として別名情報データ16に追加し(ステップ407)、ステップ408に進む。
なお、ステップ406において、あるノードに複数の正の向きのアークがある場合もあるし、あるノードに正の向きのアークがあり、その先のノードにさらに正の向きのアークがある場合もある。本実施形態においては、これらすべてのノードを登録する。
【0021】
一方、ステップ406において、正の向きのアークがないと判断された場合には、そのままステップ408に進む。ステップ408において、別名情報データ16として登録されているすべての別名について順方向の検索が終了したか否かが判断され、終了していない場合には、ステップ405に戻り、別名情報データ16の中から未処理の別名を1つ選択し、ステップ406〜ステップ408を繰り返す。一方、ステップ408において、別名情報データ16として登録されているすべての別名について順方向の検索が終了したと判断された場合には、ステップ409に進み、逆方向の検索を行う。
【0022】
すなわち、別名情報データ16の中から登録されている別名を1つ選択する(ステップ409)。この別名について、別名有向グラフを参照して、その別名のシンボルから負の向き(逆方向)のアークがあるか否かを判断し(ステップ410)、負の向きのアークがあれば、アークの先(アークの基端部)にあるノードのシンボルをすべて別名として別名情報データ16に追加し(ステップ411)、ステップ412に進む。一方、ステップ410において、負の向きのアークがないと判断された場合には、そのままステップ412に進む。
【0023】
ステップ412において、別名情報データ16として登録されているすべての別名について逆方向の検索が終了したか否かが判断され、終了していない場合には、ステップ409に戻り、別名情報データ16の中から未処理の別名を1つ選択し、ステップ410〜ステップ412を繰り返す。一方、ステップ412において、別名情報データ16として登録されているすべての別名について逆方向の検索が終了したと判断された場合には、その検索対象シンボルについての別名検索処理を終了する。
【0024】
以上のような別名検索処理の結果、別名情報データ16には、ユーザが指定した検索対象シンボルに対する「別名」のシンボルが得られる。そして、この検索結果が、出力部18によりユーザに提示される。
【0025】
(3)別名検索の具体例
続いて、上記の別名検索処理を、図3に示した別名有向グラフを例にして、より具体的に説明する。
仮に、検索対象指定部14によりpが指定されたとする(ステップ402)。まず、p自身を別名に登録する(ステップ403)。次に、正の向きに検索を行うので、ステップ405に進み、別名情報データ16の中から、すでに別名として登録されているシンボルとしてpが見つかる(ステップ405)。そのpについて別名有向グラフ(図3)を参照すると、pから正の向きのアークとしてaがあるので、aを別名に追加する(ステップ406,ステップ407)。
【0026】
次に、別名有向グラフを参照するとaから正の向きのアークはないので、そこで正の向きへの検索は終了する。この時点で別名情報データ16として登録されたシンボルは、pとaとなる。
次に、負の向きに検索を行う。別名情報データ16を参照し、すでに別名として登録されているシンボルp、aからまずpを取り出す。別名有向グラフ(図3)を参照して、pに向かうアークを負の向きに進むとrを得るので、rを別名に追加する。rから負の向きに進むアークはないので、終了する。
【0027】
同様に、別名情報データ16を参照し、すでに別名として登録されているシンボルとしてaを取り出す。aからアークを負の向きに進むとpとqがあるが、pはすでに登録されているので、qだけを登録する。qへ向かうアークはないので、別名検索は終了する。
その結果、pの別名として、p,r,a,qが得られる。ここで、p,r,a,qはポインタがpと同じ実体を指す可能性がある集合であるが、pは取得されたシンボル自身であるので、別名から除いてもよい。
【0028】
(4)効果
上述したように、本実施形態の別名検索装置によれば、ある特定のシンボルについて、別名有向グラフを参照して、正の方向と負の方向の両方向について別名検索を行うので、ある特定のシンボルに対する別名のみを効率良く、高精度に求めることができる。
【0029】
(5)他の実施形態
本発明は、上述した実施形態に限定されるものではなく、別名を検索する場合に、その検索の深度を限定することも可能である。なお、検索する深度を限定した場合には、その先にも別名となる可能性のあるシンボルが存在することを、マークや色、その他の表示方法を用いて表現することもできる。
また、ある特定のシンボルについて、正の方向あるいは負の方向の検索のいずれを先に実行するかは限定されない。上記の実施形態においては、正の方向を先に検索したが、負の方向を先に検索する場合には、図4に示したフローチャートにおいて、「順方向」と「逆方向」の用語を互いに置き換えることにより、実行することができる。
【0030】
【発明の効果】
以上のように、本発明によれば、シンボル間の関係の中で、ある特定のシンボルに対する別名のみを効率良く、高精度に求めることができる別名検索装置及び別名検索方法を提供することができる。
【図面の簡単な説明】
【図1】本発明の別名検索装置の一つの実施形態の構成を示す機能ブロック図
【図2】別名解析の実施形態を説明するためのサンプルプログラム
【図3】図2のサンプルプログラムについて作成された別名有向グラフ
【図4】本発明の別名検索装置における別名検索処理の流れを示すフローチャート
【図5】「別名」の関係にあるシンボルの例を示す図
【図6】ソースコードの一例を示す図
【符号の説明】
1…別名検索装置
11…ソースファイル群
12…別名有向グラフ作成部
13…別名有向グラフ
14…検索対象指定部
15…別名検索部
16…別名情報データ
17…別名登録部
18…出力部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a technique for analyzing a relationship between symbols for symbols such as variables and functions constituting a program, and more particularly to an alias search device and an alias search method for searching for an alias of a specific symbol.
[0002]
[Prior art]
In the IT society in recent years, services provided by IT have become larger and more complex, and accordingly, programs for realizing the IT society have become larger and more complex. On the other hand, as more people and companies enter the IT industry globally, competition for program development is intensifying.
[0003]
In such a situation, it is necessary to develop a program efficiently in a short period of time. As one method for that purpose, there is a method of developing a new program by reusing a program created in the past or a program created by another person (other company). In this way, when reusing an existing program, there are a method of using the existing program as it is without changing it, and a method of using it with some changes. Although it is easy if an existing program can be used without making any changes, it is usually necessary to add a new function or change (customize) an existing function.
[0004]
In order to change an existing program in this way, it is necessary to understand the program before the change. For that purpose, it is necessary to understand the program by referring to the specification and design document of the program. However, the specifications and design documents are sometimes changed after they are written, and the descriptions are not consistent with the program, or the specifications and design documents are not written in detail. Sometimes it is necessary to read the program to understand it correctly.
[0005]
However, as described above, the program has become huge and complicated, and it is difficult to read through all the programs. Therefore, it is very efficient if it is sufficient to consider only the points necessary for program change. To find out where to change a program, you first need an overview of the overall structure, and then you need to figure out where you want to change. Next, it is necessary to confirm where it will be affected when the part to be changed is changed. To do so, analyze in advance what kind of symbols are described in the program, and what kind of relationship each symbol has, and reuse the program for the relationship between symbols. There is a need for an environment that can be presented to an intended user.
[0006]
[Problems to be solved by the invention]
Thus, in analyzing the relationship between symbols, a so-called symbol can be given a different name to the same entity by assignment by pointer or assignment by reference as shown in FIG. It is necessary to analyze the case of "alias" relationship.
For example, Japanese Patent Application No. 5-141078 discloses a method for obtaining an alias name by performing pointer analysis and transitive closure calculation on the result as a method of obtaining an alias name of a certain symbol among relationships between symbols. Proposed.
[0007]
However, the technique disclosed in Japanese Patent Application No. 5-141078 is a method for obtaining a group of symbols that may have an alias relationship with respect to the entire program (hereinafter referred to as an alias set). It does not ask for an alias for. For this reason, in order to obtain an alias for a specific symbol, efficiency and accuracy are very poor.
In other words, as in Japanese Patent Application No. 5-141078, finding a set of aliases for the entire program is very efficient because it requires extra calculation when only aliases for a specific symbol are desired. It was bad.
[0008]
Further, when an alias set is obtained by a method such as Japanese Patent Application No. 5-141078, a symbol included in the alias set to which a specific symbol belongs is a candidate for the alias of the specific symbol. When attention is paid to a symbol, not all symbols included in the alias set are necessarily aliases of the noticed symbol, so the accuracy is poor.
[0009]
For example, if there is a source code as shown in FIG. 6, in the method of Japanese Patent Application No. 5-141078, * p may point to a, so that * p may be an alias for a, and * Since p may point to b and * p may be an alias for b, a, b, and * p are alias sets. However, when attention is paid to a as a specific symbol, for example, there is a problem that b is not necessarily an alias for a.
[0010]
The present invention has been proposed in order to solve the above-described problems of the prior art, and its purpose is to efficiently and accurately use only an alias for a specific symbol in the relationship between symbols. Another object of the present invention is to provide an alias search apparatus and an alias search method that can be obtained.
[0011]
[Means for Solving the Problems]
In order to achieve the above object, the alias search device according to claim 1 is composed of a computer having a data designation unit, storage unit, creation unit, search unit, and output unit, and a specific symbol in the source file. And an alias search device for searching for the alias, a search target designating unit that accepts designation of a specific symbol to be searched from a user, and a given symbol with a different name for the same entity as a certain symbol A source file group storage unit that stores source files including other symbols in an alias relationship, and a source file is read sequentially from the source file group storage unit, and a symbol in the source file and an alias Each related symbol is represented by a node, and between the nodes, one symbol represented by the node represents the one symbol. And alias digraph creation unit that creates an alias directed graph that represents signed by an arc of positive direction indicating a relationship that points to the symbol in the alias relationship, the specific symbol received in (1) the search target specifying unit, (2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the positive direction starting from this particular symbol; and (3) the particular symbol and the particular symbol An alias search unit that searches for a symbol that can be traced in a negative direction from a symbol that can be traced when traced in the positive direction, and an alias search unit that searches for the symbol that can be traced in the negative direction of the alias directed graph. An alias registration unit for registration and an output unit for outputting a symbol registered by the alias registration unit
According to another aspect of the present invention, there is provided an alias search apparatus comprising a computer having a data designation unit, storage unit, creation unit, search unit, and output unit, and searches for a specific symbol and its alias in a source file. In the alias search device, a search target designating unit that accepts designation of a specific symbol to be searched by the user, a different name is given to the same entity as a certain symbol, and there is a relationship between the certain symbol and the alias The source file group storing the source file including the source file, and the source file are read sequentially from the source file group storing unit, and a symbol in the source file and a symbol having an alias relationship with each symbol are respectively read. This node is represented by a node, and between these nodes, one symbol represented by the node is associated with the one symbol. And alias digraph creation unit that creates an alias directed graph that represents signed by the positive direction of the arc indicating a relationship pointing against Boll, the specific symbol received in (1) the search target specifying unit, (2) this specific A symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the negative direction, and (3) the specific symbol and the specific symbol are traced in the negative direction. An alias search unit that searches for a symbol that can be traced in the positive direction starting from a symbol that can be traced, and an alias registration unit that registers the symbol searched by the alias search unit And an output unit for outputting the symbol registered by the alias registration unit.
[0012]
An alias search method according to claim 3 captures the invention according to claim 1 from the viewpoint of the method, and includes a search target designating unit, a source file group storage unit implemented on a computer, The alias directed graph creation unit, alias search unit, alias registration unit, and output unit assign different names to the same entity as the specific symbol in the source file stored in the storage unit of the source file group. In the alias search method for searching for another symbol having an alias relationship with a specific symbol, the search target specifying unit executes a search target specifying step for receiving specification of a specific symbol to be searched from a user, The alias directed graph creation unit reads out the source file from the source file group storage unit in order, and a certain symbol in the source file and its alias Represents the symbol are in a relationship with each node, between the nodes, signed by an arc of positive direction indicating a relationship that points to the symbol in the one symbol represented by a node in relation of the one symbol and aliases An alias directed graph creating step for creating an alias directed graph that is expressed is executed, and the alias search unit includes (1) a specific symbol received by the search target designating unit from among the alias directed graphs created by the alias directed graph creation unit (2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the positive direction starting from this particular symbol; and (3) the particular symbol and the particular symbol. If the symbol is traced in the positive direction, the aliased graph is An alias search step of searching for a symbol that can be traced in the direction, the alias registration unit executes an alias registration step of registering the symbol searched by the alias search unit, and the output unit An output step of outputting a symbol registered by the alias registration unit is executed.
An alias search method according to claim 4 captures the invention according to claim 2 from the viewpoint of the method, and includes a search target designating unit, a source file group storage unit implemented on a computer, The alias directed graph creation unit, alias search unit, alias registration unit, and output unit assign different names to the same entity as the specific symbol in the source file stored in the storage unit of the source file group. In the alias search method for searching for another symbol having an alias relationship with a specific symbol, the search target specifying unit executes a search target specifying step for receiving specification of a specific symbol to be searched from a user, The alias directed graph creation unit reads out the source file from the source file group storage unit in order, and a certain symbol in the source file and its alias Each symbol in the relationship is represented by a node, and an arc in a positive direction indicating a relationship between the nodes from one symbol represented by the node to a symbol having an alias relationship with the one symbol, or one symbol Performing an aliased directed graph creating step of creating an aliased directed graph represented by connecting at least one of arcs in a negative direction indicating a relationship in which one symbol is pointed to by a symbol having an aliased relationship with the one symbol, The alias search unit includes (1) a specific symbol received by the search target designating unit from the alias directed graph created by the alias directed graph creation unit, and (2) the alias directed graph creation unit starting from the specific symbol. A symbol that can be traced when the aliased graph created in is followed in a negative direction, and ( And an alias search step of searching for the specific symbol and a symbol that can be traced when the specific symbol is traced in a negative direction, and a symbol that can trace the alias directed graph in a positive direction. The alias registration unit executes an alias registration step of registering the symbol searched by the alias search unit, and the output unit executes an output step of outputting the symbol registered by the alias registration unit. It is characterized by that.
[0013]
Further, the alias search program according to claim 5 captures the invention of claim 1 from the viewpoint of software, and allows the computer to receive a designation of a specific symbol to be searched from the user. A designation unit, a storage unit of a source file group that stores a source file including another symbol that is given another name for the same entity as a certain symbol and has an alias relationship with the certain symbol, and the source file group The source file is read sequentially from the storage unit, and a symbol in the source file and a symbol that has an alias relationship with each symbol are represented by nodes, and between the nodes, one symbol represented by the node alias directed grayed expressing signed by an arc of positive direction indicating a relationship that points to the symbol in a relationship symbol and aliases An alias directed graph creation unit that creates a file, (1) a specific symbol received by the search target designating unit, and (2) an alias directed graph created by the alias directed graph creation unit starting from the specific symbol A symbol that can be traced when traced in the direction, and (3) the specific symbol and a symbol that can be traced when traced in the positive direction as the starting point, the alias directed graph in a negative direction And an alias search unit that searches for symbols that can be traced, and an alias registration unit that registers symbols searched by the alias search unit.
According to a sixth aspect of the present invention, the alias search program captures the invention of the second aspect from the viewpoint of software, and the computer accepts designation of a specific symbol to be searched from the user. A search target designating unit; a source file group storage unit storing a source file including another symbol having a different name with respect to the same symbol and the same entity as the symbol; and the source The source file is read sequentially from the file group storage unit, and a symbol in the source file and a symbol that has an alias relationship with each symbol are represented by nodes, and between the nodes, one symbol represented by the node alias expressed signed by an arc of positive direction indicating a relationship that points to the symbol in a relationship of one symbol and aliases An alias directed graph creation unit for creating a directed graph; (1) a specific symbol received by the search target designating unit; and (2) an alias directed graph created by the alias directed graph creation unit starting from the specific symbol. A symbol that can be traced when traced in the direction of (3), and (3) the aliased graph with a positive sign, starting from the specific symbol and the symbol that can be traced when the specific symbol is traced in a negative direction. An alias search unit that searches for a symbol that can be traced in a direction, and an alias registration unit that registers a symbol searched by the alias search unit.
[0014]
According to the first to sixth aspects of the invention having the above-described configuration, it is possible to efficiently obtain a symbol having an alias relationship for a specific symbol with high accuracy.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be specifically described below with reference to the drawings. The following embodiment is realized on a computer, and each function of the embodiment is realized by a predetermined procedure (program) controlling the computer. Each means in this specification is a conceptual one corresponding to each function of the embodiment, and does not necessarily correspond one-to-one to specific hardware and software routines. The same hardware element constitutes different means in some cases. For example, a computer can be one means when executing a certain instruction and another means when executing another instruction. One means may be realized by only one instruction or may be realized by a large number of instructions. Therefore, in the present specification, the embodiment will be described below assuming a virtual circuit block (means) having each function of the embodiment. Further, the steps of each procedure in the present embodiment may be executed in a different order for each execution by changing the execution order and executing a plurality of steps at the same time, as long as it does not contradict its nature. Such a change in the order can be realized by a menu-type interface method such as selecting a process executable by the user.
[0016]
(1) Configuration The alias search device 1 of the present embodiment is provided with a source file group 11 and an alias directed graph creation unit 12 as shown in the functional block diagram of FIG. The alias directed graph creation unit 12 sequentially reads a source file from the source file group 11 and performs lexical analysis, syntax analysis, and semantic analysis, which are existing technologies, so that a symbol such as a function or a variable is a symbol other than Is analyzed as to whether there is a possibility of pointing to the same memory area, and is expressed as an aliased graph 13.
[0017]
For example, if the sample program shown in FIG. 2 is expressed in an aliased graph as shown in FIG. 3, there is a possibility that each symbol such as a function or a variable is expressed by one node, and one symbol points to another symbol. A certain thing is expressed by an arc connecting nodes. This arc has a direction, and the direction from a symbol that can be pointed to a symbol that can be pointed to is referred to as "forward direction" or "positive direction", and vice versa. Direction. Examples of the possibility that a symbol may point to another symbol include pointer assignment, assignment by reference, a virtual function, etc., as shown in FIG. It means that it has a so-called “alias” relationship in which another name can be given.
[0018]
Further, the alias search device 1 of the present embodiment refers to the search target designating unit 14 for designating a specific symbol for which an alias search is desired, and the alias directed graph 13 for the symbol. The alias search unit 15 that performs an alias search such as “which symbol may point to the same memory area as the symbol”, and the symbol that is determined to be an alias as a result of the search by the alias search unit 15 is alias information data An alias registration unit 17 for registering as 16 and an output unit 18 for outputting the result of the alias search are provided.
In the present embodiment, the alias search unit 15 is set to search the alias directed graph 13 in the positive direction (forward direction) and then in the negative direction (reverse direction). .
[0019]
(2) Operation Next, the flow of alias search processing in the alias search device of the present embodiment having the above-described configuration will be described with reference to the flowchart shown in FIG.
First, the search order in the alias search unit 15 is set to be performed in the forward direction → the reverse direction (step 401), and the alias information data 16 is emptied (step 402). Then, a symbol (search target symbol) designated by the user via the search target designating unit 14 is acquired (step 403), and the search target symbol itself is registered as the alias information data 16 (step 404).
[0020]
Next, one registered alias is selected from the alias information data 16 (step 405). For this alias, refer to the alias directed graph to determine whether or not there is a positive direction (forward) arc from the alias symbol (step 406). Are added to the alias information data 16 as aliases (step 407), and the process proceeds to step 408.
In step 406, there may be a plurality of positive-direction arcs at a certain node, a positive-direction arc at a certain node, and a further positive-direction arc at a subsequent node. . In this embodiment, all these nodes are registered.
[0021]
On the other hand, if it is determined in step 406 that there is no positive direction arc, the process proceeds to step 408 as it is. In step 408, it is determined whether or not the forward search has been completed for all the aliases registered as the alias information data 16. If not, the process returns to step 405, and the alias information data 16 contains One unprocessed alias name is selected from Steps 406 to 408. On the other hand, if it is determined in step 408 that the search in the forward direction has been completed for all the aliases registered as the alias information data 16, the process proceeds to step 409 to perform the reverse search.
[0022]
That is, one registered alias name is selected from the alias information data 16 (step 409). For this alias, refer to the alias directed graph to determine whether or not there is a negative (reverse) arc from the alias symbol (step 410). All the symbols of the nodes at (the base end of the arc) are added as aliases to the alias information data 16 (step 411), and the process proceeds to step 412. On the other hand, if it is determined in step 410 that there is no negative arc, the process proceeds to step 412 as it is.
[0023]
In step 412, it is determined whether or not the reverse search has been completed for all the aliases registered as the alias information data 16. If not, the process returns to step 409, and the alias information data 16 contains Then, one unprocessed alias is selected, and Steps 410 to 412 are repeated. On the other hand, if it is determined in step 412 that the reverse search has been completed for all the aliases registered as the alias information data 16, the alias search process for the search target symbol is terminated.
[0024]
As a result of the alias search process as described above, the “alias” symbol for the search target symbol designated by the user is obtained in the alias information data 16. Then, the search result is presented to the user by the output unit 18.
[0025]
(3) Specific Example of Alias Search Next, the above-described alias search process will be described more specifically with the alias directed graph shown in FIG. 3 as an example.
Assume that p is designated by the search target designation unit 14 (step 402). First, p itself is registered as an alias (step 403). Next, since the search is performed in the positive direction, the process proceeds to step 405, and p is found from the alias information data 16 as a symbol already registered as an alias (step 405). Referring to the alias directed graph (FIG. 3) with respect to p, since there is a as an arc having a positive direction from p, a is added to the alias (steps 406 and 407).
[0026]
Next, referring to the alias directed graph, since there is no arc in the positive direction from a, the search in the positive direction ends there. At this time, the symbols registered as the alias information data 16 are p and a.
Next, the search is performed in the negative direction. The alias information data 16 is referred to, and p is first extracted from the symbols p and a already registered as aliases. With reference to the alias directed graph (FIG. 3), r is obtained when the arc toward p is advanced in the negative direction, so r is added to the alias. Since there is no arc going in a negative direction from r, the process ends.
[0027]
Similarly, the alias information data 16 is referred to, and a is extracted as a symbol already registered as an alias. If the arc is advanced in a negative direction from a, there are p and q, but since p is already registered, only q is registered. Since there is no arc heading for q, the alias search ends.
As a result, p, r, a, and q are obtained as aliases for p. Here, p, r, a, and q are sets whose pointers may point to the same entity as p. However, since p is the acquired symbol itself, it may be excluded from the alias.
[0028]
(4) Effect As described above, according to the alias search device of this embodiment, an alias search is performed for a specific symbol in both the positive direction and the negative direction with reference to the alias directed graph. Only an alias for a specific symbol can be obtained efficiently and with high accuracy.
[0029]
(5) Other Embodiments The present invention is not limited to the above-described embodiments, and when searching for aliases, the search depth can be limited. Note that when the search depth is limited, the fact that there is a symbol that may be an alias may be expressed using marks, colors, or other display methods.
In addition, it is not limited which of the positive direction and the negative direction search is performed first for a specific symbol. In the above embodiment, the positive direction is searched first. However, when the negative direction is searched first, the terms “forward direction” and “reverse direction” in the flowchart shown in FIG. It can be executed by replacing.
[0030]
【The invention's effect】
As described above, according to the present invention, it is possible to provide an alias search device and an alias search method that can efficiently and accurately obtain an alias for a specific symbol in a relationship between symbols. .
[Brief description of the drawings]
FIG. 1 is a functional block diagram showing the configuration of an embodiment of an alias search device of the present invention. FIG. 2 is a sample program for explaining an embodiment of alias analysis. FIG. 3 is created for the sample program of FIG. Fig. 4 is a flowchart showing the flow of alias search processing in the alias search apparatus of the present invention. Fig. 5 is a diagram showing an example of symbols having an "alias" relationship. Fig. 6 is a diagram showing an example of source code. [Explanation of symbols]
DESCRIPTION OF SYMBOLS 1 ... Alias search apparatus 11 ... Source file group 12 ... Alias directed graph preparation part 13 ... Alias directed graph 14 ... Search object designation | designated part 15 ... Alias search part 16 ... Alias information data 17 ... Alias registration part 18 ... Output part

Claims (6)

データの指定部、格納部、作成部、検索部及び出力部を備えたコンピュータから構成され、ソースファイル中の特定のシンボルとその別名を検索する別名検索装置において、
ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、
あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、
前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、
を検索する別名検索部と、
前記別名検索部によって検索されたシンボルを登録する別名登録部と、
前記別名登録部により登録されたシンボルを出力する出力部とを備えることを特徴とする別名検索装置。
In an alias search device that consists of a computer having a data designation unit, storage unit, creation unit, search unit and output unit, and searches for a specific symbol and its alias in a source file,
A search target designating unit that accepts designation of a specific symbol to be searched from the user;
A storage unit of a group of source files storing a source file including another symbol which is given another name for the same entity as a certain symbol and has an alias relationship with the certain symbol;
The source file is sequentially read from the source file group storage unit, and a symbol in the source file and a symbol having an alias relationship with each symbol are represented by nodes, and one symbol represented by a node between the nodes. An alias directed graph creating unit that creates an aliased directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the positive direction starting from the specific symbol;
(3) the specific symbol and a symbol that can be traced when the specific symbol is traced in a positive direction, and a symbol that can trace the alias directed graph in a negative direction;
An alias search section to search for,
An alias registration unit for registering the symbol searched by the alias search unit;
And an output unit for outputting the symbol registered by the alias registration unit.
データの指定部、格納部、作成部、検索部及び出力部を備えたコンピュータから構成され、ソースファイル中の特定のシンボルとその別名を検索する別名検索装置において、
ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、
あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、
前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、
を検索する別名検索部と、
前記別名検索部によって検索されたシンボルを登録する別名登録部と、
前記別名登録部により登録されたシンボルを出力する出力部とを備えることを特徴とする別名検索装置。
In an alias search device that consists of a computer having a data designation unit, storage unit, creation unit, search unit and output unit, and searches for a specific symbol and its alias in a source file,
A search target designating unit that accepts designation of a specific symbol to be searched from the user;
A storage unit of a group of source files storing a source file including another symbol which is given another name for the same entity as a certain symbol and has an alias relationship with the certain symbol;
The source file is sequentially read from the source file group storage unit, and a symbol in the source file and a symbol having an alias relationship with each symbol are represented by nodes, and one symbol represented by a node between the nodes. An alias directed graph creating unit that creates an aliased directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the negative direction starting from the specific symbol;
(3) the specific symbol and a symbol that can be traced when the specific symbol is traced in a negative direction, and a symbol that can trace the alias directed graph in a positive direction,
An alias search section to search for,
An alias registration unit for registering the symbol searched by the alias search unit;
And an output unit for outputting the symbol registered by the alias registration unit.
コンピュータ上に実現される検索対象指定部、ソースファイル群の格納部、別名有向グラフ作成部、別名検索部、別名登録部及び出力部により、前記ソースファイル群の格納部に格納されているソースファイル中の特定のシンボルと同じ実体に対して別の名前が付けられた前記特定のシンボルと別名の関係にある他のシンボルを検索する別名検索方法において、
前記検索対象指定部が、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定ステップを実行し、
前記別名有向グラフ作成部が、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成ステップを実行し、
前記別名検索部が、前記別名有向グラフ作成部において作成された別名有向グラフ中から、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、を検索する別名検索ステップを実行し、
前記別名登録部が、前記別名検索部によって検索されたシンボルを登録する別名登録ステップを実行し、
前記出力部が、前記別名登録部により登録されたシンボルを出力する出力ステップを実行することを特徴とする別名検索方法。
Among the source files stored in the storage unit of the source file group by the search target designation unit, the source file group storage unit, the alias directed graph creation unit, the alias search unit, the alias registration unit, and the output unit realized on the computer In an alias search method for searching for another symbol having an alias relationship with the specific symbol that is given another name for the same entity as the specific symbol of
The search target specifying unit executes a search target specifying step for receiving specification of a specific symbol to be searched from a user,
The alias directed graph creation unit sequentially reads a source file from the source file group storage unit, and represents each symbol in the source file and a symbol having an alias relationship with each node as a node. An alias directed graph creating step for creating an alias directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from one symbol represented by
From the alias directed graph created by the alias directed graph creating unit, the alias search unit,
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the positive direction starting from the specific symbol;
(3) An alias search for searching for the specific symbol and a symbol that can be traced when the specific symbol is traced in a positive direction, and a symbol that can trace the alias directed graph in a negative direction. Perform steps,
The alias registration unit executes an alias registration step of registering a symbol searched by the alias search unit,
The alias search method, wherein the output unit executes an output step of outputting a symbol registered by the alias registration unit.
コンピュータ上に実現される検索対象指定部、ソースファイル群の格納部、別名有向グラフ作成部、別名検索部、別名登録部及び出力部により、前記ソースファイル群の格納部に格納されているソースファイル中の特定のシンボルと同じ実体に対して別の名前が付けられた前記特定のシンボルと別名の関係にある他のシンボルを検索する別名検索方法において、
前記検索対象指定部が、ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定ステップを実行し、
前記別名有向グラフ作成部が、前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成ステップを実行し、
前記別名検索部が、前記別名有向グラフ作成部において作成された別名有向グラフ中から、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、を検索する別名検索ステップを実行し、
前記別名登録部が、前記別名検索部によって検索されたシンボルを登録する別名登録ステップを実行し、
前記出力部が、前記別名登録部により登録されたシンボルを出力する出力ステップを実行することを特徴とする別名検索方法。
Among the source files stored in the storage unit of the source file group by the search target designation unit, the source file group storage unit, the alias directed graph creation unit, the alias search unit, the alias registration unit, and the output unit realized on the computer In an alias search method for searching for another symbol having an alias relationship with the specific symbol that is given another name for the same entity as the specific symbol of
The search target specifying unit executes a search target specifying step for receiving specification of a specific symbol to be searched from a user,
The alias directed graph creation unit sequentially reads a source file from the source file group storage unit, and represents each symbol in the source file and a symbol having an alias relationship with each node as a node. An alias directed graph creating step for creating an alias directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from one symbol represented by
From the alias directed graph created by the alias directed graph creating unit, the alias search unit,
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the negative direction starting from the specific symbol;
(3) An alias search for searching for the specific symbol and a symbol that can be traced when the specific symbol is traced in a negative direction, and a symbol that can trace the alias directed graph in a positive direction. Perform steps,
The alias registration unit executes an alias registration step of registering a symbol searched by the alias search unit,
The alias search method, wherein the output unit executes an output step of outputting a symbol registered by the alias registration unit.
コンピュータを、
ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、
あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、
前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを正の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを正の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを負の向きにたどることのできるシンボルと、
を検索する別名検索部と、
前記別名検索部によって検索されたシンボルを登録する別名登録部として機能させることを特徴とする別名検索用プログラム。
Computer
A search target designating unit that accepts designation of a specific symbol to be searched from the user;
A storage unit of a group of source files storing a source file including another symbol which is given another name for the same entity as a certain symbol and has an alias relationship with the certain symbol;
The source file is sequentially read from the source file group storage unit, and a symbol in the source file and a symbol having an alias relationship with each symbol are represented by nodes, and one symbol represented by a node between the nodes. An alias directed graph creating unit that creates an aliased directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the positive direction starting from the specific symbol;
(3) the specific symbol and a symbol that can be traced when the specific symbol is traced in a positive direction, and a symbol that can trace the alias directed graph in a negative direction;
An alias search section to search for,
An alias search program which functions as an alias registration unit for registering a symbol searched by the alias search unit.
コンピュータを、
ユーザからの検索対象となる特定のシンボルの指定を受け付ける検索対象指定部と、
あるシンボルと同じ実体に対して別の名前が付けられて前記あるシンボルと別名の関係にある他のシンボルを含むソースファイルを格納したソースファイル群の格納部と、
前記ソースファイル群格納部からソースファイルを順時読み出して、ソースファイル中のあるシンボルとそれに対して別名の関係にあるシンボルをそれぞれノードで表し、このノード間を、ノードで表された一つのシンボルから当該一つのシンボルと別名の関係にあるシンボルに対して指す関係を示す正の方向のアークにより結んで表現した別名有向グラフを作成する別名有向グラフ作成部と、
(1)前記検索対象指定部において受け付けた特定のシンボルと、
(2)この特定のシンボルを始点に前記別名有向グラフ作成部で作成された別名有向グラフを負の向きにたどったときにたどることのできるシンボルと、
(3)前記特定のシンボル及び前記特定のシンボルを負の向きにたどったときにたどることのできるシンボルを始点に、前記別名有向グラフを正の向きにたどることのできるシンボルと、
を検索する別名検索部と、
前記別名検索部によって検索されたシンボルを登録する別名登録部として機能させることを特徴とする別名検索用プログラム。
Computer
A search target designating unit that accepts designation of a specific symbol to be searched from the user;
A storage unit of a group of source files storing a source file including another symbol which is given another name for the same entity as a certain symbol and has an alias relationship with the certain symbol;
The source file is sequentially read from the source file group storage unit, and a symbol in the source file and a symbol having an alias relationship with each symbol are represented by nodes, and one symbol represented by a node between the nodes. An alias directed graph creating unit that creates an aliased directed graph expressed by connecting in a positive direction arc indicating a relationship pointed to a symbol in an alias relationship with the one symbol from
(1) a specific symbol received by the search target designating unit;
(2) a symbol that can be traced when the alias directed graph created by the alias directed graph creation unit is traced in the negative direction starting from the specific symbol;
(3) the specific symbol and a symbol that can be traced when the specific symbol is traced in a negative direction, and a symbol that can trace the alias directed graph in a positive direction,
An alias search section to search for,
An alias search program which functions as an alias registration unit for registering a symbol searched by the alias search unit.
JP2001224412A 2001-07-25 2001-07-25 Alias name search apparatus, alias name search method, and alias name search program Expired - Fee Related JP3999949B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001224412A JP3999949B2 (en) 2001-07-25 2001-07-25 Alias name search apparatus, alias name search method, and alias name search program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001224412A JP3999949B2 (en) 2001-07-25 2001-07-25 Alias name search apparatus, alias name search method, and alias name search program

Publications (2)

Publication Number Publication Date
JP2003036186A JP2003036186A (en) 2003-02-07
JP3999949B2 true JP3999949B2 (en) 2007-10-31

Family

ID=19057570

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001224412A Expired - Fee Related JP3999949B2 (en) 2001-07-25 2001-07-25 Alias name search apparatus, alias name search method, and alias name search program

Country Status (1)

Country Link
JP (1) JP3999949B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4516306B2 (en) * 2003-11-28 2010-08-04 株式会社日立製作所 How to collect storage network performance information
JP4706262B2 (en) * 2004-05-21 2011-06-22 日本電気株式会社 Access control system, access control method, and access control program
US20100199264A1 (en) * 2007-08-02 2010-08-05 Naoto Maeda Pattern inspection system, pattern inspection device, method and pattern inspection program
JP5409039B2 (en) * 2009-02-17 2014-02-05 三菱電機株式会社 Information processing apparatus, information processing method, and program

Also Published As

Publication number Publication date
JP2003036186A (en) 2003-02-07

Similar Documents

Publication Publication Date Title
US10579344B2 (en) Converting visual diagrams into code
CN113508385B (en) Method and system for formal language processing using subroutine graphs
US20200272426A1 (en) Code completion for dynamically-typed programming languages using machine learning
CN106502896B (en) Method and device for generating function test code
CN111143228B (en) Test code generation method and device based on decision table method
CN115017516A (en) Fuzzy test method based on symbolic execution
US8701086B2 (en) Simplifying analysis of software code used in software systems
Iser et al. Global benchmark database
CN113779311B (en) A data processing method, device and storage medium
CN114003234A (en) Small program partial compilation method, apparatus, device and computer-readable storage medium
US20120151441A1 (en) Efficient generation of executable file from program files when some of the program files expressly incorporate other program files
JP3999949B2 (en) Alias name search apparatus, alias name search method, and alias name search program
US20040010780A1 (en) Method and apparatus for approximate generation of source code cross-reference information
CN108090034B (en) Cluster-based unified code generation method and system for document code
JP3887550B2 (en) Cross-reference construction device, cross-reference construction method, and cross-reference construction program
CN107015909A (en) Method of testing and device based on code analysis on altered project
CN115328494A (en) Code generation method, device, equipment and medium
US10846198B2 (en) Automatic navigation from log statement to code
CN115033249A (en) File compiling method and device
CN115098155A (en) Service configuration method and device, storage medium and computer equipment
CN116414396A (en) A LLVM target definition file generation method, device and electronic equipment
CN110007900A (en) Tool-class call method, system, computer equipment and storage medium
Samodra et al. Development of Graph Generation Tools for Python Function Code Analysis
CN115640260B (en) Software maintainability measurement method based on ELF
Dunkel Cut to the Core: Automated Feature Extraction in R Using Program Slicing

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060703

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060711

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060911

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061121

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070118

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070327

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070523

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: 20070807

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070810

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

Free format text: PAYMENT UNTIL: 20100817

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees