JPH01158530A - Indent realizing system - Google Patents

Indent realizing system

Info

Publication number
JPH01158530A
JPH01158530A JP31801987A JP31801987A JPH01158530A JP H01158530 A JPH01158530 A JP H01158530A JP 31801987 A JP31801987 A JP 31801987A JP 31801987 A JP31801987 A JP 31801987A JP H01158530 A JPH01158530 A JP H01158530A
Authority
JP
Japan
Prior art keywords
line
parentheses
peak position
determined
indent
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.)
Granted
Application number
JP31801987A
Other languages
Japanese (ja)
Other versions
JPH07101384B2 (en
Inventor
Yuko Aki
祐子 安藝
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP31801987A priority Critical patent/JPH07101384B2/en
Publication of JPH01158530A publication Critical patent/JPH01158530A/en
Publication of JPH07101384B2 publication Critical patent/JPH07101384B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

PURPOSE:To rapidly determine an indent position and to automatically describe a source program, etc., from the rearrangement or an indent position by referring to the parentheses of a preceding line, determining the peak position of the instructed line, inputting successively from the rearrangement or the peak position and displaying the position. CONSTITUTION:When a cursor is placed at a certain line on a picture 2 and the instruction is given to a peak position determining part 1, the peak position of the instructed line is determined corresponding to the depth level while the parentheses of the preceding line is referred to. The character and symbol are rearranged from the determined peak position and the displayed or inputted character and symbol are successively arranged and displayed. Thus, when the indent is instructed, the parentheses of the preceding line is referred to, the peak position is rapidly determined, the input and displaying can be successively executed from the rearrangement or the peak position and the peak position of the next line can be rapidly determined.

Description

【発明の詳細な説明】 〔概要〕 画面に表示される文字・記号の字下げを行うインデント
実現方式に関し、 前行の括弧を参照して次行の先頭位置を迅速に決定する
ことを目的とし、 括弧に注目し、指示された行の先頭位置を、前行に記述
されている括弧に基づいて決定する先頭位置決定部を備
え、この先頭位置決定部によって決定された先頭位置か
ら文字・記号列を入力あるいは配列するように構成する
[Detailed Description of the Invention] [Summary] Regarding an indentation realization method for indenting characters and symbols displayed on the screen, the present invention aims to quickly determine the starting position of the next line by referring to the parentheses of the previous line. , is equipped with a start position determination unit that pays attention to the parentheses and determines the start position of the specified line based on the parentheses written in the previous line, and starts from the start position determined by this start position determination unit. Configure columns to input or arrange.

(産業上の利用分野〕 本発明は、画面に表示される文字・記号の字下げを行う
インデント実現方式に関するものである。
(Industrial Application Field) The present invention relates to an indent realization method for indenting characters and symbols displayed on a screen.

〔従来の技術と発明が解決しようとする問題点〕リスト
処理用プログラミング言語(LISP等)のソースプロ
グラムは、非常に多くの括弧“ じおよび“) ”から
成り、読み易いプログラムに編集するために、意味のあ
るインデント(字下げ)をしながら記述することが望ま
しい。
[Problems to be solved by the prior art and the invention] A source program for a list processing programming language (such as LISP) consists of a large number of parentheses, and in order to edit it into an easy-to-read program. It is desirable to write with a meaningful indentation.

リストは右括弧“ (”および左括弧“)”の−対によ
って構成されている。これらの括弧は弐の初めから見て
現れた“ げに対応する“)”が現れる前に再び“ じ
が現れると、リストが構造的に一段深くなり (レベル
が下がり)、一方、対応する′)′が現れると元の深さ
に戻るという意味を持っている。このことに注目して、
ソースプログラム上で見易くするには、リスト構造の深
さに対応するインデントをすることで実現できる。つま
り、弐が数行におよぶ場合に、同じ深さのリストは、同
じ位置にインデントされて表示されることが望ましい。
The list is constructed by a -pair of right parentheses "(" and left parentheses ")". These parentheses mean that if "ji" appears again before the ")" that corresponds to the ")" that appears from the beginning of the ``2'' appears, the list becomes structurally one step deeper (lower level), while the corresponding ``)'' appears. When ′ appears, it means returning to the original depth. Paying attention to this,
To make it easier to read in the source program, you can indent it according to the depth of the list structure. In other words, when 2 extends over several lines, it is desirable that lists of the same depth be displayed indented at the same position.

□    しかし、従来は、この深さに対応した位置か
ら表示(記述)させるために、式の初めからすべての括
弧を探して対応する括弧を見つけ出し、インデントを決
定するようにしていたので、迅速に決定し得ないという
問題点があった。
□ However, in the past, in order to display (describe) from a position corresponding to this depth, all parentheses were searched from the beginning of the expression to find the corresponding parentheses, and the indentation was determined. The problem was that it could not be determined.

本発明は、前行の括弧を参照して次行の先頭位置を迅速
に決定することを目的としている。
An object of the present invention is to quickly determine the starting position of the next line by referring to the parentheses of the previous line.

〔問題点を解決するための手段〕[Means for solving problems]

第1図を参照して問題点を解決するための手段を説明す
る。
Means for solving the problem will be explained with reference to FIG.

第1図において、先頭位置決定部1は、括弧に注目して
、指示された行の先頭位置を、前行の括弧を参照して決
定するものである。
In FIG. 1, the head position determination unit 1 pays attention to the parentheses and determines the head position of the designated line by referring to the parentheses of the previous line.

画面(画面バッファ)2は、リスト処理プログラム言語
を用いて記述したソースプログラムを表示(格納)する
ものである。
The screen (screen buffer) 2 displays (stores) a source program written using a list processing program language.

〔作用〕[Effect]

本発明は、図に示すように、画面2上のある行にカーソ
ルを置き、先頭位置決定部1に指示を与えると、この指
示された行の先頭位置を、前行の括弧を参照して深さレ
ベルに対応して決定し、この決定した先頭位置から文字
・記号を再配置して表示あるいは入力された文字・記号
を順次配列して表示するようにしている。
As shown in the figure, when the cursor is placed on a certain line on the screen 2 and an instruction is given to the start position determination unit 1, the start position of the specified line is determined by referring to the parentheses of the previous line. This is determined in accordance with the depth level, and the characters and symbols are rearranged and displayed from the determined top position, or the input characters and symbols are sequentially arranged and displayed.

従って、インデントが指示された場合に、前行の括弧を
参照して先頭位置を迅速に決定して再配列あるいは先頭
位置から順次入力して表示させることが可能となる。
Therefore, when indentation is instructed, it is possible to quickly determine the starting position by referring to the parentheses in the previous line, and then rearrange the data or input and display sequentially from the starting position.

〔実施例〕〔Example〕

次に第1図および第2図を用いて本発明の1実施例の構
成および動作を順次詳細に説明する。
Next, the configuration and operation of one embodiment of the present invention will be explained in detail using FIGS. 1 and 2.

第1図において、メモリ3は、画面2上に括弧の深さレ
ベルに対応づけてインデントして記述したソースプログ
ラムおよび先頭位置情報を格納したものである。図中“
l”は改行記号を表す。図中tab’は先頭位置決定部
lによって決定された位置までソースプログラムの先頭
位置を移動させる制御記号であり、かつ予め定めた所定
個の空白例えばここでは5個の空白骨だけ先頭位置を移
動させることを表している。2個のtab’は、10個
の空白に対応する。端数の空白は、図中 、”を用いて
表す。
In FIG. 1, a memory 3 stores a source program written on the screen 2 in an indented manner in correspondence with the depth level of the parentheses and start position information. In the figure “
l'' represents a line feed symbol. In the figure, tab' is a control symbol that moves the start position of the source program to the position determined by the start position determination unit l, and also a predetermined number of spaces, for example, 5 in this case. This indicates that the leading position is moved by the blank bone in . Two tab' corresponds to 10 blanks. Fractional blanks are represented using `` in the figure.

まず、括弧に注目し、指示された行の先頭位置を、前行
の括弧を参照して決定するルールを説明する。
First, we will focus on parentheses and explain the rules for determining the starting position of a designated line by referring to the parentheses in the previous line.

ルール1:指示された行の前行の後ろから探して最初に
現れる括弧が“ じの場合、その位置よりも一段下げた
位置(tab 1個文下げた位置)を、当該指示された
行のインデント位置と決定する。
Rule 1: If the first parenthesis that appears after the previous line of the specified line is ", then move the position one level lower than that position (tab one sentence lower) to the specified line. Determine the indent position.

ルール2:指示された行の前行の後ろから探して最初に
現れる括弧が“)”のとき、かつこの“)”に対応する
“ (”が見つかった場合、この見つかった“ じの位
置が当該指示された行のインデント位置と決定する。
Rule 2: If the first parenthesis that appears after the previous line of the specified line is ")", and if "(" corresponding to this ")" is found, the same position of the found " Determine the indentation position of the specified line.

ルール3:指示された行の前行の後ろから探して最初に
現れる括弧が“)”のとき、かつこの“)”に対応する
“ (′が見つからなかった場合、この見つからなかっ
た“)”の総数Nを求め、前行中で最後に見つけた″ 
(2の位置より、この総数骨だけ浅いレベルの位置が当
該指示された行のインデント位置と決定する。
Rule 3: When the first parenthesis that appears after the previous line of the specified line is ")", and the corresponding "(')" is not found, then this missing ")" is found. Find the total number N, and find the last one in the previous line.
(The position at a level shallower than the position of 2 by this total number of bones is determined to be the indentation position of the specified line.

次に、ソースプログラムが各行の例えば左端位置から記
述されており、これを画面2中に示すようにレベル深さ
に応じて先頭位置を決定して移動させる手順を詳細に説
明する。
Next, the source program is written starting from, for example, the left end position of each line, and the procedure for determining and moving the starting position according to the level depth as shown in screen 2 will be described in detail.

第2行目のいずれかの位置にカーソルを移動させた後、
tab“キーを押下して指示した場合、先頭位置決定部
lは、前行である第1行目の後から探して最初に図中■
の位置で“)”を見つけ、かつ図中■の位置で対応する
“ じを見つけたので、既述したルール2に合致し、こ
の■の位置■を当該指示された第2行目のインデント位
置と決定する。
After moving the cursor to any position on the second line,
When an instruction is given by pressing the "tab" key, the start position determination unit l searches from after the first line, which is the previous line, and first selects the position shown in the figure.
Since we found ")" at the position of , and found the corresponding " at the position of Determine the location.

第3行目のいずれかの位置にカーソルを移動させた後、
tab”キーを押下して指示した場合、先頭位置決定部
1は、前行である第2行目の後から探して最初に図中O
の位置で“) ”を見つけ、かつ図中■の位置で対応す
る1 じを見つけたので、既述したルール2に合致し、
このOの位置■を当該指示された第3行目のインデント
位置と決定する。
After moving the cursor to any position on the third line,
tab” key, the head position determination unit 1 searches from after the second line, which is the previous line, and first locates O in the figure.
Since we found ")" at the position of , and found the corresponding 1 at the position of ■ in the figure, it matches Rule 2 mentioned above,
The position of this O is determined to be the indentation position of the designated third line.

第4行目のいずれかの位置にカーソルを移動させた後、
tab”キーを押下して指示した場合、先頭位置決定部
1は、前行である第3行目の後から探して最初に図中[
F]の位置で“ (′を見つけたので、既述したルール
1に合致し、この[F]の位置よりも1段下げた位置■
を当該指示された第4行目のインデント位置と決定する
After moving the cursor to any position on the 4th line,
When an instruction is given by pressing the "tab" key, the head position determining unit 1 searches from after the third line, which is the previous line, and first selects [ in the figure.
Since we found "
is determined to be the indentation position of the specified fourth line.

第5行目のいずれかの位置にカーソルを移動させた後、
tab”キーを押下して指示した場合、先頭位置決定部
1は、前行である第4行目の後から探して最初に図中[
F]の位置で“)”を見つけたが、この“)”に対応す
る“ じがこの行で見つからないので、既述したルール
3に合致し、この見つからない“)2の総数Nを図中■
に示すように“2”として求め、第4行目のインデント
位置■よりも2段上がった位置■を当該指示された第5
行のインデント位置と決定する。
After moving the cursor to any position on the 5th line,
When an instruction is given by pressing the "tab" key, the start position determining unit 1 searches from after the fourth line, which is the previous line, and first selects [ in the figure.
F], but the corresponding ")" is not found in this line, so it matches Rule 3 mentioned above, and the total number N of missing ")2" is calculated in the figure. Middle■
As shown in , the indentation position is calculated as "2", and the position ■ that is two steps higher than the indentation position ■ of the fourth line is the specified fifth line.
Determine the line indentation position.

以上の手順によって、画面2中に記述したようい、イン
デント位置が次々決定されて表示される。
Through the above procedure, indent positions are determined and displayed one after another as described on screen 2.

尚、上述の説明は、全てのソースプログラムが記述され
ており、インデント位置のみを後程決定するとして説明
したが、ソースプログラムを順次記述しながらインデン
ト位置を決定するようにしてもよい。具体的に言えば、
第1行目に示すソースプロダムを記述した後、第2行目
に改行してtab”キーを押下して指示した場合、位置
■のインデント位置からキー入力したソースプログラム
が自動的に表示されるものである。
In the above explanation, all the source programs have been written and only the indentation position will be determined later, but the indentation position may be determined while sequentially writing the source programs. Specifically speaking,
After writing the source program shown on the first line, if you enter a new line on the second line and press the TAB key, the source program you entered will be automatically displayed from the indented position of position ■. It is something that

次に、画面2中に表示されたソースプログラムおよびイ
ンデント情報をメモリ3中に格納すると図示のようにな
る。
Next, when the source program and indentation information displayed on the screen 2 are stored in the memory 3, it becomes as shown in the figure.

簡単に説明すると、メモリ3中には、画面2中の第1行
目ないし第5行目に記述されているソースプログラムが
順次シリアルに格納されている。
Briefly, in the memory 3, source programs written in the first to fifth lines of the screen 2 are sequentially stored serially.

この際、各行の末尾には改行記号が挿入されると共に、
各行の先頭(第1行目を除く)には本発明に係わる先頭
位置制御記号tab”が少なくとも1つ挿入されている
。この先頭位置制御記号tab”は、既述したように、
先頭位置決定部lに対して先頭位置を決定させること、
およびその決定した先頭位置のためにいくつの空白を挿
入(ここでは1つのtab”が5個の空白の挿入)させ
たかの情報も備えている。このtab”が1個で挿入す
べき空白の個数に満たないときには、2個のtab″を
挿入、あるいは空白の個数が端数の場合には空白記号“
1°を必要な個数だけ挿入するようにして次に、第2図
を用いてリスト処理用のプログラム言語(LISPなど
)でソースプログラムを記述する場合の動作を節羊に説
明する。
At this time, a line feed symbol is inserted at the end of each line, and
At least one start position control symbol "tab" according to the present invention is inserted at the beginning of each line (excluding the first line).As described above, this start position control symbol "tab"
causing the head position determination unit l to determine the head position;
It also includes information on how many spaces are inserted for the determined start position (in this case, one tab" inserts five spaces). The number of spaces that should be inserted for one tab". If the number of blank spaces is a fraction, insert two tabs, or use a blank symbol " if the number of spaces is a fraction.
Next, using FIG. 2, we will briefly explain the operation when writing a source program in a list processing programming language (such as LISP).

第2図において、図中■は、行末を記述したことを示す
、これは、第1図面面(画面バッファ)2上の第1行目
の行末の図中■を用いて示す“)”を記述したことを表
す。
In Fig. 2, the symbol ■ in the diagram indicates that the end of the line has been written. Represents what has been written.

図中Oは、改行キーを押すことを示す。これは、図中◎
で行末を記述し、改行するために改行キーを押下したも
のである。これにより、カーソルが次の行の先頭に移動
する。
O in the figure indicates pressing the line feed key. This is in the diagram ◎
The end of the line is written with , and the line feed key is pressed to start a new line. This moves the cursor to the beginning of the next line.

図中◎は、タブキーを押すことを示す、これは、図中0
の改行キーの押下に対応して次の行の先頭に移動したカ
ーソルが、記述したルール1ないし4のいずれかに対応
した位置に移動、例えば第1図面面2上の第2行目の場
合には位置■の示す位置にカーソルが移動することを意
味している。このように、改行キーの押下、およびタブ
キーの押下によって、次の行の記述開始位置に自動的に
カ−ソルが移動され、図中■でこのカーソルの位置から
ソースプログラムの記述を行うことが可能となる。
◎ in the figure indicates pressing the tab key, which is 0 in the figure.
The cursor moved to the beginning of the next line in response to pressing the line feed key moves to a position corresponding to any of the rules 1 to 4 described, for example, in the case of the second line on the first drawing 2. means that the cursor moves to the position indicated by position ■. In this way, by pressing the line feed key or the tab key, the cursor is automatically moved to the writing start position on the next line, and the source program can be written from this cursor position as indicated by ■ in the figure. It becomes possible.

図中■は、終わりか否かを判別することを示す。In the figure, ■ indicates that it is determined whether or not it is the end.

YESの場合(終わりの場合)には、終了する。If YES (end), the process ends.

Noの場合には、図中■ないし[相]を繰り返し実行す
る。
In the case of No, steps from ■ to [phase] in the figure are repeatedly executed.

