JP7306026B2 - Program for converting program, information processing apparatus, and information processing method - Google Patents

Program for converting program, information processing apparatus, and information processing method Download PDF

Info

Publication number
JP7306026B2
JP7306026B2 JP2019069742A JP2019069742A JP7306026B2 JP 7306026 B2 JP7306026 B2 JP 7306026B2 JP 2019069742 A JP2019069742 A JP 2019069742A JP 2019069742 A JP2019069742 A JP 2019069742A JP 7306026 B2 JP7306026 B2 JP 7306026B2
Authority
JP
Japan
Prior art keywords
program
lines
line
list
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.)
Active
Application number
JP2019069742A
Other languages
Japanese (ja)
Other versions
JP2020170221A (en
Inventor
利明 田中
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2019069742A priority Critical patent/JP7306026B2/en
Publication of JP2020170221A publication Critical patent/JP2020170221A/en
Application granted granted Critical
Publication of JP7306026B2 publication Critical patent/JP7306026B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、プログラムを変換するためのプログラム、情報処理装置、及び、情報処理方法に関する。 The present invention relates to a program for converting a program, an information processing apparatus, and an information processing method.

コンピュータプログラムの内容を他の形式に書き換えるシステムが知られている。例えば特許文献1には、あるプログラミング言語で作成されたプログラムの内容を、視覚的に理解しやすいブロックで表現された形式に変換するシステムが開示されている。 Systems are known for transcribing the contents of computer programs into other formats. For example, Patent Literature 1 discloses a system that converts the contents of a program created in a certain programming language into a format represented by visually easy-to-understand blocks.

特開2018-190400号公報Japanese Patent Application Laid-Open No. 2018-190400

プログラムの形式などを変換するときに、変換前後の対応関係が分かると便利である。 When converting program formats, it is convenient to know the correspondence before and after conversion.

本発明は、プログラムの変換において、変換前後の対応関係が分かるようにすることを目的とする。 SUMMARY OF THE INVENTION An object of the present invention is to make it possible to understand the correspondence before and after conversion in program conversion.

本発明の一態様によれば、プログラムは、第1プログラムを取得することと、前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、前記第1プログラムから取得した構文が前記変換した際に行数が増える構文の場合、前記行数が増える構文に基づいて増加する行数を取得し、前記行数が増加する構文が記述されている行番号を取得された行数分増加させて、前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する行番号を付することと、前記行番号が付された前記第1プログラムの第1プログラムリストと前記行番号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することとをコンピュータに実行させる。 According to one aspect of the present invention, a program is obtained by obtaining a first program, writing the first program in a programming language different from a programming language used for the first program, and and converting the syntax obtained from the first program into a second program that increases the number of lines when converted, the number of lines increases based on the syntax that increases the number of lines and incrementing the number of lines describing the syntax for which the number of lines increases by the number of lines obtained, and obtaining the lines functionally corresponding to each other in the first program and the second program. and displaying on a display device a first program list of the first program with the line numbers and a second program list of the second program with the line numbers . cause a computer to create data for

本発明によれば、プログラムの変換において、変換前後の対応関係が分かるようになる。 According to the present invention, in program conversion, the correspondence between before and after conversion can be known.

図1は、一実施形態に係るシステムの構成例の概略を示すブロック図である。FIG. 1 is a block diagram showing an outline of a configuration example of a system according to one embodiment. 図2Aは、一実施形態に係る電卓の構成例の概略を示すブロック図である。FIG. 2A is a block diagram showing an outline of a configuration example of a calculator according to one embodiment. 図2Bは、一実施形態に係るスマートフォンの構成例の概略を示すブロック図である。FIG. 2B is a block diagram illustrating an outline of a configuration example of a smartphone according to one embodiment; 図2Cは、一実施形態に係るサーバの構成例の概略を示すブロック図である。FIG. 2C is a block diagram illustrating an outline of a configuration example of a server according to one embodiment; 図3は、電卓の動作の一例の概略を示すフローチャートである。FIG. 3 is a flow chart outlining an example of the operation of the calculator. 図4は、スマートフォンの動作の一例の概略を示すフローチャートである。FIG. 4 is a flowchart outlining an example of the operation of the smartphone. 図5は、サーバの動作の一例の概略を示すフローチャートである。FIG. 5 is a flow chart outlining an example of the operation of the server. 図6は、サーバで行われる変換処理の一例の概略を示すフローチャートである。FIG. 6 is a flowchart showing an outline of an example of conversion processing performed by the server. 図7Aは、説明のための第1プログラムの一例を示す図である。FIG. 7A is a diagram showing an example of the first program for explanation. 図7Bは、説明のための第2プログラムの一例を示す図である。FIG. 7B is a diagram showing an example of the second program for explanation. 図8Aは、第1プログラムを実行した際の電卓による表示の一例を示す図である。FIG. 8A is a diagram showing an example of display by the calculator when the first program is executed. 図8Bは、第1プログラムを実行した際の電卓による表示の一例を示す図である。FIG. 8B is a diagram showing an example of display by the calculator when the first program is executed. 図9は、第1プログラムリストと第2プログラムリストとのスマートフォンによる表示の一例を示す図である。FIG. 9 is a diagram showing an example of display by a smartphone of a first program list and a second program list. 図10は、サーバで行われる選択処理の一例の概略を示すフローチャートである。FIG. 10 is a flowchart showing an outline of an example of selection processing performed by the server. 図11は、スマートフォンによる表示の一例を示す図であり、選択処理の結果を示す図である。FIG. 11 is a diagram showing an example of display by the smartphone, and is a diagram showing a result of selection processing. 図12は、サーバで行われる配置変更処理の一例の概略を示すフローチャートである。FIG. 12 is a flowchart showing an outline of an example of arrangement change processing performed by the server. 図13は、スマートフォンによる表示の一例を示す図であり、配置変更処理の結果を示す図である。FIG. 13 is a diagram showing an example of display by a smartphone, and is a diagram showing a result of layout change processing. 図14Aは、第2の実施形態に係るサーバで行われる変換処理の一例の概略を示すフローチャートである。FIG. 14A is a flowchart illustrating an outline of an example of conversion processing performed by a server according to the second embodiment; 図14Bは、第2の実施形態に係るサーバで行われる変換処理の一例の概略を示すフローチャートである。FIG. 14B is a flowchart illustrating an outline of an example of conversion processing performed by the server according to the second embodiment;

[第1の実施形態]
第1の実施形態について図面を参照して説明する。
[First embodiment]
A first embodiment will be described with reference to the drawings.

〈システム構成〉
本実施形態に係るシステム10の構成例の概略を図1に示す。システム10は、電卓(プログラム入力機器)100と、スマートフォン(通信機器)200と、サーバ(情報処理装置)300とを含む。スマートフォン200とサーバ300とは、例えばインターネットなどといったネットワーク400を介して接続されている。
<System configuration>
FIG. 1 shows an outline of a configuration example of a system 10 according to this embodiment. The system 10 includes a calculator (program input device) 100 , a smartphone (communication device) 200 and a server (information processing device) 300 . Smartphone 200 and server 300 are connected via a network 400 such as the Internet.

本実施形態に係る電卓100は、四則演算、各種関数演算などを行うことができる関数電卓である。さらに、電卓100は、プログラムを作成し、実行する機能を有する。 A calculator 100 according to the present embodiment is a functional calculator capable of performing four arithmetic operations, various functional operations, and the like. Further, the calculator 100 has the function of creating and executing programs.

スマートフォン200は、電卓100と連携して各種機能を発揮する。スマートフォン200は、電卓に入力された演算式、プログラム等に基づいて、様々な表示や演算を行う。電卓100で作成したプログラムは、スマートフォン200に送信され得る。スマートフォン200は、取得したプログラムをサーバ300に送信できる。 The smartphone 200 exhibits various functions in cooperation with the calculator 100 . The smartphone 200 performs various displays and calculations based on arithmetic expressions, programs, and the like input to the calculator. A program created by calculator 100 can be transmitted to smartphone 200 . Smartphone 200 can transmit the acquired program to server 300 .

サーバ300は、電卓100と関連するスマートフォン200の動作に関する各種演算を行う。例えば、本実施形態では、サーバ300は、スマートフォン200から取得した電卓100で作成されたプログラムを、他のプログラミング言語で作成されたプログラムに変換することができる。これに限らないが、サーバ300は、例えば関数電卓用のプログラムから例えばScratchといった教育現場で用いられているプログラムへとプログラムの変換を行う。サーバ300は、変換したプログラムをスマートフォン200に返信する。スマートフォン200は、サーバから取得した変換後のプログラムと、電卓100から取得した変換前のプログラムとを並べて表示することができる。本実施形態では、サーバ300は、変換前後のプログラムの対応関係を明確にするために、各々のプログラムに、互いに対応する行を示す符号を付す。 The server 300 performs various calculations related to the operation of the smart phone 200 related to the calculator 100 . For example, in this embodiment, the server 300 can convert a program created by the calculator 100 acquired from the smartphone 200 into a program created in another programming language. Although not limited to this, the server 300 converts a program, for example, from a scientific calculator program into a program such as Scratch, which is used in an educational setting. Server 300 returns the converted program to smartphone 200 . The smartphone 200 can display the converted program acquired from the server and the pre-converted program acquired from the calculator 100 side by side. In this embodiment, the server 300 assigns to each program a code indicating a line corresponding to each other in order to clarify the correspondence between the programs before and after conversion.

(電卓の構成)
電卓100は、図2Aに示すように、バスライン190を介して互いに接続されたCentral Processing Unit(CPU、プロセッサ)112と、Read Only Memory(ROM)114と、Random Access Memory(RAM)116と、フラッシュメモリ118と、2次元コードエンコーダ122と、入力キー132と、液晶ディスプレイ134とを備える。CPU112は、各種信号処理等を行う。ROM114は、各種プログラム等を記録している。RAM116は、CPU112の主記憶装置として機能する。フラッシュメモリ118は、ユーザが作成したプログラムなどを記憶することができる。2次元コードエンコーダ122は、例えばユーザが作成したプログラムの情報を表す2次元コードを作成する。作成された2次元コードは、液晶ディスプレイ134に表示される。入力キー132は、数字キー、演算キー、機能キーなど、複数のキーを含む。液晶ディスプレイ134は、ユーザによる入力結果や、演算結果を表示する。
(Calculator configuration)
Calculator 100, as shown in FIG. 2A, includes Central Processing Unit (CPU, processor) 112, Read Only Memory (ROM) 114, Random Access Memory (RAM) 116, and It has a flash memory 118 , a two-dimensional code encoder 122 , an input key 132 and a liquid crystal display 134 . The CPU 112 performs various signal processing and the like. The ROM 114 records various programs and the like. RAM 116 functions as a main storage device for CPU 112 . The flash memory 118 can store user-created programs and the like. The two-dimensional code encoder 122 creates, for example, a two-dimensional code representing information of a program created by a user. The created two-dimensional code is displayed on liquid crystal display 134 . Input keys 132 include a plurality of keys such as numeric keys, operation keys, and function keys. The liquid crystal display 134 displays user input results and calculation results.

(スマートフォンの構成)
スマートフォン200は、図2Bに示すように、バスライン290を介して互いに接続されたCPU(プロセッサ)212と、ROM214と、RAM216と、フラッシュメモリ218と、タッチパネル222と、液晶ディスプレイ224と、カメラ232と、通信装置234とを備える。CPU212は、各種信号処理等を行う。CPUと共に、Application Specific Integrated Circuit(ASIC)、Field Programmable Gate Array(FPGA)、又はGraphics Processing Unit(GPU)等の各種集積回路が用いられてもよい。ROM214は、起動プログラム等を記録している。RAM216は、CPU212の主記憶装置として機能する。フラッシュメモリ218には、CPU212で用いられるプログラム、パラメータ等各種情報が記録されている。また、フラッシュメモリ218には、取得したデータや作成したデータなど、各種のデータも記録される。タッチパネル222は、スマートフォンへの入力を受け付ける入力装置として機能する。表示装置である液晶ディスプレイ224は、各種情報を表示する。カメラ232は、各種画像を撮像する。スマートフォン200は、例えば電卓100の液晶ディスプレイ134に表示された2次元コードの画像を取得することで、電卓100で作成されたプログラムの情報を取得することができる。通信装置234は、スマートフォン200の外部の機器と通信を行う際に用いられる。通信装置234は、例えばインターネットといったネットワーク400に接続する。
(smartphone configuration)
As shown in FIG. 2B, the smartphone 200 includes a CPU (processor) 212, a ROM 214, a RAM 216, a flash memory 218, a touch panel 222, a liquid crystal display 224, and a camera 232, all of which are connected via a bus line 290. and a communication device 234 . The CPU 212 performs various signal processing and the like. Various integrated circuits such as an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), or a Graphics Processing Unit (GPU) may be used with the CPU. A ROM 214 records a boot program and the like. A RAM 216 functions as a main storage device for the CPU 212 . The flash memory 218 stores various information such as programs and parameters used by the CPU 212 . Various data such as acquired data and created data are also recorded in the flash memory 218 . The touch panel 222 functions as an input device that receives input to the smart phone. A liquid crystal display 224, which is a display device, displays various information. The camera 232 captures various images. The smartphone 200 can acquire the information of the program created by the calculator 100 by acquiring the image of the two-dimensional code displayed on the liquid crystal display 134 of the calculator 100, for example. The communication device 234 is used when communicating with devices external to the smartphone 200 . Communication device 234 connects to a network 400, such as the Internet.

