JP2006277330A - Source code editing device and source code editing method - Google Patents

Source code editing device and source code editing method Download PDF

Info

Publication number
JP2006277330A
JP2006277330A JP2005095520A JP2005095520A JP2006277330A JP 2006277330 A JP2006277330 A JP 2006277330A JP 2005095520 A JP2005095520 A JP 2005095520A JP 2005095520 A JP2005095520 A JP 2005095520A JP 2006277330 A JP2006277330 A JP 2006277330A
Authority
JP
Japan
Prior art keywords
source code
search
file
character string
code file
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
JP2005095520A
Other languages
Japanese (ja)
Inventor
Atsushi Takagi
淳 高木
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 JP2005095520A priority Critical patent/JP2006277330A/en
Publication of JP2006277330A publication Critical patent/JP2006277330A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide an editor improved in retrieval efficiency by performing no character string retrieval for a source code that cannot become a compile object. <P>SOLUTION: This device comprises a source code translation engine. A source code is translated to generate a source code file in which the source code which cannot be the compile object such as a preprocessor instruction or comment is excluded, whether an intended character string is present in the source code file or not is retrieved, and when the character string is present, the line thereof is jumped to execute the retrieval of character from the first column. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

この発明は、ソースコードの編集装置に関し、特にソースコード内の特定文字列を検索する機能を備えたソースコード編集装置に関する。また、この発明はソースコードファイルの特定文字列を検索する際に、ソースコードの翻訳を行って、検索不要な範囲を特定することを可能にしたソースコード編集方法に関する。   The present invention relates to a source code editing apparatus, and more particularly to a source code editing apparatus having a function of searching for a specific character string in a source code. The present invention also relates to a source code editing method that enables a source code to be translated and a search unnecessary range to be specified when searching for a specific character string in a source code file.

プログラム開発する際に用いられるソースコードの編集を目的としたソースコード編集装置には、検索機能が付属されるのが一般である。例えば特定の文字列がソースコードファイルのどこの行に含まれているかというような検索を行うことができるようにして、編集の機能を向上させている。   In general, a search function is attached to a source code editing device for editing a source code used for program development. For example, the editing function is improved by making it possible to perform a search such as in which line of a source code file a specific character string is included.

従来このようなソースコード編集装置の検索機能は、ソースコードに含まれる全ての文字列に対して検索を実行するものであるため、コンパイル対象にならない、すなわち検索してほしくないソースコードまで検索していた。すなわち、例えば、プリプロセッサ命令やコメント等のコンパイル対象にならないソースコードまで検索するため、効率がよくないという問題を抱えていた。   Conventionally, the search function of such a source code editing device executes a search for all the character strings included in the source code. Therefore, the search function searches for source codes that are not to be compiled, that is, do not want to be searched. It was. That is, for example, since the source code that is not a compilation target such as a preprocessor instruction or a comment is searched, there is a problem that the efficiency is not high.

特許文献1には、一般的なソースコードを検索するシステムが開示されている。
特開平6−282429号公報
Patent Document 1 discloses a system for searching a general source code.
JP-A-6-282429

以上説明したように、従来、ソースコードの検索機能を備えたソースコード編集装置では、ソースコードに含まれる全ての文字列に対して検索を実行するため編集の効率がよくないという問題を有していた。   As described above, a conventional source code editing device having a source code search function has a problem that editing is not efficient because search is performed on all character strings included in the source code. It was.

本発明は、以上の点に鑑みてなされたものであり、ソースコードを翻訳しながら検索できるように、翻訳エンジンを備えることで、ソースコードの非コンパイル対象部分を検索対象から除外することができるようにしたソースコード編集装置及びソースコード編集方法を提供することを目的とする。   The present invention has been made in view of the above points, and by providing a translation engine so that the source code can be searched while being translated, a non-compiled portion of the source code can be excluded from the search target. An object of the present invention is to provide a source code editing apparatus and a source code editing method.

