JP4827418B2 - Conditional compiling identifier management method, computer program creation support apparatus, and program - Google Patents

Conditional compiling identifier management method, computer program creation support apparatus, and program Download PDF

Info

Publication number
JP4827418B2
JP4827418B2 JP2005029376A JP2005029376A JP4827418B2 JP 4827418 B2 JP4827418 B2 JP 4827418B2 JP 2005029376 A JP2005029376 A JP 2005029376A JP 2005029376 A JP2005029376 A JP 2005029376A JP 4827418 B2 JP4827418 B2 JP 4827418B2
Authority
JP
Japan
Prior art keywords
identifier
list
creation support
computer program
program creation
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
JP2005029376A
Other languages
Japanese (ja)
Other versions
JP2006215896A (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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2005029376A priority Critical patent/JP4827418B2/en
Publication of JP2006215896A publication Critical patent/JP2006215896A/en
Application granted granted Critical
Publication of JP4827418B2 publication Critical patent/JP4827418B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

本発明は、プログラムソースコード(以下、ソースコードという)に含まれる条件付コンパイル用識別子の管理方法、コンピュータプログラムの作成支援装置及びプログラムに関し、特に、識別子のスペルミスを検出して条件付コンパイル(Conditional Compilation)を確実に行うことのできる識別子の管理方法、コンピュータプログラムの作成支援装置及びプログラムに関する。   The present invention relates to a method for managing a conditional compilation identifier included in a program source code (hereinafter referred to as source code), a computer program creation support apparatus, and a program, and more particularly to detecting a spelling error in an identifier and performing conditional compilation (Conditional compilation). The present invention relates to an identifier management method capable of reliably performing (Compilation), a computer program creation support apparatus, and a program.

近年、アプリケーションが多機能化・多品種化しているため、それに比例して、プリプロセッサ命令(コンパイル前にソースプログラムに対して行われる前処理命令であり、文字列の置き換えやプログラムの有効/無効部分の指定が可能である)を用いた前処理が多用され、また、ソースコードも大規模かつ複雑になっている。またそのため、デバッグ作業は複雑になり時間がかかっているのが現状である。特許文献1には、ソースコード中のプリプロセッサ命令を解析し、その結果をエディタ画面に視覚的に表示する機能を備えて、プリプロセッサ命令の間違いを検出できるようにしたプログラム・エディタが紹介されている。   In recent years, applications have become multifunctional and diverse, and in proportion to this, preprocessor instructions (pre-processing instructions that are executed on the source program before compiling, replacing character strings and valid / invalid parts of the program) The pre-processing using the) is frequently used, and the source code is also large and complicated. As a result, debugging is complicated and takes time. Patent Document 1 introduces a program editor that has a function of analyzing a preprocessor instruction in a source code and visually displaying the result on an editor screen so that an error in the preprocessor instruction can be detected. .

また、特許文献2、3には、ソースコード入力作業中に、入力ミスの可能性のある箇所を強調表示することのできるエディタが紹介されており、特許文献4には、プログラム中で使用されている変数の整合性チェックを行う変数データ処理装置が紹介されている。   Patent Documents 2 and 3 introduce an editor capable of highlighting a place where there is a possibility of an input error during source code input work, and Patent Document 4 is used in a program. A variable data processing device for checking the consistency of existing variables is introduced.

図15は、従来のプログラム作成手順を示したフローチャートである。図15を参照すると、まずエディタなどを用いてプログラムの作成・編集を行い(ステップ1−1)、必要な箇所に条件付きコンパイルの設定が手動で行われる(ステップ1−2)。この条件付きコンパイルの設定は、機種依存性がからむ場合やデバッグ時に多用され、プログラマがソースコードや設計書から判断して、必要な箇所に条件付コンパイル用プリプロセッサとその識別子を設定することによって行われる。   FIG. 15 is a flowchart showing a conventional program creation procedure. Referring to FIG. 15, first, a program is created / edited using an editor or the like (step 1-1), and conditional compilation is manually set at a required location (step 1-2). This conditional compilation setting is often used when machine dependency is involved or during debugging, and the programmer decides from the source code or design document and sets the conditional compilation preprocessor and its identifier at the required location. Is called.

続いて、コンパイルが行われる(ステップ1−3、1−4)。図16は、条件付きコンパイルのコマンド例であり、この場合、ソースコード中の条件付きコンパイル用プリプロセッサ命令に後続して用いられている識別子”DEBUG”、”TEST”が有効化され、例えば、ソースコード中の#ifdef DEBUGの行から、#endifまでの部分がコンパイルの対象となる。このコンパイルの過程で、エラーのチェックが行われるが、ここで文法上のエラーがある場合は、コンパイラがエラーを表示する(プリプロセッサ命令自体の入力ミス等の文法エラーも含む)。そして、エラーと表示された場合は、再びプログラムの修正に移る(ステップ1−1)。一方、エラーが無い場合にはデバッグ作業に移る。   Subsequently, compilation is performed (steps 1-3 and 1-4). FIG. 16 shows an example of a conditional compilation command. In this case, identifiers “DEBUG” and “TEST” used after the conditional compilation preprocessor instruction in the source code are validated. The part from the #ifdef DEBUG line to #endif in the code is the target of compilation. During this compilation process, errors are checked. If there is a grammatical error, the compiler displays an error (including a grammatical error such as an input error in the preprocessor instruction itself). If an error is displayed, the program is again corrected (step 1-1). On the other hand, if there is no error, the debugging process is started.

次のデバッグ作業では、さまざまな評価を行い、プログラムが仕様書通りに動いているか評価を行う(ステップ1−5、1−6)。ここで、誤作動に気が付けば、様々なツールを使用したり、実際にソースを読むことにより、プログラムの論理的なエラーなどを発見して、ソースコードの修正に移る(ステップ1−1)。エラーが発見されなかった場合は、プログラムの作成は終了になる。   In the next debugging operation, various evaluations are performed to evaluate whether the program is operating according to the specifications (steps 1-5 and 1-6). Here, if a malfunction is noticed, a logical error of the program is found by using various tools or by actually reading the source, and the source code is corrected (step 1-1). If no error is found, the creation of the program ends.

特開2000−148508号公報JP 2000-148508 A 特開平5−341976号公報JP-A-5-341976 特開平11−73305号公報JP-A-11-73305 特開平7−78072号公報JP-A-7-78072

条件付コンパイルで用いるプリプロセッサ命令に後続する「識別子」として、任意の文字を定義可能であって大変便利であるが、その反面、プリプロセッサ命令を含む行は文法的に独立したものと取扱われるため、以下のような負担が生じていたといえる。第1の問題点は、コンパイル時のエラーチェックでは、たとえ入力ミスであってもそのような識別子が設定されているものと判断され検出できないことにある。例えば、図16のように、コンパイルコマンドで「DEBUG」と指定したのに対し、ソースコードでは識別子「DEBAG」(入力ミス)が定義されていたとしても、コンパイラは誤りとせず識別子「DEBUG」の条件付きコンパイルを行う。このように、識別子の入力ミスは、デバッグ作業でしか発見することができず、条件付きコンパイルの識別子のスペルミスの不具合が発生すると、デバッグ作業を強いられることになり、大規模かつ複雑なソースコードではかなりの負担となっている。   Arbitrary characters can be defined as an “identifier” following the preprocessor instruction used in conditional compilation, which is very convenient, but on the other hand, the line containing the preprocessor instruction is treated as being grammatically independent. It can be said that the following burden has arisen. The first problem is that in the error check at the time of compilation, even if there is an input error, it is determined that such an identifier is set and cannot be detected. For example, as shown in FIG. 16, even though the identifier “DEBAG” (input error) is defined in the source code while “DEBUG” is specified in the compile command, the compiler does not make an error and the identifier “DEBUG” Perform conditional compilation. Thus, an identifier input error can only be detected by debugging work, and if a spelling error of a conditional compilation identifier occurs, debugging work will be forced, and large and complex source code It is a considerable burden.