(サーバの構成)
サーバ300は、図2Cに示すように、バスライン390を介して互いに接続された、CPU(プロセッサ)312と、ROM314と、RAM316と、ハードディスク(記憶装置)318と、通信装置334とを備える情報処理装置である。CPU312は、各種信号処理等を行う。ROM314は、CPU312の動作に用いられる情報を記録している。RAM316は、CPU312の主記憶装置として機能する。ハードディスク318には、CPU312で用いられるプログラム、パラメータ、及びCPU312の演算結果など、各種情報が記録される。
(Server configuration)
The server 300 includes a CPU (processor) 312, a ROM 314, a RAM 316, a hard disk (storage device) 318, and a communication device 334, which are connected to each other via a bus line 390, as shown in FIG. 2C. processing equipment. The CPU 312 performs various signal processing and the like. The ROM 314 records information used for the operation of the CPU 312 . A RAM 316 functions as a main storage device for the CPU 312 . The hard disk 318 records various kinds of information such as programs and parameters used by the CPU 312 and calculation results of the CPU 312 .

〈システムの動作〉
(電卓の動作)
電卓100の動作の一例の概要について、図3を参照して説明する。
<System operation>
(calculator operation)
An overview of an example of the operation of calculator 100 will be described with reference to FIG.

ステップS101において、電卓100のCPU112は、現在設定されている動作モードがアルゴリズムモードであるか否かを判定する。アルゴリズムモードでないとき、処理はステップS102に進む。 In step S101, the CPU 112 of the calculator 100 determines whether or not the currently set operating mode is the algorithm mode. When not in the algorithm mode, the process proceeds to step S102.

ステップS102において、CPU112は、アルゴリズムモード以外の選択されているモードに関する処理を行う。例えば、一般的な電卓として、数字キー及び演算キーを用いた入力に応じて、演算を行い、その結果を液晶ディスプレイ134に表示する処理を行う。その後、処理はステップS101に戻る。 In step S102, the CPU 112 performs processing related to the selected mode other than the algorithm mode. For example, as a general calculator, processing is performed to perform calculations and display the results on the liquid crystal display 134 in response to inputs using numeric keys and calculation keys. After that, the process returns to step S101.

ステップS101において、アルゴリズムモードが選択されていると判定されたとき、処理はステップS103に進む。ステップS103において、CPU112は、実行キー以外の入力キー132への入力があったか否かを判定する。入力キー132への入力がなかったとき、処理はステップS105に進む。一方、入力キー132への入力があったとき、処理はステップS104に進む。ステップS104において、CPU112は、入力キー132への入力に応じた処理を行う。この処理によって、ユーザは、プログラムを作成することができる。その後、処理はステップS105に進む。 When it is determined in step S101 that the algorithm mode is selected, the process proceeds to step S103. In step S103, the CPU 112 determines whether or not there is an input to the input keys 132 other than the execution key. When there is no input to the input key 132, the process proceeds to step S105. On the other hand, when there is an input to the input key 132, the process proceeds to step S104. In step S<b>104 , the CPU 112 performs processing according to the input to the input key 132 . This process allows the user to create a program. After that, the process proceeds to step S105.

ステップS105において、CPU112は、実行キーが押されたか否かを判定する。実行キーが押されていないとき、処理はステップS107に進む。一方、実行キーが押されたとき、処理はステップS106に進む。ステップS106において、CPU112は、実行処理を行う。実行処理では、ユーザによって入力されたプログラムが実行される。電卓100は、プログラムに従って動作し、入力を要求したり、結果を表示したりする。その後、処理はステップS107に進む。 In step S105, the CPU 112 determines whether or not the execution key has been pressed. If the execution key has not been pressed, the process proceeds to step S107. On the other hand, when the execution key is pressed, the process proceeds to step S106. In step S106, the CPU 112 performs execution processing. In the execution process, a program input by the user is executed. Calculator 100 operates according to a program to request input and display results. After that, the process proceeds to step S107.

ステップS107において、CPU112は、プログラムを送信することが要求されたか否かを判定する。プログラムの送信が要求されていないとき、処理はステップS109に進む。一方、プログラムの送信が要求されたとき、処理はステップS108に進む。ステップS108において、CPU112は、プログラム送信処理を行う。プログラム送信処理では、CPU112は、2次元コードエンコーダ122に、作成されたプログラムに関する情報を含む2次元コードを作成させる。CPU112は、作成された2次元コードを液晶ディスプレイ134に表示させる。この2次元コードは、プログラムの内容に加えて、電卓100の機種に関する情報など、他の情報も含み得る。その後、処理はステップS109に進む。 In step S107, the CPU 112 determines whether or not a request to transmit the program has been made. When no program transmission is requested, the process proceeds to step S109. On the other hand, when the transmission of the program is requested, the process proceeds to step S108. In step S108, the CPU 112 performs program transmission processing. In the program transmission process, the CPU 112 causes the two-dimensional code encoder 122 to create a two-dimensional code including information on the created program. CPU 112 causes liquid crystal display 134 to display the created two-dimensional code. This two-dimensional code may include other information such as information on the model of the calculator 100 in addition to the contents of the program. After that, the process proceeds to step S109.

ステップS109において、CPU112は、動作モードがアルゴリズムモードから他のモードに変更されたか否かを判定する。変更されていないとき、処理はステップS103に戻る。すなわち、上述の処理が繰り返し行われ、ユーザの指示に応じてプログラムの入力、実行、2次元コード表示などが行われる。ステップS109において、モードが変更されたと判定されたとき、処理はステップS101に戻る。 In step S109, the CPU 112 determines whether or not the operation mode has been changed from the algorithm mode to another mode. If not changed, the process returns to step S103. That is, the above-described processing is repeatedly performed, and program input, execution, two-dimensional code display, etc. are performed according to user's instructions. When it is determined in step S109 that the mode has been changed, the process returns to step S101.

(スマートフォンの動作)
スマートフォン200の動作の一例の概要について、図4を参照して説明する。ここでは、スマートフォン200における、電卓100に関するアプリケーションソフトウェア(アプリ)の動作について説明する。
(smartphone behavior)
An overview of an example of the operation of smartphone 200 will be described with reference to FIG. 4 . Here, operation of application software (app) related to calculator 100 in smartphone 200 will be described.

ステップS201において、スマートフォンのCPU212は、現在選択されている動作モードがプログラム変換モードであるか否かを判定する。プログラム変換モードは、本実施形態に関する、電卓100で作成されたプログラムを他のプログラミング言語によるプログラムに変換し、変換前後のプログラムを提示したり実行したりするモードである。プログラム変換モードでないと判定されたとき、処理はステップS202に進む。 In step S201, the CPU 212 of the smart phone determines whether or not the currently selected operation mode is the program conversion mode. The program conversion mode is a mode for converting a program created by the calculator 100 into a program in another programming language, and presenting and executing the program before and after conversion. When it is determined that the program conversion mode is not set, the process proceeds to step S202.

ステップS202において、CPU212は、プログラム変換モード以外の処理を行う。例えば、高精度な計算、グラフ描画、グループメンバー間でのデータの共有などが行われ得る。その後、処理はステップS201に戻る。 In step S202, the CPU 212 performs processing other than the program conversion mode. For example, high-precision calculation, graph drawing, data sharing among group members, etc. can be performed. After that, the process returns to step S201.

ステップS201において、プログラム変換モードであると判定されたとき、処理はステップS203に進む。ステップS203において、CPU212は、プログラム変換の指示が入力されたか否かを判定する。プログラム変換の指示が入力されていないとき、処理はステップS206に進む。一方、プログラム変換の指示が入力されたとき、処理はステップS204に進む。 When it is determined in step S201 that the mode is the program conversion mode, the process proceeds to step S203. In step S203, the CPU 212 determines whether an instruction to convert the program has been input. If no program conversion instruction has been input, the process proceeds to step S206. On the other hand, when the program conversion instruction is input, the process proceeds to step S204.

ステップS204において、CPU212は、電卓100で作成されたプログラムを取得する。例えば、CPU212は、カメラ232を用いて、電卓100の液晶ディスプレイ134に表示された2次元コードを撮影させる。CPU212は、取得した2次元コードを解析し、2次元コードで表された情報を取得する。この情報には、電卓100で作成されたプログラムが含まれる。また、この情報には、電卓100の機種に関する情報など、他の情報が含まれていてもよい。CPU212は、取得した情報をサーバ300に送信する。この情報を受けたサーバ300は、電卓100で作成されたプログラムを他のプログラムに変換し、変換後のプログラムをスマートフォン200に送信する。 In step S<b>204 , CPU 212 acquires the program created by calculator 100 . For example, the CPU 212 uses the camera 232 to photograph the two-dimensional code displayed on the liquid crystal display 134 of the calculator 100 . The CPU 212 analyzes the acquired two-dimensional code and acquires information represented by the two-dimensional code. This information includes the program created by calculator 100 . This information may also include other information such as information about the model of the calculator 100 . CPU 212 transmits the acquired information to server 300 . Upon receiving this information, server 300 converts the program created by calculator 100 into another program, and transmits the converted program to smartphone 200 .

ステップS205において、CPU212は、サーバ300からプログラムの変換結果に関する情報を取得する。この情報には、プログラミング言語の種類、変換後のプログラム、プログラムの行番号などの情報が含まれる。CPU212は、取得した情報を液晶ディスプレイ224に表示させる。その後、処理はステップS206に進む。 In step S<b>205 , the CPU 212 acquires information about the conversion result of the program from the server 300 . This information includes information such as the type of programming language, the converted program, and the line number of the program. The CPU 212 causes the liquid crystal display 224 to display the acquired information. After that, the process proceeds to step S206.

