JP2004133630A - Programming method, program conversion apparatus, program and storage medium - Google Patents

Programming method, program conversion apparatus, program and storage medium Download PDF

Info

Publication number
JP2004133630A
JP2004133630A JP2002296682A JP2002296682A JP2004133630A JP 2004133630 A JP2004133630 A JP 2004133630A JP 2002296682 A JP2002296682 A JP 2002296682A JP 2002296682 A JP2002296682 A JP 2002296682A JP 2004133630 A JP2004133630 A JP 2004133630A
Authority
JP
Japan
Prior art keywords
program
source program
device
conversion
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002296682A
Other languages
Japanese (ja)
Inventor
Katsumi Honda
本田 克己
Original Assignee
Hypergear:Kk
Ricoh 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 Hypergear:Kk, Ricoh Co Ltd, 株式会社ハイパーギア, 株式会社リコー filed Critical Hypergear:Kk
Priority to JP2002296682A priority Critical patent/JP2004133630A/en
Publication of JP2004133630A publication Critical patent/JP2004133630A/en
Pending legal-status Critical Current

Links

Images

Abstract

An object of the present invention is to easily develop and test a program that operates on a device to be incorporated.
A program creation method for creating a program that operates in a device to be embedded using a computer, wherein the computer executes a source program described in a first language specification input by a user. The above problem is solved by having a program conversion step of converting a source program of a second language specification different from the first language specification.
[Selection diagram] Fig. 1

Description