第2の問題点は、条件付きコンパイルの識別子を指定する際に、多くの識別子の設定を手動で行う必要があるため、同一の識別子が指定されるべきところ、別の識別子が設定されるなど、見落としや指定間違いが発生する危険性が常にあったことにある。大規模なソースコードは、複数の人間がプログラミングしており、更には、一つのソースコードで多くの品種・バージョンに対応するため、複雑に条件付きコンパイルのプリプロセッサ命令が指定されている場合もある。また、ソースコードが大規模で複雑であれば、条件付きコンパイルが正しく設定できているかどうかを検証することも困難となり、プログラム開発作業の効率化を阻害する要因ともなっている。   The second problem is that when specifying an identifier for conditional compilation, it is necessary to manually set many identifiers, so the same identifier should be specified, but another identifier is set. There was always a risk of oversight and mis-designation. Large-scale source code is programmed by multiple people, and in addition, since a single source code supports many product types and versions, preprocessor instructions for conditional compilation may be specified in complex ways. . In addition, if the source code is large and complex, it is difficult to verify whether conditional compilation is correctly set, which hinders the efficiency of program development work.

この点、特許文献1は、プリプロセッサ命令の解釈結果を編集画面上に視覚的に表示するものであるから、デバッグ作業の軽減にはなったとしても、大規模かつ複雑なソースコードでは上記各問題点を根本的に解決するものとはならない。また、特許文献2、3の技術をもってしても、条件付コンパイル用の識別子の場合、何をもって入力ミスと判定するかどうかも一義的でなく適用が困難である。また、特許文献4に記載の技術も、インタプリタ系言語に特有の変数の整合性をチェックするためのものであり、この種の問題は、コンパイラ系言語では、コンパイル時に検出することが可能となっているものである。   In this respect, since Patent Document 1 visually displays the interpretation result of the preprocessor instruction on the editing screen, even if the debugging work is reduced, each of the above problems is not solved in a large-scale and complicated source code. It does not solve the point fundamentally. Further, even with the techniques of Patent Documents 2 and 3, in the case of an identifier for conditional compilation, it is not unambiguous and it is difficult to apply what is determined as an input error. The technique described in Patent Document 4 is also for checking the consistency of variables peculiar to an interpreter language, and this kind of problem can be detected at the time of compilation in a compiler language. It is what.

本発明の第1の視点によれば、コンピュータによるプログラムソースコードに含まれる条件付コンパイル用の識別子の管理方法であって、前記コンピュータが、プログラムソースコードを走査し、少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する工程と、少なくともコンパイルコマンド入力時に、前記コンピュータが、前記識別子一覧からユーザによって選択された識別子を、条件付コンパイル用の識別子として設定する工程と、を、含む条件付コンパイル用の識別子の管理方法が提供される。 According to a first aspect of the present invention, there is provided a method for managing an identifier for conditional compilation included in a program source code by a computer, wherein the computer scans the program source code and at least performs conditional compilation. A step of generating and displaying an identifier list including the identifier used subsequent to the preprocessor instruction, the number of occurrences thereof, and a definition state indicating whether or not the identifier is defined, and at least when a compile command is input, There is provided a method for managing conditional compilation identifiers, including the step of the computer setting an identifier selected by the user from the identifier list as an identifier for conditional compilation .

本発明の第2の視点によれば、プログラムソースコードを走査し、少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する識別子一覧出力部と、少なくともコンパイルコマンド入力時に、前記識別子一覧から任意の識別子を選択することによって、条件付コンパイル用の識別子の設定を受け付ける識別子入力受付部と、を備えたコンピュータプログラムの作成支援装置が提供される。 According to the second aspect of the present invention, the program source code is scanned, and at least the identifier used subsequent to the preprocessor instruction for conditional compilation, the number of occurrences thereof, and whether the identifier is defined. An identifier list output unit for generating and displaying an identifier list including the definition state indicating the state, and at the time of inputting a compile command, by selecting an arbitrary identifier from the identifier list, setting an identifier for conditional compilation There is provided a computer program creation support apparatus including an identifier input receiving unit .

本発明の第3の視点によれば、チェック対象のプログラムソースコードを走査し、少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する処理と、少なくともコンパイルコマンド入力時に、前記識別子一覧から任意の識別子の選択をユーザから受け付けることで、条件付コンパイル用の識別子の設定を受け付ける処理とを、前記コンピュータに実行させるコンピュータプログラムの作成支援プログラムが提供される。   According to the third aspect of the present invention, the program source code to be checked is scanned, and at least the identifier used after the preprocessor instruction for conditional compilation, the number of occurrences thereof, and the identifier are defined. An identifier for conditional compilation by receiving a selection of an identifier from the identifier list from the user at the time of inputting a compile command, at least when a compile command is input There is provided a computer program creation support program for causing the computer to execute a process of accepting the setting.

本発明によれば、少なくとも出現回数と定義状態を併記した識別子一覧を参照して、識別子のスペルミスや不整合を発見することが可能となる。   According to the present invention, it is possible to find a spelling error or inconsistency of an identifier by referring to an identifier list in which at least the number of appearances and a definition state are written.

続いて、本発明を統合開発環境(Integrated Development Environment)に適用した本発明の好適な実施の形態について、図面を参照して詳細に説明する。図1は、本発明に係るコンピュータプログラムの作成支援装置の概略構成図である。図1を参照すると、コンピュータプログラムの作成支援装置には、ソースコードやオブジェクトコードを記憶保持する記憶装置11、後述する動作を行う識別子一覧出力部12及び識別子入力受付部13、コンパイラ15(これらは、コンピュータのハードウェア資源利用するコンピュータプログラムで構成され、前2者については後に詳述する。)、識別子一覧を表示するためのモニタ14とのほか、図示しないエディタ、デバッガ等プログラミングに必要なツールが統合して扱えるような環境が整えられている。   Next, a preferred embodiment of the present invention in which the present invention is applied to an integrated development environment (Integrated Development Environment) will be described in detail with reference to the drawings. FIG. 1 is a schematic configuration diagram of a computer program creation support apparatus according to the present invention. Referring to FIG. 1, a computer program creation support apparatus includes a storage device 11 that stores and holds source code and object code, an identifier list output unit 12 that performs operations described later, an identifier input reception unit 13, and a compiler 15 (these are A computer program that uses hardware resources of a computer, and the former two will be described in detail later.) In addition to a monitor 14 for displaying a list of identifiers, an editor, a debugger, and other tools required for programming, not shown Has an environment that can be integrated and handled.

図2は、識別子一覧出力部12で管理される識別子一覧作成用のテーブル構成を表した図である。図2を参照すると、ID(通し番号)、識別子名(文字列)、出現数(ソースファイル中の出現回数)、設定(使用=ON/不使用=OFF)、定義、強調表示(ON/OFF)といったフィールドが設けられ、IDで識別される識別子の情報を格納可能となっている。また、定義フィールドには、ソースファイル中にその識別子を定義している部分がないことを示す「OFF」、ソースファイル中にその識別子をプリプロセッサ命令#defineで定義していることを示す「ON(Define)」、ソースファイル中にその識別子をプリプロセッサ命令#undefで定義していることを示す「ON(Undef)」、ソースファイル中にその識別子をプリプロセッサ命令#define及び#undefで定義していることを示す「ON(DefineUndef)」が記述される。識別子一覧出力部12は、このテーブルの適宜項目を選択・表示してユーザに提供する。   FIG. 2 is a diagram showing a table configuration for creating an identifier list managed by the identifier list output unit 12. Referring to FIG. 2, ID (serial number), identifier name (character string), number of appearances (number of appearances in the source file), setting (use = ON / non-use = OFF), definition, highlighting (ON / OFF) Field is provided, and information of an identifier identified by the ID can be stored. In the definition field, “OFF” indicating that there is no part defining the identifier in the source file, and “ON (” indicating that the identifier is defined by the preprocessor instruction #define in the source file. “Define)”, “ON (Undef)” indicating that the identifier is defined by the preprocessor instruction #undef in the source file, and the identifier is defined by the preprocessor instructions #define and #undef in the source file. “ON (DefineUndef)” indicating “” is described. The identifier list output unit 12 selects and displays appropriate items in this table and provides them to the user.