ステップS206において、CPU212は、2種類のプログラムが表示されている状態において、表示されているプログラムリストの任意の行が選択されたか否かを判定する。行の選択は、例えば液晶ディスプレイ224に表示されている行の何れかがユーザによってタッチされることで行われる。タッチされたことは、タッチパネル222を用いて検出される。選択されていないと判定されたとき、処理はステップS209に進む。選択されたと判定されたとき、処理はステップS207に進む。 In step S206, the CPU 212 determines whether or not an arbitrary line of the displayed program list has been selected while two types of programs are being displayed. Selection of a row is performed, for example, by the user touching one of the rows displayed on the liquid crystal display 224 . Touching is detected using the touch panel 222 . When it is determined that it is not selected, the process proceeds to step S209. When it is determined that it has been selected, the process proceeds to step S207.

ステップS207において、CPU212は、タッチパネル222による検出結果に基づいて、ユーザによって選択された行の情報を取得する。CPU212は、取得した行の情報を、サーバ300に送信する。選択された行の情報を取得したサーバ300は、もう一方のプログラムにおいて当該選択された行に対応する行を特定する。サーバ300は、ユーザによって選択された行と、特定された対応する行とに関する情報をスマートフォン200に送信する。送信される情報には、選択された行及び特定された対応行を強調表示する画像に関する情報が含まれてもよい。 In step S<b>207 , the CPU 212 acquires information on the line selected by the user based on the detection result from the touch panel 222 . The CPU 212 transmits the acquired row information to the server 300 . The server 300 that has acquired the information of the selected line identifies the line corresponding to the selected line in the other program. Server 300 transmits information about the row selected by the user and the identified corresponding row to smartphone 200 . The transmitted information may include information regarding an image highlighting the selected row and the identified corresponding row.

ステップS208において、CPU212は、サーバ300から選択された行に対応するもう一方の行に関する特定結果を取得する。CPU212は、取得した情報に基づいて、選択された行と、特定された対応行とが強調された画像を、液晶ディスプレイ224に表示させる。その後、処理はステップS209に進む。 In step S<b>208 , CPU 212 obtains from server 300 a specific result regarding the other line corresponding to the selected line. Based on the acquired information, CPU 212 causes liquid crystal display 224 to display an image in which the selected line and the identified corresponding line are emphasized. After that, the process proceeds to step S209.

ステップS209において、CPU212は、表示画面において、2種類のプログラムの配置を変更するか否かを判定する。例えば、スマートフォン200が、画面が縦長となる向きに固定されているとき、2種類のプログラムが縦に2つ並べて配置される。スマートフォン200が、画面が横長となる向きに固定されているとき、2種類のプログラムが横に2つ並べて配置される。このような場合、スマートフォンの向きが変更されたことが例えば重力センサの出力などを用いて検出されたとき、配置を変更すると判定される。配置を変更しないと判定されたとき、処理はステップS212に進む。配置を変更すると判定されたとき、処理はステップS210に進む。 In step S209, the CPU 212 determines whether or not to change the arrangement of the two types of programs on the display screen. For example, when the smartphone 200 is fixed in an orientation in which the screen is vertically long, two programs of two types are vertically arranged side by side. When the smartphone 200 is fixed in an orientation in which the screen is horizontally long, two programs of two types are arranged side by side. In such a case, when it is detected that the orientation of the smartphone has been changed using, for example, the output of the gravity sensor, it is determined that the arrangement should be changed. When it is determined not to change the arrangement, the process proceeds to step S212. When it is determined to change the arrangement, the process proceeds to step S210.

ステップS210において、CPU212は、例えばスマートフォン200の向きといった配置に関する情報を取得する。CPU212は、取得した配置に関する情報をサーバ300に送信する。この情報を取得したサーバ300は、配置の変更に関する情報を作成する。サーバ300は、作成した情報をスマートフォン200に送信する。この情報には、表示画面に関するデータが含まれていてもよい。 In step S<b>210 , the CPU 212 acquires information regarding the arrangement such as the orientation of the smartphone 200 . The CPU 212 transmits the acquired information regarding the arrangement to the server 300 . The server 300 that has acquired this information creates information regarding the change in arrangement. Server 300 transmits the created information to smartphone 200 . This information may include data about the display screen.

ステップS211において、CPU212は、サーバ300から作成結果である配置が変更された画面に関する情報を取得する。CPU212は、取得した情報に基づいて、配置が変更された2種類のプログラムを示す画面を液晶ディスプレイ224に表示させる。その後、処理はステップS212に進む。 In step S<b>211 , the CPU 212 acquires from the server 300 information about the screen whose layout has been changed, which is the creation result. Based on the acquired information, the CPU 212 causes the liquid crystal display 224 to display a screen showing the two types of programs whose layouts have been changed. After that, the process proceeds to step S212.

ステップS212において、CPU212は、動作モードがプログラム変換モードから変更されたか否かを判定する。モードが変更されていないとき、処理はステップS203に戻る。その結果、プログラム変換、行選択、配置変更の何れかが選択されたとき、選択された処理が実行され、選択されていないとき、何れの処理も行われずに待機する。モード変更がされたと判定されたとき、処理はステップS201に戻る。選択されたモードに応じた処理が行われる。 In step S212, the CPU 212 determines whether or not the operation mode has been changed from the program conversion mode. If the mode has not been changed, the process returns to step S203. As a result, when any one of program conversion, line selection, and layout change is selected, the selected process is executed, and when none is selected, it waits without executing any process. When it is determined that the mode has been changed, the process returns to step S201. Processing is performed according to the selected mode.

(サーバの動作)
サーバ300の動作の一例の概要について、図5を参照して説明する。サーバ300は各種の処理を行うが、ここでは、図4を参照して説明した動作に対応する動作について説明する。
(Server operation)
An overview of an example of the operation of server 300 will be described with reference to FIG. The server 300 performs various types of processing. Here, operations corresponding to the operations described with reference to FIG. 4 will be described.

ステップS301において、サーバ300のCPU312は、スマートフォン200からプログラム変換に関する情報を受信したか否かを判定する。プログラム変換に関する情報を受信していないとき、処理はステップS303に進む。プログラム変換に関する情報を受信したとき、処理はステップS302に進む。ステップS302において、CPU312は、受信した電卓100で作成されたプログラムを他のプログラミング言語を用いたプログラムに変換する変換処理を実行する。変換処理については後に詳述する。その後、処理はステップS303に進む。 In step S<b>301 , the CPU 312 of the server 300 determines whether information regarding program conversion has been received from the smartphone 200 . When information about program conversion has not been received, the process proceeds to step S303. When information about program conversion is received, the process proceeds to step S302. In step S302, the CPU 312 executes conversion processing for converting the received program created by the calculator 100 into a program using another programming language. The conversion processing will be detailed later. After that, the process proceeds to step S303.

ステップS303において、CPU312は、スマートフォン200から行選択に関する情報を受信したか否かを判定する。行選択に関する情報を受信していないとき、処理はステップS305に進む。行選択に関する情報を受信したとき、処理はステップS304に進む。ステップS304において、CPU312は、選択された行に対応するもう一方のプログラムの行を特定し、それらの行を強調表示するための情報を作成する選択処理を実行する。選択処理については後に詳述する。その後、処理はステップS305に進む。 In step S<b>303 , the CPU 312 determines whether information regarding row selection has been received from the smartphone 200 . When no information regarding row selection has been received, the process proceeds to step S305. When information regarding row selection is received, processing proceeds to step S304. In step S304, CPU 312 performs a selection process that identifies lines of the other program that correspond to the selected lines and creates information for highlighting those lines. The selection process will be detailed later. After that, the process proceeds to step S305.

ステップS305において、CPU312は、スマートフォン200から配置変更に関する情報を受信したか否かを判定する。配置変更に関する情報を受信していないとき、処理はステップS301に戻る。配置変更に関する情報を受信したとき、処理はステップS306に進む。ステップS306において、CPU312は、2種類のプログラムの表示を変更するための情報を作成する配置変更処理を実行する。配置変更処理については後に詳述する。その後、処理はステップS301に戻る。 In step S<b>305 , the CPU 312 determines whether or not information regarding layout change has been received from the smartphone 200 . When the information regarding the layout change has not been received, the process returns to step S301. When the information regarding the layout change is received, the process proceeds to step S306. In step S306, CPU 312 executes layout change processing for creating information for changing the display of the two types of programs. The arrangement change processing will be detailed later. After that, the process returns to step S301.

(変換処理)
ステップS302において行われる変換処理について、図6に示すフローチャートを参照して説明する。ここでは、電卓100で作成される、変換される前のプログラム例を図7Aに示す。また、変換された後のプログラム例を図7Bに示す。また、図7Aに示すプログラムを実行したときに、電卓100に表示される画面例を図8A及び図8Bに示す。
(conversion process)
The conversion processing performed in step S302 will be described with reference to the flowchart shown in FIG. Here, FIG. 7A shows an example of a pre-conversion program created by the calculator 100 . An example of the program after conversion is shown in FIG. 7B. 8A and 8B show screen examples displayed on the calculator 100 when the program shown in FIG. 7A is executed.

電卓100で作成され実行される第1プログラムの一例は、図7Aのコマンド欄に記載のように、下記のようなプログラムである。
-----
Go to x=-10, y=-20
Pen Down
Repeat 6
Move 20 pixels
Show Result y
Turn ↑ 60 degrees
Show Result x


-----
このプログラムが電卓100で実行されたとき次のように動作する。
An example of the first program created and executed by calculator 100 is the following program, as described in the command column of FIG. 7A.
-----
Go to x=-10, y=-20
Pen down
Repeat 6
Move 20 pixels
Show Result y
Turn ↑ 60 degrees
Show Result x


-----
When this program is executed by the calculator 100, it operates as follows.

「Go to x=-10, y=-20」によって、座標(x, y)=(-10, -20)が指定される。 "Go to x=-10, y=-20" specifies coordinates (x, y)=(-10, -20).

「Pen Down」によって、指定されている点(この場合、(x, y)=(-10, -20))から線が引かれる。線が引かれる向き、及び、線を引いた後の位置は、矢尻の記号によって示される。なお、矢尻の向きは、初期設定ではx方向である。 "Pen Down" draws a line from the specified point (in this case (x, y)=(-10, -20)). The direction in which the line is drawn and the position after the line is drawn are indicated by arrowhead symbols. Note that the direction of the arrowhead is the x direction by default.

「Repeat 6」及び「」」によって、これらに囲まれたコマンドが6回繰り返される。繰り返されるのは、以下の動作である。 "Repeat 6" and "" repeat the enclosed command six times. The following operations are repeated.

「Move 20 pixels」によって、矢尻の方向に長さ20ピクセルの線が引かれる。 "Move 20 pixels" draws a line 20 pixels long in the direction of the arrowhead.

「Show Result y」によって、現在の位置のy座標の値を示す。また、実行ボタンが押されるまで待機する。 "Show Result y" shows the y-coordinate value of the current position. Also, it waits until the execution button is pressed.

