JPH0381829A - Static variable reference system having initial value of high-ranking - Google Patents

Static variable reference system having initial value of high-ranking

Info

Publication number
JPH0381829A
JPH0381829A JP21891289A JP21891289A JPH0381829A JP H0381829 A JPH0381829 A JP H0381829A JP 21891289 A JP21891289 A JP 21891289A JP 21891289 A JP21891289 A JP 21891289A JP H0381829 A JPH0381829 A JP H0381829A
Authority
JP
Japan
Prior art keywords
name table
initial value
storage area
table type
setting means
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
JP21891289A
Other languages
Japanese (ja)
Inventor
Tomoyuki Yui
朋之 湯井
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 JP21891289A priority Critical patent/JPH0381829A/en
Publication of JPH0381829A publication Critical patent/JPH0381829A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the whole size of a static variable allocating area by providing a system with a name table classification setting means, an initial value information setting means, a data updating information setting means, a name table classification changing means, and so on. CONSTITUTION:The name table classification setting means 3 inputs a declaration data token 14 and sets up a name table classification 8 to be the classification of a variable declared in a name table classification storing area 7. The initial value information setting means 4 sets up the initial value information 10 of the token 14 in an initial value information storing area 9 and the data updating information setting means 5 inputs an execution sentence token 15 and sets up data updating information 12 in a data updating information storing area 11. The name table classification changing means 6 inputs the information 12 set up in the storing means 11, decides whether a static variable can be changed to a constant or not and changes the classification 8 set up in the area 7 by the means 3 to the sort 8 indicating a constant having the initial value information 10 as its value. Consequently, the whole size of the static variable allocating area can be reduced.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は高級言語コンパイラがコンパイル時に初期値を
有したスタティック変数を参照する方式に関し、特にス
タティック変数をメモリに割り付けず定数として参照す
る方式に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a method in which a high-level language compiler refers to a static variable that has an initial value at the time of compilation, and particularly relates to a method in which a static variable is referenced as a constant without being allocated to memory. .

〔従来の技術〕[Conventional technology]

従来この種の初期値を有したスタティック(STATI
C)変数の参照は、必らずメモリに割り付けたデータと
して参照していた。
Conventionally, static (STATI) had this kind of initial value.
C) Variables were always referenced as data allocated to memory.

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

上述した従来の初期値を有した5TATIC変数の参照
方式は、−度も更新され々い5TATIC変数も必らず
メモリに割り付けるので、5TATIC変数が多くなる
と、5TATIC変数の割り付けられているメモリサイ
ズも増大するという欠点がある。
The conventional method of referencing 5TATIC variables with initial values described above necessarily allocates the 5TATIC variables to memory, which are frequently updated, so as the number of 5TATIC variables increases, the memory size allocated to the 5TATIC variables also increases. The disadvantage is that it increases.

〔課題を解決するための手段〕[Means to solve the problem]

本発明の高級言語プログラムの初期値を有したスタティ
ック変数参照方式は、宣言データ処理部を備え、初期値
を有するスタテイ、り変数が宣言されている高級言語ソ
ースプログラムをコンパイルするとき、前記スタティッ
ク変数を参照する高級言語プログラムの初期値を有した
スタティック変数参照方式において、 前記宣言データ処理部の内の名前テーブル作成部によっ
て作成される名前テーブル内に前記初期値を有したスタ
ティック変数の初期値情報を格納する初期値情報格納域
と、名前テーブル種別を格納する名前テーブル種別格納
域と、宣言された変数の更新情報であるデータ更新情報
を格納するデータ更新情報格納域とを有し、 宣言データトークンを入力し、前記名前テーブル種別格
納域に宣言された変数の種別である名前テーブル種別を
設定する名前テーブル種別設定手段と、 前記初期値情報格納域へ前記初期値情報を設定する初期
値情報設定手段と、 実行文トークンを入力し、前記データ更新情報格納域へ
データ更新情報を設定するデータ更新情報設定手段と、 前記データ更新情報設定手段によりデータ更新情報格納
域へ設定されたデータ更新情報を入力し、スタティック
変数を定数に変更可能かを判定し前記名前テーブル種別
設定手段により前記名前テーブル種別格納域へ設定され
た名前テーブル種別を定数を表わす種別に変更する名前
テーブル種別変更手段とを備えている。
The static variable reference method having an initial value for a high-level language program of the present invention includes a declaration data processing unit, and when compiling a high-level language source program in which a state variable having an initial value is declared, the static variable In the static variable reference method that has an initial value of a high-level language program that refers to, initial value information of the static variable that has the initial value in a name table created by the name table creation unit of the declaration data processing unit. It has an initial value information storage area that stores the name table type, a name table type storage area that stores the name table type, and a data update information storage area that stores the data update information that is the update information of the declared variable. name table type setting means for inputting a token and setting a name table type that is a type of a variable declared in the name table type storage area; and initial value information for setting the initial value information in the initial value information storage area. a setting means; a data update information setting means for inputting an executable statement token and setting data update information in the data update information storage area; and data update information set in the data update information storage area by the data update information setting means. a name table type changing means for inputting a static variable, determining whether a static variable can be changed to a constant, and changing the name table type set in the name table type storage area by the name table type setting means to a type representing a constant; We are prepared.

〔実施例〕〔Example〕

次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例の構成図で・ある。FIG. 1 is a block diagram of an embodiment of the present invention.

第1図を参照すると本発明の一実施例は、コンパイラの
一部である宣言データ処理部1、ソースプログラム中の
各変数の宣言毎に作成される名前テーブル13a〜13
d、宣言文に対するトークンである宣言データトークン
14、実行文に対するトークンである実行文トークン1
5から構成される。
Referring to FIG. 1, one embodiment of the present invention includes a declaration data processing unit 1 which is a part of a compiler, and name tables 13a to 13 created for each declaration of each variable in a source program.
d, declaration data token 14, which is a token for a declaration statement; executable statement token 1, which is a token for an executable statement;
Consists of 5.

さらに、宣言データ処理部lは、名前テーブル作成部2
、データ更新情報設定手段5、名前テーブル種別変更手
段6から構成される。
Furthermore, the declaration data processing unit 1 includes the name table creation unit 2.
, data update information setting means 5, and name table type changing means 6.

また、名前テーブル作成部2は、名前テーブル種別設定
手段3、初期値情報設定手段4から構成される。
Further, the name table creation section 2 includes a name table type setting means 3 and an initial value information setting means 4.

そして、名前テーブル13a〜13dは名前テーブル種
別格納域7、初期値情報格納域9、データ更新情報格納
域11から構成される。
The name tables 13a to 13d are composed of a name table type storage area 7, an initial value information storage area 9, and a data update information storage area 11.

次に、処理の流れを説明する。Next, the flow of processing will be explained.

第1図において宣言データ処理部1が起動されると、宣
言データ処理部1の名前テーブル作成部2、データ更新
情報設定手段5、名前テーブル種別変更手段6が順次起
動される。さらに、名前テーブル作成部2の名前テーブ
ル種別設定手段3、初期値情報設定手段4が順次起動さ
れる。
In FIG. 1, when the declaration data processing section 1 is activated, the name table creation section 2, data update information setting means 5, and name table type changing means 6 of the declaration data processing section 1 are activated in sequence. Further, the name table type setting means 3 and the initial value information setting means 4 of the name table creation section 2 are sequentially activated.

そして、名前テーブル作成部2は宣言された変数の情報
を持つ宣言データトークン14を入力し、入力された変
数情報から名前テーブル13a〜13dを作成しデータ
更新情報格納域11をクリアする。さらに、名前テーブ
ル種別設定手段3は宣言データトークン14から変数の
割り付は状態を名前テーブル種別8として名前テーブル
種別格納域7へ設定する。また、初期値情報設定手段4
は宣言データトークン14内の初期値情報10を名前テ
ーブル13a〜13d中の初期値情報格納域9へ設定す
る。変数に対して初期値が存在しない場合は初期値なし
の情報を初期値情報格納域9へ設定する。
Then, the name table creation unit 2 inputs the declaration data token 14 having information on the declared variables, creates name tables 13a to 13d from the input variable information, and clears the data update information storage area 11. Furthermore, the name table type setting means 3 sets the variable allocation status from the declaration data token 14 to the name table type storage area 7 as name table type 8. In addition, the initial value information setting means 4
sets the initial value information 10 in the declaration data token 14 to the initial value information storage area 9 in the name tables 13a to 13d. If no initial value exists for the variable, information about no initial value is set in the initial value information storage area 9.

データ更新情報設定手段5は実行文トークン15を入力
し、入力された実行文が変数の内容を更新するような文
である時に、その変数に対する名前テーブル13a〜1
3dを検索し、その名前テーブル13a〜13d中のデ
ータ更新情報格納域11へ変数が更新されたことを表示
するデータ更新情報12を設定する。名前テーブル種別
変更手段6は全ての名前テーブル13a〜13dを入力
し、名前テーブル種別格納域7中に格納されている名前
テーブル種別8が5TATIC変数を表わすもので、初
期値情報格納域9中に初期値情報10が存在し、且つ、
データ更新情報格納域ll中のデータ更新情報12が変
数に対して更新が行われなかったことを示している場合
に、名前テーブル種別格納域7中の名前テーブル種別8
を初期値情報10を値として持つ定数であることを示す
名前テーブル種別8に変更する。
The data update information setting means 5 inputs an executable statement token 15, and when the input executable statement is a statement that updates the contents of a variable, the name table 13a to 1 for that variable is input.
3d and sets data update information 12 indicating that the variable has been updated in the data update information storage area 11 in the name tables 13a to 13d. The name table type changing means 6 inputs all the name tables 13a to 13d, and the name table type 8 stored in the name table type storage area 7 represents a 5TATIC variable, and the name table type 8 stored in the name table type storage area 7 represents a 5TATIC variable, and the initial value information storage area 9 Initial value information 10 exists, and
When the data update information 12 in the data update information storage area ll indicates that the variable has not been updated, the name table type 8 in the name table type storage area 7
is changed to name table type 8, which indicates that it is a constant having initial value information 10 as a value.

このように、コンパイラが初期値を有した5TATIC
変数を定数として参照できるか否かを判定し、定数とし
て参照可能であれば、5TATIC変数をメモリには割
り付けず定数として参照することにより、5TATIC
変数割り付は域の総サイズを減少することができる。ま
た、メモリへの参照が不要となるため、目的プログラム
の実行時性能を向上させることができる。
In this way, the compiler creates 5TATIC with initial values.
Determine whether the variable can be referenced as a constant, and if it is, refer to the 5TATIC variable as a constant without allocating it to memory.
Variable allocation can reduce the total size of the area. Furthermore, since there is no need to refer to memory, the execution performance of the target program can be improved.

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

以上説明したように本発明は、コンパイラが初期値を有
した5TATIC変数を定数として参照できるか否かを
判定し、定数として参照可能であれば、5TATIC変
数をメモリには割り付けず定数として参照することによ
り、5TATIC変数割り付は域の総サイズを減少する
ことができるという効果がある。
As explained above, the present invention allows the compiler to determine whether or not a 5TATIC variable with an initial value can be referenced as a constant, and if it can be referenced as a constant, the compiler refers to the 5TATIC variable as a constant without allocating it to memory. This has the effect that 5TATIC variable allocation can reduce the total size of the area.

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

第1図は本発明の一実施例の構成国である。 l・・・・・・宣言データ処理部、2・・・・・・名前
テーブル作成部、3・・・・・・名前テーブル種別設定
手段、4・・・・・・初期値情報設定手段、5・・・・
・・データ更新情報設定手段、6・・・・・・名前テー
ブル種別変更手段、7・・・・・・名前テーブル種別格
納域、8・・・・・・名前テーブル種別、9・・・・・
・初期値情報格納域、10・・・・・・初期値情報、1
1・・・・・・データ更新情報格納域、12・・・・・
・データ更新情報、13・・・・・・名前テーブル、1
4・・・・・・宣言データトークン、15・・・・・・
実行文トークン。
FIG. 1 shows the constituent countries of one embodiment of the present invention. l...Declaration data processing unit, 2...Name table creation unit, 3...Name table type setting means, 4...Initial value information setting means, 5...
... Data update information setting means, 6... Name table type changing means, 7... Name table type storage area, 8... Name table type, 9...・
・Initial value information storage area, 10...Initial value information, 1
1... Data update information storage area, 12...
・Data update information, 13... Name table, 1
4...Declaration data token, 15...
Executable statement token.

Claims (1)

【特許請求の範囲】 宣言データ処理部を備え、初期値を有するスタティック
変数が宣言されている高級言語ソースプログラムをコン
パイルするとき、前記スタティック変数を参照する高級
言語プログラムの初期値を有したスタティック変数参照
方式において、前記宣言データ処理部の内の名前テーブ
ル作成部によって作成される名前テーブル内に前記初期
値を有したスタティック変数の初期値情報を格納する初
期値情報格納域と、名前テーブル種別を格納する名前テ
ーブル種別格納域と、宣言された変数の更新情報である
データ更新情報を格納するデータ更新情報格納域とを有
し、 宣言データトークンを入力し、前記名前テーブル種別格
納域に宣言された変数の種別である名前テーブル種別を
設定する名前テーブル種別設定手段と、 前記初期値情報格納域へ前記初期値情報を設定する初期
値情報設定手段と、 実行文トークンを入力し、前記データ更新情報格納域へ
データ更新情報を設定するデータ更新情報設定手段と、 前記データ更新情報設定手段によりデータ更新情報格納
域へ設定されたデータ更新情報を入力し、スタティック
変数を定数に変更可能かを判定し前記名前テーブル種別
設定手段により前記名前テーブル種別格納域へ設定され
た名前テーブル種別を定数を表わす種別に変更する名前
テーブル種別変更手段とを備えたことを特徴とする高級
言語プログラムの初期値を有したスタティック変数参照
方式。
[Claims] When compiling a high-level language source program that includes a declaration data processing unit and in which static variables with initial values are declared, static variables with initial values of the high-level language program that refer to the static variables. In the reference method, the name table created by the name table creation unit of the declaration data processing unit includes an initial value information storage area for storing initial value information of a static variable having the initial value, and a name table type. It has a name table type storage area for storing name table type storage areas and a data update information storage area for storing data update information that is update information of declared variables, and inputs a declaration data token and displays the declared variables in the name table type storage area. a name table type setting means for setting a name table type which is a type of a variable; an initial value information setting means for setting the initial value information in the initial value information storage area; inputting an executable statement token and updating the data; a data update information setting means for setting data update information in an information storage area; and inputting the data update information set by the data update information setting means into the data update information storage area, and determining whether a static variable can be changed to a constant. and name table type changing means for changing the name table type set in the name table type storage area by the name table type setting means to a type representing a constant. Static variable reference method.
JP21891289A 1989-08-24 1989-08-24 Static variable reference system having initial value of high-ranking Pending JPH0381829A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21891289A JPH0381829A (en) 1989-08-24 1989-08-24 Static variable reference system having initial value of high-ranking

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21891289A JPH0381829A (en) 1989-08-24 1989-08-24 Static variable reference system having initial value of high-ranking

Publications (1)

Publication Number Publication Date
JPH0381829A true JPH0381829A (en) 1991-04-08

Family

ID=16727266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21891289A Pending JPH0381829A (en) 1989-08-24 1989-08-24 Static variable reference system having initial value of high-ranking

Country Status (1)

Country Link
JP (1) JPH0381829A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012069010A1 (en) * 2010-11-25 2012-05-31 意法·爱立信半导体(北京)有限公司 Static storage allocation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012069010A1 (en) * 2010-11-25 2012-05-31 意法·爱立信半导体(北京)有限公司 Static storage allocation method and device

Similar Documents

Publication Publication Date Title
JP4794437B2 (en) An extended system for representing and checking the integrity of program components during the editing process
EP0777177B1 (en) A method for object-oriented programming using dynamic interfaces
JPH0827774B2 (en) How to perform modifiable functions on the server
JPH02272627A (en) Digital computer system and method of invocation of procedure of the same
EP0373361A3 (en) Generating efficient code for a computer with dissimilar register spaces
US20060150164A1 (en) Run-time type conversion
US20030110470A1 (en) Method and apparatus for providing dynamically scoped variables within a statically scoped computer programming language
JPH0381829A (en) Static variable reference system having initial value of high-ranking
Olsson et al. The JR programming language: concurrent programming in an extended Java
JPH03257624A (en) Screen language system
US7185324B2 (en) Compiler apparatus and method for determining locations for data in memory area
US20100229164A1 (en) Method and system generating execution file system device
JPH0370038A (en) Variable allocating system for high-level language program
JPH03102428A (en) Procedure call processing system for compiler of high-level language
JP3085309B2 (en) Debug system
JPH0239242A (en) Temporary work area allocation system for electronic computer system
JPH03255534A (en) Pointer qualified data referencing system for high level program language
JPS63247824A (en) Expanding method for number of defining blocks of data entry screen
JPH04344533A (en) Data referring system from compiled code object in interpreter language
JPH04178738A (en) Register allocation system
Solis et al. Types, Storage, and Variables
JPH03157724A (en) Program loading system by dynamic link
Liu An advanced C++ library for symbolic computing
JPH02201541A (en) Compiling system
JP2764358B2 (en) Data driven information processor