図3は、上記した識別子一覧のテーブル構成中の定義欄の4つの状態を求めるためのマトリクスである。図3を参照すると、ソースファイル中にその識別子が#defineで定義されている場合に、define_flagが1となり、#undefで定義されている場合に、undef_flagが1となり、これらの組合せによって、上記OFF〜ON(DefineUndef)までのいずれかの状態を求めることが可能となっている。   FIG. 3 is a matrix for obtaining the four states of the definition column in the table structure of the identifier list described above. Referring to FIG. 3, when the identifier is defined by #define in the source file, define_flag is 1, and when it is defined by #undef, undef_flag is 1. Any state from ~ ON (DefineUndef) can be obtained.

図4は、本発明を適用した場合のプログラム作成の大まかな流れを示したフローチャートである。図4を参照すると、プログラムの作成・修正が終了したら(ステップ3−1)、識別子一覧出力部12がソースコードから条件付きコンパイルの識別子一覧を作成する処理を実行する(ステップ3−2)。   FIG. 4 is a flowchart showing a rough flow of program creation when the present invention is applied. Referring to FIG. 4, when the creation / modification of the program is completed (step 3-1), the identifier list output unit 12 executes a process of creating a conditional compilation identifier list from the source code (step 3-2).

次いで、モニタ14に出力された識別子一覧表(図11参照)より、適宜強調表示された識別子を確認して識別子にスペルミスや不整合があるかを確認し(ステップ3−3、3−4)、スペルミスが存在する場合は、再びプログラムの作成・修正に戻る(ステップ3−1)。一方、識別子にスペルミスがない場合には、識別子一覧表から、有効にする識別子を選択する(ステップ3−5)。例えば、図12のようにCUSTUM、DEBUG2、VERSIONが選択されている場合は、その設定欄に基づいて、識別子入力受付部13は(RELEASEはソースコード中で宣言されている;図11凡例参照)、コンパイラ15に対して、”−D CUSTUM −D DEBUG2 −D VERSION”のコマンドを発行する。   Next, from the identifier list (see FIG. 11) output to the monitor 14, the identifier highlighted as appropriate is confirmed to confirm whether there is a spelling error or inconsistency in the identifier (steps 3-3, 3-4). If there is a spelling error, the program returns to program creation / correction again (step 3-1). On the other hand, if there is no spelling error in the identifier, the identifier to be validated is selected from the identifier list (step 3-5). For example, when CUSTOM, DEBUG2, and VERSION are selected as shown in FIG. 12, the identifier input receiving unit 13 is based on the setting column (RELEASE is declared in the source code; see FIG. 11 legend). Then, a command “-D CUSTOM-D DEBUG2-D VERSION” is issued to the compiler 15.

続いて、本実施の形態における詳細動作(識別子一覧の生成)について説明する。図5は、上記図4のステップ3−2における詳細動作を表したフローチャートである。初めに、ソースファイルの最初の行へ移動する(ステップ7−1)。次に、ソースファイルより一行読み出す処理が行われる(ステップ7−2)。   Subsequently, a detailed operation (generation of an identifier list) in the present embodiment will be described. FIG. 5 is a flowchart showing the detailed operation in step 3-2 of FIG. First, move to the first line of the source file (step 7-1). Next, a process of reading one line from the source file is performed (step 7-2).

次に、読み出した行から#define又は#undefに後続する識別子が検出されたか否かの判断を行い(ステップ7−3)、該当する識別子が検出された場合は、後述する識別子新規登録処理を実行し(ステップ7−6)、ステップ7−9へ進む。   Next, it is determined whether or not an identifier following #define or #undef has been detected from the read line (step 7-3), and if a corresponding identifier is detected, an identifier new registration process described later is performed. Execute (Step 7-6) and go to Step 7-9.

一方、ステップ7−3で#define又は#undefに後続する識別子が検出されなかった場合は、次に条件付コンパイルで用いるプリプロセッサ命令♯ifdef、♯if define又は#elifに後続して用いられている識別子が検出されたか否かの判断を行う(ステップ7−4)。ここで、該当する識別子が検出されなかった場合は、ステップ7−9へ進む。   On the other hand, if the identifier following #define or #undef is not detected in step 7-3, it is used subsequent to the preprocessor instruction #ifdef, #ifdefine or #elif used in conditional compilation next time. It is determined whether or not an identifier has been detected (step 7-4). If no corresponding identifier is detected, the process proceeds to step 7-9.

一方、ステップ7−4で♯ifdef、♯if define又は#elifに後続する識別子が検出された場合は、次に、検出できた識別子と同じ名前の識別子が、識別子一覧のテーブルの識別子の列に既に存在するか否かの判断を行う(ステップ7−5)。ここで、当該識別子がテーブルに存在する場合は、既に過去に1回以上検出できたということなので、テーブルの一致した識別子の出現数に1を足し(ステップ7−7)、ステップ7−9へ進む。   On the other hand, if an identifier subsequent to #ifdef, #if define, or #elif is detected in step 7-4, an identifier having the same name as the detected identifier is next entered in the identifier column of the identifier list table. It is determined whether or not it already exists (step 7-5). Here, if the identifier exists in the table, it means that it has already been detected once or more in the past. Therefore, 1 is added to the number of occurrences of the identifier that matches in the table (step 7-7), and the process goes to step 7-9. move on.

一方、ステップ7−5で検出できた識別子と同じ名前の識別子が、テーブルに存在しない場合は、テーブルの最後に一行を追加して、IDを付番し、識別子名を記述、出現数を1、設定、定義、強調表示の各要素をOFFに設定し(ステップ7−8)、ステップ7−9へ進む。   On the other hand, if an identifier having the same name as the identifier detected in step 7-5 does not exist in the table, a line is added to the end of the table, the ID is assigned, the identifier name is described, and the number of occurrences is 1. The setting, definition, and highlight elements are set to OFF (step 7-8), and the process proceeds to step 7-9.

そして、ステップ7−9で次の行に移動した時点で、ファイルの終了(EOF)に達したか否かを確認し、終了(EOF)ではない場合には、ステップ7−2に戻り、ソースファイルから一行読み取りフローを続行する。そして、ソースファイルの終了(EOF)に達している場合は、識別子一覧テーブルに含まれる識別子を強調すべきか否かの強調処理要否判定(図7参照;後述する)を実行し(ステップ7−11)、このフローを終了する。   Then, when moving to the next line in step 7-9, it is confirmed whether or not the end of file (EOF) has been reached. If it is not the end (EOF), the process returns to step 7-2, and the source Continue the single line read flow from the file. If the end of the source file (EOF) has been reached, an emphasis process necessity determination (see FIG. 7, which will be described later) is executed as to whether or not the identifier included in the identifier list table should be emphasized (step 7-). 11) End this flow.

図6は、図5のステップ7−6における詳細動作を表したフローチャートである。図5のステップ7−3において読み出した行から#define又は#undefに後続する識別子が検出された場合、検出できた識別子と同じ名前の識別子が、テーブルに存在するか否かの判断を行う(ステップ8−1)。ここで、同じ識別子がすでにテーブルに存在する場合はステップ8−3へ進む。   FIG. 6 is a flowchart showing the detailed operation in step 7-6 in FIG. If an identifier following #define or #undef is detected from the read line in step 7-3 in FIG. 5, it is determined whether an identifier having the same name as the detected identifier exists in the table ( Step 8-1). If the same identifier already exists in the table, the process proceeds to step 8-3.