[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a program creation method, a program conversion device, a program, and a storage medium, and more particularly, to a program creation method, a program conversion device, a program, and a storage medium that use a computer to create a program that operates on a device to be embedded.
[0002]
[Prior art]
As one of the mechanisms for easily developing a program that operates in a device to be embedded with limited resources, there is a method called a cross compiler. One example of a cross compiler is the gcc compiler, which is famous as an open source.
[0003]
In the method of developing a program using the gcc compiler, a source program written in C language is developed and debugged on a host computer having abundant development resources, and the source program is executed by a CPU (Central) different from the host computer. It is converted into a machine language for a device to be embedded, which is composed of a processing unit (OS) and an operating system (OS), and is transferred to the device to be embedded.
[0004]
By adopting such a method, it is possible to develop a program that operates on a device to be incorporated with a small amount of development resources on a host computer with abundant development resources.
[0005]
Further, in addition to the method of performing development using the cross compiler, by using a language that does not require compilation as an execution environment of the device to be embedded, development of a program for the device to be embedded can be facilitated. There is also an attempt. For example, a one-chip CPU such as Intel's i8052 has a BASIC language interpreter in the CPU itself.
[0006]
By incorporating the one-chip CPU into a device to be embedded, a developer can easily debug while developing a program that operates on the device to be embedded.
[0007]
[Problems to be solved by the invention]
However, in the method of developing a program that operates on a device to be embedded using the cross compiler, the source program developed on the host computer is converted into a machine language on the embedded device, so that the source program is used on the host computer. However, there is a problem that debugging or the like cannot be easily performed using a debugger of the source program or a dump tool using an easy-to-understand variable name.
[0008]
In addition, when a basic test of a program created on a host computer is to be performed, as described above, the debugger cannot be easily performed by an embedded device which is an execution environment of the program. There is a problem that an execution environment must be virtually constructed on a host computer and a test must be performed.
[0009]
In addition, the program developer must finally test the embedded device, which is the original execution environment, and if a bug is found during the test of the program, the program converted into machine language However, there is also a problem that it is necessary to return to the host computer to correct the source program, compile the program, transfer the program to the embedded device, and start the test again.
[0010]
Also, in a method of developing a program that operates on the device by providing an interpreter such as a BASIC language in the CPU of the device to be embedded, generally, the device to be embedded does not have sufficient memory or the like. The available BASIC language specifications have also become poor, and there has been a problem in that the development man-hours have to be increased when attempting to create a program of the required specifications in a very limited language specification.
[0011]
The present invention has been made in view of the above points, and has as its object to easily develop and test a program that operates on a device to be incorporated.
[0012]
[Means for Solving the Problems]
Therefore, in order to solve the above-described problem, the present invention is a program creating method for creating a program that operates on a device to be embedded, using a computer, wherein the computer has a first language specification input by a user. Is converted into a source program of a second language specification different from the first language specification.
[0013]
According to another aspect of the present invention, there is provided a program creating method for creating a program that operates on a device to be embedded, wherein the device to be embedded is described in a first language specification input by a user. And a program conversion step of converting the obtained source program into a source program of a second language specification different from the first language specification.
[0014]
Further, in order to solve the above problem, the present invention is a program conversion device for converting a program, a source program described in a first language specification input by a user, the first language specification and the Is characterized by having a program conversion means for converting into a source program of a different second language specification.
[0015]
According to another aspect of the present invention, there is provided a program for causing a computer to execute the program creating method.
[0016]
According to another aspect of the present invention, there is provided a computer-readable recording medium storing a source program described in a first language specification input by a user.
[0017]
According to the present invention, there is provided a program conversion step of converting a source program described in a first language specification input by a user into a source program of a second language specification different from the first language specification. Therefore, by converting a source program developed using a computer and operating the converted source program on an embedded device having an interpreter, development is performed using an abundant development environment. The source program can be easily modified.
[0018]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0019]
FIG. 1 is a diagram (part 1) for explaining a development environment and an execution environment in a program development method of the present invention using an image forming apparatus as an apparatus to be incorporated.
[0020]
FIG. 1 includes a personal computer (hereinafter, referred to as a PC) 1, an image forming apparatus 2, and a network 3. The image forming apparatus 2 is connected to the PC 1 via the network 3.
[0021]
The PC 1 has a program development environment (for example, Visula Studio (registered trademark) of Microsoft Corporation) or the like, and the program developer operates on the image forming apparatus 2 to be incorporated later by using the development environment. Develop a program to debug the source program.
[0022]
In addition, the PC 1 converts a source program described in a predetermined language specification into a source program described in a language specification different from the predetermined language specification by using the development environment. The converted source program is transferred to the image forming apparatus 2 via the network 3. The details of the conversion of the source program will be described later.
[0023]
Hereinafter, for the sake of simplicity, the predetermined language specification will be referred to as Visual Basic (registered trademark) (hereinafter referred to as Visual Basic), and the language specification of the converted source program will be referred to as simple basic in the present invention. However, this does not limit the embodiment of the present invention.
[0024]
The image forming apparatus 2 acquires the source program described in the simple basic transmitted from the PC 1, and executes the received source program using the interpreter for the simple basic.
[0025]
A program developer who develops a program that operates in the image forming apparatus 2 which is an embedded apparatus describes and saves a source program written in visual basic in an editor or the like using the PC 1.
[0026]
The PC 1 converts the source program written in Visual Basic stored by the user into Simple Basic, and transfers it to the image forming apparatus 2 to be embedded.
[0027]
The image forming apparatus 2 stores the acquired source program described in the simple basic, and operates the program using a simple basic interpreter that reads, analyzes, and executes the source program described in the simple basic line by line. .
[0028]
Unlike the cross compiler, the program in the image forming apparatus 2, which is an embedded apparatus, is also an editable source program. Therefore, the program developer develops on the PC 1, which has a rich development environment, and creates a visual basic program. The described source program is converted to simple basic, transferred to the image forming apparatus 2, and the image forming apparatus 2 can debug and modify the source program described in simple basic.
[0029]
The conversion from Visual Basic to Simple Basic in PC1 is not the case where the Visual Basic source program is described and stored in the editor, but a conversion button or the like is provided and displayed on the PC1 screen. May be converted when the conversion button is pressed, or a timer may be provided in the PC 1 so that the conversion is performed at a predetermined time (for example, 1:00 am).
[0030]
Transfer of the converted source program to the image forming apparatus 2 is also provided with a transfer button or the like, displayed on the screen of the PC 1, and transferred when the program developer presses the transfer button. Alternatively, a timer may be provided in the PC 1 and the transfer may be performed at a predetermined time (for example, 1:30 am).
[0031]
In FIG. 1, the PC 1 and the image forming apparatus 2 are configured to be connected via the network 3, but the PC 1 and the image forming apparatus 2 are connected via a dedicated line or a cable. May be configured. The same applies to FIGS. 2 and 3 described later.
[0032]
FIG. 2 is a diagram (part 2) for explaining a development environment and an execution environment in the program development method of the present invention using an image forming apparatus as a device to be incorporated.
[0033]
FIG. 2 converts a source program described in Visual Basic into a source program described in Simple Basic in the image forming apparatus 2 to be incorporated as compared with FIG.
[0034]
FIG. 2 includes a PC 1, an image forming apparatus 2, and a network 3. The image forming apparatus 2 is connected to the PC 1 via the network 3.
[0035]
The PC 1 has a program development environment (for example, Visula Studio (registered trademark) of Microsoft Corporation) or the like, and the program developer operates on the image forming apparatus 2 to be incorporated later by using the development environment. Develop a program to debug the source program.
[0036]
In addition, the PC 1 transfers a source program described in visual basic to the image forming apparatus 2 via the network 3 by using the development environment by the developer of the program.
[0037]
On the other hand, the image forming apparatus 2 obtains the source program described in Visual Basic transferred from the PC 1, saves the source program in a predetermined storage area, and then describes the source program described in Visual Basic in Simple Basic. Convert to source program. The details of the conversion of the source program will be described later.
[0038]
The image forming apparatus 2 executes a program using the simple basic interpreter.
[0039]
A program developer who develops a program that operates in the image forming apparatus 2 which is an embedded apparatus describes and saves a source program written in visual basic in an editor or the like using the PC 1.
[0040]
The PC 1 transfers the stored source program written in Visual Basic to the image forming apparatus 2 to be embedded by the user.
[0041]
The image forming apparatus 2 converts the acquired source program written in visual basic into simple basic, reads the source program written in simple basic line by line, analyzes the program, and executes the program using a simple basic interpreter. To work.
[0042]
Unlike the cross-compiler, the program in the image forming apparatus 2 which is an embedded apparatus is also an editable source program. Therefore, the program developer develops the program in the PC 1 having a rich development environment. Then, the source program described in Visual Basic created is converted into Simple Basic in the image forming apparatus 2, and the source program written in Simple Basic can be debugged and modified in the image forming apparatus 2. .
[0043]
The transfer timing of the source program from the PC 1 to the image forming apparatus 2 is the same as that described with reference to FIG. 1, when the program developer writes and saves the source program in the editor. Or a transfer button may be provided on the PC1, and the transfer may be performed when the button is pressed. Then, it may be configured to transfer.
[0044]
The conversion of the source program from visual basic to simple basic in the image forming apparatus 2 may be performed by converting only the transferred source program at the same time as the transfer, or storing a predetermined amount of the source program. After that, they may be converted collectively.
[0045]
FIG. 3 is a diagram (part 3) for explaining a development environment and an execution environment in the program development method of the present invention using an image forming apparatus as a device to be incorporated.
[0046]
FIG. 3 shows that the program conversion device 4 converts a source program described in visual basic into a source program described in simple basic, as compared with FIG. 1 and FIG.
[0047]
FIG. 3 includes a PC 1, an image forming apparatus 2, a program conversion apparatus 4, and a network 3.
[0048]
The PC 1, the program conversion device 4, and the image forming device 2 are connected via the network 3.
[0049]
The PC 1 has a program development environment (for example, Visula Studio (registered trademark) of Microsoft Corporation) or the like. The program developer uses the development environment to operate the program that operates in the image forming apparatus 2 to be embedded. Develop and debug source programs.
[0050]
Further, the PC 1 transfers a source program described in visual basic by the developer of the program using the development environment to the program conversion device 4 via the network 3.
[0051]
The program conversion device 4 acquires the source program described in Visual Basic transferred from the PC 1 and converts the source program described in Visual Basic into a source program described in Simple Basic. The details of the conversion of the source program will be described later.
[0052]
The program conversion device 4 transfers the converted source program described in the simple basic format to the image forming device 2 via the network 3.
[0053]
The image forming apparatus 2 obtains the source program described in Visual Basic transferred from the program conversion apparatus 4, saves the source program in a predetermined storage area, and then describes the source program described in Visual Basic in Simple Basic. To a source program.
[0054]
The image forming apparatus 2 operates a program using the simple basic interpreter.
[0055]
A program developer who develops a program that operates in the image forming apparatus 2 which is an embedded apparatus describes and saves a source program written in visual basic in an editor or the like using the PC 1.
[0056]
The PC 1 transfers the stored source program written in Visual Basic to the program conversion device 4 by the user.
[0057]
The program conversion device 4 converts the acquired source program written in visual basic into simple basic, and transfers the converted source program described in simple basic to the image forming device 2.
[0058]
The image forming apparatus 2 stores the acquired source program described in the simple basic mode and operates the program using the simple basic interpreter.
[0059]
Unlike the cross compiler, the program in the image forming apparatus 2, which is an embedded apparatus, is also an editable source program. Therefore, the program developer develops on the PC 1, which has a rich development environment, and creates a visual basic program. The described source program is transferred to the program conversion device 4, converted into simple basic in the program conversion device 4, and the converted source program described in simple basic is transferred to the image forming device 2, Thus, debugging and correction of a source program described in simple basic can be performed.
[0060]
The transfer timing of the source program from the PC 1 to the program conversion device 4 is determined when the program developer writes and saves the source program in the editor in the same manner as described with reference to FIGS. The PC 1 may be configured to transfer data. Alternatively, the PC 1 may be configured to have a transfer button and configured to transfer data when the button is pressed. It is good also as a structure which transfers, when it becomes time.
[0061]
In the conversion of the source program from visual basic to simple basic in the program conversion device 4, the transferred source program may be converted at the same time as the transfer, or a predetermined amount of the source program may be stored. After that, they may be converted collectively.
[0062]
The transfer timing of the source program from the program conversion device 4 to the image forming device 2 is determined at the same time that the program conversion device 4 converts the source program described in Visual Basic into the source program described in Simple Basic. Alternatively, a predetermined amount of the source program may be converted and then transferred.
[0063]
FIG. 4 is a software configuration diagram of an embodiment of the PC. The PC 1 includes an application layer 109 running on an operating system (hereinafter, referred to as an OS) 100. The application layer 109 includes programs such as an editor and a debugger that perform processes specific to user services related to program development. In the configuration diagram of FIG. 4, components required for description are shown, and components not required for description are omitted. The same applies to the following drawings.
[0064]
The application layer 109 includes an editor application 101 which is an application for inputting / editing the contents of a file, and a debugger application 102 which is an application for finding an error (bug) in a program and supporting a correction operation. When the PC 1 has a function of performing program conversion as shown in FIG. 1, the application layer 109 converts a source program written in visual basic into a source program written in simple basic in the application layer 109. And a translator application 103 that is an application that performs
[0065]
FIG. 5 is a hardware configuration diagram of an embodiment of the PC. The hardware configuration shown in FIG. 5 includes an input device 110, a display device 111, a drive device 112, a recording medium 113, an auxiliary storage device 114, a memory device 115, which are mutually connected by a bus B. , An arithmetic processing unit 116, and an interface unit 117.
[0066]
The input device 110 includes a keyboard and a mouse operated by a developer who develops a program using the PC 1, and is used to input various operation signals to the PC 1.
[0067]
The display device 111 includes a display of the PC 1 and the like. The interface device 117 is an interface for connecting the PC 1 to a network.
[0068]
The source program conversion program corresponding to the translator application 103 is provided to the PC 1 by a recording medium 113 such as a CD-ROM, or is downloaded via a network. The recording medium 113 is set in the drive device 112, and data and a source program conversion program are installed in the auxiliary storage device 114 from the recording medium 113 via the drive device 112.
[0069]
The auxiliary storage device 114 stores data and a source program conversion program, and also stores necessary files and the like. The memory device 115 reads and stores the source program conversion program from the auxiliary storage device 114 when the PC 1 is started. The arithmetic processing unit 116 executes processing according to the source program conversion program read and stored in the memory device 115.
[0070]
In the following, the conversion process of the source program in the PC 1 will be described assuming that the source program conversion program performs the process.
[0071]
The image forming apparatus 2 has an interpreter application for reading, analyzing, and executing the source program described in the simple basic line by line, and, as shown in FIG. It includes a translator application which is an application for converting a described source program into a source program described in simple basic.
[0072]
FIG. 6 is a hardware configuration diagram of an embodiment of the image forming apparatus. The hardware configuration shown in FIG. 6 includes an input / display device 61, a drive device 62, a recording medium 63, an auxiliary storage device 64, a memory device 65, It comprises a device 66, an interface device 67, a reading device 68, and a printing device 69.
[0073]
The input / display device 61 includes an operation panel and the like, and is used to input various operation signals to the image forming apparatus 2.
[0074]
The interface device 67 is an interface for connecting the image forming device 2 to a network.
[0075]
The program of the interpreter application and the source program conversion program corresponding to the translator application are provided to the image forming apparatus 2 by a recording medium 63 such as a CD-ROM, or downloaded through a network. The recording medium 63 is set in the drive device 62, and data, a program for an interpreter application, a source program conversion program, and the like are installed from the recording medium 63 to the auxiliary storage device 64 via the drive device 62.
[0076]
The auxiliary storage device 64 stores data, a program of the interpreter application and a source program conversion program, and also stores necessary files and the like. The memory device 65 reads the inter application program and the source program conversion program from the auxiliary storage device 64 when the image forming apparatus 2 is started, and stores them. The arithmetic processing device 66 executes processing in accordance with the inter-appli program and the source program conversion program which are read and stored in the memory device 65.
[0077]
The reading device 68 reads data such as an image and a document related to image formation. The printing device 69 prints data such as images and documents read by the reading device 68.
[0078]
In the following, the source program conversion processing in the image forming apparatus 2 will be described assuming that the source program conversion program performs the processing.
[0079]
FIG. 7 is a software configuration diagram of an embodiment of the program conversion device. The program conversion device 4 includes an application layer 209 running on an operating system (hereinafter, referred to as OS) 200. The application layer 209 includes a translator application 201 that is an application that converts a source program described in Visual Basic into a source program described in Simple Basic.
[0080]
FIG. 8 is a hardware configuration diagram of an embodiment of the program conversion device. The hardware configuration of the program conversion device 4 shown in FIG. 8 includes a display device 211, a drive device 212, a recording medium 213, an auxiliary storage device 214, and a memory device 215, which are interconnected by a bus B. , An arithmetic processing unit 216 and an interface unit 217.
[0081]
The display device 211 is configured by a display of the program conversion device 4 and displays an error when the program is converted.
[0082]
The source program conversion program corresponding to the translator application 201 is provided to the program conversion device 4 by a recording medium 213 such as a CD-ROM, or is downloaded through a network. The recording medium 213 is set in the drive device 212, and data and a source program conversion program are installed in the auxiliary storage device 214 from the recording medium 213 via the drive device 212.
[0083]
The auxiliary storage device 214 stores data and a source program conversion program, and also stores necessary files and the like. The memory device 215 reads and stores the source program conversion program from the auxiliary storage device 214 when the program conversion device 4 is activated. The arithmetic processing device 216 executes processing according to the source program conversion program read and stored in the memory device 215.
[0084]
In the following, the conversion process of the source program in the program conversion device 4 will be described on the assumption that the source program conversion program performs the process.
[0085]
As described above, in the embodiment of the present invention, a source program conversion program for converting a source program described in Visual Basic into a source program described in Simple Basic may be installed in the PC 1 and operated on the PC 1. Alternatively, it may be installed in the image forming apparatus 2 and operated in the image forming apparatus 4, or may be installed in the program converting apparatus 4 and operated in the program converting apparatus 4.
[0086]
Hereinafter, a functional block diagram of the source program conversion program will be described with reference to FIG. FIG. 9 is a diagram for explaining an example of the function of the source program conversion program using a functional block diagram.
[0087]
The source program conversion program includes a lexical analyzer 301, a syntax analyzer 302, an error detector 303, an extended function detector 304, a substitute routine converter 305, a source program converter 306, a file I / O unit. 307, a device library management unit 308, and a symbol table management unit 309.
[0088]
The file I / O unit 307 opens the specified file and reads a source program described in the file. Also, the specified file is opened and the source program is written to the file.
[0089]
The lexical analysis unit 301 divides the statement of the source program read by the file I / O unit 307 into tokens of the minimum unit.
[0090]
The syntax analysis unit 302 analyzes whether or not the command sentence divided into tokens in the minimum unit in the lexical analysis unit 301 is suitable for a grammar defined by the Visual Basic language specification.
[0091]
The error detection unit 303 detects a command statement that cannot be converted from a source program described in visual basic to a source program described in simple basic based on the result analyzed by the syntax analysis unit 302.
[0092]
The extension function detection unit 304 detects a command sentence of the extension function based on the result analyzed by the syntax analysis unit 302.
[0093]
The substitute routine conversion unit 305, based on the result of the detection performed by the extension function detection unit 304, if the statement of the extension function exists in the source program described in the visual basic, Converts the statement of the extended function of the program into a substitute routine written in simple basic.
[0094]
The source program conversion unit 306 converts a source program described in Visual Basic into a source program described in Simple Basic.
[0095]
The device library management unit 308 holds and manages library information for each device to be incorporated, and provides the library information when the source program conversion unit 306 creates a source program described in simple basic for each device. I do.
[0096]
The symbol table management unit 309 holds a symbol table that describes a relationship between information such as a variable name, a constant name, and a function name of a source program described in visual basic and a position (virtual address) where the information is arranged. ,to manage. When the source program conversion unit 306 converts a source program described in visual basic into a source program described in simple basic, the symbol table management unit 309 stores information such as the variable names, constant names, and function names. , Provide the relationship with the virtual address.
[0097]
FIG. 10 is a flowchart of an example of a source program conversion process performed by the source program conversion program.
[0098]
In step S10, the file I / O unit 307 of the source program conversion program opens the source program file described in the designated visual basic and reads the source program described in the file.
[0099]
Proceeding to step S20 following step S10, the lexical analyzer 301 of the source program conversion program divides the statement of the source program written in visual basic read in step S10 into tokens of the minimum unit.
[0100]
Proceeding to step S30 following step S20, the syntax analysis unit 302 of the source program conversion program converts the imperative sentence divided into the minimum unit tokens in step S20 into a grammar defined by the Visual Basic language specification. Analyze whether
[0101]
Proceeding to step S40 following step S30, the error detection unit 303 of the source program conversion program changes the source program described in visual basic to the source program described in simple basic based on the result analyzed in step 30. Detects non-convertible statements. Here, the information that the statement is an instruction that cannot be converted is included in the syntax analysis unit 302, and the error detection unit 303 refers to the information and converts the source program described in the visual basic into the simple basic. Detects non-convertible statements.
[0102]
When the error detecting unit 303 detects a non-convertible statement from the source program described in Visual Basic (YES in step S40), the process proceeds to step S50, where the error detecting unit 303 detects an unconvertible command. If not (NO in step S30), the process proceeds to step S60.
[0103]
In step S50, the source program conversion program displays an error content such as a non-convertible command sentence detected in step S40 on a screen or the like.
[0104]
In step S60, the extended function detection unit 304 of the source program conversion program checks the statement of the extended function based on the result analyzed in step S30. Here, the information that the statement is an instruction of an extended function is included in the syntax analysis unit 302, and the extended function detecting unit 304 refers to the information, and finds the extended function from the source program described in Visual Basic. Detects a statement.
[0105]
If the extended function detection unit 304 detects a command sentence that is an extended function from the source program described in Visual Basic (YES in step S60), the process proceeds to step S70, and if the command sentence that is the extended function is not detected (step S60). (NO in S60), the process proceeds to step S80.
[0106]
In step S70, the substitute routine conversion unit 305 of the source program conversion program substitutes the command statement of the extended function of the source program described in visual basic based on the result of the detection performed in step S60 in simplified basic. Convert to a routine. An example of the conversion to the substitute routine will be described later.
[0107]
In step S80, the source program conversion unit 306 of the source program conversion program converts the source program described in Visual Basic into a source program described in Simple Basic.
[0108]
The source program conversion unit 306 uses the symbol table management unit 309 to convert a variable name or constant name of the source program described in visual basic so as to indicate an actual address with reference to the symbol table management unit 309. I do. An example of the conversion will be described later.
[0109]
In step S90, the file I / O unit 307 of the source program conversion program writes the source program described in simple basic into the specified file.
[0110]
As described above, by using the source program conversion program of the present invention, a source program created using an existing language and a development system can be converted into a source program that operates on a device to be embedded.
[0111]
The conversion of the source program in step S80 of FIG. 10 can also be converted into a source program specific to the device to be incorporated. FIG. 11 is a flowchart of an example of the conversion process in step S80 in FIG.
[0112]
In step S81, the source program conversion unit 306 of the source program conversion program determines whether the target device to be incorporated this time is the device 1 from a source program described in visual basic. If it is determined that the target device to be incorporated this time is device 1 (YES in step S81), the process proceeds to step S82. If it is determined that the device is other than device 1 (NO in step S81), the process proceeds to step S83.
[0113]
In step S82, the source program conversion unit 306 of the source program conversion program links the library for the device 1 held and managed by the device library management unit 308, and writes the source program described in the simple basic for the device 1. Generate
[0114]
In step S83, the source program conversion unit 306 of the source program conversion program determines whether or not the target device to be incorporated this time is the device 2 from the source program described in visual basic. If it is determined that the target device to be incorporated this time is device 2 (YES in step S83), the process proceeds to step S84. If it is determined that the device is not device 2 (NO in step S83), the process proceeds to step S85.
[0115]
In step S84, the source program conversion unit 306 of the source program conversion program links the library for the device 2 held and managed by the device library management unit 308, and writes the source program described in the simple basic for the device 2. Generate
[0116]
In step S85, the source program conversion unit 306 of the source program conversion program links the library for the device 3 held and managed by the device library management unit 308, and writes the source program described in the simple basic for the device 3. Generate
[0117]
By repeatedly performing the above-described processing, it is possible to generate a source program described in simple basic for a specified device as well as for three devices.
[0118]
Further, by performing the above-described processing, a source program described in visual basic can be input and a source program described in simple basic unique to each device to be incorporated can be output and acquired.
[0119]
On the other hand, unlike the above-described processing, the program conversion processing can be performed in a plurality of stages.
[0120]
FIG. 12 is a conceptual diagram of an example in which a program conversion process is performed in a plurality of stages.
[0121]
In FIG. 12, the program conversion A receives a source program described in visual basic as an input and outputs a source program described in simple basic common to a device to be incorporated.
[0122]
The program conversion A converts the source program described in the visual basic in step S80 shown in FIG. 10 into a source program described in the simple basic common to the device to be embedded, and performs step S90 in FIG. Output to a file.
[0123]
In FIG. 12, the program conversion B and the program conversion C output a source program described in a simple basic unique to the device to be incorporated as an input and a source program described in a simple basic common to the device to be incorporated. I do.
[0124]
In the program conversion B and the program conversion C, in step S80 shown in FIG. 10, the source program described in the simple basic common to the devices to be embedded is described by the simple basic unique to the device to be embedded. Convert to source program.
[0125]
As shown in FIG. 12, by once outputting a source program written in simple basic common to the devices to be incorporated, and then converting it to a source program written in simple basic unique to each device, Compared to a case where a source program unique to each device is output from the beginning, a source program conversion program can be simplified, and time and resources required for conversion processing can be saved.
[0126]
The source program conversion program may protect the converted source program by adding a process such as encrypting the converted source program before the process of step S90 in FIG. Before the processing in step S90 of step 10, the converted source program may be encoded to improve the speed of transferring the source program and executing the source program.
[0127]
Hereinafter, an example of the conversion of the source program in step S80 in FIG. 10 and the conversion to the substitute routine in step S70 in FIG. 10 will be described using actual source codes.
[0128]
FIG. 13 is a diagram illustrating an example of conversion of a variable name. FIG. 13A shows a part of a source program described in visual basic before conversion, and FIG. 13B shows an example of converting the source program of FIG. 13A using a source program conversion program. FIG. Note that the numbers on the left side of the figure are the number of lines of the source program added for explanation.
[0129]
In FIG. 13, each row in FIG. 13A is converted into a corresponding number of rows in FIG. 13B.
[0130]
For example, when the variable “Loop_Counter” in the first line in FIG. 13A is converted by the source program conversion program, it is converted into “$ 1” as shown in the first line in FIG. ing.
[0131]
The source program conversion program converts a variable name in the source program described in Visual Basic into a prefix and a number as shown in the first to third lines of FIG. 13B.
[0132]
Further, when the variable “Message $” in the fourth line of FIG. 13A is converted by the source program conversion program, it is converted into “$ 4” as shown in the fourth line of FIG. Have been.
[0133]
The source program conversion program converts a variable name of an array in the source program described in Visual Basic into a dollar and a number as shown in the fourth line of FIG. 13B.
[0134]
In this way, the simple basic interpreter that reads, interprets, and executes the simple basic line by line by converting the variable name into a number, for example, determines the memory address to which the character string “Loop_Counter” corresponds. It is not necessary to hold a table representing the “Loop_Counter”, and since the variable name is converted to a number, which address corresponds to “Loop_Counter” as compared with the case where the variable name remains “Loop_Counter” And the speed of the interpretation process can be increased.
[0135]
Hereinafter, an example of conversion of a structured program described in visual basic will be described with reference to FIGS.
[0136]
FIG. 14 is a diagram (part 1) for explaining the conversion of the structured program. FIG. 14A shows a part of a source program described in visual basic before conversion, and FIG. 14B shows an example of converting the source program of FIG. 14A using a source program conversion program. FIG.
[0137]
As shown in FIG. 14B, the source program conversion program converts a for statement, which is one of the structured programs, in the source program described in visual basic into an if statement described in simple basic, to goto minutes.
[0138]
FIG. 15 is a diagram (part 2) for explaining the conversion of the structured program. FIG. 15A shows a part of a source program described in visual basic before conversion, and FIG. 15B shows an example of converting the source program of FIG. 15A using a source program conversion program. FIG.
[0139]
As shown in FIG. 15B, the source program conversion program converts the while statement, which is one of the structured programs, in the source program described in the visual basic into the if statement described in the simple basic, to goto minutes.
[0140]
FIG. 16 is a diagram (part 3) for explaining the conversion of the structured program. FIG. 16A shows a part of a source program described in visual basic before conversion, and FIG. 16B shows an example of converting the source program of FIG. 16A using a source program conversion program. FIG.
[0141]
As shown in FIG. 16B, the source program conversion program converts a case statement, which is one of the structured programs, in the source program described in the visual basic into an if part described in the simple basic, to goto minutes.
[0142]
As described with reference to FIG. 14, FIG. 15, and FIG. 16, the source program conversion program converts the source program described by the visual basic structured program into the simple basic if statement and the goto statement. Convert to a program.
[0143]
Therefore, a developer who develops a program that operates on a device to be embedded can develop a program using structured programming using the familiar Visual Basic.
[0144]
On the other hand, the device to be incorporated can read and execute the source program converted into the simple basic if statement and goto statement by using the simple interpreter.
[0145]
In fact, in the one-chip CPU shown in the conventional description, the structured programming is not implemented, and the developer cannot perform the development using the structured programming. By using a program, a program is developed using structured programming using a familiar visual basic, and the converted program can be executed in a device to be incorporated.
[0146]
Further, the source program conversion program of the present invention has a function of generating and adding a substitute routine when a function not provided on the device to be embedded exists in a source program described in visual basic. Have.
[0147]
FIG. 17 is a diagram illustrating an example of generating and adding a substitute routine. FIG. 17A is a diagram illustrating an example of a button on the operation panel of the image forming apparatus 2. FIG. 17B is a diagram showing a part of a source code representing a button on the operation panel shown in FIG. 17A described in visual basic. FIG. 17C is a diagram showing a part of the source program obtained by converting FIG. 17B by using the source program conversion program, generating a substitute routine, and adding the substitute routine.
[0148]
For example, the program developer uses Visual Basic to group a plurality of option buttons (in the example of FIG. 17A, a “B4” button, a “B5” button, and an “A4” button). , Only one of the grouped option buttons can be selected.
[0149]
However, in general, even if the image forming apparatus 2 to be incorporated has a user interface library group related to an operation panel for inputting and displaying characters, a plurality of buttons as described above are grouped. In order to prepare such a function that only one button can be selected from among a plurality of grouped option buttons, a large number of resources and the like are required.
[0150]
When the source program conversion program detects, in a source program described in Visual Basic, a statement of an extended function that is not implemented in the target embedded device that performs button grouping as described above, FIG. A source program described in visual basic as shown in (B) is converted into a substitute routine described in simple basic as shown in FIG.
[0151]
In addition, as shown in FIG. 17A, a developer who creates a program that operates on a device to be embedded needs to install a button or the like on an operation panel of the device to be embedded beforehand. A template corresponding to the size of the operation panel of the target device is prepared in the development environment of the computer 1, and a screen such as a button to be arranged thereon can be created using the prepared template. .
[0152]
【The invention's effect】
As described above, according to the present invention, it is possible to easily develop and test a program that operates on a device to be embedded.
[0153]
[Brief description of the drawings]
FIG. 1 is a diagram (part 1) for explaining a development environment and an execution environment in a program development method of the present invention using an image forming apparatus as a device to be incorporated.
FIG. 2 is a diagram (part 2) for describing a development environment and an execution environment in the program development method of the present invention using an image forming apparatus as a device to be incorporated.
FIG. 3 is a diagram (part 3) for explaining a development environment and an execution environment in the program development method of the present invention using an image forming apparatus as a device to be incorporated.
FIG. 4 is a software configuration diagram of an embodiment of a PC.
FIG. 5 is a hardware configuration diagram of an embodiment of a PC.
FIG. 6 is a hardware configuration diagram of an embodiment of an image forming apparatus.
FIG. 7 is a configuration diagram of an embodiment of a program conversion device.
FIG. 8 is a hardware configuration diagram of an embodiment of a program conversion device.
FIG. 9 is a diagram for explaining an example of a function of a source program conversion program using a functional block diagram.
FIG. 10 is a flowchart of an example of a source program conversion process by the source program conversion program.
FIG. 11 is a flowchart illustrating an example of a conversion process in step S80 of FIG. 10;
FIG. 12 is a conceptual diagram illustrating an example in which a program conversion process is performed in a plurality of stages.
FIG. 13 is a diagram illustrating an example of conversion of a variable name.
FIG. 14 is a diagram (part 1) for explaining an example of conversion of a structured program;
FIG. 15 is a diagram (part 2) for explaining an example of conversion of a structured program;
FIG. 16 is a diagram (part 3) for explaining an example of conversion of a structured program;
FIG. 17 is a diagram for explaining an example of conversion to a substitute routine.
[Explanation of symbols]
1 Personal computer (PC)
2 Image forming apparatus
3 network
4 Program conversion device
61 Input / display device
62 Drive device
63 storage media
64 Auxiliary storage device
65 Memory device
66 arithmetic processing unit
67 Interface device
68 Reader
69 printing device
100 OS (Operating System)
101 Editor App
102 Debugger application
103 Translator app
109 Application Layer
110 input device
111 display device
112 drive device
113 storage medium
114 Auxiliary storage medium
115 Memory device
116 arithmetic processing unit
117 Interface device
200 OS (Operating System)
201 Translator app
209 Application layer
211 Display device
212 drive device
213 Storage medium
214 auxiliary storage medium
215 Memory device
216 arithmetic processing unit
217 Interface device
301 lexical analyzer
302 Parser
303 Error detection unit
304 Extended function detection unit
305 Substitution routine conversion unit
306 Source program conversion unit
307 File I / O section
308 Device library management unit
309 Symbol table management unit

Claims (12)

  1. A program creation method for creating a program that operates on a device to be embedded using a computer,
    The computer has a program conversion step of converting a source program described in a first language specification input by a user into a source program of a second language specification different from the first language specification. And how to create a program.
  2. 2. The method according to claim 1, wherein the source program of the second language specification is editable.
  3. 3. The method according to claim 1, wherein the program conversion step includes a detection step of detecting a non-convertible statement.
  4. 4. The method according to claim 1, wherein the conversion of the source program in the program conversion step is started at the same time when the source program described in the first language specification is input by a user and stored in a file. The program creation method according to any one of the preceding claims.
  5. 5. The method according to claim 1, further comprising, after the program conversion step, a transfer step of transferring the source program of the second language specification converted in the program conversion step to the device. How to create a program.
  6. 6. The method according to claim 5, wherein the transfer of the source program in the transfer step is performed simultaneously with the conversion of the source program in the program conversion step.
  7. 7. The program creation method according to claim 1, wherein the device to be embedded has an interpreter that reads, interprets, and executes the source program of the second language specification line by line. Method.
  8. A program creation method for creating a program that operates on a device to be embedded using a computer,
    A first program conversion step in which the computer converts a part of a source program described in a first language specification input by a user into a source program in a second language specification different from the first language specification When,
    The computer converts a source program described in the second language specification into a source program described in a third language specification different from the first and second language uses according to the device. And a second program conversion step.
  9. A program creation method for creating a program that operates on a device to be embedded,
    The device to be incorporated has a program conversion step of converting a source program described in a first language specification input by a user into a source program of a second language specification different from the first language specification. A program creation method characterized by the above-mentioned.
  10. A program conversion device for converting a program,
    Program conversion means for converting a source program described in a first language specification input by a user into a source program of a second language specification different from the first language specification. apparatus.
  11. A program for causing a computer to execute the method according to claim 1.
  12. A computer-readable recording medium storing the program according to claim 11.
