JPH03127226A - Display/print system for program - Google Patents

Display/print system for program

Info

Publication number
JPH03127226A
JPH03127226A JP1267112A JP26711289A JPH03127226A JP H03127226 A JPH03127226 A JP H03127226A JP 1267112 A JP1267112 A JP 1267112A JP 26711289 A JP26711289 A JP 26711289A JP H03127226 A JPH03127226 A JP H03127226A
Authority
JP
Japan
Prior art keywords
type
program
printed
variable
color
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
JP1267112A
Other languages
Japanese (ja)
Inventor
Masaaki Touhou
聖朝 東方
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co 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 Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Priority to JP1267112A priority Critical patent/JPH03127226A/en
Publication of JPH03127226A publication Critical patent/JPH03127226A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

PURPOSE:To easily detect a bug by displaying or printing the words/phrases corresponding to each type of a programming language in the colors different from a standard color when a program written in the programming language having the types is displayed or printed. CONSTITUTION:A computer system includes a computer 1 consisting of a processor board 2, a system bus 4, a memory 5, a disk controller 6, a disk 7, and a printer controller 8, and a color printer 9. When a program written in a programming language having the types is displayed or printed, it is first checked whether the words/phrases of the sentences included in the program are corresponding or not to the type prescribed by the programming language. Those words/phrases which are not corresponding to the type are displayed or printed in a prescribed standard color. Meanwhile the words/phrases corresponding to the type are displayed or printed in the colors different from the standard color for each type. Thus an error (bug) easily is detected.

Description

【発明の詳細な説明】[Detailed description of the invention] 【産業上の利用分野】[Industrial application field]

本発明は、変数や定数等に所定の「型」が定められてい
るプログラミング言語で書かれたプログラムの表示・印
刷方式に関するものである。
The present invention relates to a display/printing method for a program written in a programming language in which variables, constants, etc. have predetermined "types."

【従来の技術】[Conventional technology]

従来、コンピュータプログラムをデイスプレィ上に表示
したり、紙に印刷したりするのには、全て同じ色(例え
ば、黒)が用いられていた。 そして、プログラムの中でも特別な単語(例、予約語と
かキーワードとか)を特に目立たせたいという場合には
、下線を引いたり1字体を変えたり、2度書きするなど
といったことが行われていた。 また、プログラムの階層構造を一目で分かるようにした
いという場合には、階層に従ってプログラム文の先頭文
字を右方にずらす(つまり、段付けする)ことが行われ
ている。 第4図に、従来の方式で表示または印刷したプログラム
の例を示す。 これは、C言語で書かれたプログラムである。 点線でかこった10の部分は開始文部であり、C言語で
は、プログラムの最初にこれが記載される。 点線で囲った11の部分は、宣言文部である。 この場合、開始文部10に対して段付けされて書かれて
いる。 宣言文は、「型」名と「変数1名とで構成され、型と変
数との間には1個以上のスペースが置かれる。例えば、
rchar   a」という宣言文では、「char」
が文字(character)という型を表し、「a」
が変数を表している。従って、この宣言文は、「a」と
いう変数は、文字が入れられる変数である旨を宣言して
いる。 なお、rint」は整数(integer)という型を
表し、rfloat」は実数つまり浮動小数点数(fl
oating point number)という型を
表している。 従って、「j」という変数は整数が入れられる変数であ
り、「x」という変数は実数が入れられる変数であるこ
とを、ここで宣言していることになる。 点線で囲った12の部分は、実行文部である。 ここには、各変数に具体的にどのような値を代入して、
その後のプログラムを実行するか等が記載される。・こ
の例では、文字型の変数aには、文字の中から「C」と
いう文字定数(文字で表しである定数)が選定されて代
入される旨が記されている。同様に、整数型の変数jに
は、整数の中から「0」という整数が選定されて代入さ
れる旨が記され、実数型の変数「XJには、実数の中か
らr2.3.という実数が選定されて代入される旨が記
されている。 なお、文字定数は、r  ’C’J  のように前後を
アポストロフィで囲んで書くことになっている 以上のようなプログラムの文が、従来は青なら青、黒な
ら黒といった同一の色で表示または印刷されていた。
Traditionally, the same color (eg, black) has been used to display computer programs on a display or print them on paper. If you wanted to make a special word (for example, a reserved word or keyword) stand out in a program, you would underline it, change the font, or write it twice. Furthermore, when it is desired to understand the hierarchical structure of a program at a glance, the first character of a program statement is shifted to the right according to the hierarchy (that is, it is indented). FIG. 4 shows an example of a program displayed or printed using the conventional method. This is a program written in C language. The part 10 surrounded by a dotted line is the start statement, and in the C language, this is written at the beginning of the program. The 11 portions surrounded by dotted lines are declaration text sections. In this case, the text is written in columns relative to the start sentence section 10. A declaration statement consists of a "type" name and a "variable name," with one or more spaces between the type and variable. For example,
In the declaration "rchar a", "char"
represents the type of character, and "a"
represents a variable. Therefore, this declaration statement declares that the variable "a" is a variable into which a character can be inserted. Note that ``rint'' represents an integer type, and ``rfloat'' represents a real number, that is, a floating point number (fl
It represents a type called oating point number). Therefore, it is declared here that the variable "j" is a variable into which an integer can be stored, and the variable "x" is a variable into which a real number can be stored. The 12 parts surrounded by dotted lines are executable statements. Here, assign specific values to each variable and
It describes whether to execute subsequent programs. - In this example, it is written that the character constant "C" (a constant represented by a character) is selected from among the characters and assigned to the character type variable a. Similarly, for the integer type variable j, it is written that the integer "0" is selected and assigned from among the integers, and for the real number type variable " It is written that a real number is selected and assigned. Note that character constants are written with apostrophes around them, such as r 'C'J. Previously, blue was displayed or printed in the same color, such as blue for black and black for black.