したがって、実行ボタンが押されたとき、電卓100の液晶ディスプレイ134に表示される画面は、図8Aの符号(a)のようになる。すなわち、(x, y)=(-10, -20)からx方向に長さ20ピクセルの線が引かれ、(x, y)=(10, -20)の位置に矢尻記号が示される。また、現在位置のy座標である「-20」が表示される。 Therefore, when the execution button is pressed, the screen displayed on the liquid crystal display 134 of the calculator 100 becomes as indicated by symbol (a) in FIG. 8A. That is, a line with a length of 20 pixels is drawn in the x direction from (x, y)=(-10, -20), and an arrowhead is shown at the position of (x, y)=(10, -20). Also, "-20", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されると、「Turn ↑ 60 degrees」によって、矢尻の向きが反時計回りに60度回転される。 When the execution button is pressed, the direction of the arrowhead is rotated 60 degrees counterclockwise by "Turn ↑ 60 degrees".

「Show Result x」によって、現在の位置のx座標の値を示す。また、実行ボタンが押されるまで待機する。 "Show Result x" shows the x-coordinate value of the current position. Also, it waits until the execution button is pressed.

したがって、電卓100の液晶ディスプレイ134に表示される画面は、図8Aの符号(b)のようになる。すなわち、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「10」が表示される。 Therefore, the screen displayed on the liquid crystal display 134 of the calculator 100 becomes like symbol (b) in FIG. 8A. That is, an arrowhead symbol rotated 60 degrees counterclockwise on the spot is displayed. Also, "10", which is the x-coordinate of the current position, is displayed.

「Repeat 6」及び「」」によって囲まれた命令が繰り返される。したがって、実行ボタンが押されたとき、2回目の「Move 20 pixels」及び「Show Result y」によって、図8Aの符号(c)のように、(x, y)=(10, -20)から矢尻の方向に長さ20ピクセルの線が引かれ、(x, y)=(20, -2.679491924)の位置に矢尻記号が示される。また、現在位置のy座標である「-2.679491924」が表示される。 The instructions enclosed by "Repeat 6" and "" are repeated. Therefore, when the execution button is pressed, the second "Move 20 pixels" and "Show Result y" will change (x, y) = (10, -20) to A line with a length of 20 pixels is drawn in the direction of the arrowhead, and the arrowhead symbol is shown at the position (x, y)=(20, -2.679491924). In addition, "-2.679491924", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されたとき、「Turn ↑ 60 degrees」及び「Show Result x」によって、図8Aの符号(d)のよう、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「20」が表示される。 When the execution button is pressed, "Turn ↑ 60 degrees" and "Show Result x" show an arrowhead symbol rotated 60 degrees counterclockwise on the spot, as indicated by symbol (d) in FIG. 8A. Also, "20", which is the x-coordinate of the current position, is displayed.

実行ボタンが押されたとき、3回目の「Move 20 pixels」及び「Show Result y」によって、図8Aの符号(e)のように、(x, y)=(20, -2.679491924)から矢尻の方向に長さ20ピクセルの線が引かれ、(x, y)=(10, 14.64101615)の位置に矢尻記号が示される。また、現在位置のy座標である「14.64101615」が表示される。 When the execution button is pressed, the third "Move 20 pixels" and "Show Result y" move the arrowhead from (x, y)=(20, -2.679491924) to symbol (e) in FIG. 8A. A 20 pixel long line is drawn in the direction and an arrowhead symbol is shown at (x, y)=(10, 14.64101615). Also, "14.64101615", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されたとき、「Turn ↑ 60 degrees」及び「Show Result x」によって、図8Aの符号(f)のよう、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「10」が表示される。 When the execution button is pressed, "Turn ↑ 60 degrees" and "Show Result x" show an arrowhead symbol rotated 60 degrees counterclockwise on the spot, as symbol (f) in FIG. 8A. Also, "10", which is the x-coordinate of the current position, is displayed.

実行ボタンが押されたとき、4回目の「Move 20 pixels」及び「Show Result y」によって、図8Aの符号(g)のように、(x, y)=(10, 14.64101615)から矢尻の方向に長さ20ピクセルの線が引かれ、(x, y)=(-10, 14.64101615)の位置に矢尻記号が示される。また、現在位置のy座標である「14.64101615」が表示される。 When the execution button is pressed, the direction of the arrowhead from (x, y)=(10, 14.64101615) as indicated by symbol (g) in FIG. A 20-pixel-long line is drawn in and an arrowhead is shown at (x, y)=(-10, 14.64101615). Also, "14.64101615", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されたとき、「Turn ↑ 60 degrees」及び「Show Result x」によって、図8Bの符号(h)のよう、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「-10」が表示される。 When the execution button is pressed, "Turn ↑ 60 degrees" and "Show Result x" show an arrowhead symbol rotated counterclockwise 60 degrees on the spot, as symbol (h) in FIG. 8B. Also, "-10", which is the x-coordinate of the current position, is displayed.

実行ボタンが押されたとき、5回目の「Move 20 pixels」及び「Show Result y」によって、図8Bの符号(i)のように、(x, y)=(-10, 14.64101615)から矢尻の方向に長さ20ピクセルの線が引かれ、(x, y)=(-20, -2.679491924)の位置に矢尻記号が示される。また、現在位置のy座標である「-2.679491924」が表示される。 When the execution button is pressed, the arrowhead moves from (x, y)=(-10, 14.64101615) to (x, y)=(-10, 14.64101615) as symbol (i) in FIG. A line of length 20 pixels is drawn in the direction and an arrowhead symbol is shown at (x, y)=(-20, -2.679491924). In addition, "-2.679491924", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されたとき、「Turn ↑ 60 degrees」及び「Show Result x」によって、図8Bの符号(j)のよう、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「-20」が表示される。 When the execution button is pressed, "Turn ↑ 60 degrees" and "Show Result x" show an arrowhead symbol rotated 60 degrees counterclockwise on the spot, as indicated by symbol (j) in FIG. 8B. Also, "-20", which is the x-coordinate of the current position, is displayed.

実行ボタンが押されたとき、6回目の「Move 20 pixels」及び「Show Result y」によって、図8Bの符号(k)のように、(x, y)=(-20, -2.679491924)から矢尻の方向に長さ20ピクセルの線が引かれ、(x, y)=(-10, -20)の位置に矢尻記号が示される。また、現在位置のy座標である「-20」が表示される。 When the execution button is pressed, the arrowhead from (x, y)=(-20, -2.679491924) to (x, y)=(-20, -2.679491924) as symbol (k) in FIG. A line with a length of 20 pixels is drawn in the direction of , and an arrowhead symbol is shown at the position of (x, y)=(-10, -20). Also, "-20", which is the y-coordinate of the current position, is displayed.

実行ボタンが押されたとき、「Turn ↑ 60 degrees」及び「Show Result x」によって、図8Bの符号(l)のよう、その場で反時計回りに60度回転した矢尻記号が示される。また、現在位置のx座標である「-10」が表示される。 When the execution button is pressed, "Turn ↑ 60 degrees" and "Show Result x" show an arrowhead symbol rotated 60 degrees counterclockwise on the spot, as symbol (l) in FIG. 8B. Also, "-10", which is the x-coordinate of the current position, is displayed.

実行ボタンが押されたとき、終了を示す「(空白行)」によってプログラムの実行が終了する。その結果、図8Bの符号(m)のような画面が表示される。ここでさらに実行ボタンが押されたとき、図8Bの符号(n)のような画面が表示され、プログラムの入力画面となる。 When the run button is pressed, the execution of the program ends with "(blank line)" indicating the end. As a result, a screen such as symbol (m) in FIG. 8B is displayed. When the execution button is further pressed here, a screen such as symbol (n) in FIG. 8B is displayed and becomes a program input screen.

ステップS401において、CPU312は、スマートフォン200から、例えば上述のような電卓100で作成された第1プログラムを取得する。 In step S<b>401 , the CPU 312 acquires from the smartphone 200 the first program created by the calculator 100 as described above, for example.

ステップS402において、CPU312は、取得した第1プログラムを異なるプログラミング言語で記述された第2のプログラムに変換する。このとき、図7Aに示すように、CPU312は、第1プログラムの各命令文に順に行番号を付与する。 In step S402, CPU 312 converts the obtained first program into a second program written in a different programming language. At this time, as shown in FIG. 7A, the CPU 312 sequentially assigns line numbers to each statement of the first program.

図7Aに示すような第1プログラムに対応する第2プログラムは、例えば図7Bに示すようになる。 A second program corresponding to the first program as shown in FIG. 7A is, for example, as shown in FIG. 7B.

第1プログラムの「Go to x=-10, y=-20」は、第2プログラムでは「go to x: (-10) y: (-20)」に変換される。 "Go to x=-10, y=-20" in the first program is converted to "go to x: (-10) y: (-20)" in the second program.

第1プログラムの「Pen Down」は、第2プログラムでは「pen down」に変換される。 "Pen Down" in the first program is translated to "pen down" in the second program.

第1プログラムの「Repeat 6」は、第2プログラムでは「repeat (6)」に変換される。 "Repeat 6" in the first program is converted to "repeat (6)" in the second program.

第1プログラムの「Move 20 pixels」は、第2プログラムでは「move (20) pixels」に変換される。 "Move 20 pixels" in the first program is converted to "move (20) pixels" in the second program.

第1プログラムの「Show Result y」は、第2プログラムでは「show (y)」及び「wait any key」に変換される。 "Show Result y" in the first program is converted to "show (y)" and "wait any key" in the second program.

第1プログラムの「Turn ↑ 60 degrees」は、第2プログラムでは「turn ↑ 60 degrees」に変換される。 "Turn ↑ 60 degrees" in the first program is converted to "turn ↑ 60 degrees" in the second program.

第1プログラムの「Show Result x」は、第2プログラムでは「show (x)」及び「wait any key」に変換される。 "Show Result x" in the first program is converted to "show (x)" and "wait any key" in the second program.

第1プログラムの「」」は、第2プログラムでは「」」に変換される。 "" in the first program is converted to "" in the second program.

第1プログラムの「(空白行)」は、第2プログラムでは「(空白行)」に変換される。 "(blank line)" in the first program is converted to "(blank line)" in the second program.

以上のようなプログラムの変換は、例えばあらかじめ用意された対応表などを参照して行われ得る。 The program conversion as described above can be performed by referring to, for example, a correspondence table prepared in advance.

続いて、ステップS403乃至ステップS410の処理によって、第2プログラムの各々の行に関して、第1プログラムの行番号に対応する行番号が特定される。 Subsequently, through the processing of steps S403 to S410, a line number corresponding to the line number of the first program is specified for each line of the second program.

ステップS403において、CPU312は、第1プログラムの処理行数を示す変数Nを1に設定する。また、第2プログラムの行番号を表す数列をリセットする。 In step S403, the CPU 312 sets 1 to a variable N indicating the number of lines to be processed in the first program. It also resets the sequence representing the line numbers of the second program.

ステップS404において、CPU312は、第1プログラムのN行目のデータを取得する。ステップS405において、CPU312は、取得した第1プログラムのN行目の構文が、プログラムの変換において行数が増える構文であるか否かを判定する。行数が増える構文であるか否か及び増える行数は、例えば対応表を参照することで特定され得る。行数が増えないとき、処理はステップS406に進む。ステップS406において、CPU312は、第2プログラムの行番号を表す数列に1個のNを追加する。その後、処理はステップS407に進む。 In step S404, the CPU 312 acquires the N-th line data of the first program. In step S405, the CPU 312 determines whether or not the acquired syntax of the Nth line of the first program is a syntax that increases the number of lines in program conversion. Whether or not the syntax increases the number of lines and the number of lines to increase can be specified, for example, by referring to a correspondence table. When the number of rows does not increase, the process proceeds to step S406. In step S406, CPU 312 adds one N to the sequence representing the line number of the second program. After that, the process proceeds to step S407.

ステップS407において、CPU312は、第1プログラムに次の行があるか否かを判定する。次の行があるとき、処理はステップS408に進む。ステップS408において、CPU312は、変数Nに1を加算する。その後、処理はステップS404に戻る。すなわち、次の行について、同様の処理が繰り返される。 In step S407, the CPU 312 determines whether or not the first program has the next line. When there is a next row, the process proceeds to step S408. In step S408, the CPU 312 adds 1 to the variable N. After that, the process returns to step S404. That is, similar processing is repeated for the next row.

例えば、上述のとおり、図7Aに示した第1プログラムから図7Bに示した第2プログラムへの変換において、第1プログラムの1行目乃至4行目は、行数が増えない行である。したがって、N=1からN=4のとき、ステップS406の処理によって、数列に「1」、「2」、「3」、「4」が1個ずつ追加される。その結果、数列は、{1,2,3,4}となる。 For example, as described above, in the conversion from the first program shown in FIG. 7A to the second program shown in FIG. 7B, the first to fourth lines of the first program are lines where the number of lines does not increase. Therefore, when N=1 to N=4, one each of "1", "2", "3", and "4" is added to the sequence by the processing of step S406. The resulting sequence is {1,2,3,4}.

ステップS405において、行数が増える構文であると判定されたとき、処理はステップS409に進む。ステップS409において、CPU312は、構文に基づいて、例えば対応表を参照して、増える行数nを取得する。ステップS410において、CPU312は、数列にn+1個のNを追加する。その後、処理はステップS407に進む。 When it is determined in step S405 that the syntax increases the number of lines, the process proceeds to step S409. In step S409, the CPU 312 acquires the increasing number of lines n based on the syntax, for example, by referring to a correspondence table. In step S410, the CPU 312 adds n+1 N's to the sequence. After that, the process proceeds to step S407.

例えば、上述のとおり、図7Aに示した第1プログラムから図7Bに示した第2プログラムへの変換において、第1プログラムの5行目は、行数が1増えて2行になる。したがって、N=5のとき、ステップS409の処理によってn=1が取得され、ステップS410の処理によって、数列に2個の「5」が追加される。その結果、数列は、{1,2,3,4,5,5}となる。 For example, as described above, in converting the first program shown in FIG. 7A to the second program shown in FIG. 7B, the fifth line of the first program increases by one to become two lines. Therefore, when N=5, n=1 is acquired by the process of step S409, and two "5"s are added to the sequence by the process of step S410. The resulting sequence is {1,2,3,4,5,5}.

以上のようにして、例えば、図7Aに示した第1プログラムから図7Bに示した第2プログラムへの変換については、数列{1,2,3,4,5,5,6,7,7,8,9}が得られる。 As described above, for example, for conversion from the first program shown in FIG. 7A to the second program shown in FIG. 7B, the sequence {1,2,3,4,5,5,6,7,7 , 8, 9} are obtained.

ステップS407において次の行がないと判定されたとき、処理はステップS411に進む。ステップS411において、CPU312は、得られた数列に基づいて、第2プログラムに行番号を付与する。例えば、図7Bに示す第2プログラムの例では、図7Bに示すような行番号が付与される。 When it is determined in step S407 that there is no next line, the process proceeds to step S411. In step S411, the CPU 312 assigns line numbers to the second program based on the obtained sequence. For example, in the example of the second program shown in FIG. 7B, line numbers are given as shown in FIG. 7B.

ステップS412において、CPU312は、第1プログラム及び第2プログラムとそれらの行番号との情報を用いて、スマートフォン200に表示させる画面に関するデータを作成する。ステップS413において、CPU312は、画面に関するデータの作成結果をスマートフォン200に送信する。ここで送信される画面に関するデータは、表示画面の画像データであってもよい。この場合、スマートフォン200は、受信した画像を表示する。また、送信される画面に関するデータは、テキストデータであってもよい。この場合、スマートフォン200は、このテキストデータに基づいて、表示画面を作成する。以上で、変換処理は終了する。 In step S<b>412 , the CPU 312 creates data regarding the screen to be displayed on the smartphone 200 using the information of the first program, the second program, and their line numbers. In step S<b>413 , the CPU 312 transmits to the smart phone 200 the creation result of the screen-related data. The screen-related data transmitted here may be image data of the display screen. In this case, smartphone 200 displays the received image. Also, the screen-related data to be transmitted may be text data. In this case, smartphone 200 creates a display screen based on this text data. With this, the conversion processing ends.

その結果、例えば図9に示すような画像がスマートフォン200に表示される。すなわち、画面600内には、第1プログラムに関する第1プログラムリスト610と第2プログラムに関する第2プログラムリスト620とが縦に並べて表示される。第1プログラムリスト610には、行番号611と命令文612とが含まれる。同様に、第2プログラムリスト620には、行番号621と命令文622とが含まれる。本実施形態では、第1プログラムリスト610の行番号611と第2プログラムリスト620の行番号621とは、機能的に対応する命令文に同じ行番号が付されるという関係になっている。このため、ユーザは、変換前後の第1プログラムリスト610と第2プログラムリスト620とを比較することができ、さらにその対応関係を容易に把握することができる。 As a result, an image as shown in FIG. 9 is displayed on the smartphone 200, for example. That is, in the screen 600, a first program list 610 relating to the first program and a second program list 620 relating to the second program are displayed vertically side by side. First program list 610 includes line number 611 and statement 612 . Similarly, second program listing 620 includes line number 621 and statement 622 . In this embodiment, the line number 611 of the first program list 610 and the line number 621 of the second program list 620 are related in that the same line number is assigned to functionally corresponding statements. Therefore, the user can compare the first program list 610 and the second program list 620 before and after conversion, and can easily grasp the correspondence between them.

なお、ここでは、行の対応関係が番号によって示される例を示したが、これに限らない。アルファベットや記号など各種の符号が同様に用いられ得る。 Although an example in which the correspondence between rows is indicated by numbers has been shown here, the present invention is not limited to this. Various codes such as alphabets and symbols can be used as well.

(選択処理)
ステップS304で行われる選択処理について、図10に示すフローチャートを参照して説明する。
(selection process)
The selection process performed in step S304 will be described with reference to the flowchart shown in FIG.

ステップS501において、CPU312は、スマートフォン200から選択位置を受信する。ステップS502において、CPU312は、選択位置に基づいて、選択された行を特定する。このとき、第1プログラムと第2プログラムとの対応関係が明らかになっているので、第1プログラムと第2プログラムとの両方の選択された行が特定される。ステップS503において、CPU312は、特定された行について、第1プログラムと第2プログラムとの両方について強調するハイライトを付与するための情報を生成する。例えば、選択された行がハイライト表示された画像を作成する。ステップS504において、CPU312は、ステップS503で生成された結果をスマートフォン200へ送信する。その結果、スマートフォン200では、選択された行が強調表示された画像が表示される。 In step S<b>501 , the CPU 312 receives the selected position from the smart phone 200 . In step S502, CPU 312 identifies the selected line based on the selection position. At this time, since the correspondence relationship between the first program and the second program is clarified, the selected lines of both the first program and the second program are identified. In step S503, the CPU 312 generates information for adding a highlight to the specified line for both the first program and the second program. For example, create an image with the selected row highlighted. In step S<b>504 , the CPU 312 transmits the result generated in step S<b>503 to the smart phone 200 . As a result, smartphone 200 displays an image in which the selected row is highlighted.

例えば、図11に示すように、第1プログラムリスト610の5行目613が選択されたとする。このとき、第1プログラムリスト610の5行目613及び第2プログラムリスト620の対応する2行623が強調表示される。 For example, as shown in FIG. 11, assume that the fifth line 613 of the first program list 610 is selected. At this time, the fifth line 613 of the first program listing 610 and the corresponding two lines 623 of the second program listing 620 are highlighted.

本実施形態によれば、対応した行が強調表示されるので、ユーザは行を選択することで容易に対応関係を把握することができる。 According to this embodiment, since the corresponding line is highlighted, the user can easily comprehend the correspondence by selecting the line.

(配置変更処理)
ステップS306で行われる配置変更処理について、図12に示すフローチャートを参照して説明する。
(Placement change processing)
The arrangement change processing performed in step S306 will be described with reference to the flowchart shown in FIG.

ステップS601において、CPU312は、第1プログラム及び第2プログラムの並べ方について縦に並べるか横に並べるかを判定する。並べ方は、ユーザによる操作に応じて変更される。例えば、スマートフォン200の液晶ディスプレイ224が縦長となるようにスマートフォン200が配置されるとき、縦に並べると判定される。例えば、スマートフォン200の液晶ディスプレイ224が横長となるようにスマートフォン200が配置されるとき、横に並べると判定される。横に並べると判定されたとき、処理はステップS602に進む。第1プログラムと第2プログラムとが横に並べて配置されるとき、命令文のうち対応する行が横に並べられると対応関係が把握されやすい。そこで、本実施形態では、ステップS602乃至ステップS607において、第2プログラムに応じて第1プログラムの命令文の行間に必要な空白行を挿入する。 In step S601, the CPU 312 determines whether the first program and the second program are arranged vertically or horizontally. The arrangement is changed according to the user's operation. For example, when smartphone 200 is arranged such that liquid crystal display 224 of smartphone 200 is vertically long, it is determined that the smartphones are arranged vertically. For example, when smartphone 200 is arranged such that liquid crystal display 224 of smartphone 200 is horizontally long, it is determined that the smartphones 200 are arranged side by side. When it is determined that they should be arranged horizontally, the process proceeds to step S602. When the first program and the second program are arranged side by side, it is easy to grasp the correspondence if the corresponding lines of the imperative sentences are arranged side by side. Therefore, in this embodiment, in steps S602 to S607, necessary blank lines are inserted between lines of statements of the first program according to the second program.

ステップS602において、CPU312は、処理対象の行番号を示す変数Nを1に設定する。ステップS603において、CPU312は、第2プログラムのN番目の行番号を取得する。 In step S602, the CPU 312 sets 1 to a variable N indicating the line number to be processed. In step S603, the CPU 312 acquires the Nth line number of the second program.

ステップS604において、CPU312は、現在対象としている行番号が繰り返されている番号であるか否かを判定する。例えば、図7Bに示す第2プログラムにおいて、行番号が「1」である行は、繰り返されていない。これに対して、行番号が「5」である行は、2つ繰り返されている。行番号が繰り返されていないと判定されたとき、処理はステップS606に進む。一方、行番号が繰り返されていると判定されたとき、処理はステップS605に進む。ステップS605において、CPU312は、第1プログラムの対応する行の下に空白行を挿入する。その後、処理はステップS606に進む。 In step S604, the CPU 312 determines whether or not the current target line number is a repeated number. For example, in the second program shown in FIG. 7B, the line numbered "1" is not repeated. On the other hand, the line with the line number "5" is repeated twice. When it is determined that the line numbers are not repeated, processing continues to step S606. On the other hand, when it is determined that the line numbers are repeated, the process proceeds to step S605. In step S605, the CPU 312 inserts a blank line below the corresponding line of the first program. After that, the process proceeds to step S606.