JP2002296682A 2002-10-09 2002-10-09 Programming method, program conversion apparatus, program and storage medium Pending JP2004133630A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002296682A JP2004133630A (en) 2002-10-09 2002-10-09 Programming method, program conversion apparatus, program and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002296682A JP2004133630A (en) 2002-10-09 2002-10-09 Programming method, program conversion apparatus, program and storage medium

Publications (1)

Publication Number Publication Date
JP2004133630A true JP2004133630A (en) 2004-04-30

Family

ID=32286591

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002296682A Pending JP2004133630A (en) 2002-10-09 2002-10-09 Programming method, program conversion apparatus, program and storage medium

Country Status (1)

Country Link
JP (1) JP2004133630A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007133622A (en) * 2005-11-10 2007-05-31 Hitachi Ltd Engineering tool and program conversion method
JP2010191578A (en) * 2009-02-17 2010-09-02 Kyocera Mita Corp Software development system and software development method
JP2011028406A (en) * 2009-07-22 2011-02-10 Icr Co Ltd System and software for operating application development
WO2013150872A1 (en) * 2012-04-06 2013-10-10 ソニー株式会社 Information processing device, information processing method, and computer program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007133622A (en) * 2005-11-10 2007-05-31 Hitachi Ltd Engineering tool and program conversion method
JP2010191578A (en) * 2009-02-17 2010-09-02 Kyocera Mita Corp Software development system and software development method
JP2011028406A (en) * 2009-07-22 2011-02-10 Icr Co Ltd System and software for operating application development
WO2013150872A1 (en) * 2012-04-06 2013-10-10 ソニー株式会社 Information processing device, information processing method, and computer program
JPWO2013150872A1 (en) * 2012-04-06 2015-12-17 ソニー株式会社 Information processing apparatus, information processing method, and computer program
US9600248B2 (en) 2012-04-06 2017-03-21 Sony Corporation Information processing device, information processing method, and computer program

Similar Documents

Publication Publication Date Title
Mössenböck Object-oriented programming in Oberon-2
Karsai et al. Design guidelines for domain specific languages
KR101150003B1 (en) Software development infrastructure
US5325531A (en) Compiler using clean lines table with entries indicating unchanged text lines for incrementally compiling only changed source text lines
US5313387A (en) Re-execution of edit-compile-run cycles for changed lines of source code, with storage of associated data in buffers
DE69819188T2 (en) Program interface converter for computers with multiple environments
US6055369A (en) Apparatus for visual programming with screen flow
US5170465A (en) Incremental-scanning compiler for source-code development system
US6286132B1 (en) Debugging support apparatus, a parallel execution information generation device, a computer-readable recording medium storing a debugging support program, and a computer-readable recording medium storing a parallel execution information generation program
US8117589B2 (en) Metadata driven API development
US7478366B2 (en) Debugger and method for debugging computer programs across multiple programming languages
US5926638A (en) Program debugging system for debugging a program having graphical user interface
JP4901075B2 (en) Computer-readable medium, method and computing device
CA2255050C (en) A method and system for debugging hybrid source code
US5978585A (en) Development system with improved methods for recompiling dependent code modules
US8370810B2 (en) Debugging device and debugging method
KR100661393B1 (en) Web site management system and method applying web programming environment
US7437715B2 (en) System and method for generating a set of robot commands based on user entry events in a user interface
US6795963B1 (en) Method and system for optimizing systems with enhanced debugging information
US8316349B2 (en) Deployment script generation and execution
EP1388064B1 (en) System and method for combinatorial test generation in a compatibility testing environment
US8347272B2 (en) Call graph dependency extraction by static source code analysis
US6026235A (en) System and methods for monitoring functions in natively compiled software programs
US5946488A (en) Method for selectively and incrementally displaying the results of preprocessing
Higgins et al. The marking system for CourseMaster

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050302

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071121

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071204

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080304

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080701