【発明が解決しようとする課題】[Problem to be solved by the invention]

(問題点) しかしながら、従来のプログラムの表示・印刷方式では
、同じ色で表示または印刷するので、成る型の変数に、
その型には適合しない定数が割り当てられているといっ
たプログラムのバグがあった場合、そのバグを発見する
のに大変な熟練と労力を要するという問題点があった。 (問題点の説明) プログラミング言語には、変数や定数等に所定の「型」
が定められているものがある。第4図で説明した「C言
語」もそのうちの1つであるが、その外にrPASCA
L、、rFORTRAN、。 rPL/1.等がある。 このようなプログラミング言語でプログラムを作成する
時には、変数の型に適合した定数を削り当てなければな
らない。適合しない値を誤って割り当ててしまった場合
には、その個所はプログラムのバグということになり、
プログラムを実行させても所望の動作をしてくれない。 第5図に、バグを含むプログラムを従来の方式で表示ま
たは印刷した例を示す、これは、C言語で書かれた実行
文の例である0点線で囲った13の部分が、バグを含む
実行文である。 変数aはchar型(文字型)であるのに、rloOJ
という整数(int)が割り当てである。変数jはin
t型(整数型)であるのに、r9.3Jという実数(f
loat)が割り当てである。変数Xはfloat型(
実数型)であるのに、eという値(ここに、eは定義さ
れていない変数とする)が割り当てである。これらは、
型に適合しない値が割り当てられているわけであるから
、プログラムのバグである。 同じ色で表示または印刷されていると、このようなバグ
を発見するのには、「a」はどういう型の変数、rjJ
はどういう型の変数等ということを絶えず念頭におきな
がら、これらに割り当てられている値の適否をチエツク
する必要がある。しかし、この作業は大変な熟練と労力
を要するものであり、しばしばバグを見過ごしてしまう
こともある。 本発明は、以上のような問題点を解決することを課題と
するものである。 (f!I!題を解決するための手段1 前記課題を解決するため、本発明にかかわるプログラム
の表示・印刷方式では、型を有するプロゲラ4ング言語
で書かれたプログラムの各字句が型に該当するかどうか
調べ、型に該当しない字句は所定の標準色で表示・印刷
し、型に該当する字句は標準色とは異なる色で型毎に色
分けして表示・印刷することとした。
(Problem) However, in the conventional program display/printing method, the display/printing method uses the same color, so variables of type
If there is a bug in the program, such as a constant being assigned that does not fit the type, there is a problem in that it requires great skill and effort to discover the bug. (Explanation of the problem) Programming languages have predetermined "types" for variables, constants, etc.
There are some things that are defined. "C language" explained in Figure 4 is one of them, but rPASCA
L,,rFORTRAN,. rPL/1. etc. When creating a program using such a programming language, it is necessary to select constants that match the types of variables. If you accidentally assign an incompatible value, that point is a bug in the program.
Even if I run the program, it doesn't do what I want. Figure 5 shows an example of a program containing a bug displayed or printed using the conventional method.This is an example of an executable statement written in C language.The 13 parts surrounded by the 0-dot line contain the bug. It is an executable statement. Variable a is of char type (character type), but rloOJ
The integer (int) is the assignment. variable j is in
Although it is a t type (integer type), it is a real number r9.3J (f
loat) is the allocation. The variable X is of float type (
real number type), but the value e (here, e is an undefined variable) is an assignment. these are,
This is a bug in the program because a value that does not match the type is assigned. To find such a bug, what type of variable is "a", rjj
It is necessary to check the suitability of the values assigned to these variables while constantly keeping in mind what type of variables they are. However, this process requires great skill and effort, and bugs can often be overlooked. An object of the present invention is to solve the above-mentioned problems. (Means for solving the f!I! problem 1) In order to solve the above problem, in the program display/printing method according to the present invention, each token of a program written in a progera language that has a type is We investigated whether this was the case, and decided to display and print words that do not correspond to the type in a predetermined standard color, and display and print words that fit the type in different colors for each type.

【作  用】[For production]

型を有するプログラミング言語で書かれたプログラムを
表示または印刷する際には、まず、該プログラムの文中
の字句が、そのプログラミング言語で規定されている型
に該当するかどうか調べる。 型に該当しない字句(例、C言語では「=」とか「、」
等)は、所定の標準色(例、黒色)で表示または印刷す
る。 型に該当する字句は、標準色とは異なるよう予め型毎に
色を定めておき、その色で表示・印刷する。 以上のようにすると、型が異、なる字句は異なった色で
表示または印刷されるから、型を一致させてプログラム
文を作成しなければならないところを、誤って一致させ
なかったような場合、その誤りの発見(バグの発見)が
極めて容易になされる。
When displaying or printing a program written in a programming language that has types, it is first checked whether the words in the sentences of the program correspond to the types defined in the programming language. Lexical words that do not correspond to types (e.g., "=" or "," in C language)
etc.) are displayed or printed in a predetermined standard color (eg, black). The words corresponding to the type are displayed/printed in a predetermined color for each type, which is different from the standard color. If you do the above, the words with different types will be displayed or printed in different colors, so if you accidentally do not match the type where you should create a program statement by matching the types, Errors (bugs) can be discovered very easily.