一方、同じ識別子がテーブルに存在しない場合は、テーブルの最後に一行を追加して、IDを付番し、識別子名を記述、出現数を0、設定、定義、強調表示の各要素をOFFに設定し(ステップ8−2)、ステップ8−3へ進む。   On the other hand, if the same identifier does not exist in the table, add a line to the end of the table, number the ID, describe the identifier name, set the number of occurrences to 0, set, define, and highlight each element OFF Set (step 8-2) and proceed to step 8-3.

ステップ8−3では、識別子の検出箇所は#defineでの定義であるか否かの判断を行い、識別子の定義が#defineであった場合には、図3のdefine_flagを1に設定する(ステップ8−4)。一方、識別子の定義が#undefであった場合には、図3のundef_flagを1に設定する(ステップ8−5)。   In Step 8-3, it is determined whether or not the detected location of the identifier is a definition in #define. If the definition of the identifier is #define, define_flag in FIG. 3 is set to 1 (step S3). 8-4). On the other hand, when the definition of the identifier is #undef, undef_flag in FIG. 3 is set to 1 (step 8-5).

その後このフローを終了し、図6のステップ7−6に制御を返す。このようにして、ソースファイルから#defineや#undefが検出されると、それぞれdefine_flagやundef_flagが更新され、最終的に当該識別子の定義状態が図3のマトリックスを用いて決定される。   Thereafter, this flow is terminated, and control is returned to step 7-6 in FIG. When #define and #undef are detected from the source file in this way, define_flag and undef_flag are updated, respectively, and the definition state of the identifier is finally determined using the matrix of FIG.

図7は、図5のステップ7−11における詳細動作(強調表示要否判定)を表したフローチャートである。図7を参照すると、初期化の後(ステップ9−1)、識別子一覧作成用のテーブルの識別子が順次評価される(ステップ9−2)。   FIG. 7 is a flowchart showing the detailed operation (determination of necessity for highlighting) in step 7-11 in FIG. Referring to FIG. 7, after initialization (step 9-1), identifiers in the table for creating an identifier list are sequentially evaluated (step 9-2).

まず、その識別子の定義状態がON(DefineUndef)であるか否かの判断を行う(ステップ9−3)。ここで、定義状態がON(DefineUndef)である場合は、ソース中で一つの識別子を#define/#undefの両方で定義しているのは、誤りである可能性があるため、当該識別子の強調表示をONにする(ステップ9−8)。   First, it is determined whether or not the definition state of the identifier is ON (DefineUndef) (step 9-3). Here, when the definition state is ON (DefineUndef), it is possible that it is an error that one identifier is defined in both # define / # undef in the source. The display is turned on (step 9-8).

一方、定義状態がON(DefineUndef)でなかった場合は、識別子の定義がON(define)又はON(undef)であって、かつ、出現数が0であるか否かの判断を行う(ステップ9−4)。識別子の定義がON(define)又はON(undef)であって、かつ、出現数が0である場合は、識別子のスペルミスなどの可能性があるため、当該識別子の強調表示をONにする(ステップ9−8)。   On the other hand, if the definition state is not ON (DefineUndef), it is determined whether the definition of the identifier is ON (define) or ON (undef) and the number of appearances is 0 (step 9). -4). If the definition of the identifier is ON (define) or ON (undef) and the number of occurrences is 0, there is a possibility that the identifier is misspelled. 9-8).

一方、定義状態がON(define)又はON(undef)であって、かつ、出現数が0でなかった場合は、大文字・小文字の違いに過ぎない、文字構成中所定字数が共通する等、当該識別子と文字構成上の特徴が一致する類似識別子が、テーブル内に存在するか判断する類似識別子探索処理を実行する(ステップ9−5、9−6)。ここで、類似識別子が存在しない場合には、ステップ9−8の強調処理ON設定を飛ばしてステップ9−9に進む。   On the other hand, if the definition state is ON (define) or ON (undef) and the number of occurrences is not 0, only the difference between uppercase and lowercase letters, the predetermined number of characters in the character structure is common, etc. A similar identifier search process is performed to determine whether or not a similar identifier having the same character characteristics as the identifier exists in the table (steps 9-5 and 9-6). If there is no similar identifier, the emphasis process ON setting in step 9-8 is skipped and the process proceeds to step 9-9.

一方、類似識別子が存在する場合は、評価中(着目中)の識別子の出現数が設定値以下であるか否かを判断する(ステップ9−7)。ここで、評価中(着目中)の識別子の出現数が設定値より多い場合は、ステップ9−8の強調処理ON設定を飛ばしてステップ9−9に進む。   On the other hand, if a similar identifier exists, it is determined whether or not the number of appearances of the identifier being evaluated (under consideration) is equal to or less than the set value (step 9-7). Here, if the number of appearances of the identifier being evaluated (under consideration) is larger than the set value, the emphasis process ON setting in step 9-8 is skipped and the process proceeds to step 9-9.

一方、類似識別子があり、評価中(着目中)の出現数が設定値(例えば3を用いる。別途ユーザが設定できるものとする)以下である場合は、その識別子がスペルミスである可能性があるため、識別子の強調表示をONに設定する(ステップ9−8)。   On the other hand, if there is a similar identifier and the number of appearances under evaluation (under consideration) is equal to or less than a set value (eg, 3 is used, which can be set separately by the user), the identifier may be a spelling error. Therefore, identifier highlighting is set to ON (step 9-8).

そして、上記一連の評価処理が終了すると、次の識別子が存在するか否かの判断が行われ(ステップ9−9)、次の識別子がある場合には、ステップ9−10(インクリメント処理)を経てステップ9−2に戻り、次の識別子の評価を続行する。一方、次の識別子がない場合には、この処理を終了する。   When the series of evaluation processes is completed, it is determined whether or not the next identifier exists (step 9-9). If there is a next identifier, step 9-10 (increment process) is performed. Then, the process returns to step 9-2 to continue the evaluation of the next identifier. On the other hand, if there is no next identifier, this process is terminated.