ステップS606において、CPU312は、次の行があるか否かを判定する。次の行があるとき、処理はステップS607に進む。ステップS607において、CPU312は、変数Nに1を加算する。その後、処理はステップS603に戻る。すなわち、第2プログラムで行番号が繰り返されている行に対応する行については、第1プログラムにおいて対応する行において空白行が挿入される。 In step S606, CPU 312 determines whether or not there is a next line. If there is a next line, the process proceeds to step S607. In step S607, the CPU 312 adds 1 to the variable N. After that, the process returns to step S603. That is, for lines corresponding to lines with repeated line numbers in the second program, blank lines are inserted in the corresponding lines in the first program.

ステップS606において、次の行がないと判定されたとき、処理はステップS608に進む。ステップS608において、CPU312は、必要に応じて空白行が挿入された第1プログラムに関して表示するためのデータを作成する。このデータは表示用の画像データであってもよい。 When it is determined in step S606 that there is no next line, the process proceeds to step S608. In step S608, CPU 312 creates data for display regarding the first program with blank lines inserted as necessary. This data may be image data for display.

ステップS609において、CPU312は、ステップS608で作成された第1プログラムに関する表示データを用いて、また、第2プログラムに関して既に存在していた表示データを流用して、第1プログラムと第2プログラムとが横に(左右に)並べられた表示データを作成する。 In step S609, the CPU 312 uses the display data related to the first program created in step S608 and the existing display data related to the second program to display the first program and the second program. Creates display data that is aligned horizontally (left and right).

ステップS610において、CPU312は、作成した表示用のデータを、スマートフォン200に送信する。その後、配置変更処理は終了する。その結果、スマートフォン200では、第1プログラムリスト610と第2プログラムリスト620とが横に並べられた画面が表示される。 In step S<b>610 , the CPU 312 transmits the created display data to the smartphone 200 . After that, the arrangement change processing ends. As a result, the smartphone 200 displays a screen in which the first program list 610 and the second program list 620 are arranged side by side.

スマートフォン200に表示される画面の一例を図13に示す。この図に示すように、画面600には、第1プログラムリスト610と第2プログラムリスト620とが横に並べて表示されている。ここで、第1プログラムリスト610においては1行の命令文が第2プログラムリスト620においては2行であることがある。このような行については、第1プログラムリスト610において空白行が挿入されることで、第1プログラムリスト610と第2プログラムリスト620とで、対応する命令文が左右に並べて表示される。その結果、ユーザは第1プログラムリスト610の命令文と第2プログラムリスト620の命令文との対応関係を把握しやすい。 An example of a screen displayed on smartphone 200 is shown in FIG. As shown in this figure, a screen 600 displays a first program list 610 and a second program list 620 side by side. Here, one line of statement in the first program list 610 may be two lines in the second program list 620 . By inserting a blank line in the first program list 610 for such a line, the corresponding statements are displayed side by side in the first program list 610 and the second program list 620 . As a result, the user can easily grasp the correspondence relationship between the statements in the first program list 610 and the statements in the second program list 620 .

図12に戻って説明を続ける。ステップS601において、並べ方が縦に変更されると判定されたとき、処理はステップS611に進む。ステップS611において、CPU312は、既にある空白行が挿入されていない第1プログラムリスト610と第2プログラムリスト620との表示データを流用して、第1プログラムリスト610と第2プログラムリスト620とが縦に(上下に)並べられた表示データを作成する。その後、処理はステップS610に進む。このとき、作成された第1プログラムリスト610と第2プログラムリスト620とが縦に並べられた表示データをスマートフォン200に送信する。その結果、図9に示すような、第1プログラムリスト610と第2プログラムリスト620とが縦に並べられた画面600が表示される。 Returning to FIG. 12, the description continues. When it is determined in step S601 that the arrangement is to be changed vertically, the process proceeds to step S611. In step S611, CPU 312 diverts the display data of first program list 610 and second program list 620, in which no blank line is inserted, to display first program list 610 and second program list 620 vertically. Creates display data that is aligned (top-to-bottom). The process then proceeds to step S610. At this time, display data in which the created first program list 610 and second program list 620 are vertically arranged is transmitted to the smartphone 200 . As a result, a screen 600 in which the first program list 610 and the second program list 620 are vertically arranged is displayed as shown in FIG.

[第2の実施形態]
本発明の第2の実施形態について説明する。ここでは、第1の実施形態との相違点について説明し、同一の部分については、同一の符号を付してその説明を省略する。第1の実施形態では、第1プログラムに対して第2プログラムは行が増えることはあるが、減ることはないものとした。また、増える行数は構文の種類によって決まっており、命令文を1行確認することで増える行数が特定されるものとした。これに対して、本実施形態では、第1プログラムに対して第2プログラムは行が増えたり減ったりする。また、増減する行数も次の行の記載次第で変化するものとする。
[Second embodiment]
A second embodiment of the present invention will be described. Here, the points of difference from the first embodiment will be described, and the same reference numerals will be given to the same parts, and the description thereof will be omitted. In the first embodiment, the number of lines in the second program may increase with respect to the number of lines in the first program, but the number of lines may not decrease. Also, the number of lines to be increased is determined by the type of syntax, and the number of lines to be increased is specified by checking one line of the imperative sentence. On the other hand, in this embodiment, the number of lines in the second program increases or decreases with respect to the first program. Also, the number of lines that increases or decreases also changes depending on the description in the next line.

本実施形態に係る変換処理について、図14A及び図14Bに示すフローチャートを参照して説明する。 Conversion processing according to the present embodiment will be described with reference to flowcharts shown in FIGS. 14A and 14B.

ステップS701において、CPU312は、スマートフォン200から、電卓100で作成された第1プログラムを取得する。ステップS702において、CPU312は、取得した第1プログラムを異なるプログラミング言語で記述された第2のプログラムに変換する。このとき、CPU312は、第1プログラムの各命令文に順に行番号を付与する。ステップS703において、CPU312は、第1プログラムの処理行数を示す変数Nを1に設定する。また、第2プログラムの行番号を表す数列をリセットする。 In step S<b>701 , the CPU 312 acquires the first program created by the calculator 100 from the smart phone 200 . In step S702, CPU 312 converts the obtained first program into a second program written in a different programming language. At this time, the CPU 312 sequentially assigns line numbers to each statement of the first program. In step S703, the CPU 312 sets 1 to a variable N indicating the number of lines to be processed in the first program. It also resets the sequence representing the line numbers of the second program.

ステップS704において、CPU312は、第1プログラムのN行目のデータを取得する。ステップS705において、CPU312は、取得した第1プログラムのN行目の構文が、プログラムの変換において行数が増える構文であるか否かを判定する。行数が増えるとき、処理はステップS706に進む。 In step S704, the CPU 312 acquires the N-th line data of the first program. In step S705, the CPU 312 determines whether or not the acquired syntax of the N-th line of the first program is a syntax that increases the number of lines in program conversion. When the number of rows increases, the process proceeds to step S706.

ステップS706において、CPU312は、変数kを1に設定する。ステップS707において、CPU312は、第1プログラムのN+k行目のデータを取得する。ステップS708において、CPU312は、第1プログラムのN+k行目のデータに基づいて、増加行数を決定するために次の行を確認する必要があるか否かを判定する。次の行を確認する必要があるとき、処理はステップS709に進む。ステップS709において、CPU312は、変数kに1を加算する。その後、処理はステップS707に戻る。ステップS708において、次の行を確認する必要がないと判定されたとき、処理はステップS710に進む。 In step S706, the CPU 312 sets the variable k to 1. In step S707, the CPU 312 acquires the data of the N+kth row of the first program. In step S708, the CPU 312 determines whether or not it is necessary to check the next line to determine the increased number of lines, based on the data of the N+kth line of the first program. When the next row needs to be confirmed, processing proceeds to step S709. In step S709, the CPU 312 adds 1 to the variable k. After that, the process returns to step S707. When it is determined in step S708 that there is no need to check the next row, processing proceeds to step S710.

ステップS710において、CPU312は、第1プログラムのN行目からN+k行目までの命令文の記載に基づいて、第2プログラムにおいて対応する行数を示す数列を確定する。例えば、N行目が2行に、N+1行目が3行に変換される場合、数列は、{N,N,N+1,N+1,N+1}となる。ステップS711において、CPU312は、第2プログラムの行数を示す数列に、ステップS710で確定した数列を追加する。 In step S710, the CPU 312 determines a sequence indicating the corresponding number of lines in the second program based on the description of the statements from the Nth line to the N+kth line of the first program. For example, if row N is transformed to row 2 and row N+1 is transformed to row 3, the sequence is {N, N, N+1, N+1, N+1}. In step S711, the CPU 312 adds the sequence determined in step S710 to the sequence indicating the number of lines of the second program.

ステップS712において、CPU312は、変数Nにk+1を加算する。ステップS713において、CPU312は、次の行があるか否かを判定する。次の行があるとき、処理はステップS704に戻る。すなわち、数列に追加していない行から処理を繰り返す。 In step S712, the CPU 312 adds k+1 to the variable N. In step S713, the CPU 312 determines whether or not there is a next line. When there is a next line, the process returns to step S704. That is, the process is repeated from the row that has not been added to the numerical sequence.

ステップS705において、行数が増えていないと判定されたとき、処理はステップS714に進む。ステップS714において、CPU312は、取得した第1プログラムのN行目の構文が、プログラムの変換において行数が減る構文であるか否かを判定する。行数が減るとき、処理はステップS715に進む。 When it is determined in step S705 that the number of rows has not increased, the process proceeds to step S714. In step S714, the CPU 312 determines whether or not the acquired syntax of the N-th line of the first program is a syntax that reduces the number of lines in program conversion. When the number of rows decreases, the process proceeds to step S715.

ステップS715において、CPU312は、変数kを1に設定する。ステップS716において、CPU312は、第1プログラムのN+k行目のデータを取得する。ステップS717において、CPU312は、第1プログラムのN+k行目のデータに基づいて、減少行数を決定するために次の行を確認する必要があるか否かを判定する。次の行を確認する必要があるとき、処理はステップS718に進む。ステップS718において、CPU312は、変数kに1を加算する。その後、処理はステップS716に戻る。ステップS717において、次の行を確認する必要がないと判定されたとき、処理はステップS719に進む。 In step S715, the CPU 312 sets the variable k to 1. In step S716, the CPU 312 acquires the data of the N+kth row of the first program. In step S717, the CPU 312 determines whether or not it is necessary to confirm the next line in order to determine the number of reduced lines, based on the data of the N+kth line of the first program. When the next row needs to be confirmed, processing proceeds to step S718. In step S718, the CPU 312 adds 1 to the variable k. After that, the process returns to step S716. When it is determined in step S717 that there is no need to check the next row, the process proceeds to step S719.

ステップS719において、CPU312は、第1プログラムのN行目からN+k行目までの命令文の記載に基づいて、第2プログラムにおいて対応する行数を示す数列を確定する。ステップS720において、CPU312は、第2プログラムの行数を示す数列に、ステップS719で確定した数列を追加する。例えば、N行目、N+1行目、及びN+2行目が1行に変換される場合、数列には1つの値が追加される。追加される値は例えば、{N}のように最初の行の値であってもよいし、例えば{N/N+1/N+2}のように、行番号を列記した値であってもよい。 In step S719, the CPU 312 determines a sequence indicating the corresponding number of lines in the second program, based on the descriptions of the statements from the Nth line to the N+kth line of the first program. In step S720, CPU 312 adds the sequence determined in step S719 to the sequence indicating the number of lines of the second program. For example, if the Nth, N+1, and N+2 rows are converted to 1 row, one value is added to the sequence. The added value may be the value of the first row, for example {N}, or it may be a value listing the row numbers, for example {N/N+1/N+2}.