【実 施 例】【Example】

以下、本発明の実施例を図面に基づいて詳細に説明する
。 本発明では、変数や定数等に所定の「型」が定められて
いるプログラミング言語を用いて作成したプログラムを
、表示または印刷する際、型に応して予め色を割り当て
ておき、色分けして表示または印刷するようにした。 第1図に、本発明を実施するためのコンピュータシステ
ムを示す。第1図において、1はコンピュータ、2はプ
ロセッサボード、3はCPU、4はシステムバス、5は
メモリ、6はディスク・コントローラ、7はディスク、
8はプリンタ・コントローラ、9はカラー・プリンタで
ある。 この例では、プログラムをデイスプレィに表示するので
はなく、紙に印刷するようにしている。 また、プログラム文を色分けして印刷するために、プリ
ンタにはカラー・プリンタを用いている。 ディスク・コントローラ6は、ディスク7ヘデータを入
れたり出したりする際の制御を行うためのものである。 プリンタ・コントローラ8は、カラー・プリンタ9の動
作を制御する0作成されたプログラム(ソースプログラ
ム)は、ディスク7に格納されている。 次に、本発明による印刷時の動作を、第8図のフローチ
ャートによって説明する。なお、作成したプログラムは
、第4図に示したのと同じプログラムだとする。 以下の説明における項番■〜■は、第8図のステップ■
〜■に対応している。 ■ 作成したソースプログラムを、ディスク7からメモ
リ5へ読み込む。 ■ 読み込んだソースプログラムの字句を、解析する。 ここに「字句jとは、具体的にはrchar」とかri
nt」等の型を表す語、「a」等での変数を表す語、r
2.3J等の定数を表す語、「=」とか「、」等の記号
のことである。 このような字句を、プログラム文の中から1つ1つ取り
出す。 ■ プログラムをfjl戒する文が、宣言文であるかど
うかをチエツクする。 宣言文であれば、最初、型を表す字句(例えばrcha
r」)が置かれ、次に1個以上のスペースを置いて変数
を表す字句(例えば「aJ)が置かれているから、そう
なっているかどうかを目安にして判断することが出来る
。 ■ 宣言文を基にして、変数名と型との対応関係を表し
た記号表を作成する。第6図に、そうして作成した記号
表を示す。 第4図のプログラムで、最初に出て来る宣言文は、rc
har   a」である、この宣言文では、rchar
4が型であり「a」が変数名である。従って、記号表の
第1行の変数名の欄には「aJと書き、型の欄にはrc
har」と書く、他の宣言文についても同様にする。そ
のようにして記号表を作成する。 また、どういう型に属する変数であるかが定義されてい
ない変数としてr6.という変数があった場合には、「
eノは「未定義」として記号表にfS載する。 ■ 字句すべてについて、それがどのような種類のもの
であるかを判定する。即ち、変数であるか、定数である
か、その他の記号であるか等の判定をする。 定数については、その形によって直ちに型まで判明する
。例えば、rloO,という定数が出て来た場合、それ
は少数点の無い数値であるから、rintJ型(整数型
)であると直ちに判明する。r2.3Jという定数は少
数点を含む数値であるから、rfloaJ型(実数型)
と判明する。また、「 C’J  のように前後をアポ
ストロフィで囲まれた定数は、rcharj型(文字型
)の定数と判明する。 ■ ここで変数かどうかチエツクする。変数であればス
テップ■に進ませ、それ以外(例、定数〉であればステ
ップ■に進ませる。 定数についてはステップ■で型まで分かるが、変数につ
いてはまだ型は分かっていないが、それを知る必要があ
るので、ここで変数だけをピックアップする。 なお、ステップ■では、単に宣言文にもとづいて記号表
を作成しただけであり、プログラムの最後の文までの変
数を1つ1つチエツクして、その型を調べたわけではな
い。 ■ 変数については、ステップ■で作成した記号表(第
6図)を参照して、型を知る。 例えば、プログラム文中に「a」という変数が出て来た
場合、第6図を参照してrcharJ型であると判定す
る。 ■ 第7図のような予め定めておいたカラーテーブルを
参照し、各字句それぞれについて印刷する色を決定する
。 例えば、「a」という変数は、ステップ■で記号表(第
6図)を参照した結果、rcha「」型であると分かる
から、第7図のカラーテーブルでrchar」型に対応
する色の欄を参照することによって、青色で印刷すべき
ものと決定される。 定数については、前記したように、その形によって型が
分かっているから、やはりその型に応して色が決定され
る。 プログラム文中の字句で、変数名でも定数でもないもの
く例えば、「=Jとか「、」等)は、標準色(第7図の
カラーテーブルでは、黒色が割り当てられている)とす
る。 なお、カラーテーブルにおける色の設定の仕方であるが
、未定義の変数は赤などの目立ちやすい色にするとか、
相互に自動型変換が行われる変数(C言語で例を挙げれ
ば、rchar」(文字)とrin5  (整数))は
、同系統の色(char→青、int→緑)にするとか
といった配慮をして設定しておけば、デバッグをする時
の作業効率が向上する。 ■ ステップ■〜■までの処理は、CPU3どメモリ5
においてなされる。その結果を踏まえてプリンタ・コン
トローラ8がカラー・プリンタ9を作動させ、プログラ
ムを印刷する。印刷は、型に該当しない字句は標準色で
行われ、型に該当する字句は、型毎に予め定められた色
に色分けされて行われる。 第2図に、以上のような本発明の方式で印刷したプログ
ラムを示す。「青」、「緑J、「黄」という文字および
点線矢印は、印刷されているわけではなく、点線矢印で
指示した字句の色を説明するものである。 プログラムが正しく作成されていれば、実jテ文部ra
−’ C’、j=0.x=2.3Jのところに記した説
明から分かるように、変数とそれに割り当てられた定数
との印刷色は、同じ色となる。 しかし、プログラムを作成する際、成る型の変数に、そ
れとは異なった型の定数を割り当てた場合には、そうは
ならない。つまり、型の誤りに起因するバグを含む場合
には、色が一致しない。 第3図に、型の誤りに起因するバグがあるプログラムを
本発明の方式で印刷した例を示す。 まず、ra=100」の印刷色について説明する。変数
「a」は、宣言文によればrchar」型(文字型)で
ある。従って、これは青色で印刷される(第7図参照)
。これに対してrlooJという定数が割り当てられて
いるが、rlQOJは整数であるからrintJ型であ
り、緑色で印刷される。従って、「=」の両側で色が異
なることになる。なお、「=」は、変数でも定数でもな
いから型に該当する字句ではなく、標準色である黒で印
刷される。 rj=9.3Jについても、変数の型と割り当てられて
いる定数の型とが一致しないので、色は一致しない。 rX=eJについては、rfloatj型(実数型)で
ある「X」という変数に対して、型が定義されてない変
数「e」が割り当てられている。従って、この場合も、
色は一致しない。 従って、型の誤りに起因するバグがあるプログラムを印
刷すると、そのバグの個所は色の不一致という形で現れ
るので、その種のバグの発見が極めて容易になる。 なお、上側では、カラー・プリンタで印刷する場合を例
にとって説明したが、デイスプレィ上にカラーで表示す
る場合についても同様である。
Embodiments of the present invention will be described in detail below with reference to the drawings. In the present invention, when displaying or printing a program created using a programming language in which predetermined "types" are defined for variables, constants, etc., colors are assigned in advance according to the type and the program is color-coded. Displayed or printed. FIG. 1 shows a computer system for implementing the invention. In FIG. 1, 1 is a computer, 2 is a processor board, 3 is a CPU, 4 is a system bus, 5 is a memory, 6 is a disk controller, 7 is a disk,
8 is a printer controller, and 9 is a color printer. In this example, the program is printed on paper rather than displayed on a display. In addition, a color printer is used to print program statements in different colors. The disk controller 6 is for controlling the inputting and outputting of data to and from the disk 7. The printer controller 8 controls the operation of the color printer 9. A created program (source program) is stored on the disk 7. Next, the operation during printing according to the present invention will be explained with reference to the flowchart shown in FIG. It is assumed that the created program is the same program as shown in FIG. Item numbers ■ to ■ in the following explanation refer to steps ■ in Figure 8.
It corresponds to ~■. ■ Load the created source program from the disk 7 into the memory 5. ■ Analyze the words of the loaded source program. Here, ``The lexical j is specifically rchar'' or ri
Words that represent types such as "nt", words that represent variables such as "a", r
It refers to words that represent constants such as 2.3J, and symbols such as "=" and ",". These tokens are extracted one by one from the program sentences. ■ Check whether the statement that prescribes the program is a declaration statement. If it is a declarative statement, first the token representing the type (e.g. rcha
``r'') is placed next, followed by one or more spaces and a word representing a variable (for example, ``aJ''), so you can judge whether this is the case or not. ■ Declaration Based on the statement, create a symbol table that shows the correspondence between variable names and types. Figure 6 shows the symbol table created in this way. The declaration statement is rc
har a'', in this declaration, rchar
4 is the type and "a" is the variable name. Therefore, in the variable name column of the first line of the symbol table, write ``aJ'', and in the type column, write rc.
Do the same for the other declaration sentences written as "har". Create a symbol table in this way. Also, r6. is a variable whose type is not defined. If there is a variable called ``
e is listed in fS as "undefined" in the symbol table. ■ Determine for every lexical what kind of thing it is. That is, it is determined whether it is a variable, a constant, or some other symbol. The type of a constant can be immediately determined by its shape. For example, when a constant rloO appears, it is a numerical value without a decimal point, so it is immediately clear that it is of rintJ type (integer type). The constant r2.3J is a numerical value that includes a decimal point, so it is of type rfloaJ (real number type).
It turns out that. Also, a constant surrounded by apostrophes like "C'J" is known to be an rcharj type (character type) constant. ■ Check here whether it is a variable. If it is a variable, proceed to step ■. If it is other than that (for example, a constant), proceed to step ■.For constants, the type is known in step ■, but for variables, the type is not yet known, but it is necessary to know it, so here we will explain only the variable. Note that in step ■, we simply created a symbol table based on the declaration statement, and did not check each variable up to the last statement of the program to find out its type. ■ Learn the types of variables by referring to the symbol table (Figure 6) created in step ■.For example, if the variable "a" appears in a program statement, refer to Figure 6 and learn the type. rcharJ type. ■ Refer to a predetermined color table as shown in Figure 7, and decide the color to be printed for each word. For example, the variable "a" is changed to the symbol in step ■. As a result of referring to the table (Figure 6), it is found that it is of the rchar type, so by referring to the color column corresponding to the rchar type in the color table of Figure 7, it is determined that it should be printed in blue. As mentioned above, the type of a constant is known by its shape, so the color is determined according to its type. , "=J", ",", etc.) are standard colors (black is assigned in the color table of FIG. 7). Regarding how to set colors in the color table, undefined variables should be set in a color that stands out, such as red.
Variables that undergo automatic type conversion between each other (for example, rchar (character) and rin5 (integer) in the C language) should be given the same color (char → blue, int → green). If you set it up, the work efficiency when debugging will improve. ■ Processing from steps ■ to ■ is carried out by the CPU 3 and memory 5.
It is done in. Based on the results, the printer controller 8 operates the color printer 9 to print the program. In printing, words that do not correspond to the type are printed in standard colors, and words that correspond to the type are printed in predetermined colors for each type. FIG. 2 shows a program printed using the method of the present invention as described above. The characters "Blue", "Green J", "Yellow" and dotted line arrows are not printed, but are used to explain the color of the word indicated by the dotted line arrow. If the program is created correctly, the actual text part ra
-'C', j=0. As can be seen from the explanation given for x=2.3J, the variable and the constant assigned to it are printed in the same color. However, when creating a program, this will not happen if you assign a constant of a different type to a variable of one type. In other words, if a bug is caused by a type error, the colors will not match. FIG. 3 shows an example in which a program with a bug caused by a type error is printed using the method of the present invention. First, the printing color of "ra=100" will be explained. According to the declaration statement, the variable "a" is of type "rchar" (character type). It is therefore printed in blue (see Figure 7).
. A constant called rlooJ is assigned to this, but since rlQOJ is an integer, it is of type rintJ and is printed in green. Therefore, the colors on both sides of "=" will be different. Note that since "=" is neither a variable nor a constant, it is printed in black, which is the standard color, rather than as a token corresponding to the type. For rj=9.3J, the colors do not match because the variable type and the assigned constant type do not match. Regarding rX=eJ, a variable "e" whose type is not defined is assigned to a variable "X" which is an rfloatj type (real number type). Therefore, in this case too,
Colors don't match. Therefore, when a program containing a bug caused by a typographical error is printed, the bug will appear in the form of a color mismatch, making it extremely easy to discover such bugs. Note that although the above explanation has been given using an example of printing with a color printer, the same applies to the case of displaying in color on a display.