この発明に係わるソースコード編集装置は、ソースコード翻訳手段と、コンパイル対象としないソースコードを特定するための情報を設定する非コンパイルソースコード情報設定手段と、検索文字列を設定する検索文字列設定手段と、前記ソースコード翻訳手段によってソースコードファイルを翻訳させ、前記非コンパイルソースコード情報設定手段で設定された情報に基づくソースコードを除外した2次ソースコードファイルを生成する2次ソースコードファイル生成手段と、この2次ソースコードファイル生成手段によって生成された2次ソースコードファイルに対して、前記検索文字列設定手段で設定された文字列を検索する文字列検索手段と、この文字列検索手段による検索結果に基づき、前記ソースコードファイルの少なくとも特定部位を表示する表示手段と、を具備したことを特徴とする。   A source code editing apparatus according to the present invention includes a source code translating means, a non-compiled source code information setting means for setting information for specifying a source code not to be compiled, and a search character string setting for setting a search character string And a source code file is generated by translating the source code file by the source code translating means and excluding the source code based on the information set by the non-compiled source code information setting means And a character string search means for searching the character string set by the search character string setting means for the secondary source code file generated by the secondary source code file generation means, and the character string search means Based on the search result of the source code file. Characterized by comprising display means for displaying the site, the.

この発明に係わるソースコード編集方法は、コンパイル対象としないソースコードを特定するための情報を設定するステップと、検索文字列を設定するステップと、前記ソースコード翻訳手段によってソースコードファイルを翻訳させ、前記非コンパイルソースコード情報設定手段で設定された情報に基づくソースコードを除外した2次ソースコードファイルを生成するステップと、前記2次ソースコードファイル生成手段によって生成された2次ソースコードファイルに対して、前記設定された検索文字列を検索するステップと、検索結果に基づき、前記ソースコードファイルの少なくとも特定部位を表示するステップと、を具備したことを特徴とする。   The source code editing method according to the present invention includes a step of setting information for specifying source code not to be compiled, a step of setting a search character string, a source code file translated by the source code translation means, Generating a secondary source code file excluding source code based on the information set by the non-compiled source code information setting means, and the secondary source code file generated by the secondary source code file generating means And a step of searching for the set search character string, and a step of displaying at least a specific part of the source code file based on the search result.

本発明によれば、ソースコードを翻訳しながら目的の文字列を検索することによってソースコードのコンパイル対象部分のみを検索することが可能となり、編集の効率を向上させることができるものである。   According to the present invention, it is possible to search only the part to be compiled of the source code by searching for the target character string while translating the source code, and the efficiency of editing can be improved.

以下、この発明の実施の形態について、図面を参照して詳細に説明する。図1は、この発明に係わるソースコード編集装置(エディタ)を実行させるためのシステムの概略を説明するための構成図であり、システム全体を制御するためのCPU(Central Processing Unit)で構成される制御部101と、ユーザが設定のための入力を行う操作入力部102と、制御部101のワークエリアとして使われるメモリ103と、エディタを含むアプリケーションソフト、あるいは編集対象のソースコードファイルが蓄積される例えばHDD(Hard Disk Drive)で構成される記憶装置104と、ユーザが設定を行う際に、その設定のための表示を行うと共に、ソースコードの表示を行う表示部105を有している。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram for explaining the outline of a system for executing a source code editing apparatus (editor) according to the present invention, and is composed of a CPU (Central Processing Unit) for controlling the entire system. A control unit 101, an operation input unit 102 for a user to input for setting, a memory 103 used as a work area of the control unit 101, application software including an editor, or a source code file to be edited are stored. For example, a storage device 104 configured by an HDD (Hard Disk Drive) and a display unit 105 that displays a source code and displays the setting when the user performs the setting.

次に、この発明に係わるソースコード編集装置(ソースコード翻訳機能付きエディタ)と、このエディタによって、編集されるソースコードファイルが保存されるHDD(Hard Disk Drive)等の記憶装置との間で実行される処理の概略について図2を参照して説明する。   Next, it is executed between the source code editing apparatus (an editor with a source code translation function) according to the present invention and a storage device such as an HDD (Hard Disk Drive) in which the source code file to be edited is stored by the editor. An outline of the processing to be performed will be described with reference to FIG.

エディタ201は、機能としてのオプション設定202と、ソースコード検索エンジン203と、検索A204と、ソースコード表示205を含む。   The editor 201 includes an option setting 202 as a function, a source code search engine 203, a search A 204, and a source code display 205.

オプション設定202は、ユーザによる操作入力部102の操作に基づきソースコードを翻訳するためのスクリプトファイルを設定し、さらに検索エンジン203でコメントと解釈する文字を設定する機能を有する。   The option setting 202 has a function of setting a script file for translating the source code based on the operation of the operation input unit 102 by the user, and further setting a character to be interpreted as a comment by the search engine 203.

ソースコード翻訳エンジン203は、オプション設定202で設定したスクリプトファイルを解釈してソースコードの翻訳を実行しながら、コメントと解釈する文字及びプリプロセッサ命令を特定し、コンパイル対象となるソースコードと、そのソースコードの行番号で構成される「翻訳されたソースコードファイル」生成する。さらにソースコード翻訳エンジン203は、生成した「翻訳されたソースコードファイル」内で、後述する検索Aから与えられる文字列を検索し、その検索結果を検索Aに送出する。   The source code translation engine 203 interprets the script file set in the option setting 202 and executes translation of the source code, specifies the character and preprocessor instruction to be interpreted as a comment, the source code to be compiled, and its source Generate a "translated source code file" consisting of the line numbers of the code. Further, the source code translation engine 203 searches the generated “translated source code file” for a character string given from the search A described later, and sends the search result to the search A.

検索A204は、ユーザによる操作入力部102の操作に基づき、検索文字列の設定、検索モードの設定、すなわち翻訳検索モードか通常検索モードかの設定を行うと共に、翻訳検索モードにおいて、ソースコード翻訳エンジン203に対してこれを起動させる処理を行う。さらに検索A204は、ソースコード翻訳エンジン203から検索結果を受け取って、それに基づいてソースコードを検索し、検索結果をソースコード表示203に送出する。   The search A 204 sets a search character string and a search mode based on the operation of the operation input unit 102 by the user, that is, sets a translation search mode or a normal search mode. In the translation search mode, the source code translation engine A process for activating this is performed for 203. Further, the search A 204 receives the search result from the source code translation engine 203, searches the source code based on the search result, and sends the search result to the source code display 203.

ソースコード表示205は、ソースコードを表示すると共に、検索A204から与えられる表示位置データに基づいてソースコードファイルの内容を表示する機能を有する。   The source code display 205 has a function of displaying the source code and displaying the contents of the source code file based on the display position data given from the search A 204.

記憶装置104には、編集対象であるソースコードファイル206と、コンパイル用のスクリプトファイル207と、翻訳エンジンによって翻訳されたソースコードファイル208とが蓄積される。   The storage device 104 stores a source code file 206 to be edited, a script file 207 for compilation, and a source code file 208 translated by a translation engine.

なお、プリプロセッサ命令は、#include、#define、#undef、#ifdef、#ifndef、#if、#else、#elif、#endifであり、コメントは「/*」から「*/」まて、または「//」から改行コードまで、または「//」からEOF(End Of File)コードまでの文字列のことである。   Note that the preprocessor instructions are #include, #define, #undef, #ifdef, #ifndef, #if, #else, #elif, #endif, and the comment ranges from “/ *” to “* /”, or A character string from “//” to a line feed code or from “//” to an EOF (End Of File) code.

以上のように構成されたエディタにおいて、その処理の詳細を図3に示すフローチャートを参照してさらに詳細に説明する。   Details of the processing in the editor configured as described above will be described in more detail with reference to the flowchart shown in FIG.

図3において、ステップS301で開始され、ステップS302で、ユーザの操作によってエディタが起動する。このときソースコードファイルの内容がソースコード表示205に表示される。   In FIG. 3, the editor starts in step S301, and in step S302, an editor is activated by a user operation. At this time, the contents of the source code file are displayed on the source code display 205.

次にステップS303で、オプション設定を起動し、ここでユーザは表示部105の表示画面を見ながら操作入力部102を駆使して、ソースコードを翻訳させるためのスクリプトファイルと、コメントと解釈させる文字を指定する。すなわち、ステップS304でスクリプトファイルの指定を行い、ステップS305でコメントと解釈させる文字の指定を行って、ステップS306でオプション設定を終了する。   In step S303, option setting is activated. Here, the user makes full use of the operation input unit 102 while viewing the display screen of the display unit 105, and a script file for translating the source code and a character to be interpreted as a comment. Is specified. That is, a script file is designated in step S304, a character to be interpreted as a comment is designated in step S305, and option setting is terminated in step S306.

次に、ステップS307でユーザの操作入力部102の操作によって検索A204を起動し、ステップS308で検索文字列を指定する。この処理も、ユーザは表示部105の画面表示に基づいて行う。   Next, in step S307, the search A204 is activated by the user's operation on the operation input unit 102, and a search character string is designated in step S308. The user also performs this process based on the screen display of the display unit 105.

検索文字列の指定が完了したら、ステップS309で、ユーザによって翻訳検索モードが指定される。次いでステップS310で、ユーザによって操作入力部102の検索ボタンが押されると、ステップS311において、検索A204がソースコード翻訳エンジン203を起動する。   When the designation of the search character string is completed, the translation search mode is designated by the user in step S309. Next, when the user presses the search button of the operation input unit 102 in step S310, the search A 204 activates the source code translation engine 203 in step S311.

起動されたソースコード翻訳エンジン203によって、ステップS312でソースコードの翻訳と文字列の検索が実行される。このとき、ソースコード翻訳エンジン203は、オプション設定で指定したスクリプトファイルを解釈して翻訳を実行し、さらにプリプロセッサ命令とコメントと解釈される文字を特定し、それらが除外された「翻訳されたソースコードファイル」すなわち2次ソースコードファイルを生成する。   The activated source code translation engine 203 executes source code translation and character string search in step S312. At this time, the source code translation engine 203 interprets the script file specified in the option setting, executes the translation, further identifies the characters to be interpreted as preprocessor instructions and comments, and excludes them as “translated source” A “code file”, ie, a secondary source code file is generated.

次に、ソースコード翻訳エンジン203は、「翻訳されたソースコードファイル」ついて、検索A204から与えられた文字列の検索を実行し、「翻訳されたソースコードファイル」全てについて検索が実行されたらステップS313で検索処理を終了する。   Next, the source code translation engine 203 executes a search of the character string given from the search A 204 for the “translated source code file”, and when the search is executed for all the “translated source code files”, the step is performed. In step S313, the search process ends.

次に、ステップS314でソースコード翻訳エンジン203は、検索結果を検索A204に送出するものであるが、検索の結果、対象となる文字列があった場合にはその行番号、文字列がなかった場合には最終行番号に1を加えたものかあるいはゼロを検索結果として、検索Aに送出する。   Next, in step S314, the source code translation engine 203 sends the search result to the search A 204. If there is a target character string as a result of the search, there is no line number or character string. In this case, 1 is added to the last line number or zero is sent to the search A as a search result.

次に、ステップS315で、検索A204が、ソースコード翻訳エンジン203から送られた検索結果に基づいて、ソースコードファイル内の検索を行う。すなわち、検索A204は、ソースコード翻訳エンジン203から送られた行番号にジャンプして、その1カラム目から目的の文字列を検索して対象となる文字列の位置情報を得る。   Next, in step S315, the search A 204 searches the source code file based on the search result sent from the source code translation engine 203. That is, the search A 204 jumps to the line number sent from the source code translation engine 203, searches the target character string from the first column, and obtains the position information of the target character string.

さらに検索A204は、ステップS316で、検索の結果得られた目的の文字列の位置情報をソースコード表示205に渡し、ステップS317で検索A204としての処理を終了する。   In step S316, the search A 204 passes the position information of the target character string obtained as a result of the search to the source code display 205, and the processing as the search A 204 is terminated in step S317.

次に、ステップS318で、ソースコード表示205が、検索した文字列を含めてソースコードファイルを表示部105で表示させ、ステップS319で全ての処理を終了する。   Next, in step S318, the source code display 205 causes the display unit 105 to display the source code file including the searched character string, and in step S319, all processing is terminated.

なお、図3において、斜線で囲ったステップS304,S305,S309,S311,S312,S313,S314は、本件発明の特徴的な処理であり、従来存在しなかった新規な処理である。   In FIG. 3, steps S304, S305, S309, S311, S312, S313, and S314 surrounded by diagonal lines are characteristic processes of the present invention and are new processes that did not exist in the past.

以上のように本発明によれば、ソースコードの特定の文字列を検索する機能を有したエディタにおいて、ソースコード翻訳エンジンを備え、ソースコードファイルを翻訳して、コンパイルの対象とならないプリプロセッサ命令と、コメントを除外して、翻訳されたソースコードファイル(2次ソースコードファイル)を生成すると共に、この翻訳されたソースコードファイル内で目的の文字列を検索して、検索の結果、文字列が検出されたらその行番号を検索Aに渡して、検索Aで、行番号の文字列を検索するように構成したので、コンパイルの対象とならない範囲を除外して、目的の文字列の検索が実行できるので、編集効率を向上させることができるものである。   As described above, according to the present invention, in an editor having a function of searching for a specific character string in a source code, a preprocessor instruction that includes a source code translation engine, translates a source code file, and is not subject to compilation, , Excluding comments, generating a translated source code file (secondary source code file) and searching for the target character string in the translated source code file. If it is detected, the line number is passed to search A, and the search A is searched for the character string of the line number. Therefore, the target character string search is executed by excluding the range not to be compiled. Therefore, editing efficiency can be improved.