図9は、図8に示したサンプルソースファイルについて、上記図5のフローチャートのステップ7−1から7−11までを実行した時点の識別子一覧作成用のテーブルを表した図である。図8を参照し、どのように判定されるかを説明すると、1行目の[#define RELEASE]が検出され、ID番号1/ 識別子RELEASE/ 出現数0/ 設定Off/ 定義On(define)/ 強調表示Offとしたデータがテーブルに追加される。   FIG. 9 is a diagram showing a table for creating an identifier list when steps 7-1 to 7-11 in the flowchart of FIG. 5 are executed for the sample source file shown in FIG. Referring to FIG. 8, how the determination is made will be described. [#Define RELEASE] on the first line is detected, and ID number 1 / identifier RELEASE / number of appearances 0 / setting Off / definition On (define) / Data that is highlighted off is added to the table.

次に、2行目の[#undef DEBUG3]が検出され、これもテーブルにないため、ID番号2/ 識別子DEBUG3/ 出現数0/ 設定Off/ 定義On(undef)/ 強調表示Offとしたデータがテーブルに追加される。   Next, [#undef DEBUG3] on the second line is detected, and this is also not in the table. Therefore, the data with ID number 2 / identifier DEBUG3 / number of appearances 0 / setting Off / definition On (undef) / highlighting Off is obtained. Added to the table.

次に、4行目の[#ifdef CUSTUM]が検出され、これもテーブルにないため、ID番号3/ 識別子CUSTUM/ 出現数1/ 設定Off/ 定義Off/ 強調表示Offとしたデータがテーブルに追加される。   Next, [#ifdef CUSTUM] on the fourth line is detected, and this is also not in the table. Therefore, data with ID number 3 / identifier CUSTUM / number of appearances 1 / off setting / off setting / highlighting off is added to the table. Is done.

次に、8行目の[#ifdef DEBUG3]が検出されるが、これはテーブルに既に存在するため、テーブルのID番号2(DEBUG3)の出現数の値が加算される(0から1に変更)。   Next, [#ifdef DEBUG3] in the eighth line is detected, but since this already exists in the table, the value of the appearance number of ID number 2 (DEBUG3) of the table is added (changed from 0 to 1). ).

次に、11行目の[#ifdef RELEASE]が検出されるが、これもテーブルに既に存在するため、テーブルのID番号1(RELEASE)の出現数の値が加算される(0から1に変更)。   Next, [#ifdef RELEASE] on the 11th line is detected, but since this also exists in the table, the value of the appearance number of ID number 1 (RELEASE) of the table is added (changed from 0 to 1). ).

次に、13行目の[#ifdef DEBUG3]が検出されるが、これはテーブルに既に存在するため、テーブルのID番号2(DEBUG3)の出現数の値が加算される(1から2に変更)。   Next, [#ifdef DEBUG3] on the 13th line is detected. Since this already exists in the table, the value of the number of appearances of ID number 2 (DEBUG3) of the table is added (change from 1 to 2). ).

次に、18行目の[#ifdef RELEACE]が検出されるが、これはテーブルにないため、ID番号4/ 識別子RELEACE/ 出現数1/ 設定Off/ 定義Off/ 強調表示Onとしたデータがテーブルに追加される。   Next, [#ifdef RELEACE] on the 18th line is detected, but since this is not in the table, the data with ID number 4 / identifier RELEACE / appearance number 1 / off setting / off definition / highlighted on is stored in the table. To be added.

以上の各判定処理をまとめたものが図9であり、この短いソースファイルでも、RELEASEとRELEACEが互いに類似識別子(その判定詳細は後述する)となり、それぞれ出現数が少ないため、強調表示ON設定されることが了解される。   FIG. 9 shows a summary of the above determination processes. Even in this short source file, RELEASE and RELEACE are similar identifiers (details of the determination will be described later), and since the number of appearances is small, highlighting is set to ON. It is understood that

図10は、別のソースファイルから生成された識別子一覧作成用のテーブルである。図10を参照すると、ID番号1乃至4、7、9の識別子は強調表示がOffであり、問題点がないことが判別できる。   FIG. 10 is a table for creating an identifier list generated from another source file. Referring to FIG. 10, the identifiers of ID numbers 1 to 4, 7, and 9 are highlighted off, and it can be determined that there is no problem.

しかしながら、ソース中に6回記述されているID番号5、識別子”NEW”は、定義フィールドは、On(DefineUndef)となっている。これは、上述したようにソース中に#define/ #undefの両方の定義が検出されたためである。そのような不定状態は、識別子の定義ミス/スペルミスの可能性があると考えられるため、強調表示はONに設定される。   However, the definition field of the ID number 5 and the identifier “NEW” described six times in the source is On (DefineUndef). This is because both definitions of # define / # undef were detected in the source as described above. Such an indeterminate state is considered to have the possibility of an identifier definition error / spell mistake, so the highlighting is set to ON.

また、ID番号6、識別子”OLD”は、#undefで定義はされており、また♯ifdef、♯if define又は#elifが見当たらない状態となっている(出現数が0)。この場合は、スペルミスの可能性があると考えられるため、強調表示はONに設定される。   Further, the ID number 6 and the identifier “OLD” are defined by #undef, and #ifdef, #if define or #elif is not found (the number of appearances is 0). In this case, since there is a possibility of a spelling error, the highlighting is set to ON.

また、ID番号8、識別子”RELEACE”は、ソース中に1回記述されているが、定義(#define/ #undef)は無い。この場合は、類似する(一文字相違)スペルを有するRELEASEが存在し、かつ出現数が少ない(3回より少ない)ため、スペルミスの可能性があると判断され、強調表示はONに設定される。   The ID number 8 and the identifier “RELEACE” are described once in the source, but there is no definition (# define / # undef). In this case, since there is RELEASE having a similar (one character difference) spelling and the number of appearances is small (less than three times), it is determined that there is a possibility of a spelling error, and the highlighting is set to ON.

図11は、図10の識別子一覧作成用のテーブルを視覚的にわかりやすい態様に構成し直したものである。図10の識別子一覧作成用のテーブルをそのまま表示してユーザに注意を喚起しても良いが、図11の例では、出現数でソートしてあり、更に、定義と設定が設定欄にまとめて記号表示され、強調表示は行頭の「*」でもって表されている(NEW/ RELEACE/ OLD参照)。また、すでにソース中に明示的に宣言している識別子については、コマンドラインよりも優先的に設定されるため、凡例に示したように設定欄には状態(有効・無効)が示され、一覧表から変更できないように、適宜チェックボックスが変更不可状態にされている。   FIG. 11 is a table in which the identifier list creation table of FIG. The identifier list creation table of FIG. 10 may be displayed as it is to alert the user. However, in the example of FIG. 11, the table is sorted by the number of appearances, and the definition and setting are collected in the setting column. It is displayed as a symbol, and the highlighting is represented by a “*” at the beginning of the line (see NEW / RELEACE / OLD). In addition, since identifiers that have already been explicitly declared in the source are set with priority over the command line, the status (valid / invalid) is displayed in the setting column as shown in the legend. The check boxes are appropriately set to non-changeable so that they cannot be changed from the table.

また、この識別子一覧は、出現数(昇順/降順)又は識別子名(辞書順)でソートできるように構成され、識別子のスペルミスや不整合をそれぞれの視点から確認できるようになっている。そして、ユーザがその識別子を使用したい場合には、設定欄のボックスをチェックして選択状態とすることができる。但し、ここでは、RELEASEは既にソース中で#defineで定義されているので、選択状態で変更不可能であり、DEBUG3及びOLDは、ソース中で#undefで定義されているので、未選択状態で変更不可能になっている。またNEWは、ソース中で#defineかつ#undefで定義されているため、不定状態で変更不可能になっている。   The identifier list is configured so that it can be sorted by the number of appearances (ascending / descending order) or identifier name (dictionary order), so that spelling mistakes and inconsistencies of identifiers can be confirmed from each viewpoint. If the user wants to use the identifier, the user can check the box in the setting column to select it. However, since RELEASE is already defined by #define in the source, it cannot be changed in the selected state, and DEBUG3 and OLD are defined by #undef in the source. It cannot be changed. Since NEW is defined by #define and #undef in the source, it cannot be changed in an indefinite state.

図12は、図11の一覧により、RELEACEが間違っていたことに気が付き、ソースに戻り、識別子RELEACEをRELEASEと訂正、識別子NEWの定義箇所を削除、識別子OLDの定義箇所を削除した後、再度出力される識別子一覧である。図12を参照すると、エラーを暗示する行頭の「*」は無くなっている。この状態で図12に示されたとおり、ユーザが設定欄のチェックボックスをチェックすることにより、識別子一覧のテーブルの設定の値がONになる。また、定義の値がOff以外の識別子に関しては、設定の値は常にOffを取る。図12の例では、ユーザが、複数の識別子”CUSTUM”、”DEBUG2”、”VERSION”を使用するとして、設定欄にチェックが入れられている。従って、この状態から所定の操作を行うことで、コンパイラ15に対して、”−D CUSTUM −D DEBUG2 −D VERSION”のコマンドを発行することが可能となっている。   FIG. 12 shows that the RELEACE is wrong from the list of FIG. 11, returns to the source, corrects the identifier RELEACE as RELEASE, deletes the definition part of the identifier NEW, deletes the definition part of the identifier OLD, and then outputs again. It is a list of identifiers. Referring to FIG. 12, the “*” at the beginning of the line that implies an error is gone. In this state, as shown in FIG. 12, when the user checks the check box in the setting column, the setting value in the identifier list table is turned ON. For identifiers whose definition value is other than Off, the setting value is always Off. In the example of FIG. 12, the setting column is checked as the user uses a plurality of identifiers “CUSTOM”, “DEBUG2”, and “VERSION”. Accordingly, by performing a predetermined operation from this state, it is possible to issue a command “-D CUSTOM-D DEBUG2-D VERSION” to the compiler 15.

以上説明したとおり、従来の方法では、条件付きコンパイルの識別子を指定する際に、多くの識別子の設定を手動で行う必要があり、ここでスペルミスが起こる可能性があるところ、本実施の形態によれば、ユーザは、識別子一覧の強調表示に促されて間違いを容易に検出することが可能となる。また、上記の識別子一覧から定義(有効状態)したい識別子を選択することにより、識別子の定義ミスによるエラーの確率を低減することが可能である。   As described above, in the conventional method, when specifying identifiers for conditional compilation, it is necessary to manually set many identifiers, and there is a possibility that spelling errors may occur. According to this, the user is easily prompted to highlight the identifier list and can easily detect an error. In addition, by selecting an identifier to be defined (valid state) from the above-described identifier list, it is possible to reduce the probability of error due to an identifier definition error.

また上記した実施の形態では、強調表示をアスタリスクをもって行う例を挙げて説明したが、その他太字化、彩色変更、点滅等の強調表示を採用することができる。   Further, in the above-described embodiment, an example in which highlighting is performed with an asterisk has been described, but other highlighting such as bolding, color change, and blinking can be employed.

続いて、上記第1の実施の形態における類似識別子探索をより細かく行うこととした第2の実施の形態について説明する。本実施の形態は、図7のステップ9−5の類似識別子探索処理を詳細に行う点が異なるのみであるので、既に説明した内容と重複する部分は省略し、その相違点を中心に説明する。図13は、図7のステップ9−5の類似識別子探索処理として行われる詳細動作を表したフローチャートである。   Next, a second embodiment in which the similar identifier search in the first embodiment is performed more finely will be described. Since the present embodiment is different only in that the similar identifier search process in step 9-5 in FIG. 7 is performed in detail, portions that overlap the already described contents are omitted, and the differences will be mainly described. . FIG. 13 is a flowchart showing a detailed operation performed as the similarity identifier search process in step 9-5 of FIG.

図13を参照すると、初めに、識別子一覧作成用のテーブルより、比較照合を行う識別子A(ID(x))と識別子B(ID(x+y))が取得される(ステップ14−1)。続いて、一文字タイプミス比較処理、識別子中のある特定の文字を一つ削除又は追加した場合残りの部分が一致するか?といった視点での判断を行う(ステップ14−2、14−3)。その具体的詳細は、後に図14を用いて説明する。   Referring to FIG. 13, first, an identifier A (ID (x)) and an identifier B (ID (x + y)) for comparison and collation are acquired from a table for creating an identifier list (step 14-1). Subsequently, if one character typo comparison process, one particular character in the identifier is deleted or added, does the remaining part match? Judgment is performed from such a viewpoint (steps 14-2 and 14-3). The specific details will be described later with reference to FIG.

ここで、一致(一文字多いか少ないかの相違に過ぎない)と判定した場合は、ステップ14−10に進み、類似識別子と判定される。   Here, when it is determined that they match (only one character is greater or less), the process proceeds to step 14-10, where it is determined as a similar identifier.

一方、ステップ14−3で一致しないと判定した場合、続いて、識別子Aと識別子Bがアルファベットの大文字と小文字の相違に過ぎないかどうかという視点での判定を行う(ステップ14−4、14−5)。ここで、例えばDEBUGとdebug、RELEASEとReLEaSE等のように一致(大文字と小文字の相違に過ぎない)と判定した場合は、ステップ14−10に進み、類似識別子と判定される。   On the other hand, if it is determined in step 14-3 that they do not match, then determination is made from the viewpoint of whether or not identifier A and identifier B are only the difference between uppercase and lowercase letters (steps 14-4 and 14-). 5). Here, for example, if it is determined that they match (only a difference between uppercase and lowercase letters), such as DEBUG and debug, RELEASE and ReLEaSE, the process proceeds to step 14-10, where it is determined as a similar identifier.

一方、ステップ14−5で一致しないと判定した場合、続いて、識別子Aと識別子Bの各文字を順番に比較し、異なっている文字数をカウントする処理を行う(ステップ14−6)。そして、相違する文字数が所定値n個以下であるか否かを判定する(ステップ14−7)。例えば所定値nは、識別子の文字列の長さが3以下のときはn=2、文字列の長さが4以上の時はn=3とする等比較元の識別子の文字数を基準に変動させることが好ましい。例えばDEBUGとDABUG、RELEASEとRELEACE等のように一致(相違文字がそれぞれ1文字であり、所定値n以下である)と判定した場合は、ステップ14−10に進み、類似識別子と判定される。   On the other hand, if it is determined in step 14-5 that they do not match, then the characters of identifier A and identifier B are compared in order and the number of different characters is counted (step 14-6). Then, it is determined whether or not the number of different characters is a predetermined value n or less (step 14-7). For example, the predetermined value n varies based on the number of characters of the identifier of the comparison source, such as n = 2 when the length of the character string of the identifier is 3 or less, and n = 3 when the length of the character string is 4 or more. It is preferable to make it. For example, if it is determined that they match (such as one different character and less than or equal to a predetermined value n), such as DEBUG and DABUG, RELEASE and RELEACE, etc., the process proceeds to step 14-10 to determine a similar identifier.

一方、ステップ14−7で一致しないと判定した場合、続いて、識別子Aと識別子Bを比較し、ある一定数以下の文字が置き換わったに過ぎない(各文字の出現回数が略一致する)かどうかという視点で判定を行う(ステップ14−8、14−9)ここで、例えばDEBUGとDABUG、RELEASEとRELEACE、REREASEとRELEASE、のように一致(各文字の出現回数の差が所定値以下)と判定した場合は、ステップ14−10に進み、類似識別子と判定される。   On the other hand, if it is determined in step 14-7 that they do not match, then identifier A and identifier B are compared, and only a certain number of characters or less have been replaced (the number of appearances of each character substantially matches). Judgment is made from the viewpoint of whether or not (steps 14-8 and 14-9). Here, for example, DEBUG and DABUG, RELEASE and RELEACE, REREASE and RELEASE are matched (the difference in the number of appearances of each character is a predetermined value or less) If it is determined, the process proceeds to step 14-10 to determine a similar identifier.

図14は、図13のステップ14−2における詳細動作を表したフローチャートである。図14を参照すると、まず、文字列長の長い識別子にフラグをセットし(ステップ15−1)、両識別子の文字列長が同じ場合を除外した上で(ステップ15−2)、識別子Aと識別子Bを先頭より順番に比較し(ステップ15−3、15−4)、相違が発生しても最初の相違であれば、文字列長の長い方の比較文字を進める処理を行って(ステップ15−5)、比較を続行する(ステップ15−6、15−7)。最終的に、どちらか一方の識別子の特定の一文字を除外すれば、識別子A、Bが一致する場合には「一致」、一致しない場合には「不一致」と判断する。例えば、DEBUGとDEBG、RELEASEとRELEAASEは類似識別子と判断されることになる。   FIG. 14 is a flowchart showing the detailed operation in step 14-2 of FIG. Referring to FIG. 14, first, a flag is set for an identifier having a long character string length (step 15-1), and the case where both identifiers have the same character string length is excluded (step 15-2). The identifier B is compared in order from the beginning (steps 15-3 and 15-4). If there is a difference, if it is the first difference, a process of advancing the comparison character with the longer character string length is performed (step 15-5) and the comparison is continued (steps 15-6 and 15-7). Finally, if one specific character of either one of the identifiers is excluded, it is determined that the identifiers A and B match each other, “match”, and if they do not match, “no match”. For example, DEBUG and DEBG, RELEASE and RELEASE are determined to be similar identifiers.

上記各判定処理において類似識別子が存在すると判定されれば、第1の実施の形態で説明した強調処理ONが設定され(図7のステップ9−8)、ユーザにソースコードの確認を的確に促すことが可能となる。   If it is determined in each determination process that a similar identifier exists, the enhancement process ON described in the first embodiment is set (step 9-8 in FIG. 7), and the user is prompted to confirm the source code accurately. It becomes possible.

以上、2つの識別子が類似すると判定するための方法を各種説明したが、これらは、その一例を挙げたに過ぎず、その他の処理を加えても良いし、図13、図14に例示された判定処理の一部を省略しても良いし、順序を変えるなどしても良い。また、上記各判定処理で用いたしきい値も適宜変更可能である。いずれにしても、手入力時に誤りやすいミスを的確に検出できるようなロジックであることが望まれる。   As described above, various methods for determining that two identifiers are similar have been described. However, these are merely examples, and other processing may be added, as illustrated in FIGS. 13 and 14. A part of the determination process may be omitted, or the order may be changed. Further, the threshold value used in each determination process can be changed as appropriate. In any case, it is desirable that the logic is such that mistakes that are likely to be mistaken during manual input can be accurately detected.

以上、本発明のいくつかの実施の形態を説明したが、その原理からも明らかなとおり、本発明の技術的範囲は、上述した実施の形態に限定されるものではなく、ソースコードから識別子一覧を生成表示しユーザに注意を喚起するとともに、該識別子一覧から識別子を設定可能とする構成という本発明の要旨を逸脱しない範囲で、各種の変形・置換をなしうることが可能であることはいうまでもない。   Although several embodiments of the present invention have been described above, as is clear from the principle thereof, the technical scope of the present invention is not limited to the above-described embodiments, and a list of identifiers from the source code. It is possible to make various modifications and substitutions without departing from the gist of the present invention, in which the identifier is set and displayed to alert the user and the identifier can be set from the identifier list. Not too long.

また、上記した実施の形態では、C言語を用いた例を挙げて説明したが、その原理からして明らかなとおり、Java(登録商標)、C#など、おおよそ条件付コンパイルが可能な言語であれば、特に限定するものではないことはもちろんである。   In the above-described embodiment, an example using the C language has been described. However, as is apparent from the principle, a language such as Java (registered trademark), C #, or the like that can be roughly conditional-compiled. Of course, there is no particular limitation.

本発明に係るコンピュータプログラムの作成支援装置の概略構成図である。1 is a schematic configuration diagram of a computer program creation support apparatus according to the present invention. 識別子一覧のテーブル構成例を表した図である。It is a figure showing the example of a table structure of an identifier list. 識別子一覧の定義状態を決定するためのマトリクスの一例である。It is an example of the matrix for determining the definition state of an identifier list. 本発明を適用した場合のプログラム作成の基本的な流れを示したフローチャートである。It is the flowchart which showed the basic flow of the program creation at the time of applying this invention. 図4のステップ3−2における詳細動作を表したフローチャートである。It is a flowchart showing the detailed operation | movement in step 3-2 of FIG. 図5のステップ7−6における詳細動作を表したフローチャートである。6 is a flowchart showing a detailed operation in step 7-6 of FIG. 図5のステップ7−11における詳細動作を表したフローチャートである。It is a flowchart showing the detailed operation | movement in step 7-11 of FIG. 本発明の実施の形態を説明するためのサンプル・ソースコードである。It is a sample source code for demonstrating embodiment of this invention. 図8に示したサンプルソースファイルに基づいて生成される識別子一覧作成用のテーブルを表した図である。It is a figure showing the table for identifier list creation produced | generated based on the sample source file shown in FIG. 別のソースファイルから生成された識別子一覧テーブルである。It is an identifier list table generated from another source file. 視覚的にわかりやすい態様で構成した識別子一覧の例である。It is an example of the identifier list comprised in the aspect which is easy to understand visually. 識別子一覧の別の一例である。It is another example of an identifier list. 本発明の第2の実施の形態の要点を説明するためのフローチャートである。It is a flowchart for demonstrating the principal point of the 2nd Embodiment of this invention. 図13のステップ14−2における詳細動作を表したフローチャートである。It is a flowchart showing the detailed operation | movement in step 14-2 of FIG. 従来のプログラム作成手順を示したフローチャートである。It is the flowchart which showed the conventional program creation procedure. 条件付きコンパイルのコマンド例である。This is an example command for conditional compilation.

符号の説明Explanation of symbols

11 記憶装置
12 識別子一覧出力部
13 識別子入力受付部
14 モニタ
15 コンパイラ
11 Storage Device 12 Identifier List Output Unit 13 Identifier Input Accepting Unit 14 Monitor 15 Compiler

Claims (11)

コンピュータによるプログラムソースコードに含まれる条件付コンパイル用の識別子の管理方法であって、
前記コンピュータが、プログラムソースコードを走査し、
少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する工程と、
少なくともコンパイルコマンド入力時に、前記コンピュータが、前記識別子一覧からユーザによって選択された識別子を、条件付コンパイル用の識別子として設定する工程と、を、含むこと、
を特徴とする条件付コンパイル用の識別子の管理方法。
A method for managing an identifier for conditional compilation included in a program source code by a computer,
The computer scans the program source code;
Generating and displaying an identifier list including at least an identifier used subsequent to a preprocessor instruction for conditional compilation, the number of occurrences thereof, and a definition state indicating whether or not the identifier is defined ; ,
Including, at least when a compile command is input, the computer sets an identifier selected by the user from the identifier list as an identifier for conditional compilation .
An identifier management method for conditional compilation characterized by
コンピュータプログラムの作成支援装置であって、
プログラムソースコードを走査し、少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する識別子一覧出力部と、
少なくともコンパイルコマンド入力時に、前記識別子一覧から任意の識別子を選択することによって、条件付コンパイル用の識別子の設定を受け付ける識別子入力受付部と、を備えたこと、
を特徴とするコンピュータプログラムの作成支援装置。
A computer program creation support device,
An identifier that scans the program source code and includes at least the identifier used following the preprocessor instruction for conditional compilation, the number of occurrences, and the definition status indicating whether the identifier is defined An identifier list output unit for generating and displaying a list ;
An identifier input receiving unit that receives setting of an identifier for conditional compilation by selecting an arbitrary identifier from the identifier list at least when a compile command is input ;
A computer program creation support apparatus characterized by the above.
請求項に記載のコンピュータプログラムの作成支援装置において、
前記識別子一覧出力部は、識別子に使用された文字順でソートされた識別子一覧を生成表示すること
を特徴とするコンピュータプログラムの作成支援装置。
In the computer program creation support device according to claim 2 ,
The identifier list output unit generates and displays an identifier list sorted in the order of characters used for the identifier ;
A computer program creation support apparatus characterized by the above.
請求項に記載のコンピュータプログラムの作成支援装置において、
前記識別子一覧出力部は、識別子の出現回数でソートされた識別子一覧を生成表示すること
を特徴とするコンピュータプログラムの作成支援装置。
In the computer program creation support device according to claim 2 ,
The identifier list output unit generates and displays an identifier list sorted by the number of occurrences of the identifier ;
A computer program creation support apparatus characterized by the above.
請求項2乃至4いずれか一に記載のコンピュータプログラムの作成支援装置において、
前記識別子一覧出力部は、前記識別子一覧から識別子を順次選択して、他の識別子照合し、前記識別子一覧から選択した一の識別子と文字構成上の特徴が一致する類似識別子が存在し、かつ、着目する識別子の出現回数が所定値より少ない場合は、前記識別子一覧の該識別子の部分を強調表示すること、
を特徴とするコンピュータプログラムの作成支援装置。
In the computer program creation support apparatus according to any one of claims 2 to 4 ,
The identifier list output unit sequentially selects the identifier from the identifier list, against the other identifier, similar identifier exists that features on one of the identifier and the character structure selected from the identifier list matches, and When the number of occurrences of the identifier of interest is less than a predetermined value, highlighting the identifier portion of the identifier list;
A computer program creation support apparatus characterized by the above.
請求項に記載のコンピュータプログラムの作成支援装置において、
前記識別子一覧出力部は、前記識別子一覧から選択した一の識別子の文字列から少なくとも1文字を削除して並べた文字列と、一致する識別子が検出された場合は、前記文字構成上の特徴が一致する類似識別子と判定すること、
を特徴とするコンピュータプログラムの作成支援装置。
The computer program creation support apparatus according to claim 5 ,
The identifier list output unit, when a character string in which at least one character is deleted and arranged from a character string of one identifier selected from the identifier list and an identifier that matches are detected, Determining a matching similar identifier;
A computer program creation support apparatus characterized by the above.
ェック対象のプログラムソースコードを走査し、少なくとも、条件付コンパイル用のプリプロセッサ命令に後続して用いられている識別子とその出現回数と、識別子が定義されているか否かを示した定義状態と、を併記した識別子一覧を生成表示する処理と、
少なくともコンパイルコマンド入力時に、前記識別子一覧から任意の識別子の選択をユーザから受け付けることで、条件付コンパイル用の識別子の設定を受け付ける処理とを、前記コンピュータに実行させるコンピュータプログラムの作成支援プログラム。
Scans the program source code Ji Ekku subject, at least, an identifier which is used by following the preprocessor directives for conditional compilation and its number of occurrences, a defined state shown whether the identifier is defined, and a process for generating display an identifier list was also shown,
A computer program creation support program that causes the computer to execute processing for accepting setting of an identifier for conditional compilation by accepting selection of an arbitrary identifier from the identifier list from a user at least when a compile command is input.
前記識別子一覧を生成表示する処理において、識別子に使用された文字順で各識別子をソートした識別子一覧を生成すること、
を特徴とする請求項7記載のコンピュータプログラムの作成支援プログラム
In the process of generating and displaying the identifier list, generating an identifier list in which each identifier is sorted in the order of characters used for the identifier;
The computer program creation support program according to claim 7 .
前記識別子一覧を生成表示する処理において、識別子の出現回数で各識別子をソートした識別子一覧を生成すること、
を特徴とする請求項7記載のコンピュータプログラムの作成支援プログラム
In the process of generating and displaying the identifier list, generating an identifier list in which each identifier is sorted by the number of occurrences of the identifier;
The computer program creation support program according to claim 7 .
更に、
前記識別子一覧から識別子を順次選択して、他の識別子照合する処理と、
前記識別子一覧から選択した一の識別子と文字構成上の特徴が一致する類似識別子が存在し、かつ、着目する識別子の出現回数が所定値より少ない場合は、前記識別子一覧の該識別子の部分を強調表示する処理と、を前記コンピュータに実行させる請求項7乃至9いずれか一記載のコンピュータプログラムの作成支援プログラム
Furthermore,
A process of sequentially selecting an identifier from the identifier list and checking with another identifier;
If there is a similar identifier that matches the character structure of one identifier selected from the identifier list and the number of occurrences of the identifier of interest is less than a predetermined value, the identifier portion of the identifier list is emphasized. The computer program creation support program according to claim 7, which causes the computer to execute a display process.
前記識別子一覧から選択した一の識別子の文字列から少なくとも1文字を削除して並べた文字列と、一致する識別子が検出された場合は、前記文字構成上の特徴が一致する類似識別子と判定すること、
を特徴とする請求項10記載のコンピュータプログラムの作成支援プログラム
When a matching identifier is detected with a character string obtained by deleting at least one character from a character string of one identifier selected from the identifier list, it is determined as a similar identifier that matches the character configuration characteristics. thing,
The computer program creation support program according to claim 10 .
JP2005029376A 2005-02-04 2005-02-04 Conditional compiling identifier management method, computer program creation support apparatus, and program Expired - Fee Related JP4827418B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005029376A JP4827418B2 (en) 2005-02-04 2005-02-04 Conditional compiling identifier management method, computer program creation support apparatus, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005029376A JP4827418B2 (en) 2005-02-04 2005-02-04 Conditional compiling identifier management method, computer program creation support apparatus, and program

Publications (2)

Publication Number Publication Date
JP2006215896A JP2006215896A (en) 2006-08-17
JP4827418B2 true JP4827418B2 (en) 2011-11-30

Family

ID=36979079

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005029376A Expired - Fee Related JP4827418B2 (en) 2005-02-04 2005-02-04 Conditional compiling identifier management method, computer program creation support apparatus, and program

Country Status (1)

Country Link
JP (1) JP4827418B2 (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3120443B2 (en) * 1990-10-12 2000-12-25 富士通株式会社 Command processing unit
JPH04178837A (en) * 1990-11-14 1992-06-25 Hitachi Ltd Method for correcting error of term
JPH04273328A (en) * 1991-02-28 1992-09-29 Hokkaido Nippon Denki Software Kk Generation system for cross-reference list
JPH05341976A (en) * 1992-06-10 1993-12-24 Fujitsu Ltd Character string editing device
JPH1153219A (en) * 1997-07-30 1999-02-26 Mitsubishi Heavy Ind Ltd Software verifying device
JPH1173305A (en) * 1997-08-29 1999-03-16 Nec Corp Screen editor having check function

Also Published As

Publication number Publication date
JP2006215896A (en) 2006-08-17

Similar Documents

Publication Publication Date Title
Meinicke et al. Mastering software variability with FeatureIDE
JP2795244B2 (en) Program debugging system
US6055369A (en) Apparatus for visual programming with screen flow
JP4195479B2 (en) Incremental generation system
US20120174061A1 (en) Code suggestion in a software development tool
JP2008052312A (en) Operation specification extraction support system
JP4826120B2 (en) Business specification creation support system and method
JP4835859B2 (en) State transition diagram creation device and state transition diagram creation method
TWI437457B (en) Method for analyzing dependency of target object
US20160062738A1 (en) Methods and Apparatuses for Interactive Computer Programming
Coppit et al. Spotlight: A prototype tool for software plans
JP4827418B2 (en) Conditional compiling identifier management method, computer program creation support apparatus, and program
US11809844B2 (en) Creating an app method and system
Salter et al. NetBeans IDE 8 Cookbook
JP5504212B2 (en) Test case automatic generation system, test case automatic generation method, and test case automatic generation program
KR20220003106A (en) Systems and methods of computer-assisted computer programming
JP4953896B2 (en) Program review support device
JP2006338399A (en) Program developing device, program development software and storage medium
Gąsior ReSharper Essentials
Campbell iPhone Application Development for iOS 4: Visual QuickStart Guide
JPH11296406A (en) Program correction supporting system
JP2007226739A (en) Software development unit and program
JP2005092519A (en) Device and method for supporting creation of object-oriented program
JP2008015879A (en) Method, program and system for supporting description of specification including natural sentence
JP2006236088A (en) Trace data collection device, trace data collection support device, trace data collection method, trace data collection program and trace data collection support program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080116

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100406

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110301

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110428

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110524

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110824

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20110829

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110913

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

Free format text: PAYMENT UNTIL: 20140922

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees