JPH0216644A - System for preventing endless loop in microprocessor - Google Patents

System for preventing endless loop in microprocessor

Info

Publication number
JPH0216644A
JPH0216644A JP63165909A JP16590988A JPH0216644A JP H0216644 A JPH0216644 A JP H0216644A JP 63165909 A JP63165909 A JP 63165909A JP 16590988 A JP16590988 A JP 16590988A JP H0216644 A JPH0216644 A JP H0216644A
Authority
JP
Japan
Prior art keywords
label
macro
text
field
array
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
JP63165909A
Other languages
Japanese (ja)
Inventor
Akira Igusa
伊草 明
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP63165909A priority Critical patent/JPH0216644A/en
Publication of JPH0216644A publication Critical patent/JPH0216644A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate the useless cost of a microprocessor produced by wasteful CPU time by counting the number of passing times of a label pass counting field corresponding to a label name appearing in a micro-source and, when the count value exceeds a pass limit value previously set by a user, stopping the operation of an endless loop. CONSTITUTION:A microprocessor 5 prepares a micro-text train 22 by analyzing a micro-source 1 and a label pass count array 12 is constituted of an array field 30 composed of label name fields and label pass count fields 13. The processor 5 is actuated by means of the operation of a user of a macro-processing kind 3 and a macro-source analyzing section 7 detects a label 25 by analyzing the source 1. Moreover, when a text interpreting section 16 is actuated, each section is controlled and, at the same time, a text interpretation controlling section 17 measures the number of label passing times, compares the number with a pass limit value, and controls the operation of the loop by analyzing and executing each text in the macro-text train 22.

Description

