JPH02291024A - Comment sentence starting character selection type object program preparing device - Google Patents

Comment sentence starting character selection type object program preparing device

Info

Publication number
JPH02291024A
JPH02291024A JP11167689A JP11167689A JPH02291024A JP H02291024 A JPH02291024 A JP H02291024A JP 11167689 A JP11167689 A JP 11167689A JP 11167689 A JP11167689 A JP 11167689A JP H02291024 A JPH02291024 A JP H02291024A
Authority
JP
Japan
Prior art keywords
program
comment
character
source program
line
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
JP11167689A
Other languages
Japanese (ja)
Inventor
Hanayo Kitafuru
北古 華代
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP11167689A priority Critical patent/JPH02291024A/en
Publication of JPH02291024A publication Critical patent/JPH02291024A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To save labor by comparing a character read from a table with a leading character in the prescribed row of an inputted source program, deciding the row as a comment sentence when the both characters are coincident, deciding the row as an instruction sentence when the both characters are dissident, converting the program into an object program and outputting the program. CONSTITUTION:In a comparison part 30, the character read from a table 20 is compared with the leading character in the prescribed row of the inputted source program. When the both characters are coincident, the row is decided as the comment sentence and when the both characters are dissident, the row is decided as the instruction sentence. Then, the program is converted into the object program and outputted. Thus, since only the character, which is designated in advance before the source program is inputted, is defined as a comment sentence starting character, the different object program can be prepared in one source program by selectively using the comment sentence starting character in the source program.

Description

【発明の詳細な説明】 〔概 要〕 コメント文を含むソースプログラムからオブジェクトプ
ログラムを作成するためのコンパイラに関し、 コメント文開始文字を利用者が選択することができるオ
ブジェクトプログラム作成装置を提供することを目的と
し、 ソースプログラムを入力してオブジェクトプログラムに
変換して出力するコンパイラを有するソフトウェア開発
システムにおいて、コンパイラに、ソースプログラムの
任意の行をコメント文とするためのコメント文開始文字
を入力して記憶するテーブルと、テーブルから読み出し
た文字と入力したソースプログラムの所定の行の先頭文
字とを比較し両者が一致した時にはその行はコメント文
と判定し、両者が不一致の時にはその行は命令文と判定
してオブジェクトプログラムに変換して出力ずる比較部
とを設け、比較をソースプログラJ、のすべての行につ
いて行うように構成する。
[Detailed Description of the Invention] [Summary] The present invention relates to a compiler for creating an object program from a source program including comment statements, and provides an object program creation device that allows the user to select the starting character of the comment statement. In a software development system that has a compiler that inputs a source program, converts it into an object program, and outputs it, the compiler inputs and stores comment statement start characters to make any line of the source program a comment statement. The characters read from the table are compared with the first character of a predetermined line of the input source program. If the two match, that line is determined to be a comment statement, and if they do not match, the line is determined to be an instruction statement. A comparison unit is provided to perform the judgment, convert it into an object program, and output it, and is configured to compare all lines of the source program J.

〔産業上の利用分野〕[Industrial application field]

本発明は、コメン1・文を含むソースプログラムからオ
ブジェク1・プログラムを作成するためのコンパイラの
改良に関するものである。
The present invention relates to an improvement of a compiler for creating an object 1 program from a source program including comment 1 statements.

この際、コメント文開始文字を利用者が選択することが
できるオブジェク1・プログラム作成装置が要望されて
いる。
At this time, there is a need for an object 1 program creation device that allows the user to select the starting character of a comment sentence.

〔従来の技術〕[Conventional technology]

第5図は従来例の特定文字の使用方法を説明する図であ
る。
FIG. 5 is a diagram illustrating a conventional method of using specific characters.

第6図は従来例のコメント文判定方法を説明するフロー
チャートである。
FIG. 6 is a flowchart illustrating a conventional comment sentence determination method.

ソフトウェア開発時には、ソースプログラム内にそのプ
ログラムを説明ずるためのコメン1文を入れることによ
り、分かり易いものとすることができる。又、ソフ1・
ウェア開発途中でソースプロダラム内の表示としては残
しておきたいが、その時のコンパイル(ソースプログラ
ムからオブジェクI・プログラムへの変換(翻訳))で
はオブジェクl・プログラムに載セたくない命令につい
ては、ソースプログラムの各行の先頭コラムにコメン1
〜文開始文字を付けることによって、その命令をコメン
1・文とめなしてコンパイルする必要がある。
When developing software, it can be made easier to understand by including a comment in the source program to explain the program. Also, Soft 1.
Instructions that you want to keep as displayed in the source program during software development, but do not want to be included in the object program during compilation (conversion (translation) from the source program to the object program), Comment 1 in the first column of each line of the source program
~By adding the start-of-sentence character, it is necessary to compile the instruction with a comment 1 and a sentence.