ステップS721において、CPU312は、変数Nにk+1を加算する。その後、処理はステップS713に戻る。すなわち、次の行があるときには、数列に追加していない行から処理を繰り返す。 In step S721, the CPU 312 adds k+1 to the variable N. After that, the process returns to step S713. That is, when there is a next row, the process is repeated from the row that has not been added to the sequence.

ステップS714において、行数が減らないと判定されたとき、処理はステップS722に進む。ステップS722において、CPU312は、数列に1個のNを追加する。その後、処理はステップS713に戻る。すなわち、次の行があるときには、数列に追加していない行から処理を繰り返す。 When it is determined in step S714 that the number of rows does not decrease, the process proceeds to step S722. In step S722, the CPU 312 adds one N to the sequence. After that, the process returns to step S713. That is, when there is a next row, the process is repeated from the row that has not been added to the sequence.

ステップS713において、次の行がないと判定されたとき、処理はステップS723に進む。ステップS723において、CPU312は、得られた数列に基づいて、第2プログラムに行番号を付与する。ステップS724において、CPU312は、第1プログラム及び第2プログラムとそれらの行番号との情報を用いて、スマートフォン200に表示させる画面に関するデータを作成する。ステップS725において、CPU312は、画面に関するデータの作成結果をスマートフォン200に送信する。以上で、変換処理は終了する。 When it is determined in step S713 that there is no next line, the process proceeds to step S723. In step S723, the CPU 312 assigns line numbers to the second program based on the obtained sequence. In step S<b>724 , the CPU 312 creates data regarding the screen to be displayed on the smartphone 200 using the information of the first program, the second program, and their line numbers. In step S<b>725 , the CPU 312 transmits the creation result of the screen-related data to the smartphone 200 . With this, the conversion processing ends.

本実施形態によれば、第1プログラムから第2プログラムに変換するにあたって、行数が増える場合と減る場合とがあっても対応できる。また、本実施形態によれば、命令文の内容に応じて増減する行数が変化する場合があっても対応できる。したがって、種々のプログラム間の変換に対応できる。 According to this embodiment, when converting from the first program to the second program, it is possible to deal with cases where the number of lines increases and cases where the number of lines decreases. Moreover, according to this embodiment, even if the number of lines to be increased or decreased according to the content of the imperative sentence changes, it can be dealt with. Therefore, conversion between various programs can be handled.

[変形例]
システムの構成については、上述の実施形態に限らない。システム構成は種々に変更し得る。例えば、スマートフォン200は、これに限らず、タブレット型の情報端末、パーソナルコンピュータなど、各種情報処理装置であってよい。また、電卓100とスマートフォン200との間の情報の伝達は、2次元コードで行うに限らない。Bluetooth Low Energy(Bluetoothは登録商標)などの規格を用いた無線通信又は有線通信などで行われてもよい。電卓100がWi-Fi(登録商標)などで直接ネットワーク400に接続してもよい。この場合、スマートフォン200を介さずに、電卓100がサーバ300に第1プログラムを送信してもよい。また、電卓100とスマートフォン200とは別体でなくてもよい。例えば、電卓100の機能とスマートフォン200の機能とを1つのスマートフォンなどの情報処理端末が担ってもよい。また、サーバ300で行われる情報処理は、スマートフォン200で行われてもよい。したがって、システム10の全ての機能を1つの情報処理端末で担ってもよい。
[Modification]
The configuration of the system is not limited to the above embodiments. Various system configurations are possible. For example, the smartphone 200 is not limited to this, and may be various information processing devices such as a tablet-type information terminal and a personal computer. Further, transmission of information between the calculator 100 and the smartphone 200 is not limited to the two-dimensional code. Wireless communication or wired communication using standards such as Bluetooth Low Energy (Bluetooth is a registered trademark) may be used. The calculator 100 may be directly connected to the network 400 via Wi-Fi (registered trademark) or the like. In this case, calculator 100 may transmit the first program to server 300 without using smartphone 200 . Also, the calculator 100 and the smartphone 200 do not have to be separate entities. For example, one information processing terminal such as a smartphone may perform the function of the calculator 100 and the function of the smartphone 200 . Further, the information processing performed by the server 300 may be performed by the smart phone 200 . Therefore, one information processing terminal may serve all the functions of the system 10 .

つまり、電卓100がプログラム入力機器、スマートフォン200が通信機器、サーバ300が情報処理装置として機能するシステムや、電卓100がプログラム入力機器、及び、通信機器、サーバ300が情報処理装置として機能し、スマートフォン200が無いシステムや、電卓100がプログラム入力機器、スマートフォン200が通信機器、及び、情報処理装置として機能し、サーバ300が無いシステム、あるいは、電卓100又はスマートフォン200のそれぞれが単体でプログラム入力機器、通信機器、及び、情報処理装置として機能し、サーバ300が無くてもよい。 That is, a system in which the calculator 100 functions as a program input device, the smartphone 200 functions as a communication device, and the server 300 functions as an information processing device, or a system in which the calculator 100 functions as a program input device and communication device, and the server 300 functions as an information processing device, and the smartphone 200, the calculator 100 functions as a program input device, the smartphone 200 functions as a communication device and an information processing device, and the server 300 does not exist, or the calculator 100 or the smartphone 200 is a single program input device, It functions as a communication device and an information processing device, and the server 300 may be omitted.

上述の実施形態では、行数を特定するアルゴリズムの一例を示したが、これに限らない。同様の機能を発揮すれば、上述の機能は他の方法によって実現されもよい。 Although an example of the algorithm for specifying the number of rows has been shown in the above embodiment, the present invention is not limited to this. The functions described above may be implemented in other ways as long as they perform similar functions.

上述の実施形態では、変換前の第1プログラムを基準として、第1プログラムの1行ごとに行番号が付され、変換後の第2プログラムの各々の行に、対応する行番号が付されている。しかしながら、これに限らない。変換後の第2プログラムを基準として、第2プログラムの1行ごとに行番号が付され、変換前の第1プログラムの各々の行に、対応する行番号が付されてもよい。 In the above-described embodiment, with reference to the first program before conversion, each line of the first program is assigned a line number, and each line of the second program after conversion is assigned a corresponding line number. there is However, it is not limited to this. A line number may be assigned to each line of the second program with reference to the second program after conversion, and a corresponding line number may be assigned to each line of the first program before conversion.

なお、本発明は、上記実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。また、各実施形態は適宜組み合わせて実施してもよく、その場合組み合わせた効果が得られる。更に、上記実施形態には種々の発明が含まれており、開示される複数の構成要件から選択された組み合わせにより種々の発明が抽出され得る。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、課題が解決でき、効果が得られる場合には、この構成要件が削除された構成が発明として抽出され得る。 It should be noted that the present invention is not limited to the above-described embodiments, and can be variously modified in the implementation stage without departing from the gist of the present invention. Further, each embodiment may be implemented in combination as appropriate, in which case the combined effect can be obtained. Furthermore, various inventions are included in the above embodiments, and various inventions can be extracted by combinations selected from a plurality of disclosed constituent elements. For example, even if some constituent elements are deleted from all the constituent elements shown in the embodiments, if the problem can be solved and effects can be obtained, the configuration with the constituent elements deleted can be extracted as an invention.

以下に、本願出願の当初の特許請求の範囲に記載された発明を付記する。
[1]
第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する符号を付することと
前記符号が付された前記第1プログラムの第1プログラムリストと前記符号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
をコンピュータに実行させるためのプログラム。
[2]
ユーザによって選択された、前記第1プログラムリストと前記第2プログラムリストとのうち何れか一方の任意の行の情報を取得することと、
前記第1プログラムリストと前記第2プログラムリストとのうち他方の、前記選択された行に対応する行を示す表示を前記表示装置に表示させるためのデータを作成することと
を更にコンピュータに実行させるための[1]に記載のプログラム。
[3]
前記第1プログラムリストと前記第2プログラムリストとを左右に並べたときに互いに対応する行が左右に並ぶように、前記第1プログラムリスト又は前記第2プログラムリストの行間に空白行を挿入することと、
前記空白行が挿入された、前記第1プログラムリストと前記第2プログラムリストとを左右に並べて前記表示装置に表示させるためのデータを作成することと
を更にコンピュータに実行させるための[1]又は[2]に記載のプログラム。
[4]
ユーザによる操作に応じて、前記空白行を含まない前記第1プログラムリストと前記第2プログラムリストとを上下に並べて前記表示装置に表示させるためのデータを作成することを更にコンピュータに実行させるための[3]に記載のプログラム。
[5]
第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する符号を付することと、
前記符号が付された前記第1プログラムの第1プログラムリストと前記符号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
を実行する回路を備える情報処理装置。
[6]
第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する符号を付することと、
前記符号が付された前記第1プログラムの第1プログラムリストと前記符号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
を実行させるためのプログラムが記憶された記憶装置を備える情報処理装置。
[7]
情報処理装置、通信機器、及び、プログラム入力機器を備えるシステムにより実行される情報処理方法であって、
前記プログラム入力機器により、第1プログラムを入力すること、
前記情報処理装置により、
前記プログラム入力機器により入力された前記第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する符号を付することと、
前記符号が付された前記第1プログラムの第1プログラムリストと前記符号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと、
前記通信機器へ前記データを送信することと、
前記通信機器の表示装置により、前記データを表示することと
を含む、情報処理方法。
The invention described in the original claims of the present application is appended below.
[1]
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
assigning corresponding reference numerals to lines of the first program and the second program that functionally correspond to each other; A program for causing a computer to create data for displaying a second program list of the second program on a display device.
[2]
obtaining information of any row in either one of the first program list and the second program list selected by a user;
creating data for causing the display device to display a row corresponding to the selected row in the other of the first program list and the second program list. The program according to [1] for
[3]
inserting a blank line between the lines of the first program list or the second program list so that when the first program list and the second program list are arranged horizontally, corresponding lines are aligned horizontally; and,
[1] for further causing a computer to execute: creating data for displaying the first program list and the second program list, in which the blank line is inserted, arranged side by side on the display device; or A program according to [2].
[4]
for further causing the computer to create data for displaying the first program list and the second program list not including the blank line vertically arranged on the display device according to an operation by a user; A program according to [3].
[5]
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
assigning corresponding symbols to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying a first program list of the first program to which the code is attached and a second program list of the second program to which the code is attached on a display device; An information processing device comprising a circuit.
[6]
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
assigning corresponding symbols to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program to which the code is attached and a second program list of the second program to which the code is attached; An information processing apparatus comprising a storage device storing a program for
[7]
An information processing method executed by a system comprising an information processing device, a communication device, and a program input device,
inputting a first program by the program input device;
By the information processing device,
obtaining the first program input by the program input device;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
assigning corresponding symbols to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program to which the code is attached and a second program list of the second program to which the code is attached;
transmitting the data to the communication device;
and displaying the data by a display device of the communication device.

10…システム、100…電卓、112…CPU、114…ROM、116…RAM、118…フラッシュメモリ、122…2次元コードエンコーダ、132…入力キー、134…液晶ディスプレイ、190…バスライン、200…スマートフォン、212…CPU、214…ROM、216…RAM、218…フラッシュメモリ、222…タッチパネル、224…液晶ディスプレイ、232…カメラ、234…通信装置、290…バスライン、300…サーバ、312…CPU、314…ROM、316…RAM、318…ハードディスク、334…通信装置、390…バスライン、400…ネットワーク、600…画面、610…第1プログラムリスト、611…行番号、612…命令文、620…第2プログラムリスト、621…行番号、622…命令文。 DESCRIPTION OF SYMBOLS 10... System, 100... Calculator, 112... CPU, 114... ROM, 116... RAM, 118... Flash memory, 122... Two-dimensional code encoder, 132... Input key, 134... Liquid crystal display, 190... Bus line, 200... Smartphone , 212 CPU 214 ROM 216 RAM 218 flash memory 222 touch panel 224 liquid crystal display 232 camera 234 communication device 290 bus line 300 server 312 CPU 314 ROM, 316 RAM, 318 hard disk, 334 communication device, 390 bus line, 400 network, 600 screen, 610 first program list, 611 line number, 612 statement, 620 second Program list, 621...line number, 622...statement.

Claims (7)

第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムから取得した構文が前記変換した際に行数が増える構文の場合、前記行数が増える構文に基づいて増加する行数を取得し、前記行数が増加する構文が記述されている行番号を取得された行数分増加させて、前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する行番号を付することと、
前記行番号が付された前記第1プログラムの第1プログラムリストと前記行番号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
をコンピュータに実行させるためのプログラム。
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
If the syntax obtained from the first program is a syntax that increases the number of lines when converted, the number of lines that increases is obtained based on the syntax that increases the number of lines, and the syntax that increases the number of lines is described. incrementing the line number by the obtained number of lines, and assigning the corresponding line numbers to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program with the line numbers and a second program list of the second program with the line numbers ; A program that makes a computer run.
ユーザによって選択された、前記第1プログラムリストと前記第2プログラムリストとのうち何れか一方の任意の行の情報を取得することと、
前記第1プログラムリストと前記第2プログラムリストとのうち他方の、前記選択された行に対応する行を示す表示を前記表示装置に表示させるためのデータを作成することと
を更にコンピュータに実行させるための請求項1に記載のプログラム。
obtaining information of any row in either one of the first program list and the second program list selected by a user;
creating data for causing the display device to display a row corresponding to the selected row in the other of the first program list and the second program list. The program according to claim 1 for.
前記第1プログラムリストと前記第2プログラムリストとを左右に並べたときに互いに対応する行が左右に並ぶように、前記第1プログラムリスト又は前記第2プログラムリストの行間に空白行を挿入することと、
前記空白行が挿入された、前記第1プログラムリストと前記第2プログラムリストとを左右に並べて前記表示装置に表示させるためのデータを作成することと
を更にコンピュータに実行させるための請求項1又は2に記載のプログラム。
inserting a blank line between the lines of the first program list or the second program list so that when the first program list and the second program list are arranged horizontally, corresponding lines are aligned horizontally; and,
and creating data for displaying the first program list and the second program list, in which the blank line is inserted, arranged side by side on the display device. 2. The program according to 2.
ユーザによる操作に応じて、前記空白行を含まない前記第1プログラムリストと前記第2プログラムリストとを上下に並べて前記表示装置に表示させるためのデータを作成する
ことを更にコンピュータに実行させるための請求項3に記載のプログラム。
for further causing the computer to create data for displaying the first program list and the second program list not including the blank line vertically arranged on the display device according to an operation by a user; 4. A program according to claim 3.
第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムから取得した構文が前記変換した際に行数が増える構文の場合、前記行数が増える構文に基づいて増加する行数を取得し、前記行数が増加する構文が記述されている行番号を取得された行数分増加させて、前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する行番号を付することと、
前記行番号が付された前記第1プログラムの第1プログラムリストと前記行番号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
を実行する回路を備える情報処理装置。
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
If the syntax obtained from the first program is a syntax that increases the number of lines when converted, the number of lines that increases is obtained based on the syntax that increases the number of lines, and the syntax that increases the number of lines is described. incrementing the line number by the obtained number of lines, and assigning the corresponding line numbers to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program with the line numbers and a second program list of the second program with the line numbers ; An information processing device that includes circuitry for executing.
第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムから取得した構文が前記変換した際に行数が増える構文の場合、前記行数が増える構文に基づいて増加する行数を取得し、前記行数が増加する構文が記述されている行番号を取得された行数分増加させて、前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する行番号を付することと、
前記行番号が付された前記第1プログラムの第1プログラムリストと前記行番号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと
を実行させるためのプログラムが記憶された記憶装置を備える情報処理装置。
obtaining a first program;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
If the syntax obtained from the first program is a syntax that increases the number of lines when converted, the number of lines that increases is obtained based on the syntax that increases the number of lines, and the syntax that increases the number of lines is described. incrementing the line number by the obtained number of lines, and assigning the corresponding line numbers to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program with the line numbers and a second program list of the second program with the line numbers; An information processing apparatus comprising a storage device storing a program to be executed.
情報処理装置、通信機器、及び、プログラム入力機器を備えるシステムにより実行される情報処理方法であって、
前記プログラム入力機器により、第1プログラムを入力すること、
前記情報処理装置により、
前記プログラム入力機器により入力された前記第1プログラムを取得することと、
前記第1プログラムを、前記第1プログラムに用いられているプログラミング言語と異なるプログラミング言語で記述され、前記第1プログラムと同等の機能を果たす第2プログラムに変換することと、
前記第1プログラムから取得した構文が前記変換した際に行数が増える構文の場合、前記行数が増える構文に基づいて増加する行数を取得し、前記行数が増加する構文が記述されている行番号を取得された行数分増加させて、前記第1プログラムと前記第2プログラムとの互いに機能的に対応する行に、対応する行番号を付することと、
前記行番号が付された前記第1プログラムの第1プログラムリストと前記行番号が付された前記第2プログラムの第2プログラムリストとを、表示装置に表示させるためのデータを作成することと、
前記通信機器へ前記データを送信することと、
前記通信機器の表示装置により、前記データを表示することと
を含む、情報処理方法。
An information processing method executed by a system comprising an information processing device, a communication device, and a program input device,
inputting a first program by the program input device;
By the information processing device,
obtaining the first program input by the program input device;
converting the first program into a second program written in a programming language different from the programming language used for the first program and performing the same function as the first program;
If the syntax obtained from the first program is a syntax that increases the number of lines when converted, the number of lines that increases is obtained based on the syntax that increases the number of lines, and the syntax that increases the number of lines is described. incrementing the line number by the obtained number of lines, and assigning the corresponding line numbers to lines functionally corresponding to each other in the first program and the second program;
creating data for displaying on a display device a first program list of the first program with the line numbers and a second program list of the second programs with the line numbers;
transmitting the data to the communication device;
and displaying the data by a display device of the communication device.
JP2019069742A 2019-04-01 2019-04-01 Program for converting program, information processing apparatus, and information processing method Active JP7306026B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019069742A JP7306026B2 (en) 2019-04-01 2019-04-01 Program for converting program, information processing apparatus, and information processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019069742A JP7306026B2 (en) 2019-04-01 2019-04-01 Program for converting program, information processing apparatus, and information processing method

Publications (2)

Publication Number Publication Date
JP2020170221A JP2020170221A (en) 2020-10-15
JP7306026B2 true JP7306026B2 (en) 2023-07-11

Family

ID=72745933

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019069742A Active JP7306026B2 (en) 2019-04-01 2019-04-01 Program for converting program, information processing apparatus, and information processing method

Country Status (1)

Country Link
JP (1) JP7306026B2 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003316605A (en) 2002-04-26 2003-11-07 Fujitsu Ltd Debugger program
JP2004133630A (en) 2002-10-09 2004-04-30 Ricoh Co Ltd Programming method, program conversion apparatus, program and storage medium
JP2005063121A (en) 2003-08-11 2005-03-10 Ricoh Co Ltd Device, method and program for converting source code and storage medium
JP2006011756A (en) 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
WO2007072652A1 (en) 2005-12-22 2007-06-28 Syunichi Niihara Program processing pattern automatic analysis processing device
JP2008181311A (en) 2007-01-24 2008-08-07 Toshiba Corp Refactoring support device and program
JP2013257639A (en) 2012-06-11 2013-12-26 Ntt Data Corp Method and system of difference extraction of source code using syntax analysis
WO2017120894A1 (en) 2016-01-15 2017-07-20 华为技术有限公司 Display method and terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6275223B1 (en) * 1998-07-08 2001-08-14 Nortel Networks Limited Interactive on line code inspection process and tool

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003316605A (en) 2002-04-26 2003-11-07 Fujitsu Ltd Debugger program
JP2004133630A (en) 2002-10-09 2004-04-30 Ricoh Co Ltd Programming method, program conversion apparatus, program and storage medium
JP2005063121A (en) 2003-08-11 2005-03-10 Ricoh Co Ltd Device, method and program for converting source code and storage medium
JP2006011756A (en) 2004-06-24 2006-01-12 Fujitsu Ltd Program converting program, program converting device and program converting method
WO2007072652A1 (en) 2005-12-22 2007-06-28 Syunichi Niihara Program processing pattern automatic analysis processing device
JP2008181311A (en) 2007-01-24 2008-08-07 Toshiba Corp Refactoring support device and program
JP2013257639A (en) 2012-06-11 2013-12-26 Ntt Data Corp Method and system of difference extraction of source code using syntax analysis
WO2017120894A1 (en) 2016-01-15 2017-07-20 华为技术有限公司 Display method and terminal

Also Published As

Publication number Publication date
JP2020170221A (en) 2020-10-15

Similar Documents

Publication Publication Date Title
US20190034379A1 (en) Calculator, recording medium and compute server
US10504258B2 (en) Information processing device editing map acquired from server
US20190318518A1 (en) Graph drawing method, graph drawing system, server apparatus, graph drawing apparatus, and recording medium
US20130185620A1 (en) Ladder program creation apparatus
JP2013196100A (en) Drawing display device and drawing display program
JP4971226B2 (en) Design support device
JP7306026B2 (en) Program for converting program, information processing apparatus, and information processing method
CN112487871A (en) Handwriting data processing method and device and electronic equipment
JP4854797B2 (en) Programs and electronics
JP2009059256A (en) Electronic device capable of drawing graph, and program
CN111951348A (en) Method and device for determining frame selection area and electronic equipment
JP6287498B2 (en) Electronic whiteboard device, electronic whiteboard input support method, and program
JP2017037416A (en) Image processor, image processing method
JPWO2015033599A1 (en) Information input device, control method, and program
US10885685B2 (en) Electronic apparatus for drawing graphs of mathematical expressions
CN112529984B (en) Method, device, electronic equipment and storage medium for drawing polygon
JP2019082927A (en) Information processing apparatus, information processing method, and program
EP3419004B1 (en) Data processing method and data processing device
CN115129278A (en) Image display control method, system, readable storage medium and electronic device
CN114443022A (en) Method for generating page building block and electronic equipment
CN112256175A (en) Character display method and device, electronic equipment and computer readable storage medium
EP3223112A1 (en) Information display device, information display method and storage medium
JP2017045276A (en) Mobile drawing display device, drawing display system
JP7279986B1 (en) Information processing method, information processing system and information processing program
US9990338B2 (en) Display device for controlling enlargement of displayed image data, and data processing device and non-transitory computer readable medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20220308

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20221213

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20221214

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20230104

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230213

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230530

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230612

R150 Certificate of patent or registration of utility model

Ref document number: 7306026

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150