JPS62274343A - Type conversion and selection system - Google Patents
Type conversion and selection systemInfo
- Publication number
- JPS62274343A JPS62274343A JP11722286A JP11722286A JPS62274343A JP S62274343 A JPS62274343 A JP S62274343A JP 11722286 A JP11722286 A JP 11722286A JP 11722286 A JP11722286 A JP 11722286A JP S62274343 A JPS62274343 A JP S62274343A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- program
- data
- type conversion
- executed
- 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
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は電子計算機の計算処理システムに係シ。[Detailed description of the invention] [Industrial application field] The present invention relates to a calculation processing system for an electronic computer.
特に、プログラム開発効率と実行効率を向上させるのに
好適な型変換遺択万式に関する。In particular, it relates to type conversion options suitable for improving program development efficiency and execution efficiency.
フォートラン等のプログラム言語では、例えば培風館発
行のrFoRTa*N77入門」に記載されているよう
に、整数量、数値型等の数値間の演算に対して、例えば
整数型と英数型で書かれた数値を加算できる等、混合演
算を許容している。これは、コンパイラが自動的に型変
換命令を作り出すためである。In programming languages such as Fortran, for example, as described in "Introduction to rFoRTa*N77" published by Baifukan, for operations between numbers such as integer quantities and numeric types, there are Mixed operations are allowed, such as adding numbers. This is because the compiler automatically creates type conversion instructions.
プログラムを開発する場合、上述した混合演算が許容さ
れているのでプログラマは「型」についていちいち考慮
しなくても済むため、プログラムの開発効率がよい。し
かし、プログラムを実行するときは、型変換を必要とす
る分だけ実行効率が低下してしまうという問題がある。When developing a program, since the above-mentioned mixed operations are allowed, the programmer does not have to consider each "type", which improves the efficiency of program development. However, when executing a program, there is a problem in that execution efficiency decreases by the amount of type conversion required.
数回しか使わないようなプログラムの場合には実行効率
より開発効率を上げることが]1要な昧題であるが、定
常的にくり返し使用され、しかも、長い計算時間を要す
るプログラムにおいては、実行効率を上げることがより
重要な問題となる。しかし、コンパイラが出す型変換命
令は目動的になされるので、プログラマは「型」の相違
を見逃してしまい、夷行効率の高いプログラムを作成す
るのが困難である。In the case of programs that are used only a few times, it is important to improve development efficiency rather than execution efficiency.] One important issue is that for programs that are used repeatedly and require long calculation times, execution efficiency is more important than execution efficiency. Increasing efficiency becomes a more important issue. However, since the type conversion instructions issued by the compiler are done purposefully, programmers tend to overlook differences in types, making it difficult to create programs with high execution efficiency.
本発明の目的は、特に1 ンースプログラムを即ちに実
行するインタプリタ型言語処理系において、プログラム
の開発効率を下げることなく完成したプログラムの実行
効率を上げる型変換選択方式を提供することKろる0
〔問題点を解決するための手段〕
上記目的は、プログラムを開発するときは自動型変換機
能を利用し、次に1開発したプログラムを自動型変換を
行なわないモードで実行し、エラー処理を行なって相違
する「型」を訂正し、プログラムを改良することで達成
される。An object of the present invention is to provide a type conversion selection method that increases the execution efficiency of a completed program without reducing the program development efficiency, particularly in an interpreted language processing system that executes a single-source program. 0 [Means for solving the problem] The above purpose is to use the automatic type conversion function when developing a program, then run the developed program in a mode that does not perform automatic type conversion, and perform error handling. This is achieved by correcting the different "types" and improving the program.
プログラム開発は自!@型変換を利用して行なうため、
開発効率は高い0開発後にプログラムを自gJ型変換を
行なわないモードで興行し、相違する「型」を訂正する
ため、プログラムの実行効率が高まる。Program development is my own! Because this is done using @ type conversion,
Development efficiency is high. After development, the program is run in a mode that does not perform self-gJ type conversion, and different "types" are corrected, so the program execution efficiency is increased.
〔実施例〕 以下、本発明の一実施例を図面を参照して説明する。〔Example〕 Hereinafter, one embodiment of the present invention will be described with reference to the drawings.
第2図は、本発明に係る型変換選択方式の一実施例に供
される計/に機システムの概観図である。FIG. 2 is an overview diagram of a counter system used in an embodiment of the type conversion selection method according to the present invention.
電床7から投入された命令(コマンド)はインタプリタ
Beで解釈され、実行される。投入され次命令がマクロ
コマンド名であれば、マクロ定義ファイル9を参照して
、マクロ中に記述されている命令が次々と実行される。Instructions (commands) input from the electric bed 7 are interpreted and executed by the interpreter Be. If the input next instruction is a macro command name, the macro definition file 9 is referred to and the instructions described in the macro are executed one after another.
また、データペース11中のデータを参照する命令でめ
れば、データベースシステム10を弁してデータが参照
される。Furthermore, if an instruction to refer to data in the database 11 is issued, the data is referenced by activating the database system 10.
命令の例を次に示す。An example of the command is shown below.
(リ SET MODE=、TRUl。(Re SET MODE=, TRUL.
(2) WHILE 、NOT、 EOF(3)
FETCHX、 Y
(4) 5ETX=Y骨α1
(5) E N D W HI I、 Iff命令(
りでは、型変換選択モードを保持する変数μODDに論
理1区の、TRUB、を代入する。命令(2)a、デー
タベース中のデータを絖み終ってEOF(End at
File )となるまで命令(3)、 (4)をく9
返す命令である。命令(3)ではデータベース中からX
とYを読み出し、命令(4)ではXの値をyxα1の値
に置き換える。(2) WHILE, NOT, EOF (3)
FETCHX, Y (4) 5ETX=Y bone α1 (5) E N D W HI I, Iff command (
In this step, the logical 1 block, TRUB, is assigned to the variable μODD that holds the type conversion selection mode. Command (2) a, completes the data in the database and executes EOF (End at
Repeat commands (3) and (4) until File )9
This is a command to return. In command (3), select X from the database.
and Y, and in instruction (4) replaces the value of X with the value of yxα1.
第3図はシステム変数テーブルでおり、第4図はユーザ
変数テーブルである。各テーブルは、変数に関する変数
名、型、値等を保持する欄を有する。命令(1)を実行
すると、第6図のシステム変数テーブル中の変数MOD
FfO(i欄に、TRIJFf、が記入される。また、
命令(3)で取り出したX、 Yのうち、Yの値が文
字列’+00’であったとすると、第4図のユーザ変数
テーブル中のXの値は整数10と記入される。FIG. 3 is a system variable table, and FIG. 4 is a user variable table. Each table has columns that hold variable names, types, values, etc. regarding variables. When command (1) is executed, the variable MOD in the system variable table in Figure 6
FfO (TRIJFf is entered in the i column. Also,
If the value of Y of X and Y retrieved in command (3) is the character string '+00', the value of X in the user variable table of FIG. 4 is entered as an integer 10.
第5図は第2図のインタプリタ部の概略図であシ、命令
解釈923では命令を解釈して実行しやすい形に変換し
て中間テーブル24に出力する。FIG. 5 is a schematic diagram of the interpreter section of FIG. 2. In the instruction interpretation section 923, the instruction is interpreted, converted into an easily executable form, and outputted to the intermediate table 24.
命令実行部25では中間テーブル24の情報を用いて命
令(す〜(5)等を実行する。The instruction execution unit 25 uses the information in the intermediate table 24 to execute instructions (su~(5), etc.).
この命令(1)〜(5)を命令実行部25で実行すると
きの処理手順を第1図に示す。FIG. 1 shows the processing procedure when the instruction execution unit 25 executes the instructions (1) to (5).
先ず、ヌテッブ1で星の整合性をチェックする。First, check the consistency of the stars using Nuteb 1.
命令(4)の場合にはYが文字型であり、fllは実数
型のために型が整合していないので、ステップ2で分岐
してステップ3の自動変換モードのテストを行う■今、
自動型変換モードを保持する変数MODEの値が第3図
のとと(、TRUE、 であるから、ステップ5でY
の保持する文字列°100°を実数値に変換したのち、
命令(4)の右辺の計算をステップ6で実行する〇
自Ig!7型変換モードにおいては、データの型が異る
場合においても正常に計算が完了するので、プログラマ
はデータ呈の一致、不一致を意識することなく、プログ
ラム開発が可能である。In the case of instruction (4), since Y is a character type and fll is a real number type, the types are inconsistent, so branch at step 2 and test the automatic conversion mode at step 3.
Since the value of the variable MODE that holds the automatic type conversion mode is (, TRUE, in Figure 3), Y is selected in step 5.
After converting the character string °100° held by into a real value,
Execute the calculation on the right side of instruction (4) in step 6.〇SelfIg! In the Type 7 conversion mode, calculations are completed normally even when the data types are different, so the programmer can develop a program without being aware of the coincidence or mismatch of data presentation.
しかし、自llIh型変換モードでは、Yt−実数型と
して同じ命令(4)を実行する場合に比べて、文字列゛
100°を実数[100,0に変換する時間が余分に必
要となる。従って、実行効率を高めるため、Yを実数型
に定義しなおす必要が生じる。However, in the self-llIh type conversion mode, more time is required to convert the character string ``100° to the real number [100, 0'' than when executing the same instruction (4) as the Yt-real number type. Therefore, in order to improve execution efficiency, it is necessary to redefine Y to a real number type.
そこで、命令(1)〜(5)のプログラムを開発した後
。So, after developing the program for instructions (1) to (5).
このプログラムのうち、命令い)を績0I)E=、FA
LSILと変更し、第1図の手順で実行する。すると、
命令(4)の実行で、ステップ3の判定が否定(N)と
なってステップ4に分岐し、プログラマはデータ型が不
一致であシ型変換を必要とする箇所を知る。Out of this program, execute the command (I) E=, FA
LSIL and execute the procedure shown in Figure 1. Then,
Upon execution of instruction (4), the determination in step 3 becomes negative (N) and the program branches to step 4, where the programmer learns where the data types do not match and requires type conversion.
この結果を踏まえて、データペース中にあるデータの型
や、変数のデータ型を変更して実行効率の良いプログラ
ムを得る。Based on this result, the data types in the database and the data types of variables are changed to obtain a program with high execution efficiency.
ステップ4のエラー処理では、端末7にエラーメツセー
ジを茨示するとともに、後処理として、(1)当該命令
をスキップして次の命令を実行する場合や、(2)命令
の実行を停止して端末から次の命令の入力を待つ場合や
、(3)型変換を実行し、当該命令の実行を継続する場
合などがある◎
〔発明の効果〕
以上、詳細に説明したように、本発明によれば、自動型
変換モードを実行、不笑行と切りfえる機能を肩するの
で、以下の効果がある。In the error handling in step 4, an error message is displayed on the terminal 7, and as post-processing, (1) the instruction is skipped and the next instruction is executed, or (2) the execution of the instruction is stopped. There are cases when waiting for the next instruction to be input from the terminal, and cases where (3) type conversion is performed and execution of the instruction is continued. [Effects of the Invention] As explained in detail above, the present invention has advantages. According to the method, it performs the automatic type conversion mode and handles the function of cutting off inappropriate behavior, so it has the following effects.
(リ 自′MJ型変換実行モードではデータ型の不一致
を考慮せずにすむために、70グラム開発効率を向上で
きる・
(2) 自動型Km不実行モードではデータ型の不一
致を言語処理系が検出し、その箇所が容易に知れること
から、実行効率の良いプログラムへの改良が容易になる
。(In the automatic MJ type conversion execution mode, there is no need to consider data type mismatches, so 70gram development efficiency can be improved. (2) In the automatic Km non-execution mode, the language processing system detects data type mismatches. However, since the location can be easily known, it is easy to improve the program to be more efficient.
第1図は本発明の一実施例に係る言語処理フローチャー
ト、第2図は計算機システムの構成図。
第6図はシステム変数テーブル図、第4図はユーザ変数
テーブル図、第5図は第2図に示すインタプリタの説明
図である0
7・・・海床、8・・・インタプリタ部。
°)、FIG. 1 is a language processing flowchart according to an embodiment of the present invention, and FIG. 2 is a configuration diagram of a computer system. FIG. 6 is a system variable table diagram, FIG. 4 is a user variable table diagram, and FIG. 5 is an explanatory diagram of the interpreter shown in FIG. 2. 07...Sea floor, 8...Interpreter section. °),
Claims (1)
語を解釈して実行する言語処理系を有する計算機システ
ムにおいて、演算の対象となるデータ型が不一致の場合
に型変換を行う自動型変換実行モードと、演算の対象と
なるデータ型が不一致の場合に不一致情報を出力する自
動型変換不実行モードとを設け、いずれかのモードを選
択指定することを特徴とする型変換選択方式。1. In a computer system that has a language processing system that interprets and executes a programming language that describes the operation of the computer system, an automatic type conversion execution mode that performs type conversion when the data types that are the targets of the operation do not match, and an operation A type conversion selection method characterized by providing an automatic type conversion non-execution mode for outputting mismatch information when the target data types do not match, and selecting and specifying one of the modes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11722286A JPS62274343A (en) | 1986-05-23 | 1986-05-23 | Type conversion and selection system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11722286A JPS62274343A (en) | 1986-05-23 | 1986-05-23 | Type conversion and selection system |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS62274343A true JPS62274343A (en) | 1987-11-28 |
Family
ID=14706417
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP11722286A Pending JPS62274343A (en) | 1986-05-23 | 1986-05-23 | Type conversion and selection system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS62274343A (en) |
-
1986
- 1986-05-23 JP JP11722286A patent/JPS62274343A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8429627B2 (en) | Asynchronous preemptive edit time semantic analysis of a graphical program | |
Baba et al. | The MPG system: A machine-independent efficient microprogram generator | |
JPS62274343A (en) | Type conversion and selection system | |
JPH0766342B2 (en) | Program test equipment | |
JP2002268896A (en) | Control program creation method and device | |
JPH0554277A (en) | Plant monitor device | |
Herzog | From elementary knowledge schemes towards heuristic expertise—designing an ITS in the field of parallel programming | |
JPH09147132A (en) | Cad system | |
Cosgrove et al. | Dynamic modeling and verification of safe-set architectures | |
JPS62147534A (en) | Program test system | |
JPH0664541B2 (en) | Command processor | |
JPH03242736A (en) | Abnormality processing system | |
JPH064348A (en) | Program debugging system | |
JPS61131124A (en) | Conversation input processing system | |
JPH03172958A (en) | Synchronous processing method, parallel processing system, parallel processing method, and parallel program generation device | |
JPS62282333A (en) | Instruction rearrangement program generating system | |
JPH0610767B2 (en) | Robot language execution method | |
JPH05127945A (en) | Program execution situation analysis system | |
JPH03291730A (en) | Method for integrating program with different language form | |
JPS6365542A (en) | Debugging system | |
JPS6143347A (en) | Vector instruction simulation method | |
JPH05233241A (en) | Program forming device | |
JPH04340628A (en) | Fuzzy inference process compile system | |
JPH05204698A (en) | Debugger processing system | |
JPS63217433A (en) | Control system for execution of program |