例えばソースプし1グラムが第5図(a)に示すような
ものであり、コメンI一文開始文字として特定文字゛*
゜“を設定した場合について説明する。
For example, one gram of sources is as shown in Fig. 5(a), and a specific character ゛* is used as the starting character of one sentence of comment I.
The case where “゜” is set will be explained.

同図(I)の(a)に示すソースプログラムの■行目〜
■行目、及び■行目に“*゜′が付番」られているため
、■〜■行目及び■行目を除いた同図(■)の(b)に
示すようなソースプログラムがコンパイルされ、機械語
に変換される。
Line ■ of the source program shown in (a) of Figure (I)
Since "*゜' is numbered" in the ■ and ■ lines, the source program as shown in (b) of the same figure (■) excluding the ■ to ■ lines and the ■ line is Compiled and converted to machine language.

又、上述のソースプログラムにおいて、■行目を除いて
■行目を入れたい時は、同図(n)の(C)に示すよう
なソースプログラムがコンパイルされ機械語に翻訳され
る。
In addition, in the above source program, when it is desired to remove line ① and insert line ①, a source program as shown in (C) of FIG.

次に、上述のコメント文の判定方法について第6図によ
り説明する。
Next, the method for determining the above-mentioned comment text will be explained with reference to FIG.

第6図において、ソースプログラムをコンパイルする時
、まず1行目の文について先頭文字を読み取り、特定文
字(例えば“*”)と比較する。
In FIG. 6, when compiling the source program, first read the first character of the statement in the first line and compare it with a specific character (for example, "*").

両者が一致した時にはその行をコメント文と判定して、
ソースプログラムの次の行について同様に先頭文字を読
み取って判定を行う。
When the two match, the line is determined to be a comment, and
For the next line of the source program, the first character is read and determined in the same way.

又、両者が一敗しなかった時には、その行を命令文と判
定してオブジェクトプログラムに変換する処理をCPU
 (図示しない)により行う。そして、ソースプログラ
ムの次の行について同様に判定ヲ行う。これをソースプ
ログラムのすべての行について行う。
Also, if both parties do not lose, the CPU determines that line as a command statement and converts it into an object program.
(not shown). Then, the next line of the source program is judged in the same way. Do this for every line of the source program.

このようにしてコメント文の判定を行っていた。Comment sentences were judged in this way.

〔発明が解決しようとする課題] しかしながら」二述のオブジェクl・プログラム作成方
法においては、利用者がコメント文開始文字を指定する
ことができず、1つのソースプログラムでいくつかの命
令文について実行するものと実行しないものの2通り以
上の組み合わせのオブジェク1・プログラムを作成した
い時には、その都度命令文の先頭コラムにコメン1・文
開始文字をつりかえなければならず、手間がかかるとい
う問題点があった。
[Problems to be Solved by the Invention] However, in the object/program creation method described above, the user cannot specify the starting character of a comment statement, and it is difficult to execute several command statements in one source program. When you want to create an object 1 program that has two or more combinations of things that are executed and things that are not executed, you have to change the comment 1 and sentence start character in the first column of the instruction statement each time, which is a time-consuming problem. there were.

又、開発用と出荷用の2つのソースプログラムを準備し
なげればならないという問題点があった。
Another problem was that two source programs had to be prepared, one for development and one for shipping.

したがって本発明の目的は、コメント文開始文字を利用
者が選択して設定することができるオブジェクトプログ
ラム作成装置を提供することにある。
SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide an object program creation device that allows a user to select and set a starting character for a comment sentence.