【発明の詳細な説明】 (産業上の利用分野〕 本発明はマクロプロセッサにおける無限ループ防止方式
に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to an infinite loop prevention method in a macro processor.

〔従来の技術〕[Conventional technology]

マクロソースを解析してマクロテキスト列を生成し、こ
の生成したマクロテキスト列を解釈実行する従来のマク
ロプロセッサには、無限ループの防止機構は組み込まれ
ていなかった。
A conventional macro processor that analyzes a macro source to generate a macro text string, and interprets and executes the generated macro text string does not have a built-in mechanism to prevent infinite loops.

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

上述したように、従来のマクロプロセッサには無限ルー
プの防止機構が組み込まれていない為、利用者が誤って
無限ループを含むマクロソースを作成し、これをマクロ
プロセッサに実行させた場合、オペレーティング・シス
テムが許す時間までマクロプロセッサが動作を続けてし
まい、CPU時間の浪費を招いて無駄なコストがかかる
という欠点があった。
As mentioned above, conventional macro processors do not have a built-in mechanism to prevent infinite loops, so if a user accidentally creates a macro source that includes an infinite loop and causes the macro processor to execute it, the operating system The disadvantage is that the macro processor continues to operate until the time allowed by the system, resulting in wasted CPU time and unnecessary costs.

そこで本発明の目的は、マクロプロセッサが無限ループ
に陥ることを防止するマクロプロセッサにおける無限ル
ープ防止方式を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide an infinite loop prevention method for a macro processor that prevents the macro processor from falling into an infinite loop.

〔課題を解決するための手段〕 本発明のマクロプロセッサにおける無限ループ防止方式
は、上記の目的を達成するために、マクロソースを解析
してマクロテキスト列を生成し、この生成したマクロテ
キスト列を解釈実行するマクロプロセッサにおいて、ラ
ベル名フィールドおよびラベルパスカウントフィールド
で構成されるアレイフィールドを複数個有するラベルパ
スカウントアレイと、ラベルパスリミット値を保持する
ラベルパスリミットフィールドと、前記マクロソースを
解析してマクロテキスト列を生成するマクロソース解析
部に設けられ、前記マクロソース内に出現したラベルの
ラベル名を前記ラベルパスカウントアレイのアレイフィ
ールドにおけるラベル名フィールドに設定すると共に、
この設定処理したアレイフィールドを指示するインデッ
クスを含むラベルパステキストを前記マクロテキスト列
の該当箇所に生成するラベル処理手段と、前記マクロテ
キスト列を解釈するテキスト解釈部に設けられ、前記ラ
ベル処理手段によって前記マクロテキスト列に含められ
たラベルパステキストを解釈し、このラベルパステキス
トに含まれる前記インデックスが指示するアレイフィー
ルドにおけるラベルパスカウントフィールドの値の更新
、その値と前記ラベルパスリミットフィールドに保持さ
れたラベルパスリミット値との比較により動作を続ける
か或いは前記比較を行ったラベルパスカウントフィール
ドと対を為すラベル名フィールドに設定されたラベル名
を出力して動作を中断するがを決定するラベルパステキ
スト解釈手段とで構成されている。
[Means for Solving the Problem] In order to achieve the above object, the infinite loop prevention method in the macro processor of the present invention analyzes a macro source to generate a macro text string, and then uses the generated macro text string to generate a macro text string. A macro processor that executes interpretation analyzes a label path count array having a plurality of array fields consisting of a label name field and a label path count field, a label path limit field that holds a label path limit value, and the macro source. is provided in a macro source analysis unit that generates a macro text string by setting a label name of a label appearing in the macro source to a label name field in an array field of the label path count array;
A label processing means for generating a label path text including an index indicating the set array field at a corresponding location of the macro text string; and a text interpretation section for interpreting the macro text string; interpreting the label path text included in the macro text string and updating the value of the label path count field in the array field pointed to by the index included in this label path text; A label path that determines whether to continue the operation or to interrupt the operation by outputting the label name set in the label name field that is paired with the label pass count field that has been compared. It consists of a text interpretation means.

〔作用〕[Effect]

本発明のマクロプロセッサにおける無限ループ防止方式
においては、ラベルパスリミットフィールドが、外部よ
り指定されたラベルパスリミット値を保持し、利用者の
マクロソースを解析してマクロテキスト列を生成するマ
クロソース解析部に設けられたラベル処理手段が、マク
ロソース内に出現したラベルのラベル名をラベルパスカ
ウントアレイの一つのアレイフィールドにおけるラベル
名フィールドに設定すると共に、この設定処理したアレ
イフィールドを指示するインデックスを含むラベルパス
テキストをマクロテキスト列の該当箇所に生成する。そ
の後のマクロテキスト列の解釈、実行時において、マク
ロテキスト列を解釈するテキスト解釈部に設けられたラ
ベルパステキスト解釈手段が、ラベル処理手段によって
マクロテキスト列に含められたラベルパステキストを解
釈し、このラベルパステキストに含まれるインデックス
が指示するアレイフィールドにおけるラベルパスカウン
トフィールドの値の更新、その値と前記ラベルパスリミ
ットフィールドに保持されたラベこレバスリミツト値と
の比較により動作を続けるか或いは前記比較を行ったラ
ベルパスカウントフィールドと対を為すラベル名フィー
ルドに設定されたラベル名を出力して動作を中断するが
を決定する。
In the infinite loop prevention method in the macro processor of the present invention, the label path limit field holds a label path limit value specified from the outside, and macro source analysis generates a macro text string by analyzing the user's macro source. A label processing means provided in the section sets the label name of the label that appears in the macro source in the label name field of one array field of the label pass count array, and also sets an index indicating the array field that has undergone this setting processing. Generates the containing label path text at the corresponding location in the macro text string. At the time of subsequent interpretation and execution of the macro text string, the label path text interpretation means provided in the text interpretation section that interprets the macro text string interprets the label path text included in the macro text string by the label processing means, The operation continues by updating the value of the label pass count field in the array field indicated by the index included in this label path text, and comparing that value with the label pass limit value held in the label pass limit field, or the above comparison is performed. It is determined whether to output the label name set in the label name field that is paired with the label pass count field for which the operation was performed and to interrupt the operation.

〔実施例〕 次に、本発明の実施例について図面を参照して詳細に説
明する。
[Example] Next, an example of the present invention will be described in detail with reference to the drawings.

第1図は本発明の一実施例の構成図である。同図におい
て、マクロプロセッサ5は、マクロプロセッサ制御部6
.マクロソース解析部?、テキスト解釈部16.ラベル
パスカウントアレイ12゜ラベルパスカウントアレイ有
効エントリフィールド11.マクロテキスト列22を含
む、このマクロプロセッサ5には外部よりマクロソース
1.マクロ処理種別3.ラベルバスリミット値4が与え
られる。また、マクロプロセッサ5は無限ループに陥る
と外部にラベル25を出力して動作を停止する。
FIG. 1 is a block diagram of an embodiment of the present invention. In the figure, the macro processor 5 includes a macro processor control section 6.
.. Macro source analysis department? , text interpretation section 16. Label pass count array 12° Label pass count array valid entry field 11. This macro processor 5, which includes a macro text string 22, receives a macro source 1. Macro processing type 3. A label bus limit value of 4 is given. Furthermore, when the macro processor 5 falls into an infinite loop, it outputs the label 25 to the outside and stops its operation.

マクロプロセッサ5内のマクロプロセッサ制御部6は、
マクロプロセッサ5の起動時にマクロ処理種別3の値を
判定し、その値が「0」であればマクロソース解析部7
を起動し、「1」であればテキスト解釈部16を起動す
るものである。
The macro processor control unit 6 in the macro processor 5 is
When the macro processor 5 starts up, the value of the macro processing type 3 is determined, and if the value is "0", the macro source analysis unit 7
If it is "1", the text interpretation section 16 is started.

マクロプロセッサ制御部6により起動されるマクロソー
ス解析部7は、起動時に各部を制御すると共にマクロソ
ースlの解析を行いそれに応じたマクロテキストをマク
ロテキスト列22に出力するマクロソース解析制御部8
.ラベルパスカウントアレイ初期化テキスト23を生成
してマクロテキスト列22に出力するラベルパスカウン
トアレイ初期化テキスト出力手段24.ラベルパスカウ
ントアレイ有効エンド4ノフイールド11の初期化を行
うラベルパスカウントアレイ有効エントリフィールド初
期化手段9.マクロソース1中に出現するラベル2に関
する処理を行うラベル処理手段10から構成される。
The macro source analysis unit 7 activated by the macro processor control unit 6 controls each unit at the time of activation, and also includes a macro source analysis control unit 8 that analyzes the macro source l and outputs the corresponding macro text to the macro text string 22.
.. Label pass count array initialization text output means 24 for generating label pass count array initialization text 23 and outputting it to macro text string 22. Label pass count array valid entry field initialization means 9 for initializing the label pass count array valid end 4 field 11. It is comprised of label processing means 10 that performs processing regarding labels 2 appearing in macro source 1.

他方、テキスト解釈部16は、起動時に各部を制御する
と共にマクロテキスト列22中の各テキストの解釈、実
行を行うテキスト解釈制御部17゜マクロテキスト列2
2に格納されたうベルパスカウントアレイ初期化テキス
ト23およびラベルパスカウントアレイ有効エントリフ
ィールド11の内容に従ってラベルパスカウントアレイ
12を初期化するラベルパスカウントアレイ初期化テキ
スト解釈手段18.ラベルパスリミットフィールド20
、外部から入力されるラベルパスリミット値4をラベル
パスリミットフィールド20にセットするラベルパスリ
ミットフィールドセット手段19、マクロテキスト列2
2に含まれるラベルパステキスト14を解釈して、ラベ
ル通過回数の測定。
On the other hand, the text interpretation section 16 controls each section at startup, and also includes a text interpretation control section 17° macro text string 2 that interprets and executes each text in the macro text string 22.
label pass count array initialization text interpretation means 18 for initializing the label pass count array 12 according to the contents of the label pass count array initialization text 23 and the label pass count array valid entry field 11 stored in the label pass count array initialization text 23 stored in the label pass count array initialization text 23; Label path limit field 20
, a label path limit field setting means 19 for setting a label path limit value 4 inputted from the outside into a label path limit field 20, and a macro text string 2.
Interpret the label path text 14 included in step 2 and measure the number of times the label passes.

ラベルバスリミット値4との比較、実行の中断。Compare with label bus limit value 4 and interrupt execution.

ラベル25の出力等を行うラベルパステキスト解釈手段
21から構成される。
It is composed of a label path text interpretation means 21 that outputs a label 25 and the like.

マクロテキスト列22は、マクロソースlに基づいて生
成された通常のマクロテキストの他に、マクロソース解
析部7で生成されたうベルパスカウントアレイ初期化テ
キスト23.ラベルパステキスト14が含まれる。そし
て、このラベルパステキスト14にはラベルパスカウン
トアレイインデックスフィールド15が含まれる。
The macro text string 22 includes, in addition to the normal macro text generated based on the macro source l, the pass count array initialization text 23. generated by the macro source analysis unit 7. Label path text 14 is included. This label path text 14 includes a label path count array index field 15.

ラベルパスカウントアレイ12は、ラベルパスカウント
フィールド13とラベル名フィールド26とから成るア
レイフィールド30の並びで構成された配列型のアレイ
であり、その先頭のアレイフィールドから順にrlJ、
r2J、 ・・・、「n」の番号が割り当てられている
The label pass count array 12 is an array type array composed of array fields 30 consisting of a label pass count field 13 and a label name field 26, and is arranged in order from the first array field to rlJ, rlJ,
r2J, . . . , numbers “n” are assigned.

なお、第1図において細い矢印はw制御の流れを、太い
矢印はデータの流れをそれぞれ示す。
In FIG. 1, thin arrows indicate the flow of w control, and thick arrows indicate the flow of data.

次に、このように構成された本実施例の動作について説
明する。
Next, the operation of this embodiment configured as described above will be explained.

利用者により、値がrOJのマクロ処理種別3が与えら
れてマクロプロセッサ5が起動されると、マクロプロセ
ッサ制御部6は、マクロソース解析部7のマクロソース
解析制御部8を起動する。
When the user starts the macro processor 5 by giving the macro processing type 3 having the value rOJ, the macro processor control section 6 starts the macro source analysis control section 8 of the macro source analysis section 7 .

マクロソース解析制御部8は起動されると、ラベルパス
カウントアレイ有効エントリフィールド初期化手段99
次にラベルパスカウントアレイ初期化テキスト出力手段
24を起動した後、マクロソース1の解析を始め、ラベ
ル2を検出すると、このラベル2を渡してラベル処理手
段10を起動する。
When the macro source analysis control unit 8 is activated, the label path count array valid entry field initialization means 99
Next, after activating the label path count array initialization text output means 24, analysis of the macro source 1 is started, and when label 2 is detected, this label 2 is passed and the label processing means 10 is activated.

ラベルパスカウントアレイ有効エントリフィールド初期
化手段9は、ラベルパスカウントアレイ有効エントリフ
ィールド11にrOJをセントすることによりその初期
化を行い、ラベルパスカウントアレイ初期化テキスト出
力手段24は、ラベルパスカウントアレイ初期化テキス
ト23をマクロテキスト列22の先−頭部分に出力する
The label pass count array valid entry field initializing means 9 initializes the label pass count array valid entry field 11 by placing rOJ, and the label pass count array initialization text output means 24 initializes the label pass count array valid entry field 11. The initialization text 23 is output at the beginning of the macro text string 22.

また、ラベル2が検出されることにより起動されたラベ
ル処理手段10は、次の処理を行う。
Further, the label processing means 10 activated when the label 2 is detected performs the following processing.

■ラベルパスカウントアレイ有効エントリフィールド1
1の値を1カウントアツプする。
■Label pass count array valid entry field 1
Increase the value of 1 by 1.

■ラベルパスカウントアレイ12の複数のアレイフィー
ルド30のうち、上記カウントアツプしたラベルパスカ
ウントアレイ有効エントリフィールド11の値rNと等
しい番号のアレイフィールド30におけるラベル名フィ
ールド26に、今回検出されたラベル2のラベル名を設
定する。
■Among the plurality of array fields 30 of the label pass count array 12, the currently detected label 2 is placed in the label name field 26 of the array field 30 with the same number as the value rN of the counted up label pass count array valid entry field 11. Set the label name.

■上記のラベルパスカウントアレイ有効エントリフィー
ルド11の値「i」をラベルパスカウントアレイインデ
ックスフィールド15に持つラベルパステキスト14を
生成し、これをマクロテキスト列2.2内における当8
亥ラベルに対応するソース文に基づいて生成したマクロ
テキストの直前または直後に出力する。
■ Generate a label path text 14 that has the value "i" of the above label path count array valid entry field 11 in the label path count array index field 15, and add this to the corresponding 8 in the macro text string 2.2.
Output immediately before or after the macro text generated based on the source sentence corresponding to the Pig label.

以上の■〜■の処理は、マクロソース1にラベルが出現
する毎に行われる。従って、マクロソース1にm個のラ
ベルが出現した場合、ラベルパスカウントアレイ有効エ
ントリフィールド11の値はrmJになり、ラベルパス
カウントアレイ12の番号r I Jから番号rmJま
でのアレイフィールド30のラベル名フィールド26に
各ラベル名が登録され、且つ、マクロテキスト列22の
各々該当する箇所にラベルバステキスト14が組み込ま
れることになる。
The above processes ① to ② are performed every time a label appears in the macro source 1. Therefore, when m labels appear in the macro source 1, the value of the label pass count array valid entry field 11 becomes rmJ, and the labels of the array field 30 from number r I J to number rmJ of the label pass count array 12 Each label name is registered in the name field 26, and the label bus text 14 is incorporated into each corresponding location of the macro text string 22.

さて、マクロテキスト列22に必要なマクロテキストが
格納された後、成る値rLTMITJを持つラベルバス
リミット値4および「1」の値を持つマクロ処理種別3
を与えてマクロプロセッサ5を起動すると、マクロプロ
セッサ制御部6によりテキスト解釈部16のテキスト解
釈制御部17が起動される。
Now, after the necessary macro text is stored in the macro text column 22, the label bus limit value 4 has the value rLTMITJ and the macro processing type 3 has the value "1".
When the macro processor 5 is activated by giving the following, the macro processor control unit 6 activates the text interpretation control unit 17 of the text interpretation unit 16.

テキスト解釈制御部17は起動されると、ラベルパスリ
ミットフィールドセット手段19を起動した後、マクロ
テキスト列22内のテキストの解釈を始める。そして、
テキストの解釈においてラベルパスカウントアレイ初期
化テキスト23を検出すると、ラベルパスカウントプレ
イ初期化テキスト解釈手段18を起動し、ラベルバステ
キスト14を検出すると、ラベルパステキスト解釈手段
21を起動する。
When activated, the text interpretation control unit 17 activates the label path limit field setting means 19 and then starts interpreting the text in the macro text string 22. and,
When label pass count array initialization text 23 is detected in text interpretation, label pass count play initialization text interpretation means 18 is activated, and when label bus text 14 is detected, label path text interpretation means 21 is activated.

ラベルパスリミットフィールドセント手段19は起動さ
れると、外部のラベルパスリミット値4をラベルパスリ
ミットフィールド20にセットする。
When activated, the label path limit field setting means 19 sets an external label path limit value 4 in the label path limit field 20.

又、ラベルパスカウントアレイ初期化テキスト解釈手段
18は起動されると、ラベルパスカウントアレイ有効エ
ントリフィールド11の値が「0」か否かを判別し、r
OJであれば処理を終了するが、「0」以外の値rmJ
であれば、ラベルパスカウントアレイ12の第1番目か
ら第m番目までのアレイフィールド30に含まれるラベ
ルパスカウントフィールド13の値をそれぞれ「0」に
初期化する。
Further, when the label pass count array initialization text interpretation means 18 is activated, it determines whether the value of the label pass count array valid entry field 11 is "0" or not, and r
If it is OJ, the process ends, but if the value rmJ is other than "0"
If so, the values of the label pass count fields 13 included in the first to mth array fields 30 of the label pass count array 12 are each initialized to "0".

この後、テキスト解釈制御部17でマクロテキスト列2
2中のテキストの解釈が進められ、前述したようにラベ
ルバステキスト14が検出されてラベルパステキスト解
釈手段21が起動されると、ラベルパステキスト解釈手
段21は次のような処理を行う。ここで、今回検出され
たラベルバステキスト14のラベルパスカウントアレイ
インデックスフィールド15に含まれるインデックスの
値が「j」、この値「j」が指し示すラベルパスカウン
トアレイ12のラベルパスカウントフィールド13に格
納されている現カウント値がrcouNTjJとする。
After this, the text interpretation control unit 17 reads the macro text string 2.
When the label bus text 14 is detected and the label path text interpreting means 21 is started, the label path text interpreting means 21 performs the following processing. Here, the index value included in the label pass count array index field 15 of the label bus text 14 detected this time is "j", and this value "j" is stored in the label pass count field 13 of the label pass count array 12 pointed to. Assume that the current count value rcouNTjJ.

なお、ラベルパスリミットフィールド20に保持された
ラベルバスリミット値4はrLIMITJである。
Note that the label bus limit value 4 held in the label path limit field 20 is rLIMITJ.

■C0UNTjとLIMITを比較し、C0UNTJ<
LIMITが成立するか否かを判定する。
■Compare C0UNTj and LIMIT, C0UNTJ<
It is determined whether LIMIT is established.

■ (1)上記条件が成立すれば、C0UNTjを+1
して処理をテキスト解釈制御部17に戻す。
■ (1) If the above conditions are met, C0UNTj is +1
Then, the processing is returned to the text interpretation control section 17.

(2)上記条件が不成立であれば、インデックスの値r
JJが指し示すラベルパスカウントアレイ12のラベル
名フィールド26に設定されているラベル名をラベル2
5として出力し、動作を中止する。
(2) If the above conditions are not met, the index value r
The label name set in the label name field 26 of the label pass count array 12 pointed to by JJ is set to label 2.
Output as 5 and stop the operation.

制御を戻されたテキスト解釈制御部17は、マクロテキ
スト列22に含まれる次のテキストの解釈に進むので、
マクロプロセッサ5は動作を続行することになる。しか
し、上記の条件が不成立のときはラベルパステキスト解
釈手段21はラベル25を出力して動作を中止するので
、マクロプロセッサ5も動作を停止することになる。
The text interpretation control unit 17 to which control has been returned proceeds to interpret the next text included in the macro text string 22.
Macro processor 5 will continue its operation. However, if the above conditions are not satisfied, the label path text interpretation means 21 outputs the label 25 and stops its operation, so the macro processor 5 also stops its operation.

このように、本実施例によれば、マクロテキスト列22
に含まれる成るラベル対応のテキストが、外部から予め
指定されたラベルパスリミット値4に達するまで、繰り
返し解釈実行されると、マクロプロセッサ5は該当する
ラベル名をラベル25として出力して動作を停止する。
In this way, according to this embodiment, the macro text string 22
When the text corresponding to the label included in the macro processor 5 is repeatedly interpreted until the label path limit value 4 specified from the outside is reached, the macro processor 5 outputs the corresponding label name as the label 25 and stops the operation. do.

一般に、マクロソース1を作成した利用者はそのマクロ
ソース1中に含まれる最大ループ回数のおおよその値を
知っているものであるから、それより若干大きい値をラ
ベルパスリミット値4で指定することにより、マクロプ
ロセッサ5が無限ループに陥ったまま動作し続けること
を防止できる。
Generally, the user who created macro source 1 knows the approximate value of the maximum number of loops included in macro source 1, so specify a value slightly larger than that for label path limit value 4. This prevents the macro processor 5 from continuing to operate in an infinite loop.

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

以上説明したように、本発明のマクロプロセッサにおけ
る無限ループ防止方式は、マクロソースからマクロテキ
スト列を生成する際に、マクロソースに含まれるラベル
のラベル名をラベルパスカウントアレイのラベル名フィ
ールドに設定すると共に、マクロテキスト列のそのラベ
ル定義位置に相当する箇所にラベルパステキストを組み
込んでおき、マクロテキスト列の解釈、実行時、ラベル
パステキストが解釈される毎に即ち実行がラベル定義位
置を通過する毎に、そのラベルのラベル名に対応するラ
ベルパスカウントフィールドの値をカウントアツプする
ことでラベル通過回数を計測し、この計測回数が予め利
用者により設定されたラベルパスリミット値以上となっ
たとき、動作を中断するので、利用者が誤って無限ルー
プを含むマクロソースを作成してマクロプロセッサに入
力しても、マクロプロセッサが動作し続けることがなく
なる。従って、CPU時間の浪費による無駄なコストの
消費を無くすことができる。
As explained above, the infinite loop prevention method in the macro processor of the present invention sets the label name of the label included in the macro source in the label name field of the label path count array when generating a macro text string from the macro source. At the same time, the label path text is included in the macro text string at the location corresponding to the label definition position, and when the macro text string is interpreted and executed, each time the label path text is interpreted, the execution passes through the label definition position. Each time, the number of times the label is passed is measured by counting up the value of the label pass count field corresponding to the label name of that label, and the number of times this measurement is greater than or equal to the label pass limit value set by the user in advance. Therefore, even if a user accidentally creates a macro source containing an infinite loop and inputs it to the macro processor, the macro processor will not continue operating. Therefore, unnecessary cost consumption due to wasted CPU time can be eliminated.

また、動作の中断時に、ラベルパスリミット値以上通過
したラベルのラベル名を出力するので、利用者はこのラ
ベル名をもとにマクロソース中に存在する無限ループの
原因を容易に究明することができる。
In addition, when the operation is interrupted, the label name of the label that has passed the label path limit value or more is output, so the user can easily determine the cause of the infinite loop that exists in the macro source based on this label name. can.

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

第1図は本発明の一実施例の構成図である。 図において、 1・・・マクロソース 2・・・ラベル 3・・・マクロ処理種別 4・・・ラベルパスリミット値 5・・・マクロプロセッサ 6・・・マクロプロセッサ制御部 7・・・マクロソース解析部 10・・・ラベル処理手段 11・・・ラベルパスカウントアレイ有効エントリフィ
ールド 12・・・ラベルパスカウントアレイ 13・・・ラベルパスカウントフィールド14・・・ラ
ベルパステキスト 15・・・ラベルパスカウントアレイインデックスフィ
ールド 16・・・テキスト解釈部 21・・・ラベルパステキスト解釈手段22・・・マク
ロテキスト列 23・・・ラベルパスカウントアレイ初期化テキスト 25・・・ラベル 26・・・ラベル名フィールド 30・・・アレイフィールド
FIG. 1 is a block diagram of an embodiment of the present invention. In the figure, 1... Macro source 2... Label 3... Macro processing type 4... Label path limit value 5... Macro processor 6... Macro processor control unit 7... Macro source analysis Part 10...Label processing means 11...Label pass count array Valid entry field 12...Label pass count array 13...Label pass count field 14...Label pass text 15...Label pass count array Index field 16...Text interpreter 21...Label path text interpreter 22...Macro text string 23...Label pass count array initialization text 25...Label 26...Label name field 30...・Array field

Claims (1)

【特許請求の範囲】 マクロソースを解析してマクロテキスト列を生成し、該
生成したマクロテキスト列を解釈実行するマクロプロセ
ッサにおいて、 ラベル名フィールドおよびラベルパスカウントフィール
ドで構成されるアレイフィールドを複数個有するラベル
パスカウントアレイと、 ラベルパスリミット値を保持するラベルパスリミットフ
ィールドと、 前記マクロソースを解析してマクロテキスト列を生成す
るマクロソース解析部に設けられ、前記マクロソース内
に出現したラベルのラベル名を前記ラベルパスカウント
アレイのアレイフィールドにおけるラベル名フィールド
に設定すると共に、該設定処理したアレイフィールドを
指示するインデックスを含むラベルパステキストを前記
マクロテキスト列の該当箇所に生成するラベル処理手段
と、 前記マクロテキスト列を解釈するテキスト解釈部に設け
られ、前記ラベル処理手段によって前記マクロテキスト
列に含められたラベルパステキストを解釈し、該ラベル
パステキストに含まれる前記インデックスが指示するア
レイフィールドにおけるラベルパスカウントフィールド
の値の更新、該値と前記ラベルパスリミットフィールド
に保持されたラベルパスリミット値との比較により動作
を続けるか或いは前記比較を行ったラベルパスカウント
フィールドと対を為すラベル名フィールドに設定された
ラベル名を出力して動作を中断するかを決定するラベル
パステキスト解釈手段とを含むことを特徴とするマクロ
プロセッサにおける無限ループ防止方式。
[Scope of Claim] A macro processor that analyzes a macro source to generate a macro text string, and interprets and executes the generated macro text string, includes a plurality of array fields each including a label name field and a label pass count field. a label path count array having a label path count array having a label path limit value, a label path limit field holding a label path limit value, and a macro source analysis unit that analyzes the macro source to generate a macro text string, label processing means for setting a label name in a label name field in an array field of the label path count array, and generating a label path text including an index indicating the array field subjected to the setting processing at a corresponding location in the macro text string; , provided in a text interpretation unit that interprets the macro text string, interprets the label path text included in the macro text string by the label processing means, and in the array field indicated by the index included in the label path text. The operation continues by updating the value of the label pass count field and comparing the value with the label pass limit value held in the label pass limit field, or the label name field that is paired with the label pass count field that performed the comparison. A method for preventing an infinite loop in a macro processor, comprising label path text interpreting means for determining whether to output a label name set to and interrupt operation.
JP63165909A 1988-07-05 1988-07-05 System for preventing endless loop in microprocessor Pending JPH0216644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63165909A JPH0216644A (en) 1988-07-05 1988-07-05 System for preventing endless loop in microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63165909A JPH0216644A (en) 1988-07-05 1988-07-05 System for preventing endless loop in microprocessor

Publications (1)

Publication Number Publication Date
JPH0216644A true JPH0216644A (en) 1990-01-19

Family

ID=15821312

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63165909A Pending JPH0216644A (en) 1988-07-05 1988-07-05 System for preventing endless loop in microprocessor

Country Status (1)

Country Link
JP (1) JPH0216644A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5084872A (en) * 1989-06-19 1992-01-28 Alcatel Business Systems Interface for transmit and receive mode access to the synchronous transmission medium of a distributed switching network
JPH0485853U (en) * 1990-11-27 1992-07-27

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5084872A (en) * 1989-06-19 1992-01-28 Alcatel Business Systems Interface for transmit and receive mode access to the synchronous transmission medium of a distributed switching network
JPH0485853U (en) * 1990-11-27 1992-07-27

Similar Documents

Publication Publication Date Title
US8056078B2 (en) Cooperatively multitasking in an interrupt free computing environment
CA2284248A1 (en) System for creating, editing, displaying, and executing rules-based programming language rules having action part subsets for both true and false evaluation of the conditional part
US4903264A (en) Method and apparatus for handling out of order exceptions in a pipelined data unit
KR930016896A (en) Calculator with parallel operation
EP3329364B1 (en) Data processing
JP2806524B2 (en) Vector operation instruction issue control method
JPH0216644A (en) System for preventing endless loop in microprocessor
JPS56153457A (en) Measuring device for computer load
JPS63120338A (en) Program converting device
JPH11272477A (en) Data processor and method for operating the same
JPS5654550A (en) Information processor
JPH025136A (en) Error processing system for language processing program
Huang et al. A denotational model for interrupt-driven programs
EP0206346A1 (en) Operation code selected overflow interrupts
JPS60198640A (en) Pipeline type information processor
JP2624798B2 (en) Processing unit debugging mechanism
JPH02176940A (en) Coprocessor register group dispatch control system of data processor
JPS63269239A (en) Processor load measuring system
JPH0667896A (en) Single chip microcomputer
JPH03168836A (en) Emulation processor
JPS61272843A (en) Program execution supervisory system
JPS6367648A (en) Program trace control system
JPS58115546A (en) Microcomputer incorporating hardware break pointer
JPH02297638A (en) Cpu runaway detector
KR870006484A (en) Process control method and apparatus using microprocessor