図4は、図2に示すソースコード翻訳エンジンを詳細に示すもので、エディタ401は、ソースコード翻訳エンジン402と、機能としてのオプション設定403及び検索A404と、記憶装置405を含む。   FIG. 4 shows the source code translation engine shown in FIG. 2 in detail. The editor 401 includes a source code translation engine 402, option settings 403 and search A 404 as functions, and a storage device 405.

ソースコード翻訳エンジン402は、機能としてソースコード翻訳406と、ファイル作成407と、ファイル入出力408と、オプション認識409と、検索Aインターフェース410と検索B411で構成される。   The source code translation engine 402 includes source code translation 406, file creation 407, file input / output 408, option recognition 409, search A interface 410, and search B 411 as functions.

ソースコード翻訳406は、プリプロセッサ命令である#include、#define、#undef、#ifdef、#ifndef、#if、#else、#elif、#endifを翻訳し、オプション認識409を介してオプション設定403から与えられるスクリプトファイルとコメント情報に基づき、当該コメントの翻訳も実行する。   The source code translation 406 translates the preprocessor instructions #include, #define, #undef, #ifdef, #ifndef, #if, #else, #elif, #endif from the option setting 403 via the option recognition 409. Based on the given script file and comment information, the comment is also translated.

ファイル作成407は、ソースコード翻訳で翻訳されたソースコードファイル(2次ソースコードファイル)を作成するが、このとき、コンパイル対象にならないプリプロセッサ命令及びコメントのソースコード行はファイルに含めない。   The file creation 407 creates a source code file (secondary source code file) translated by source code translation. At this time, the source code lines of preprocessor instructions and comments that are not to be compiled are not included in the file.

ファイル作成407で作成するファイル形式は、図5に示すように、エディタでの表示イメージ501に対して、ファイルのレコード内容502としては、ソースコードの1カラムが5バイト目に入り、1バイト目から4バイト目にはソースコードの行番号が入るようになる。   As shown in FIG. 5, the file format created by the file creation 407 is such that the first column of the source code enters the fifth byte as the record content 502 of the file with respect to the display image 501 in the editor. The line number of the source code is entered in the 4th byte.

ファイル入出力408は、ファイル作成407で作成された翻訳されたソースコードファイルを記憶装置405に記憶させるべく送出したり、あるいは記憶装置405から読み出されたソースコードファイルあるいはスクリプトファイルを受けて、ソースコード翻訳406に送出する機能を有する。   The file input / output 408 sends the translated source code file created in the file creation 407 to be stored in the storage device 405, or receives the source code file or script file read from the storage device 405, It has a function of sending to source code translation 406.

オプション認識409は、オプション設定403から与えられるオプション情報を認識して、コメントと解釈する文字を特定しソースコード翻訳406に出力する。   The option recognition 409 recognizes the option information given from the option setting 403, specifies the character to be interpreted as a comment, and outputs it to the source code translation 406.

検索Aインターフェース410は、検索A404から与えられるソースコード翻訳エンジン起動コマンドを受けて、ソースコード翻訳エンジン402を起動させ、さらに検索A404から与えられる検索文字列情報を検索B411に導出する。   The search A interface 410 receives the source code translation engine start command given from the search A 404, starts the source code translation engine 402, and derives the search character string information given from the search A 404 to the search B 411.

検索B411は、検索A404から与えられる検索文字列情報に基づき、翻訳されたソースコードファイルを検索して、その結果を検索Aインターフェース410を介して検索Aに導出する。   The search B411 searches the translated source code file based on the search character string information given from the search A404, and derives the result to the search A via the search A interface 410.

記憶装置405は、編集の対象となるソースコードファイル412と、ソースコード翻訳406でソースコード翻訳を実行させるためのスクリプトファイル413と、翻訳されたソースコードファイル414を保存する。翻訳されたソースコードファイル414は、ソースコード翻訳エンジン402のファイル作成407で生成され、ファイル入出力408を介して送出されたものである。また、スクリプトファイル413は、ソースコード翻訳406を実行させるものである。   The storage device 405 stores a source code file 412 to be edited, a script file 413 for causing the source code translation 406 to execute source code translation, and a translated source code file 414. The translated source code file 414 is generated by the file creation 407 of the source code translation engine 402 and sent via the file input / output 408. The script file 413 is for executing the source code translation 406.

なお、図4において、実線の矢印は、ソースコードを翻訳するために必要なデータの流れを示し、荒い点線は、翻訳されたソースコードファイルを構成するデータの流れを示し、細かな点線は、検索B411が検索文字列を検索するときのデータの流れを示すものである。   In FIG. 4, solid line arrows indicate the flow of data necessary for translating the source code, rough dotted lines indicate the flow of data constituting the translated source code file, and fine dotted lines indicate The flow of data when search B411 searches for a search character string is shown.

図4に示す実施の形態の処理の過程を図6のフローチャートを参照してさらに詳細に説明する。   The process of the embodiment shown in FIG. 4 will be described in more detail with reference to the flowchart of FIG.

図6において、ステップS601で開始され、ステップS602で、ソースコード翻訳エンジン402が起動し、オプション認識409が、オプション設定403からステップS603でソースコードを翻訳するためのスクリプトファイルを取得し、さらにステップS604でコメントと解釈する文字情報を取得して、それらを認識してソースコード翻訳406に渡す。   In FIG. 6, the process starts in step S601. In step S602, the source code translation engine 402 is activated, and the option recognition 409 obtains a script file for translating the source code in step S603 from the option setting 403. In step S604, character information to be interpreted as comments is acquired, recognized, and passed to the source code translation 406.

次にステップS605で、ファイル入出力408が記憶装置405からソースコードファイル412を読み出してソースコード翻訳406に渡す。次いで、ステップS606で、ソースコード翻訳406がソースコードファイルを翻訳して、翻訳した内容をファイル作成407に渡す。   In step S 605, the file input / output 408 reads the source code file 412 from the storage device 405 and passes it to the source code translation 406. Next, in step S606, the source code translation 406 translates the source code file and passes the translated content to the file creation 407.

次にステップS607で、ファイル作成407が、ソースコード翻訳406から受け取ったデータから、翻訳されたソースコードファイルを、ファイル入出力408を介して記憶装置405に作成する。   In step S <b> 607, the file creation 407 creates a translated source code file from the data received from the source code translation 406 in the storage device 405 via the file input / output 408.

次に、ステップS608で、検索Bが翻訳されたソースコードファイル内において、目的の文字列を検索し、目的文字列が存在する場合その行番号を、また存在しない場合には、最終行番号に1を加えたものかゼロを検索結果とし、ステップS609でそれを検索Aインターフェース410に渡し、ステップS610で検索Aインターフェース410が、受け取った検索結果を検索Aに渡す。   Next, in step S608, the target character string is searched in the source code file in which the search B is translated. If the target character string exists, the line number is set. If not, the line number is set to the final line number. A search result obtained by adding 1 or zero is used as a search result, and the search result is passed to the search A interface 410 in step S609. The search A interface 410 passes the received search result to the search A in step S610.

ステップS611でソースコード翻訳エンジン402を終了し、ステップS612で処理を終了する。   In step S611, the source code translation engine 402 is terminated, and in step S612, the process is terminated.

以上説明したように、本件発明によれば、エディタでソースコード内の目的の文字列を検索する際に、ソースコードを翻訳して、コンパイル対象とならない、プリプロセッサ命令とコメントを除外した翻訳したソースコードファイルを別途生成し、この翻訳したソースコードファイル内に目的の文字列が存在するか否か検索を行うようにしたので、検索効率を向上させることができるものである。   As described above, according to the present invention, when searching for a target character string in the source code with the editor, the source code is translated, and the translated source excluding preprocessor instructions and comments that are not to be compiled Since a code file is separately generated and a search is performed to determine whether or not the target character string exists in the translated source code file, the search efficiency can be improved.

なお、本発明は以上説明した実施の形態に限定されるものではなく、趣旨を逸脱しない範囲で種々変形可能である。   The present invention is not limited to the embodiment described above, and various modifications can be made without departing from the spirit of the present invention.

この発明に係わるソースコード編集装置において、編集を実行するためのシステムの概略を説明するために示す図。The figure shown in order to demonstrate the outline of the system for performing edit in the source code editing apparatus concerning this invention. この発明に係わるソースコード編集装置の一実施の形態の機能の概略を説明するために示す図。The figure shown in order to demonstrate the outline of the function of one Embodiment of the source code editing apparatus concerning this invention. 図2に示すソースコード編集装置の処理状況を説明するために示すフローチャート。The flowchart shown in order to demonstrate the processing condition of the source code editing apparatus shown in FIG. 図1に示す装置の要部の構成をさらに詳細に説明するために示す図。The figure shown in order to demonstrate the structure of the principal part of the apparatus shown in FIG. 1 further in detail. この発明に係わるソースコード編集装置で生成される翻訳されたソースコードファイルの内容を説明するために示す図。The figure shown in order to demonstrate the content of the translated source code file produced | generated with the source code editing apparatus concerning this invention. 図4に示すソースコード編集装置の処理状況を説明するために示すフローチャート。The flowchart shown in order to demonstrate the processing condition of the source code editing apparatus shown in FIG.

符号の説明Explanation of symbols

101…制御部
102…操作入力部
103…メモリ
104…記憶装置
105…表示部
201…ソースコード翻訳検索機能付きエディタ
202…オプション設定
203…ソースコード翻訳エンジン
204…検索A
205…ソースコード表示
206,412…ソースコードファイル
207,413…スクリプトファイル
208,414…翻訳されたソースコードファイル
401…ソースコード翻訳検索機能付きエディタ
402…ソースコード翻訳エンジン
403…オプション設定
404…検索A
405…記憶装置
406…ソースコード翻訳
407…ファイル作成
408…ファイル入出力
409…オプション認識
410…検索Aインターフェース
411…検索B
DESCRIPTION OF SYMBOLS 101 ... Control part 102 ... Operation input part 103 ... Memory 104 ... Memory | storage device 105 ... Display part 201 ... Editor with source code translation search function 202 ... Option setting 203 ... Source code translation engine 204 ... Search A
205 ... Source code display 206, 412 ... Source code file 207, 413 ... Script file 208, 414 ... Translated source code file 401 ... Editor with source code translation search function 402 ... Source code translation engine 403 ... Option setting 404 ... Search A
405: Storage device 406 ... Source code translation 407 ... File creation 408 ... File input / output 409 ... Option recognition 410 ... Search A interface 411 ... Search B

Claims (5)

ソースコード翻訳手段と、
コンパイル対象としないソースコードを特定するための情報を設定する非コンパイルソースコード情報設定手段と、
検索文字列を設定する検索文字列設定手段と、
前記ソースコード翻訳手段によってソースコードファイルを翻訳させ、前記非コンパイルソースコード情報設定手段で設定された情報に基づくソースコードを除外した2次ソースコードファイルを生成する2次ソースコードファイル生成手段と、
この2次ソースコードファイル生成手段によって生成された2次ソースコードファイルに対して、前記検索文字列設定手段で設定された文字列を検索する文字列検索手段と、
この文字列検索手段による検索結果に基づき、前記ソースコードファイルの少なくとも特定部位を表示する表示手段と、
を具備したことを特徴とするソースコード編集装置。
Source code translation means;
Non-compiled source code information setting means for setting information for identifying source code not to be compiled;
A search string setting means for setting a search string;
Secondary source code file generation means for generating a source code file by excluding the source code based on the information set by the non-compiled source code information setting means by translating the source code file by the source code translation means;
A character string search means for searching the character string set by the search character string setting means for the secondary source code file generated by the secondary source code file generation means;
Display means for displaying at least a specific part of the source code file based on the search result by the character string search means;
A source code editing apparatus comprising:
前記文字列検索手段は、2次ソースコードファイルの検索の結果、文字列が存在する場合、その行番号情報を出力する第1の検索手段と、前記ソースコードファイルの、この第1の検索手段によって与えられる行番号にジャンプしてその行の前記文字列を検索する第2の検索手段を含むことを特徴とする請求項1に記載のソースコード編集装置。   The character string search means includes a first search means for outputting line number information when there is a character string as a result of searching the secondary source code file, and the first search means for the source code file. 2. The source code editing apparatus according to claim 1, further comprising second search means for jumping to a line number given by and searching for the character string in the line. さらに、前記ソースコード翻訳手段に、翻訳を実行させるためのスクリプトファイル設定手段を備えたことを特徴とする請求項1または2に記載のソースコード編集装置。   3. The source code editing apparatus according to claim 1, further comprising script file setting means for causing the source code translation means to execute translation. 前記非コンパイルソースコードは、コメントを含むことを特徴とする請求項1乃至3のいずれかに記載のソースコード編集装置。   The source code editing apparatus according to claim 1, wherein the non-compiled source code includes a comment. コンパイル対象としないソースコードを特定するための情報を設定するステップと、
検索文字列を設定するステップと、
前記ソースコード翻訳手段によってソースコードファイルを翻訳させ、前記非コンパイルソースコード情報設定手段で設定された情報に基づくソースコードを除外した2次ソースコードファイルを生成するステップと、
前記2次ソースコードファイル生成手段によって生成された2次ソースコードファイルに対して、前記設定された検索文字列を検索するステップと、
検索結果に基づき、前記ソースコードファイルの少なくとも特定部位を表示するステップと、
を具備したことを特徴とするソースコード編集方法。
A step of setting information for identifying source code not to be compiled;
Setting a search string;
A step of translating a source code file by the source code translating means and generating a secondary source code file excluding the source code based on the information set by the non-compiled source code information setting means;
Searching the set search character string with respect to the secondary source code file generated by the secondary source code file generating means;
Displaying at least a specific part of the source code file based on a search result;
A source code editing method characterized by comprising:
JP2005095520A 2005-03-29 2005-03-29 Source code editing device and source code editing method Pending JP2006277330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005095520A JP2006277330A (en) 2005-03-29 2005-03-29 Source code editing device and source code editing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005095520A JP2006277330A (en) 2005-03-29 2005-03-29 Source code editing device and source code editing method

Publications (1)

Publication Number Publication Date
JP2006277330A true JP2006277330A (en) 2006-10-12

Family

ID=37212032

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005095520A Pending JP2006277330A (en) 2005-03-29 2005-03-29 Source code editing device and source code editing method

Country Status (1)

Country Link
JP (1) JP2006277330A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013008304A (en) * 2011-06-27 2013-01-10 Nec System Technologies Ltd Program analysis device, program analysis method, and program
CN111552479A (en) * 2020-05-06 2020-08-18 湖南国科微电子股份有限公司 Mirror image file compiling method and device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013008304A (en) * 2011-06-27 2013-01-10 Nec System Technologies Ltd Program analysis device, program analysis method, and program
CN111552479A (en) * 2020-05-06 2020-08-18 湖南国科微电子股份有限公司 Mirror image file compiling method and device and electronic equipment

Similar Documents

Publication Publication Date Title
JP4007562B2 (en) Programming support method and apparatus
JP2009134462A (en) Debugging device and debugging method
JP2006119884A (en) Editing apparatus of sequence program
JP4818091B2 (en) Information processing apparatus, image processing apparatus, control method for information processing apparatus, and control method for image processing apparatus
JP2005182460A (en) Information processor, annotation processing method, information processing program, and recording medium having information processing program stored therein
JP2006277330A (en) Source code editing device and source code editing method
JP3943582B2 (en) Bilingual text matching device
JP2007058677A (en) Display control device and method
JPH11191159A (en) Image output device and program recording medium therefor
JP6244743B2 (en) Layout editing processing method, apparatus and program
JP2008015879A (en) Method, program and system for supporting description of specification including natural sentence
JP3964910B2 (en) Machine translation device
JP2009054009A (en) Structured document drawing apparatus, structured document drawing method, program, and storage medium
JP2011008352A (en) Document processor, document processing method, and program
JP2672968B2 (en) Source list output processing method for debugging
JP3880383B2 (en) Speech recognition apparatus and method, and program
JP2007094829A (en) Program creation/understanding support device and method therefor
JP2928246B2 (en) Translation support device
JPH06259528A (en) Method and device for generating animation
JP2004078375A (en) Information processing apparatus, business form processing method, computer-readable storage medium, and program
JPH1021062A (en) Device and method for visual programming
JPH11203279A (en) Kana-kanji conversion device and method and storage medium
JPS60134977A (en) Input device of information
JP2001101327A (en) Information processing method, information processor and printing system
JP2006099349A (en) Jsp test system and jsp test program