【発明の効果】【Effect of the invention】

以上述べた如き本発明によれば、型を有するプログラミ
ング言語で書かれたプログラムを表示または印刷する際
、型に該当する字句は、標準色とは異なる色に型毎に色
分けして表示または印刷されるようにした。 そのため、プログラム文の中の成る型に属する変数に、
その型に適合しない定数が割り当てられてしまったとい
うような型の誤りに起因するバグがあった場合、それら
の字句の色は異なることになる。 従って、単に色が一致しないことを見るだけでそのバグ
を発見することができる。即ち、本発明によれば、熟練
や労力を要することなく、極めて容易にバグが発見でき
るようになった。
According to the present invention as described above, when displaying or printing a program written in a programming language that has types, the words corresponding to the types are displayed or printed in different colors for each type than the standard color. I made it so that it would be done. Therefore, for variables belonging to the types in the program statement,
If there is a bug due to a type error, such as assigning a constant that doesn't match the type, those lexical colors will be different. Therefore, you can discover the bug simply by looking at the color mismatch. That is, according to the present invention, bugs can be found extremely easily without requiring any skill or effort.

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

第1図・・・本発明を実施するためのコンピュータシス
テム 第2図・・・本発明の方式で表示または印刷したプログ
ラムの例 第3図・・・型の誤りに起因するバグがあるプログラム
を本発明の方式で表示または印刷した例 第4図・・・従来の方式で表示または印刷したプログラ
ムの例 第5図・・・型の誤りに起因するバグを含むプログラム
を従来の方式で表示または印刷した例第6図・・・記号
表 第7図・・・カラーテーブル 第8図・・・本発明による印刷時の動作を説明するフロ
ーチャート 図において、Iはコンピュータ、2はプロセッサボード
、3はCPU、4はシステムバス、5はメモリ、6はデ
ィスク・コントローラ、7はディスク、8はプリンタ・
コントローラ、9はカラー・プリンタ、10は開始文部
、11は宣言文部、12は実行文部、13はバグを含む
実行文である。
Figure 1: Computer system for implementing the present invention Figure 2: Example of a program displayed or printed using the method of the present invention Figure 3: A program with a bug caused by a type error Example of a program displayed or printed using the method of the present invention Figure 4: Example of a program displayed or printed using a conventional method Figure 5: A program containing a bug caused by a type error is displayed or printed using a conventional method Printed example Fig. 6 Symbol table Fig. 7 Color table Fig. 8 In the flowchart explaining the printing operation according to the present invention, I is a computer, 2 is a processor board, and 3 is a CPU, 4 is system bus, 5 is memory, 6 is disk controller, 7 is disk, 8 is printer.
9 is a color printer; 10 is a start statement; 11 is a declaration statement; 12 is an executable statement; and 13 is an executable statement containing a bug.

Claims (1)

【特許請求の範囲】[Claims] 型を有するプログラミング言語で書かれたプログラムの
各字句が型に該当するかどうか調べ、型に該当しない字
句は所定の標準色で表示・印刷し、型に該当する字句は
標準色とは異なる色で型毎に色分けして表示・印刷する
ことを特徴とするプログラムの表示・印刷方式。
Check whether each token of a program written in a programming language that has types corresponds to the type, display and print tokens that do not correspond to the type in a predetermined standard color, and print tokens that correspond to the type in a color different from the standard color. A program display/printing method characterized by color-coded display/printing for each type.
JP1267112A 1989-10-13 1989-10-13 Display/print system for program Pending JPH03127226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1267112A JPH03127226A (en) 1989-10-13 1989-10-13 Display/print system for program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1267112A JPH03127226A (en) 1989-10-13 1989-10-13 Display/print system for program

Publications (1)

Publication Number Publication Date
JPH03127226A true JPH03127226A (en) 1991-05-30

Family

ID=17440230

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1267112A Pending JPH03127226A (en) 1989-10-13 1989-10-13 Display/print system for program

Country Status (1)

Country Link
JP (1) JPH03127226A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5909539A (en) * 1995-09-20 1999-06-01 Casio Computer Co., Ltd. Image generating system and method
JP2018156654A (en) * 2017-03-16 2018-10-04 富士通株式会社 Program, information processing method, and information processor

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63289636A (en) * 1987-05-22 1988-11-28 Hitachi Ltd Input editing device equipped with program attribute display function

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63289636A (en) * 1987-05-22 1988-11-28 Hitachi Ltd Input editing device equipped with program attribute display function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5909539A (en) * 1995-09-20 1999-06-01 Casio Computer Co., Ltd. Image generating system and method
JP2018156654A (en) * 2017-03-16 2018-10-04 富士通株式会社 Program, information processing method, and information processor

Similar Documents

Publication Publication Date Title
Fox An R and S-Plus companion to applied regression
Salomon The Advanced TEXbook
Karttunen et al. Two-level rule compiler
Henderson et al. An experiment in structured programming
US6014517A (en) Automatic creation of C to assembler interface
Clerman et al. Modern Fortran: style and usage
Van Dongen LATEX and Friends
US5434805A (en) Test timing program automatic generator
JPH03127226A (en) Display/print system for program
US6611924B1 (en) Reducing code size of debug output statements
Pignalberi et al. Introduction to LATEX and to some of its tools
Barron Approaches to conversation FORTRAN
McGettrick ALGOL 68: a first and second course
Burgess C programming tutorial
Buchanan Jr et al. Laboratory microcomputer system for the development of microcomputer-controlled analytical instrumentation
CN101364399A (en) Method generating object property related to user interface
Johnson Textual bloopers: an excerpt from GUI bloopers
Watts Using single-purpose SAS macros to format Excel spreadsheets with DDE
Learner et al. Computers and their Languages
JP2024008473A (en) Program conversion support apparatus, program conversion support method, and program
Brown SUPERMAC—A macro facility that can be added to existing compilers
Hutty et al. Mastering COBOL programming
Zambon Practical C
Johnson Project Report:" Strong Writer"
Krieger A PL-11 compiler on the CDC 7600