JPS63289636A - Input editing device equipped with program attribute display function - Google Patents

Input editing device equipped with program attribute display function

Info

Publication number
JPS63289636A
JPS63289636A JP12379687A JP12379687A JPS63289636A JP S63289636 A JPS63289636 A JP S63289636A JP 12379687 A JP12379687 A JP 12379687A JP 12379687 A JP12379687 A JP 12379687A JP S63289636 A JPS63289636 A JP S63289636A
Authority
JP
Japan
Prior art keywords
program
input
editing device
display
syntax
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
JP12379687A
Other languages
Japanese (ja)
Inventor
Toshihisa Aoshima
青島 利久
Masaaki Kurosu
黒須 正明
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP12379687A priority Critical patent/JPS63289636A/en
Publication of JPS63289636A publication Critical patent/JPS63289636A/en
Pending legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)

Abstract

PURPOSE:To detect the input of misspelling by extracting a function name existing in an inputted program and classifying, discriminating and displaying a user definition function name and an undefined function name from the extracted element. CONSTITUTION:A function name extracting/sorting means 14 inputs the contents of a character string buffer 12 and decides whether each character string element is a function name or not. The sort of the character string can be decided by referring to a code name management table by using the character string as a key. The contents of the character string can be added or updated by registering the definition of a new number. After deciding the sort of each extracted function name, the means 14 transfers a light for the pair of the character position of the function name and color attribute to a display attribute management part 22. The management part 22 displays integrating functions of a specific format, integrating functions of a standard format, compiled user function names, other user function names, and undefined function names as respectively different color display attributes.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、プログラムの入力編集装置に係り、特にプロ
グラムの構造や構文の確認や理解に好適な、プログラム
の属性表示に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a program input/editing device, and particularly to a program attribute display suitable for checking and understanding the structure and syntax of a program.

[従来の技術] プログラムは、通常文字列の集合してい記述され、入力
されるので、それらを単に文字列として表示出力すると
、極めてわかりづらいプログラム−となってしまう。そ
こで通常、プログラマが、入力編集装置にプログラムを
入力する時点で、適当な空白や改行を挿入する。
[Prior Art] A program is usually written and input as a collection of character strings, so if these are simply displayed and output as character strings, the program becomes extremely difficult to understand. Therefore, programmers usually insert appropriate spaces and line breaks when inputting a program into an input editing device.

また、プログラム言語の処理系が、構文を識別して先の
先頭に適当な空白を挿入する段下げや改行を挿入して出
力する清書(プリティ・プリント)機能が公開されてい
る。
In addition, a pretty print function has been released in which the processing system of a programming language identifies the syntax and inserts an appropriate space at the beginning of the text, inserts a line break, or inserts a new line before outputting the text.

また、プログラムが本構造をなしており、その本構造の
単位を左右の括弧によって表現するLIS P (L 
I S T  Processor)では、それらの対
応する括弧を同輝度または同色表示する本構造表示方法
が知られている(特開昭62−19939)。
In addition, the program has a book structure, and the unit of the book structure is expressed by left and right parentheses.LIS P (L
In IST Processor), this structure display method is known in which the corresponding brackets are displayed with the same brightness or the same color (Japanese Patent Laid-Open No. 19939/1983).

前記本構造表示によって、プログラムの構造を確認する
ことは、特にLISPにおいては重要な作業である。
Confirming the structure of a program using the main structure display is an important task, especially in LISP.

[発明が解決しようとする問題点] 上記従来技術は、プログラムの構文要素の属性の表示に
ついては配慮されておらず、プログラムの構造や構文の
確認や理解、誤りの発見には不十分な点があった。
[Problems to be Solved by the Invention] The above-mentioned prior art does not take into account the display of attributes of program syntax elements, and is insufficient for checking and understanding the structure and syntax of a program, and for finding errors. was there.

また従来技術を含め、プログラムの構造や属性の表示は
、プログラムの入力や編集時に実行して、即時に確認・
修正できる必要がある。
In addition, the display of the program structure and attributes, including the conventional technology, can be performed when inputting or editing a program to immediately check and display it.
You need to be able to fix it.

本発明の目的は、プログラムの入力編集装置において、
プログラムの構造と構文要素の属性の3別表示を行うこ
とにある。
An object of the present invention is to provide a program input editing device,
Its purpose is to display the structure of a program and the attributes of syntax elements in three different ways.

[問題点を解決するための手段] 上記目的は、入力されたプログラムの文字列に対して、
関数名・変数名・条件構文・くり返し構文・ブロック構
文を抽出し、該抽出要素から、各々関数種別・変数種別
を分類する手段と、前記抽出構文の要素を属性ごとに分
類する手段と、前記抽出のブロック構文のレベル分は手
段を用いることにより、達成される。
[Means for solving the problem] The above purpose is to
means for extracting function names, variable names, conditional syntax, repetition syntax, and block syntax, and classifying each function type and variable type from the extracted elements; means for classifying the elements of the extracted syntax according to attributes; The level of block syntax of extraction is achieved by means.

[作用] 前記関数名種別分類手段は、抽出した関数名の文字列に
対応する。言語処理系の実行環境に設定されている記号
名の管理テーブルを参照することにより、種別の判定を
行う。記号名管理テーブルには、言語処理系に当該記号
名(文字列要素)が登録されたとき、その種別を記憶し
ている。
[Operation] The function name type classification means corresponds to the character string of the extracted function name. The type is determined by referring to the symbol name management table set in the execution environment of the language processing system. The symbol name management table stores the type of symbol name (character string element) when it is registered in the language processing system.

前記変数名種別分類手段は、グローバル変数のデータ型
は、前記記号名管理テーブルに記憶されているが、ロー
カル変数は、実行時に別の記憶領域に一時的に生成され
るだけであるので、プログラム中の変数の存在場所から
、個々に判断する。
The variable name type classification means stores the data types of global variables in the symbolic name management table, but local variables are only temporarily created in a separate storage area during execution. Judgment is made individually based on the location of variables within.

即ち、関数の引数と同じ変数名、ブロック構文でのロー
カル変数宣言部からローカル変数を抽出する。データ型
による分類は、ローカルなデータ型宣言文を検出するこ
とと、記号名管理テーブル参照によりグローバル変数の
データ型を抽出することにより達成する。
That is, local variables are extracted from the same variable name as the function argument and the local variable declaration part in the block syntax. Classification by data type is achieved by detecting a local data type declaration statement and extracting the data type of a global variable by referring to a symbolic name management table.

また前記条件構文、くり返し構文の要素の属性は、構文
テーブルの照合により識別を行う、構文テーブルは予め
、言語処理系によって定められている前記構文の形式と
対応する要素の属性の並びを保持しておく。
In addition, the attributes of the elements of the conditional syntax and repetition syntax are identified by checking against a syntax table. The syntax table holds in advance the arrangement of the attributes of the elements corresponding to the syntax format determined by the language processing system. I'll keep it.

前記ブロックのレベル分は手段は、ブロックの識別子と
、構造の区切り記号(L I S Pでは左右の括弧)
のカウントによってレベル分は表示を行う。
The means for the level of the block are the block identifier and the structure delimiter (left and right parentheses in LISP)
The level is displayed based on the count.

前記各種のプログラムの構造や要素の属性表示は、各々
コマンド指令により、選択的に実行され、混在すること
なく識別表示される。
The structure of the various programs and the attribute display of the elements are selectively executed by each command, and are displayed in an identified manner without being mixed.

[実施例コ 第1図は、本発明の入力・編集装置の一実施例を示す全
体構成のブロック図である。図中の破線は制御の流れ、
実線はデータの流れを示す。
[Embodiment] FIG. 1 is a block diagram of the overall configuration of an embodiment of the input/editing device of the present invention. The dashed line in the figure is the control flow,
Solid lines indicate data flow.

第1図11はオペレータまたはプログラマから入力され
る文字列や指令の入力解釈部で、例えばキーボードから
のプログラム(文字列)の入力や、入力されたプログラ
ムに対する操作指令(コマンド)を受付は解釈を行う。
Fig. 11 shows an input interpretation unit for character strings and commands input from an operator or programmer. conduct.

入力されたプログラムは、12の文字列バッファに記憶
される。13は、前記文字列バッファの内容を、後述す
る表示属性管理部22に設定された表示属性に従って画
面に表示する。
The input program is stored in 12 string buffers. 13 displays the contents of the character string buffer on the screen according to display attributes set in a display attribute management section 22, which will be described later.

第1図の実施例は、入力したプログラム中の関数名を、
関数の種別によって異なる表示色等の表示属性で表示す
る手段である。
In the example of FIG. 1, the function name in the input program is
This is a means of displaying with display attributes such as different display colors depending on the type of function.

第1図14は関数名抽出・種別分類手段で、最初に12
の文字列バッファの内容を入力し、各文字列要素が関数
名であるか否かを判定する。ところでプログラムの構文
(式)中で、関数名が存在し得る位置は、プログラミン
グ言語によって異なる。
Figure 1 14 shows the function name extraction and type classification means.
inputs the contents of the string buffer and determines whether each string element is a function name. By the way, the position where a function name can exist in the syntax (formula) of a program differs depending on the programming language.

例えばL I S P (Lisp Processo
r)のプログラムは、(it+ i2・・・11・・・
)の形をしたリスト形式で表現され、さらに各i1も同
様のリスト形式によって記述される。原則として左括弧
の次の11が関数名で、それに続<iiがその関数の引
数であると約束付けられている。従って、LISPプロ
グラムでは、左括弧の次に位置する文字列要素をすべて
関数名の候補として抽出し、該文字列の文字列バッファ
上での位置とをペアにしたリストを生成する。
For example, L I S P (Lisp Processo
r) program is (it+ i2...11...
), and each i1 is also described in a similar list format. As a general rule, the number 11 following the left parenthesis is the function name, and the following <ii is guaranteed to be the argument of that function. Therefore, in the LISP program, all string elements located after the left parenthesis are extracted as function name candidates, and a list is generated in which the strings are paired with the positions of the strings on the string buffer.

次に、前記抽出の関数名の候補である文字列を関数の種
類によって分類する。該文字列をキーにして15の記号
名管理テーブルを参照することにより、該文字列の関数
の種類を判定できる。該記号名管理テーブルは、言語処
理系の実行環境に用意されているものであり、第2図に
その記憶内容の例を示す。各記号ごとの種別欄に、最初
から言語処理系に組込みの関数、コンパイルされたユー
ザ関数、まだコンパイルされていないユーザ関数等の種
別が記載されている。
Next, the character strings that are candidates for the extracted function names are classified according to the type of function. By referring to the 15 symbol name management tables using the character string as a key, the type of function of the character string can be determined. The symbol name management table is prepared in the execution environment of the language processing system, and an example of its stored contents is shown in FIG. In the type column for each symbol, types such as functions built into the language processing system from the beginning, compiled user functions, user functions not yet compiled, etc. are listed.

新たな関数の定義の登録により、その内容は追加・更新
される。同テーブルには、グローバル変数の記号名も格
納されており、現在値が保持されている。関数名につい
ての値欄は“niL”(なしの意)で、関数の定義の存
在場所はポインタで指している。ここで、記号名管理テ
ーブルに存在しない文字列(記号名)は、未定義関数と
判定する。14は抽出した各関数名の種別を判定した後
、該関数名の文字位置と色属性のペアのリストを23の
表示属性管理部に転送する。第3図に入力したプログラ
ム中に使用されている関数名の種別表示例を示す0本表
示例では、特殊形式の組込み関数(special f
orm)を白に標準形式の組込み関数を空色、コンパイ
ルされたユーザ関数名を青、それ以外のユーザ関数名を
黄、未定義の関数名を赤の表示属性で表示した。入力し
たプログラム中の関数名の種別表示は、LISPのよう
な関数参照によってプログラムを構築する言語において
、入力した関数が、既に定義済のものであるかを確認で
き、併せて不注意や記憶違いによるミススペルを発見で
きる。
By registering a new function definition, its contents are added or updated. The table also stores symbolic names of global variables and holds their current values. The value field for the function name is "niL" (meaning none), and the location of the function definition is indicated by a pointer. Here, a character string (symbol name) that does not exist in the symbol name management table is determined to be an undefined function. 14 determines the type of each extracted function name, and then transfers a list of pairs of character positions and color attributes of the function name to the display attribute management section 23. Figure 3 shows an example of displaying the types of function names used in the input program.
orm) in white, standard format built-in functions in sky blue, compiled user function names in blue, other user function names in yellow, and undefined function names in red. The type display of the function name in the input program allows you to check whether the input function has already been defined in languages such as LISP that construct programs by referring to functions, and also to prevent carelessness or misunderstanding. You can find misspellings by

第2の実施例は、入力したプログラム中の変数名を変数
の種別によって、異なる表示色等の表示属性で表示する
手段である。第1図16は変数名抽出・種別分類手段で
、まず12の文字列バッファの内容を入力し、各文字列
要素が変数名であるか否かを判定する。プログラムがL
ISP言語の場合は、前記関数名以外の文字列要素を原
則として変数と解釈する。抽出した変数名と該変数名の
文字列バッファ上での位置をペアにしたリストを生成す
る。
The second embodiment is a means for displaying variable names in an input program with display attributes such as different display colors depending on the type of variable. FIG. 16 shows a variable name extraction/type classification means, which first inputs the contents of 12 character string buffers and determines whether each character string element is a variable name. The program is L
In the case of the ISP language, character string elements other than the function name are in principle interpreted as variables. A list of pairs of extracted variable names and positions of the variable names on the character string buffer is generated.

次に、抽出した変数名を、関数間にまたがって有効なグ
ローバル変数と、特定の構文の範囲内だけで有効なロー
カル変数に分類する。LISP言語の場合、同じ記号(
名称)の変数名を、グローバル変数とローカル変数の両
方に使用することができ、かつ前記記号名管理テーブル
にはローカル変数は記憶されないので記号名管理テーブ
ルの参照では判定できない。分類は、該変数名のプログ
ラム上の位置で決まり、ローカル変数が設定される構文
をプログラムの先頭からサーチする。ローカル変数は、
関数の引数、ブロック構文(LISPでは、LET文、
PH10文)、くり返し構文(LISPでは、00文)
の中の決められた位置で定義される。LISPでは、ロ
ーカル変数以外の変数を基本的にはグローバル変数と解
釈することになっている。ローカル変数でも特別な宣言
によりグローバル変数の値の参照を行うスペシャル変数
を指定できるか発明の本質ではないので説明を省略する
Next, the extracted variable names are classified into global variables that are valid across functions and local variables that are valid only within a specific syntax. In the LISP language, the same symbol (
The variable name (name) can be used as both a global variable and a local variable, and local variables are not stored in the symbol name management table, so it cannot be determined by referring to the symbol name management table. The classification is determined by the position of the variable name in the program, and the syntax in which the local variable is set is searched from the beginning of the program. Local variables are
Function arguments, block syntax (in LISP, LET statement,
PH10 statement), repetition syntax (00 statement in LISP)
is defined at a fixed position within. In LISP, variables other than local variables are basically interpreted as global variables. Even if it is a local variable, it is possible to specify a special variable that refers to the value of a global variable by a special declaration.Since this is not the essence of the invention, the explanation will be omitted.

該抽出の変数名を、構文によって決められた位置のロー
カル変数と、ローカル変数以外のグローバル変数に分類
した後、各文字列の表示属性を設定する。各文字列の文
字バッファ上での位置データと、色属性のペアのデータ
のリストは、22の表示属性管理部に送られる。本実施
例では、ローカル変数を黄色、グローバル変数を赤とし
た。第4図に該表示例を示す。
After classifying the extracted variable names into local variables whose positions are determined by the syntax and global variables other than local variables, display attributes of each character string are set. The position data of each character string on the character buffer and the list of color attribute pair data are sent to the display attribute management section 22. In this embodiment, local variables are yellow and global variables are red. FIG. 4 shows an example of this display.

本実施例により、ローカル変数の初期設定の忘れ、類似
変数が異なる表示色となることによるミス・スペルの発
見、グローバル変数の確認と注意の喚気によりエラーの
防止に効果がある。プログラム中の所定の範囲(ブロッ
ク)の中でのみ使用の変数が、グローバル変数になって
いたり、初期設定のみ行い、1度も参照・更新されない
変数が目視チェックでき、文法上エラーチェックできな
い、変数の好ましくない使い方を発見できる効果がある
This embodiment is effective in preventing errors by forgetting to initialize local variables, discovering misspellings due to similar variables being displayed in different colors, and by checking and alerting global variables. Variables that are used only within a specified range (block) in a program are global variables, variables that are only initialized and are never referenced or updated can be visually checked, and variables that cannot be checked for errors due to syntax. This has the effect of discovering undesirable uses of .

また指定の変数名のみを分類識別表示することも可能で
、当該プログラム中での該変数の参照・更新場所のすべ
てを確認することが容易となる。
It is also possible to classify and identify only the specified variable name, making it easy to check all the locations where the variable is referenced and updated in the program.

また、変数ごとにデータ型宣言の必要なC言語やP a
scal言語においては、データ型による変数の分類識
別表示を行うことができる。16の手段においてローカ
ル変数のデータ型は、ローカルな型宣言文の抽出により
、グローバル変数のデータ型は、15の記号名管理テー
ブルの種別欄を参照することにより種別を判定・分類す
る。
In addition, C language and Pa
In the Scal language, variables can be classified and identified by data type. In the means of item 16, the data type of the local variable is determined and classified by extracting a local type declaration statement, and the data type of the global variable is determined and classified by referring to the type column of the symbol name management table of item 15.

本実施例により入力プログラム中のデータ型の不正な使
用に早期に気づく効果がある。
This embodiment has the effect of detecting illegal use of data types in input programs at an early stage.

第3の実施例は、プログラム中の条件判定構文を抽出し
1条件判定部文の条件判定部と条件未成立時実行部(t
henパート)、条件未成立時実行部(else)を識
別表示する手段である。
The third embodiment extracts the condition judgment syntax in the program and creates the condition judgment part of one condition judgment part statement and the execution part when the condition is not satisfied (t
hen part) and the execution part when the condition is not satisfied (else).

第1図17が条件構文抽出・要素分類手段である。FIG. 17 shows the conditional syntax extraction/element classification means.

17は、前記12の文字列バッファのプログラムを入力
し、該入力文字列中から、LISPの場合は、IF文と
C0ND文を抽出する。1構文の範囲のは、対応する左
右の括弧の範囲である。
17 inputs the program for the character string buffer described in 12 above, and extracts an IF statement and a C0ND statement from the input character string in the case of LISP. The range of one syntax is the range of the corresponding left and right parentheses.

次に条件構文中の要素の分類には、各構文の形式を記述
した構文テーブル18を参照する。第5図に該構文テー
ブルの内容を示す。該テーブルに、IF文とC0ND文
の各引数のデータ型と引数の意味が記されている。IF
文の場合、引数の個数は2または3で第3引数は省略し
てもよい、各引数は、リスト(要素の並び)かアトム(
1要素)であり、第1引数部が条件判定部、第2引数が
、条件未成立時実行部、第3引数が条件未成立時実行部
であると判定する。
Next, to classify the elements in the conditional syntax, reference is made to the syntax table 18 that describes the format of each syntax. FIG. 5 shows the contents of the syntax table. The table describes the data type and meaning of each argument of the IF statement and C0ND statement. IF
In the case of a statement, the number of arguments is 2 or 3, and the third argument may be omitted. Each argument must be a list (a sequence of elements) or an atom (
1 element), the first argument part is the condition determination part, the second argument is the execution part when the condition is not met, and the third argument is the execution part when the condition is not met.

C0ND文の場合は、引数が1個以上のリストから構成
され、各引数のリストの先頭要素(リストまたはアトム
)が条件判定部、各引数の第2要素以降が条件未成立時
実行部である。C0ND文は、各種条件を並べ、各条件
を満足したとき、その後30式を実行する構文である。
In the case of a C0ND statement, the argument consists of a list of one or more, the first element (list or atom) of each argument list is the condition judgment part, and the second and subsequent elements of each argument are the execution part if the condition is not met. . The C0ND statement is a syntax that arranges various conditions and then executes 30 expressions when each condition is satisfied.

第5図の引数の番号、引数のデータ型の欄に記述した[
 ]は、省略可、()はO個以上複数指定可の意味であ
る。
In Figure 5, the argument number and argument data type are [
] can be omitted, and () means that O or more can be specified.

前記のごとく、構文テーブルに記載された構文の形式に
従って、該抽出の条件構文のリストをたどることにより
゛、構文の要素は、所定の属性に分類される。なお、構
文テーブルの内容は、該分類手段のプログラムの中に組
込んでしまってもよい。
As described above, by following the list of extraction conditional syntaxes according to the syntax format described in the syntax table, syntax elements are classified into predetermined attributes. Note that the contents of the syntax table may be incorporated into the program of the classification means.

前実施例と同様、構文の各要素に対応する文字列の文字
列バッファ上での位置データと色属性のペアのデータの
リストを22の表示属性管理部に送る。第6図に、IF
文とC0ND文の属性表示例を示す0条件の構文(IF
  ・・・)を自条件判定部を赤、条件未成立時実行部
を黄、条件で不成立時実行部を空色とした。第6図は1
プログラム全体を属性表示対象としており、多重のIF
文の例も表示している。多重IF文は、外側のIF文に
ついて色分けする。属性表示範囲は文字カーソル位置に
よって認定可能であり、内側のIF文を色分けするには
、文字カーソルを内側のIF文の括弧の上に移動したの
ち、条件判定構文の色分は表示を起動することにより可
能である。なお文字カーソルの位置は22の表示属性管
理部で管理している。
As in the previous embodiment, a list of pair data of the position data on the character string buffer of the character string corresponding to each element of the syntax and the color attribute is sent to the display attribute management section 22. In Figure 6, IF
Syntax of 0 condition (IF
), the self-condition judgment part is colored red, the execution part when the condition is not met is colored yellow, and the execution part when the condition is not met is colored sky blue. Figure 6 is 1
The entire program is targeted for attribute display, and multiple IF
Example sentences are also shown. Multiple IF statements are color-coded for outer IF statements. The attribute display range can be determined by the position of the character cursor. To color code the inner IF statement, move the character cursor over the parentheses of the inner IF statement, and then start displaying the color of the conditional judgment syntax. This is possible. Note that the position of the character cursor is managed by the display attribute management section 22.

特に多重の分岐構文は、本発明の色分は表示により、分
岐の流れが明確になる。
Particularly in the case of multiple branching syntax, the color-separated display of the present invention clarifies the flow of branching.

第4の実施例は、プログラム中のくり返し構文を抽出し
、くり返し構文の変数初期設定部と終了判定部と実行部
の式を識別表示する手段である。
The fourth embodiment is a means for extracting repetitive syntax in a program and identifying and displaying expressions in a variable initialization section, end determination section, and execution section of the repetitive syntax.

第1図19がくり返し構文抽出・要素分類手段であり、
12の文字列バッファの文字列から00文を抽出する。
FIG. 19 shows the repeated syntax extraction/element classification means,
Extract the 00 sentence from the string in the 12 string buffer.

関数名の抽出と同様の手順で、関数名としてDoの構文
(リスト)を抽出する1次に00文の要素を分類する。
Using the same procedure as for extracting function names, the elements of the 00 sentence are classified in the first order to extract the syntax (list) of Do as a function name.

00文は、第5図の構文テーブルに記載されているよう
に、3個以上のリストを引数にとる形式であり、抽出し
た00文の第1引数のリストを変数初期設定部、第2引
数のリストを終了判定部、第3引数以降のすべてのリス
トを実行部と判定する。
As shown in the syntax table in Figure 5, the 00 statement takes a list of three or more arguments, and the first argument list of the extracted 00 statement is used as the variable initialization section and the second argument The list is determined to be the end determination part, and all the lists after the third argument are determined to be the execution part.

色属性設定の手順は前実施例と同様である。第7図に0
0文の属性表示例を示す、くり返し構文(Do・・・)
を白、初期設定部を空色、終了判定部を赤、実行部を黄
色とした0本表示例では、実行部の中にさらにDo構文
が含まれているが、最も外側の00文に対して色分けし
ている。内側の00文を色分けするには、第3の実施例
と同様、文字カーソル位置によって属性表示範囲を変更
することによって可能である。
The procedure for setting color attributes is the same as in the previous embodiment. 0 in Figure 7
Repetition syntax (Do...) showing an example of attribute display for 0 sentences
In the 0 line display example where 0 is white, the initial setting part is sky blue, the end judgment part is red, and the execution part is yellow, the execution part further contains a Do syntax, but for the outermost 00 statement It is color coded. The inner 00 sentence can be color-coded by changing the attribute display range depending on the character cursor position, as in the third embodiment.

LISPの場合、D○構文は、括弧が複雑に並ぶので、
くり返し構造の確認支援に本実施例は役立つ。
In the case of LISP, the D○ syntax has a complicated array of parentheses, so
This embodiment is useful for supporting confirmation of repeated structures.

なお、第3.第4の発明の実施例で、第1図17.19
で構文を抽出した時点で該抽出の構文の引数の数とデー
タ型が第5図記載の構文テーブルの内容と一致とないと
きは、構文の要素の分類は行わず、当該構文全体を赤色
輝度反転表示し、エラーメツセージを表示する。
In addition, 3rd. In the embodiment of the fourth invention, FIG. 17.19
When a syntax is extracted, if the number of arguments and data types of the extracted syntax do not match the contents of the syntax table shown in Figure 5, the elements of the syntax are not classified and the entire syntax is highlighted in red. Highlight it and display an error message.

第5の実施例は、入力したプログラム中に存在する多重
のブロックからなる構文を、ブロックの深さレベルごと
にブロック内の文字列を異なる表示属性で表示する手段
である。
The fifth embodiment is a means for displaying a syntax consisting of multiple blocks existing in an input program with different display attributes for character strings in the blocks for each block depth level.

第1図20がブロック構文抽出・要素分類手段である。FIG. 120 shows block syntax extraction/element classification means.

12の文字列バッファの文字列から、LIspのブロッ
ク構文PROG、LET、Do文を抽出する。抽出の手
順は、関数名の抽出と同様で、関数名としてPROG、
LET、Doのリストを抽出する。各ブロック構文の文
字列バッファ上での先頭位置と終了位置のリストをマー
ジ・ソートすることにより、各ブロックレベルの範囲が
求められる。第8図は、ブロックレベルの表示例で、各
ブロックレベルの範囲を深さレベルによって、赤、黄、
青、独、紫、白に色分けする。なお、ブロックレベルの
表示対象範囲を文字カーソル位置によって変更可能なも
のは、前発明と同じである。
LIsp block syntax PROG, LET, and Do statements are extracted from the character strings in the 12 character string buffers. The extraction procedure is the same as the function name extraction, and the function name is PROG,
Extract the list of LET and Do. The range of each block level is determined by merging and sorting the list of the start position and end position of each block syntax on the character string buffer. Figure 8 shows an example of block level display, where the range of each block level is displayed in red, yellow,
Color-coded into blue, German, purple, and white. Note that, as in the previous invention, the display target range at the block level can be changed by the character cursor position.

本実施例のブロック・レベルによる色分けにより、プロ
グラム・ブロックの制御範囲ローカル変数の有効範囲が
目視チェックできる利点がある。
The color coding according to the block level of this embodiment has the advantage that the effective range of control range local variables of program blocks can be visually checked.

第6の実施例は、LISPのような本構造を有するプロ
グラムの本構造の深さレベルを、プログラム中の文字列
の色分けによって表示する手段である。
The sixth embodiment is a means for displaying the depth level of the main structure of a program having a main structure such as LISP by color-coding the character strings in the program.

第1図21は本構造深さレベル判定手段である。FIG. 121 shows this structure depth level determining means.

LISI’は、左指の括弧によって、本構造の境界を表
現している言語である。21は、12の文字列バッファ
の文字を入力として、先頭から左右の括弧をサーチしな
がら、左括弧は+1.右括弧は−1にカウントし、各文
字列の深さレベルが求める。左右の各括弧位置ごとの、
その時点の深さレベルに対応する色属性を出力して、2
2の表示属性管理部に転送する。第9図は、本構造の深
さレベルによる色分は表示例である。レベルごとの色の
対応、色分は表示対象範囲の変更は、前実施例と同様で
ある。
LISI' is a language in which the boundaries of book structures are expressed by left-finger brackets. 21 inputs the characters in the character string buffer 12, searches the left and right parentheses from the beginning, and searches the left parenthesis +1. The right parenthesis is counted as -1, and the depth level of each character string is determined. For each left and right parenthesis position,
Output the color attribute corresponding to the depth level at that point, and
The data is transferred to the display attribute management section No. 2. FIG. 9 is a display example of the color divisions according to the depth levels of this structure. The correspondence of colors for each level and the changes in the display target range for each color are the same as in the previous embodiment.

本実施例により構文の深さレベルが確認でき、括弧入力
のミスによる本構造の乱れを一覧できる利点がある。
This embodiment has the advantage that it is possible to check the depth level of the syntax and to see any disturbances in the structure due to parenthesis input errors.

第7の実施例は、第6の実施例と目的と手段がほとんど
同じであり、表示の色分けにおいて、本構造の境界の括
弧のみを色分は表示する0色属性の出力において、括弧
以外の文字列部分を元の色に設定する処理のみが追加さ
れる0本実施例の表示例は第10図に示す、括弧の対応
に注目したときに有効である。第6および第7の実施例
は、従来、括弧対応を1つずつくり返していたのに比較
し、プログラムの指定範囲に対して1度に目視チェック
できるので、チェックの能率が向上する。
The seventh embodiment has almost the same purpose and means as the sixth embodiment, and in the display color coding, only the parentheses at the boundaries of this structure are displayed. The display example of this embodiment, in which only the process of setting the character string part to the original color is added, is effective when paying attention to the correspondence between the parentheses shown in FIG. In the sixth and seventh embodiments, the efficiency of checking is improved because the designated range of the program can be visually checked at one time, compared to the conventional method of repeating parenthesis correspondence one by one.

なお、第10図において、最も内側の括弧の対応は、色
分は表示していない。通常距離のはなれた括弧の対応を
調べたいわけで、多色による障害を軽減している。
Note that in FIG. 10, the correspondence between the innermost parentheses does not indicate the color. Since we want to check the correspondence between parentheses that are usually far apart, we are trying to reduce the problems caused by multiple colors.

第1乃至第7の実施例手段14,16,17゜19.2
0.21は、キーボードからのコマンドにより選択して
実行するようになっている。なお第1乃至第7の手段に
よる識別表示は色属性の違いにより実現したが、モノク
ロ表示装置においては、文字の背景の図柄を変更するな
どの手段が採られる。第1図22は、第1図14.16
.17゜19.20.21から出力される文字列バッフ
ァ上の位置と表示属性のペアのデータを受領して、文字
バッファの文字が、該指定の表示属性で表示させるよう
に13の表示出力手段を制御する。
First to seventh embodiment means 14, 16, 17°19.2
0.21 is designed to be selected and executed by a command from the keyboard. Note that the identification display by the first to seventh means was realized by different color attributes, but in a monochrome display device, means such as changing the background pattern of the characters are adopted. Figure 1 22 is Figure 1 14.16
.. 17. 19.20.13 receives the pair data of the position on the character string buffer and the display attribute outputted from 21, and displays the character in the character buffer with the specified display attribute. control.

[発明の効果コ 本発明の関数名や変数名の識別表示手段によれば、プロ
グラマの不注意や記憶違いによるミス・スペルの入力を
発見できる場合が多い、従来これらの間違いはプログラ
ムをコンパイルしたり、実行して初めて検出されるが、
本発明により、プログラムの入力編集時に早期発1.で
きれば、プログラムの生産性を大幅に向上できる。
[Effects of the Invention] According to the means for identifying and displaying function names and variable names of the present invention, it is often possible to detect misspellings and spellings caused by the programmer's carelessness or misunderstanding. It is detected only after running or
According to the present invention, early release 1. If possible, you can greatly improve the productivity of your program.

本発明の構文の属性表示手段や本構造表示手段によれば
、構文の構成が複雑なプログラムに対して、構造の確認
作業を文種してくれる。従来、プログラムの構造が間違
っていたために予期せぬ実行結果になり、その間違いに
気づくのに案外時間を浪費していることがよくある。入
力したプログラムが自分の意図した構造とマツチしてい
るか否かを早期に確認できる効果は大きい。さらに他人
の作成したプログラムの理解や再利用時にも、プログラ
ムの構文の属性表示や、構造の表示は大いに役立つ。
According to the syntax attribute display means and the present structure display means of the present invention, it is possible to check the structure of a program with a complicated syntax structure. In the past, errors in the structure of a program often resulted in unexpected execution results, and it often took an unexpected amount of time to realize the error. The effect of being able to quickly check whether the input program matches the structure you intended is great. Furthermore, when understanding and reusing programs created by others, displaying program syntax attributes and structure is extremely useful.

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

第1図は、本発明の入力編集装置の全体構成図。 第2図は記号名管理テーブル、第3図は関数各種別表示
例、第4図は変数各種別表示例、第5図は構文テーブル
、第6図は条件構文属性表示例、第7図はくり返し構文
属性表示例、第8図はブロック構文レベル表示例、第9
図は、本構造深さレベ閃 ル表示例、第10項は本構造境界深さレベル表示例、を
それぞれ示す。 14・・・関数名抽出・種別分類手段、16・・・変数
名抽出・種別分類手段、17・・・条件構文抽出・要素
分類手段、19・・・くり返し構文抽出・要素分類手段
、20・・・ブロック構文抽出・要素分類手段、21・
・・本構造深さレベル判定手段。 第2園 第3目 第4図 第2図 第夕図 第7凹 第3@ 第ゾテ 第70図
FIG. 1 is an overall configuration diagram of an input editing device according to the present invention. Figure 2 is a symbolic name management table, Figure 3 is an example of displaying each type of function, Figure 4 is an example of displaying each type of variable, Figure 5 is a syntax table, Figure 6 is an example of conditional syntax attribute display, and Figure 7 is Example of repeated syntax attribute display, Figure 8 is an example of block syntax level display, Figure 9
The figure shows an example of displaying the depth level of the main structure, and item 10 shows an example of displaying the depth level of the boundary of the main structure. 14... Function name extraction/type classification means, 16... Variable name extraction/type classification means, 17... Conditional syntax extraction/element classification means, 19... Repetitive syntax extraction/element classification means, 20.・Block syntax extraction/element classification means, 21・
...Means for determining the depth level of this structure. 2nd Garden, 3rd Eye, 4th Figure 2, Evening Figure, 7th Concave, 3rd @ Zote, Figure 70

Claims (1)

【特許請求の範囲】 1、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 入力したプログラム中に存在する関数名を抽出し、該抽
出の関数名を処理系で提供された組込み関数名、コンパ
イル済みのユーザ定義関数名、コンパイルされていない
ユーザ定義関数名、未定義の関数名の分類識別表示する
手段を付加したことを特徴とするプログラム属性表示機
能付き入力編集装置。 2、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 入力したプログラム中に存在する変数名を抽出し、該抽
出の変数名を、関数間にまたがって有効なグローバルな
変数と、プログラムの特定の範囲のみで有効なローカル
な変数に分割識別表示する手段および変数のデータ型に
よって変数を分類識別表示する手段を付加したことを特
徴とするプログラム属性表示記能付き入力編集装置。 3、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 入力したプログラム中に存在する条件判定構文を抽出し
、該抽出の条件判定構文の条件判定部と条件成立時実行
部と条件未成立時実行部を、識別表示する手段を付加し
たことを特徴とするプログラム属性表示機能付き入力編
集装置。 4、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 入力したプログラム中に存在するくり返し構文を抽出し
、該抽出のくり返し構文の変数初期設定部と終了判定部
と実行部の式を、識別表示する手段を付加したことを特
徴とするプログラム属性表示機能付き入力編集装置。 5、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 入力したプログラム中に存在する多重のブロックからな
る構文を抽出し、 前記抽出の多重ブロックの深さレベルごとにブロック内
の文字列を異なる表示属性で表示する手段を付加したこ
とを特徴とするプログラム属性表示機能付き入力編集装
置。 6、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 本構造を有するプログラムに対して、本構造の深さレベ
ルごとに、プログラム中の文字列を異なる表示属性で表
示する手段を付加したことを特徴とするプログラム属性
表示機能付き入力編集装置。 7、入力したプログラムを画面上に表示して編集可能な
入力編集装置において、 本構造を有するプログラムに対して、本構造の開始と終
了の区切り記号を、本構造の深さレベルごとに異なる表
示属性で表示する手段を付加したことを特徴とするプロ
グラム属性表示機能付き入力編集装置。
[Claims] 1. In an input editing device capable of displaying and editing an input program on a screen, a function name existing in the input program is extracted, and the extracted function name is provided by a processing system. 1. An input editing device with a program attribute display function, characterized in that the input editing device has a means for classifying and displaying the names of built-in functions, compiled user-defined function names, uncompiled user-defined function names, and undefined function names. 2. In an input editing device that can display and edit the input program on the screen, extract the variable names that exist in the input program, and convert the extracted variable names into global variables that are valid across functions. An input editing device with a program attribute display function, further comprising a means for dividing and displaying local variables that are valid only within a specific range of a program, and a means for classifying and displaying variables according to their data types. . 3. In an input editing device that can display and edit the input program on the screen, extract the condition judgment syntax that exists in the input program, and execute the condition judgment part and the execution part when the condition is met of the extracted condition judgment syntax. 1. An input editing device with a program attribute display function, further comprising a means for identifying and displaying a section to be executed when a condition is not met. 4. In an input editing device that can display and edit the input program on the screen, extract the repetition syntax that exists in the input program, and execute the variable initialization part, end determination part, and execution part of the extracted repetition syntax. An input editing device with a program attribute display function, characterized in that a means for identifying and displaying the formula is added. 5. In an input editing device that can display and edit the input program on the screen, extract the syntax consisting of multiple blocks existing in the input program, and extract the syntax within the block for each depth level of the extracted multiple blocks. 1. An input editing device with a program attribute display function, characterized in that a means for displaying a character string with a different display attribute is added. 6. In an input editing device that can display and edit an input program on the screen, for a program having this structure, display character strings in the program with different display attributes for each depth level of this structure. An input editing device with a program attribute display function, characterized in that a means is added. 7. In an input editing device that can display and edit an input program on the screen, for a program having this structure, the delimiter at the start and end of this structure is displayed differently depending on the depth level of this structure. An input editing device with a program attribute display function, characterized in that a means for displaying attributes is added.
JP12379687A 1987-05-22 1987-05-22 Input editing device equipped with program attribute display function Pending JPS63289636A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12379687A JPS63289636A (en) 1987-05-22 1987-05-22 Input editing device equipped with program attribute display function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12379687A JPS63289636A (en) 1987-05-22 1987-05-22 Input editing device equipped with program attribute display function

Publications (1)

Publication Number Publication Date
JPS63289636A true JPS63289636A (en) 1988-11-28

Family

ID=14869521

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12379687A Pending JPS63289636A (en) 1987-05-22 1987-05-22 Input editing device equipped with program attribute display function

Country Status (1)

Country Link
JP (1) JPS63289636A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03127226A (en) * 1989-10-13 1991-05-30 Fuji Xerox Co Ltd Display/print system for program

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5945549A (en) * 1982-09-07 1984-03-14 Toshiba Corp Device for displaying program
JPS59180738A (en) * 1983-03-31 1984-10-13 Fuji Electric Co Ltd Character display device
JPS6219939A (en) * 1985-07-19 1987-01-28 Hitachi Ltd Method for displaying tree structure

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5945549A (en) * 1982-09-07 1984-03-14 Toshiba Corp Device for displaying program
JPS59180738A (en) * 1983-03-31 1984-10-13 Fuji Electric Co Ltd Character display device
JPS6219939A (en) * 1985-07-19 1987-01-28 Hitachi Ltd Method for displaying tree structure

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03127226A (en) * 1989-10-13 1991-05-30 Fuji Xerox Co Ltd Display/print system for program

Similar Documents

Publication Publication Date Title
Lesk et al. Lex: A lexical analyzer generator
US6311323B1 (en) Computer programming language statement building and information tool
US7747588B2 (en) Extensible XML format and object model for localization data
US20070260584A1 (en) System for processing formatted data
US20110271179A1 (en) Methods and systems for graphically visualizing text documents
Semura et al. Ccfindersw: Clone detection tool with flexible multilingual tokenization
KR102014266B1 (en) Apparatus and method for detecting security weakness of program source code
US7921138B2 (en) Comment processing
US8701086B2 (en) Simplifying analysis of software code used in software systems
US9495638B2 (en) Scalable, rule-based processing
Horák et al. New features of wordnet editor VisDic
US4965765A (en) Distinguishing nested structures by color
US20020129066A1 (en) Computer implemented method for reformatting logically complex clauses in an electronic text-based document
CN110989991A (en) Method and system for detecting source code clone open source software in application program
JPS63289636A (en) Input editing device equipped with program attribute display function
Hunt et al. Regular expressions in python
JPH08194611A (en) Device for analyzing rang of influence caused by program correction
JP2002288004A (en) Program source processing device and method, and program source processing program
JP4953896B2 (en) Program review support device
Hunt Regular Expressions in Python
JP3414319B2 (en) Data retrieval apparatus, method and recording medium
JPH1011438A (en) Word checker
Etheredge JavaScript: Optimizing Native JavaScript: Designing, Programming, and Debugging Native JavaScript Applications
JPH04230532A (en) Method for controlling transaltion from source language of information on display screen to object language
JP2002082804A (en) Editor dynamically utilizing identifier information