(課題を解決するための手段〕 」二記問題点は第1図に示す構成によって解決される。(Means for solving problems) The second problem is solved by the configuration shown in FIG.

即ち第1図において、ソースプログラムを入力してオブ
ジェクトプログラムに変換して出力するコンパイラ10
を有するソフ1・ウェア開発システムにおいて、20は
ソースプログラムの任意の行をコメント文とするための
コメン1〜文開始文字を入力して記憶するテーブルであ
る。
That is, in FIG. 1, a compiler 10 inputs a source program, converts it into an object program, and outputs it.
In the software 1/ware development system having the following, reference numeral 20 is a table in which comments 1 to sentence start characters for making any line of a source program a comment are input and stored.

30はテーブルから読み出した文字と入力したソースプ
ログラムの所定の行の先頭文字とを比較し両者が一致し
た時にはその行はコメント文と判定し、両者が不一致の
時にはその行は命令文と判定してオブジェクトプログラ
ムに変換して出力する比較部である。
30 compares the characters read from the table with the first character of a predetermined line of the input source program, and if the two match, the line is determined to be a comment statement, and if the two do not match, the line is determined to be an instruction statement. This is a comparison unit that converts the data into an object program and outputs it.

上記20、30をコンパイラIOに設ける。そして、比
較をソースプログラムのすべての行について行うように
構成する。
The above 20 and 30 are provided in the compiler IO. The comparison is then configured to be performed on all lines of the source program.

〔作 用〕[For production]

第1図において、比較部30において、テーブル20か
ら読み出した文字と入力したソースプログラムの所定の
行の先頭文字とを比較する。そして、両者が一致した時
にはその行はコメント文と判定する。又、両者が不一致
の時にはその行は命令文と判定してオブジェクトプログ
ラムに変換して出力する。
In FIG. 1, a comparison unit 30 compares the characters read from the table 20 with the first character of a predetermined line of the input source program. When the two match, the line is determined to be a comment. If the two do not match, the line is determined to be a command statement and is converted into an object program and output.

このようにしてソースプログラムを入力する前なさない
ため、ソースプログラム中でコメント文開始文字を使い
分けることによって、1つのソースプログラムで異なっ
たオブジェクトプログラムの作成が可能となる。
Since this is not done before inputting the source program, different object programs can be created using one source program by using different comment start characters in the source program.

〔実施例〕〔Example〕

第2図は本発明の実施例のオブジェクトプログラム作成
方法を説明する図である。
FIG. 2 is a diagram illustrating a method for creating an object program according to an embodiment of the present invention.

第3図は実施例で使用されるテーブルを説明する図であ
る。
FIG. 3 is a diagram illustrating a table used in the embodiment.

第4図は実施例のコメント文判定方法を説明するフロー
チャートである。
FIG. 4 is a flowchart illustrating the comment sentence determination method of the embodiment.

全図を通じて同一符号は同一対象物を示す。The same reference numerals indicate the same objects throughout the figures.

第3図に示すように予めランダムアクセス・メモリ(以
下RAMと称する、図示しない)等にコメント文開始文
字を指定文字として外部入力装置(例えばキーボード等
、図示しない)により入力して記憶し、コメント文開始
文字テーブルとして保持する。このテーブルの内容は外
部入力装置により書き換えが可能である。
As shown in FIG. 3, the start character of a comment sentence is input and stored in a random access memory (hereinafter referred to as RAM, not shown) as a specified character using an external input device (for example, a keyboard, etc., not shown), and the comment Stored as a sentence start character table. The contents of this table can be rewritten using an external input device.

第2図に示すソースプログラムを例えば■の方法により
オブジェクトプログラムに変換する場合、即ち、“*′
゛及び“一゛を指定文字として設定する時、コメント分
開始文字選択型コンパイラlによりソースプログラムの
行の先頭に“*゛及び“′一゜゛が記述された行をコメ
ント文とみなす。その結果、■に示すオブジェクトプロ
グラムが出力される。
For example, when converting the source program shown in FIG. 2 into an object program by method (■),
When ゛ and ``1゛'' are set as specified characters, the compiler that selects starting characters for comments treats lines with ``*゛ and ``1゛'' written at the beginning of the source program line as comment statements.As a result. , Object programs shown in ■ are output.

又、■の方法によりオブジェクトプログラムに変換する
場合、即ち、” * ”及び” & ”を指定文字とし
て設定する時、コメント文開始文字選択型コンパイラ1
によりソースプログラムの行の先頭に“′*゜゛及び“
′&゛が記述された行をコメント文とみなす。その結果
、■に示すオブジェクトプログラムが出力される。
In addition, when converting to an object program using method (■), that is, when setting "*" and "&" as specified characters, the comment statement start character selection type compiler 1
This adds “′*゜゛ and “ to the beginning of the source program line.
A line containing ``&゛ is regarded as a comment statement. As a result, the object program shown in (3) is output.

次に、コメント文判定方法について第4図により説明す
る。
Next, the comment sentence determination method will be explained with reference to FIG.

第4図において、まず■ソースプログラムの行を順に1
行ずつ判定を行う。次に■判定行の先頭文字を読み取る
。次に■第3図に示すテーブルに設定した指定文字を1
個読み出して、例えば主記憶装置(図示しない)に入力
して書き込む。■cpUにおいて主記憶装置に記憶した
指定文字を読み出し、読み取った文字と比較する。
In Figure 4, first select the lines of the source program by 1.
Judgment is made line by line. Next, read the first character of the judgment line. Next, ■ 1 the specified characters set in the table shown in Figure 3.
The data is read out, and inputted and written into, for example, a main storage device (not shown). (2) The CPU reads out the designated character stored in the main memory and compares it with the read character.

■比較した結果、両者が一致していればその行をコメン
ト文と判定し、次の行について上記■〜■を行う。又、
■′比較した結果、両者が一致しなかった時には指定し
た文字のうちまだ比較していない文字が残っているかど
うかを判定する。
(2) As a result of the comparison, if the two match, the line is determined to be a comment, and steps (1) to (4) above are performed for the next line. or,
■'If the two do not match as a result of the comparison, it is determined whether there are any remaining characters that have not been compared yet among the specified characters.

■指定した文字のうちまだ比較していない文字が残って
いない時には、その行を命令文としてオブジェクトプロ
グラムに翻訳する処理をCPUにより行う。そして次の
行について上記■〜■゜を行う。又、■゜指定した文字
のうちまだ比較していない文字が残っている時には次の
指定文字をテーブルから1個読み出して主記憶装置に入
力して書き込む。以下上記■〜■゛の動作を行う。
(2) If there are no characters left that have not been compared among the specified characters, the CPU performs processing to translate that line into an object program as a command statement. Then, perform the above ■ to ■゜ for the next line. Also, ■゜If there are still characters that have not been compared among the specified characters, the next specified character is read from the table, inputted into the main memory, and written. Hereafter, perform the operations from ■ to ■゛ above.

このようにしてソースプログラムのすべての行について
、該当行がコメント文か命令文かを判定する時、、その
行の先頭文字を読み取り、その文字がコメン1一文開始
文字として登録してあるかどうかを判定して、無登録の
文字であった場合についてのみその行を命令文としてオ
ブジェク1・プログラムへの変化処理を行う。
In this way, when determining whether a line in question is a comment or an imperative statement for every line in the source program, read the first character of that line and check whether that character is registered as the starting character for comment 1 sentence. is determined, and only if the character is an unregistered character, the process of changing the line to the object 1 program is performed using that line as a command statement.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、利用者が複数個の
指定文字を選択して指定することができるため、ソフ1
・ウエア開発中に1つのソースプ1’Jグラムから任意
に複数のオブジェクトプログラムを作成することができ
、開発中に保持するソースプログラムの数が城少ずる。
As explained above, according to the present invention, since the user can select and specify a plurality of specified characters, the software 1
- A plurality of object programs can be arbitrarily created from one source program during software development, and the number of source programs to be maintained during development is reduced.

又、コメント文にする行を同しソースプログラムで、オ
ブジェク1−プログラムを作成する時に選択することに
よって決めるごとができるため、コメンl・文にする行
を変更する時にその都度ソースプログラムを修正する手
間が省ける。したがって、ソフトウェア開発の生産性向
上に寄与するところが大きい。
Also, since you can decide which line to make a comment statement in the same source program by selecting it when creating the object 1 program, you need to modify the source program each time you change the line to make a comment statement. Saves time and effort. Therefore, it greatly contributes to improving the productivity of software development.

更に、ソフ1・ウェア開発では出荷用のソフ1・ウェア
と開発中のソフ1・ウエアとの間に多少の修正を加えな
ければならない場合が多いが、この時も出荷用ハージョ
ンと開発用バージョンを1つのソースプログラムとして
管理することができるため、製品(オブジェクトプログ
ラム)の信頼性を高めることができる。
Furthermore, in software 1/ware development, it is often necessary to make some modifications between the shipping software 1/ware and the software 1/ware under development, but in this case, the shipping version and the development version are different. can be managed as one source program, thereby increasing the reliability of the product (object program).

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

第1図は本発明の原理図、 第2図は木発明の実施例のオブジェク1・プログラム作
成方法を説明する図、 第3図は実施例で使用されるテーブルを説明する図、 第4図は実施例のコメン1・文判定方法を説明するフロ
ーチャーl・、 第5図は従来例の特定文字の使用方法を説明する図、 第6図は従来例のコメント文判定方法を説明するフロー
チャートである。 図において 20はテーブル、 30は比較部 を示す。 ど一一\ ○ @ ■ ■ ■ ■ O
Figure 1 is a diagram showing the principle of the present invention. Figure 2 is a diagram explaining the method for creating an object 1 program in the embodiment of the tree invention. Figure 3 is a diagram explaining the tables used in the embodiment. Figure 4. is a flowchart explaining the comment 1/sentence judgment method of the embodiment, Fig. 5 is a diagram explaining the usage of specific characters in the conventional example, and Fig. 6 is a flowchart explaining the comment sentence judgment method of the conventional example. It is. In the figure, 20 indicates a table, and 30 indicates a comparison section. Doichiichi \ ○ @ ■ ■ ■ ■ O

Claims (1)

【特許請求の範囲】 ソースプログラムを入力してオブジェクトプログラムに
変換して出力するコンパイラ(10)を有するソフトウ
ェア開発システムにおいて、 該コンパイラに、該ソースプログラムの任意の行をコメ
ント文とするためのコメント文開始文字を入力して記憶
するテーブル(20)と、 該テーブルから読み出した文字と該入力したソースプロ
グラムの所定の行の先頭文字とを比較し、両者が一致し
た時にはその行はコメント文と判定し、両者が不一致の
時にはその行は命令文と判定してオブジェクトプログラ
ムに変換して出力する比較部(30)とを設け、該比較
を該ソースプログラムのすべての行について行うように
したことを特徴とするコメント文開始文字選択型オブジ
ェクトプログラム作成装置。
[Claims] In a software development system having a compiler (10) that inputs a source program, converts it into an object program, and outputs the object program, the compiler is provided with a comment for converting any line of the source program into a comment statement. Compare the characters read from the table (20) in which the sentence start character is input and stored with the first character of a predetermined line of the input source program, and if the two match, that line is marked as a comment statement. A comparison unit (30) is provided which determines that the line is an imperative statement, converts it to an object program, and outputs it when the two do not match, and the comparison is performed for all lines of the source program. A comment sentence start character selection type object program creation device characterized by:
JP11167689A 1989-04-28 1989-04-28 Comment sentence starting character selection type object program preparing device Pending JPH02291024A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11167689A JPH02291024A (en) 1989-04-28 1989-04-28 Comment sentence starting character selection type object program preparing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11167689A JPH02291024A (en) 1989-04-28 1989-04-28 Comment sentence starting character selection type object program preparing device

Publications (1)

Publication Number Publication Date
JPH02291024A true JPH02291024A (en) 1990-11-30

Family

ID=14567361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11167689A Pending JPH02291024A (en) 1989-04-28 1989-04-28 Comment sentence starting character selection type object program preparing device

Country Status (1)

Country Link
JP (1) JPH02291024A (en)

Similar Documents

Publication Publication Date Title
JPS63181033A (en) Automatic program generating system
JPH08202545A (en) Object-oriented system and method for generation of target language code
JPS6375835A (en) Apparatus for generating intended code, program, list and design document
US7350180B1 (en) Search algorithm for inheriting clock contexts in hardware description language translation tools
US20180373218A1 (en) Device and method for common type conversion of plc control program
JP2008186244A (en) Program development device, program development method and program
JPH02291024A (en) Comment sentence starting character selection type object program preparing device
JPH07160490A (en) Coding assistance device
JP2002312167A (en) Program for making computer calculate value of variable, compile program, variable value determining method, and program generating method
JP2585793B2 (en) Compiler system
KR100229567B1 (en) Coordination and text value generation method
JPH0695890A (en) Name replacement system in compiler
JP2003076547A (en) System and method for automatically generating control software
JPS63273132A (en) Program development aid system
CN112579088A (en) Heterogeneous hybrid programming-oriented one-stop program compiling method
JPH06274312A (en) General-purpose data conversion device
JPH03123939A (en) Computer system where multiple languages coexist
JP3044953B2 (en) Symbol processing method of language processing system
JPS63115236A (en) Object selecting system
JPH03186933A (en) Symbol processing system for language processing system
CN110262802A (en) A kind of novel execution method of knockout machine Sequence data
JPH0371229A (en) Program controller
JPS62166432A (en) Control system for program translation
JPH0795275B2 (en) Compile processor
Meyer CAD tool interchangeability through net list translation