尚、第2図は、改行キーおよびタブキーを順次押下して
自動的に移動されたカーソルの位置からソースプログラ
ムなどを順次記述した場合について説明したが、これに
限られず、既に記述したソースプログラムに対して、あ
る行にカーソルを移動させて、タブキーを押下しても、
図中■で説明したと同様に、前行の括弧の状態などを見
て当該行の括弧の先頭位置が設定されるものである。
Although Fig. 2 describes the case where the source program, etc. is written sequentially from the position of the cursor that is automatically moved by pressing the line feed key and the tab key in sequence, this is not a limitation. On the other hand, even if you move the cursor to a certain line and press the tab key,
As explained in section 3 in the figure, the starting position of the parentheses in the current line is set by looking at the state of the parentheses in the previous line.

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

以上説明したように、本発明によれば、インデントが指
示された場合に、前行の括弧を参照して当該指示、され
た行の先頭位置を決定して再配列あるいは先頭位置から
順次入力して表示させる構成を採用しているため、迅速
にインデント位置を決定して再配列あるいはインデント
位置からソースプログラムなどをいわば自動的に記述す
ることができる。
As explained above, according to the present invention, when indentation is specified, the starting position of the instructed line is determined by referring to the parentheses of the previous line, and the arrangement is rearranged or input sequentially from the starting position. Since it is configured to display the indentation position, it is possible to quickly determine the indentation position and rearrange it, or to automatically write the source program from the indentation position.

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

第1図は本発明の1実施例構成図、第2図は本発明の動
作説明フローチャートを示す。 図中、1は先頭位置決定部、2はソースプログラムを表
示する画面(画面バッファ)、3はメモリを表す。
FIG. 1 is a block diagram of one embodiment of the present invention, and FIG. 2 is a flowchart for explaining the operation of the present invention. In the figure, 1 represents a head position determination unit, 2 represents a screen (screen buffer) for displaying a source program, and 3 represents a memory.

Claims (1)

【特許請求の範囲】  画面に表示される文字・記号の字下げを行うインデン
ト実現方式において、 括弧に注目し、指示された行の先頭位置を、前行に記述
されている括弧に基づいて決定する先頭位置決定部(1
)を備え、 この先頭位置決定部(1)によって決定された先頭位置
から文字・記号列を入力あるいは配列するように構成し
たことを特徴とするインデント実現方式。
[Claims] In an indent realization method for indenting characters and symbols displayed on a screen, the parentheses are noted and the starting position of the designated line is determined based on the parentheses written in the previous line. The head position determination unit (1
), and a character/symbol string is input or arranged from the start position determined by the start position determination unit (1).
JP31801987A 1987-12-15 1987-12-15 Indentation processing device Expired - Fee Related JPH07101384B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31801987A JPH07101384B2 (en) 1987-12-15 1987-12-15 Indentation processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31801987A JPH07101384B2 (en) 1987-12-15 1987-12-15 Indentation processing device

Publications (2)

Publication Number Publication Date
JPH01158530A true JPH01158530A (en) 1989-06-21
JPH07101384B2 JPH07101384B2 (en) 1995-11-01

Family

ID=18094585

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31801987A Expired - Fee Related JPH07101384B2 (en) 1987-12-15 1987-12-15 Indentation processing device

Country Status (1)

Country Link
JP (1) JPH07101384B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631606A (en) * 2020-12-31 2021-04-09 中国农业银行股份有限公司 Script formatting method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631606A (en) * 2020-12-31 2021-04-09 中国农业银行股份有限公司 Script formatting method and device

Also Published As

Publication number Publication date
JPH07101384B2 (en) 1995-11-01

Similar Documents

Publication Publication Date Title
JPH11219355A (en) Document coloring edition device
JPH01158530A (en) Indent realizing system
JP3064323B2 (en) Character string replacement device with attributes
JPH11250037A (en) Content editing device and recording medium
JP2618865B2 (en) Information processing device
JPH0128974B2 (en)
JP2001282791A (en) Machine translation device
JP3083665B2 (en) Sentence information processing equipment
JP2980056B2 (en) Questionnaire answer support device, questionnaire answer support method, and recording medium recording questionnaire answer support program
JP2021149274A (en) Program, terminal device, and method
JP2969920B2 (en) Document processing device
JP3129375B2 (en) Document processing device with space / tab conversion function
JP2922578B2 (en) Character processor
JP2749180B2 (en) How to erase characters
JPS6148064A (en) Word processor
JPH11296514A (en) Method and device for composing and storage medium where program for performing process thereof is recorded
JPH0320876A (en) Induction input system
JPS6278586A (en) Character processor
JPH02304671A (en) Document processor
JPH03142656A (en) Document processor
JPH01211169A (en) Japanese information processor
JPH07168833A (en) Area specifying device
JPS62229316A (en) Character processor
JPH10240727A (en) Document coloring edition method
JPH03141461A (en) Document processor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees