CN117075907A - Application program compiling method, system, compiler and storage medium - Google Patents

Application program compiling method, system, compiler and storage medium Download PDF

Info

Publication number
CN117075907A
CN117075907A CN202310985086.7A CN202310985086A CN117075907A CN 117075907 A CN117075907 A CN 117075907A CN 202310985086 A CN202310985086 A CN 202310985086A CN 117075907 A CN117075907 A CN 117075907A
Authority
CN
China
Prior art keywords
program
target
application
compiling
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310985086.7A
Other languages
Chinese (zh)
Other versions
CN117075907B (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.)
Beijing Cssca Technologies Co ltd
Original Assignee
Beijing Cssca Technologies 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 Beijing Cssca Technologies Co ltd filed Critical Beijing Cssca Technologies Co ltd
Priority to CN202310985086.7A priority Critical patent/CN117075907B/en
Publication of CN117075907A publication Critical patent/CN117075907A/en
Application granted granted Critical
Publication of CN117075907B publication Critical patent/CN117075907B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application provides an application program compiling method, an application program compiling system, a compiler and a storage medium, wherein a processing program is precompiled according to a set target development language rule; preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; and generating a target program which can be interpretably executed by the target language virtual machine according to the intermediate program through a target language compiler. The application provides an application development language and a compiler which are specific to the application direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application development language which is learned by using a large amount of time, the development time and labor cost are greatly reduced.

Description

Application program compiling method, system, compiler and storage medium
Technical Field
The application belongs to the technical field of software development, in particular to a program software development processing technology, and particularly relates to an application program compiling method, an application program compiling system, a compiler and a storage medium.
Background
Most of the current domestic general development languages (Python, java, C ++, C# and the like) are high in learning cost, such as assembly language, or are difficult to interact with other languages, such as C#, java language, so that the programming difficulty of the current general development languages is high, and codes are difficult to manage and control.
For the development of program software in the exclusive field, the development direction of enterprise resource management planning (ERP), supply Chain Management (SCM) application programs and related system tools in the industrial software management field is oriented, and most of the software development adopts a general development language and related technical frameworks to develop enterprise resource management planning applications, and no application program development language and compiler in the exclusive field exists.
The statements made above merely provide background information related to the present disclosure and may not constitute prior art to the present disclosure except as may be expressly incorporated herein in any of the various aspects of the present disclosure.
Disclosure of Invention
The application program compiling method, the system, the compiler and the storage medium provided by the application provide the application program development language and the compiler which are dedicated to the enterprise resource management program (ERP) and the Supply Chain Management (SCM) application program direction in the field of industrial software operation management, and compared with the application program development language and the compiler which are used for learning the universal development language in a large amount of time, the development time and the labor cost are greatly reduced.
Meanwhile, the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and the development process can be divided into work and cooperation, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
According to a first aspect of an embodiment of the present application, there is provided an application compiling method, including:
precompiled processing programs according to set target development language rules;
preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode;
generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler;
when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
In some embodiments of the present application, a pre-compiling process program according to a set target development language rule includes: when the target development language rule is applied to development, 4GL is used in a designated code segment, and a service processing logic is written in an event-oriented programming mode; when the system tool is developed, the 3GL is used for writing a standard program set through the target development language rule, so that tool support is provided for the operation of a target system; the target development language rules have common specifications in terms of vocabulary conventions, keywords, pre-processing, macro definitions, constants, variables, expressions, operators, and flow control.
In some embodiments of the present application, preprocessing application class code and system tool class code of a target program after precompiled processing according to a target development language rule, respectively, to obtain an intermediate program, including: inputting the application program class code of the target program and the script corresponding to the system tool class code into a standard program preprocessor; the standard program preprocessor combines the standard program set according to the target development language rule to generate an intermediate program.
In some embodiments of the application, the processing steps of the standard program preprocessor include:
constructing a keyword table required by initializing 4GL compiling processing; the keyword table comprises all keywords used in the 4GL application script, is constructed in a hash table mode, and can be subjected to query and search processing by adopting a hash search algorithm;
acquiring information in a 4GL application script corresponding to an application program class code, wherein the information comprises form object information, field object information and selection object information, searching keywords based on lexical analysis and grammar analysis, and performing compiling inspection of the script;
reading standard programs in the standard program set; the standard program set is a public basic engine which can be multiplexed when the system runs;
And reading the content in the 4GL application script line by line, compiling the content by line by retrieving the keyword table, and generating a compiled target result into a 3GL target file to obtain an intermediate program with the 3GL characteristics.
In some embodiments of the present application, generating, by a target language compiler, a target program capable of being interpretable by a target language virtual machine from an intermediate program, includes:
initializing a compiler structure, a keyword symbol hash table, a standard program set list and a data dictionary;
analyzing, checking and precompiling the intermediate program based on lexical analysis and grammar analysis to obtain a target object containing instructions, symbol information and calling function information;
optimizing the target object to generate a plurality of session programs executable by the target virtual machine; the session program is the most basic operation unit in the operation period, and a plurality of session programs form a target program;
the target language virtual machine is used for executing program instructions, standard programs and dispatch processing related software component units related to a session object by taking the session program in the target program as an execution unit, and completing the execution of the application program and the system tool function module.
In some embodiments of the present application, the step of executing the target program by the target language virtual machine includes:
Reading object information of a session program file in a target program through a program counter, wherein the information comprises instructions, functions and symbol information;
the virtual central processing unit is used for completing address operation, stack operation and arithmetic operation by the basic operation unit according to the instruction information of the program counter; the complex processing of the function level is completed through the scheduling coprocessor, and the scheduling coprocessor comprises a form processing module, an event processing module, a data dictionary processing module, a display service processing module and a debugger processing module.
In some embodiments of the present application, a debugger having a target program debugging function is used for performing program trace debugging work, including: in the compiling process of the program script, generating debugging information according to compiling options; the debugging information is activated during the execution of the object program, so that the debugger has the functions of source code tracking, debugging command and console message feedback.
According to a second aspect of the embodiment of the present application, there is provided an application compiling system, including:
and a precompiled processing module: the pre-compiling processing program is used for pre-compiling the processing program according to the set target development language rule;
standard program preprocessing module: the system comprises a standard program preprocessor, a system tool class code and an application program class code, wherein the standard program preprocessor is used for preprocessing the application program class code and the system tool class code of the precompiled program to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode;
The target language compiling module: the target language compiler is used for generating a target program which can be interpretable and executed by the target language virtual machine according to the intermediate program;
program execution and debugging module: when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
According to a third aspect of an embodiment of the present application, there is provided a compiler including: a memory for storing executable instructions; and a processor coupled to the memory for executing the executable instructions to complete the application compilation method.
According to a fourth aspect of an embodiment of the present application, there is provided a computer-readable storage medium having a computer program stored thereon; the computer program is executed by the processor to implement an application compilation method.
By adopting the application program compiling method, the system, the compiler and the storage medium, the processing program is precompiled according to the set target development language rule; preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode; generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler; when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work. The application provides an application development language and a compiler which are specific to the application direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application development language which is learned by using a large amount of time, the development time and labor cost are greatly reduced.
Meanwhile, the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and the development process can be divided into work and cooperation, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
a schematic diagram of steps of an application compiling method according to an embodiment of the application is shown in fig. 1;
a schematic diagram of the processing steps of a standard program preprocessor according to an embodiment of the application is shown in fig. 2;
a schematic diagram of the compilation process of a target language compiler according to an embodiment of the present application is shown in fig. 3;
an operational schematic of an application compilation method according to an embodiment of the present application is shown in FIG. 4;
an operational schematic of a target language virtual machine according to an embodiment of the application is shown in FIG. 5;
a schematic structural diagram of an application compiling system according to an embodiment of the application is shown in fig. 6;
A schematic of the structure of a compiler according to an embodiment of the present application is shown in fig. 7.
Detailed Description
Regarding the present application, the development direction of enterprise resource management planning (ERP), supply Chain Management (SCM) application programs and related system tools in the field of industrial software operation management is oriented, and most of the current software development adopts general development languages (Python, java, C ++, c# and the like) and related technical frameworks to develop enterprise resource management planning applications, and no application program development language and compiler in the exclusive field exists.
The application adopts the open source technology based on Lex and Bison/Yacc lexical analysis and grammar analysis to construct the development language compiler of the application program of the private agency.
The application provides an application program compiling method and a compiler matched with the same, which mainly comprise the following points: 1. respectively preprocessing source program codes of the application program class and the tool class according to special language rules; 2. performing lexical and grammatical analysis on the preprocessed intermediate program to generate a target program which can be interpreted and executed for the exclusive language virtual machine; 3. program tracking debugging work can be performed through a dedicated debugger in the execution process of the target program.
By adopting the technical scheme of compiling the application program, in the development process, developers can conveniently conduct division work cooperation aiming at different works such as application programs, system tools and the like, the developers in different fields concentrate on the respective good fields, and meanwhile, a unified compiling method and a corresponding compiling tool set are adopted for developing the application program and the system tool program.
On the principle of the whole technical scheme, the method and the system adopt the compiling, executing and debugging method and the system of the exclusive target language, and the exclusive target development language rule is customized according to the development characteristics of the application program of the business management system of the industrial software enterprise. And based on the Lex and Bison/Yacc lexical analysis and grammar analysis open source technology, an intermediate program is generated by combining a standard program set through a standard program preprocessor. The intermediate program is compiled by a proprietary target language compiler to generate a session object, the session object can be interpreted and executed by a proprietary language virtual machine, and tracking and debugging can be carried out by a proprietary program debugger in the executing process.
The specific target development language rules are divided into two layers 4GL and 3GL, which are respectively oriented to application developers and system tool developers, and have common specifications in terms of vocabulary conventions, keywords, preprocessing, macro definition, constants, variables, expressions, operators, flow control and the like.
The application developer mainly uses 4GL to write service processing logic in a specified code segment in an event-oriented programming mode. System tool developers mainly use 3GL to write as standard program set, and provide tool support for the operation of the system.
Among them, 3GL (third generation programming language) is categorized as a procedural language, because program instructions are procedural-oriented, containing a series of steps that tell the computer not only what to do, but also how to do. On the other hand, 4GL (fourth generation programming language) is a non-procedural language; they enable users and developers to write programs that specify only what the computer should do, not how it should do.
Third generation languages are also known as high-level languages, while fourth generation languages are sometimes referred to as very high-level programming languages. When generating 3GL statements, a large number of assembly language and machine language instructions are generated. The complexity of fourth generation languages is reduced, most 4GL is associated with data processing and databases; they reflect the language used by professionals in the field to formulate business process sequences and rules, thereby facilitating efficient development of business oriented systems. Most fourth generation languages for data are based on SQL (structured query language). Java, C, and C++ are common examples of third generation languages. High-level code is typically introduced into 4GL to introduce specific system logic.
The standard program preprocessor takes a system tool script and an application program script as input, and generates an intermediate program according to a specific language rule and combining a standard program set.
In the development period, the standard program set is used as a public basic engine for running a special reusable system, and is mainly applied to aspects of interface processing, form processing, report processing, data query, file reading and writing, event message processing, mathematical calculation and the like. The standard program set is issued together as part of building an industrial software product, and the platform independence design of the standard program set can adapt to various heterogeneous operating systems and database basic operating environments in the running period.
The exclusive target language compiler takes the intermediate program as input, and outputs a session program which can be interpreted and executed by an exclusive language virtual machine according to the exclusive language rule through the processes of symbol table generation, stream processing, optimization processing, confusion processing, system data dictionary verification and the like, wherein the session program is the most basic operation unit of the compiling method in the operation period.
The application relates to a special target language virtual machine, which is also called a special software CPU, simulates the running mechanism of the CPU, mainly takes a session program as an execution unit, executes program instructions related to a session object, standard programs and schedules other software constituent units, and completes the execution of functional modules of an application system and a system tool.
The exclusive target program debugger can be used as a part of an exclusive target language virtual machine, and in the compiling process of a program script, the debugging information can be generated and activated in the executing process of an application program according to compiling options, and the activated debugger comprises source code tracking, a debugging command and console message feedback.
The application supports domestic mainstream basic software and basic chips, and a compiler is used as a part of the basic software, and the application supports domestic mainstream CPU architecture (Loongson, feiteng, kupeng, megacore, sea light and the like), domestic operation system and domestic database system, thereby meeting the requirements of the domestic process of the core technology, being beneficial to finishing the domestic substitution of the core software and greatly optimizing the quality and efficiency of the program software development in the domestic exclusive field.
Compared with the prior art of developing the enterprise resource management plan application by using a general development language and a related technical framework, the application adopts a special target development language and a compiler, is convenient for application developers to rapidly design and develop an application system, and does not need to spend a great deal of time to learn complex language rules and mastering development tool skills compared with the general language development.
In the development process of the development achievements adopting the technical scheme of the application, the development achievements are cooperated by division, developers in different fields concentrate on the respective good fields, and the development of application programs and system tool programs is carried out by adopting a unified method and corresponding compiling tools. Meanwhile, development achievements are beneficial to accumulation and inheritance of application products and industry solutions, and the problems that a great deal of time and labor cost are consumed due to application system reconstruction caused by changes of third party development languages and technical frameworks are not needed.
The development result of the technical scheme of the application is a technical basis for forming a unique ecological technical system, is beneficial to developing corresponding professional technical communities, and greatly promotes the development of the technology in the field along with the expansion of the application scale.
Specifically, the application program compiling method, the system, the compiler and the storage medium of the application pre-compile the processing program according to the set target development language rule; preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode; generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler; when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work. The application provides an application development language and a compiler which are specific to the application direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application development language which is learned by using a large amount of time, the development time and labor cost are greatly reduced.
Meanwhile, the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and the development process can be divided into work and cooperation, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of exemplary embodiments of the present application is provided in conjunction with the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application and not exhaustive of all embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
Example 1
A schematic diagram of the steps of an application compiling method according to an embodiment of the application is shown in fig. 1.
As shown in fig. 1, the application compiling method according to the embodiment of the application includes the following steps:
s1: and precompiled the processing program according to the set target development language rule. S2: preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to the 4GL application script written in an event-oriented programming mode. S3: and generating a target program which can be interpretably executed by the target language virtual machine according to the intermediate program through a target language compiler. S4: when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
Based on the method, the application provides the application program development language and the compiler which are dedicated to the application program direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation and management, and compared with the method for learning the general development language by using a large amount of time, the method greatly reduces development time and labor cost.
In specific implementation, S1 includes the following: when the target development language rule is applied to development, 4GL is used in a designated code segment, and a service processing logic is written in an event-oriented programming mode; when the system tool is developed, the 3GL is used for writing a standard program set through the target development language rule, so that tool support is provided for the operation of a target system; the target development language rules have common specifications in terms of vocabulary conventions, keywords, pre-processing, macro definitions, constants, variables, expressions, operators, and flow control.
Therefore, the embodiment of the application also realizes the development of application programs and system tool programs by adopting a unified development method and corresponding compiling tools, and can be divided into work and cooperation in the development process, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
In other embodiments, in S2, the preprocessing is performed on the application class code and the system tool class code of the target program after the precompiled processing according to the target development language rule, to obtain an intermediate program, including: inputting the application program class code of the target program and the script corresponding to the system tool class code into a standard program preprocessor; the standard program preprocessor combines the standard program set according to the target development language rule to generate an intermediate program.
A schematic diagram of the processing steps of a standard program preprocessor according to an embodiment of the application is shown in fig. 2.
As shown in fig. 2, the processing steps of the standard program preprocessor include:
s21: constructing a keyword table required by initializing 4GL compiling processing; the keyword table comprises all keywords used in the 4GL application script, is constructed in a hash table mode, and can be subjected to query and search processing by adopting a hash search algorithm;
s22: acquiring information in a 4GL application script corresponding to an application program class code, wherein the information comprises form object information, field object information and selection object information, searching keywords based on Lex and Bison/Yacc lexical analysis and grammar analysis, and performing compiling inspection of the script;
S23: reading standard programs in the standard program set; the standard program set is a public basic engine which can be multiplexed when the system runs;
s24: and reading the content in the 4GL application script line by line, compiling the content by line by retrieving the keyword table, and generating a compiled target result into a 3GL target file to obtain an intermediate program with the 3GL characteristics.
A schematic diagram of the compilation process of a target language compiler according to an embodiment of the present application is shown in fig. 3.
As shown in fig. 3, generating, in S3, a target program capable of being interpretable by a target language virtual machine from an intermediate program by a target language compiler includes:
s31: initializing a compiler structure, a keyword symbol hash table, a standard program set list and a data dictionary;
s32: analyzing, checking and precompiling the intermediate program based on Lex and Bison/Yacc lexical analysis and grammar analysis to obtain a target object containing instructions, symbol information and calling function information;
s33: optimizing the target object to generate a plurality of session programs executable by the target virtual machine; the session program is the most basic operation unit in the operation period, and a plurality of session programs form a target program;
the target language virtual machine is used for taking a session program in the target program as an execution unit, executing program instructions related to the session object, a standard program and dispatch processing related software to form a unit, and completing the execution of the application program and the system tool function module.
In specific implementation, the step of executing the target program by the target language virtual machine includes: 1) Reading object information of a session program file in a target program through a program counter, wherein the information comprises instructions, functions and symbol information; 2) The virtual central processing unit is used for completing address operation, stack operation and arithmetic operation by the basic operation unit according to the instruction information of the program counter; the complex processing of the function level is completed through the scheduling coprocessor, and the scheduling coprocessor comprises a form processing module, an event processing module, a data dictionary processing module, a display service processing module and a debugger processing module.
In other embodiments, the step S4 of performing the program trace debug operation using a debugger having a target program debug function includes: in the compiling process of the program script, generating debugging information according to compiling options; the debugging information is activated during the execution of the object program, so that the debugger has the functions of source code tracking, debugging command and console message feedback.
In order to further illustrate embodiments of the present application, the following description is provided in conjunction with the accompanying drawings.
An operational schematic of an application compilation method according to an embodiment of the present application is shown in fig. 4.
As shown in FIG. 4, the embodiment of the application firstly customizes the exclusive target development language rule according to the development characteristics of the application program of the enterprise operation management system of the industrial software. And based on the Lex and Bison/Yacc lexical analysis and grammar analysis open source technology, an intermediate program is generated by combining a standard program set through a standard program preprocessor. The intermediate program is compiled by a proprietary target language compiler to generate a session object, the session object can be interpreted and executed by a proprietary language virtual machine, and tracking and debugging can be carried out by a proprietary program debugger in the executing process.
1. The compiling process is performed with respect to the preprocessor. The preprocessor is oriented to an application program developer, the application program developer writes a 4GL application script in an event-oriented programming mode, and the result of compiling processing by the preprocessor is to generate a target program with 3GL characteristics.
The 4GL application script is mainly used for realizing application user interface business function processing. The main types of the 4GL application scripts are divided into a main table type and a non-main table type according to the existence of a main table of the current application program.
The 4GL application script main body consists of a main program processing flow and one or more event segments, wherein the currently supported event segments comprise a program segment, a form segment, a group segment, a field event segment, a selection segment, a switching segment and a main table IO segment, each segment also comprises a main segment and a sub-segment part, and an application developer completes the realization of service logic at the corresponding event.
Related embodiments of the 4GL application script are described below:
main table name, type 2;
the above is an example of an application script annotation line that is generally used to summarize program function descriptions, authors, times, version information, and master table information for a program script.
#pragmawarnings
# include < contain File name >
#definemacroname
The above is a compile preprocessing portion example.
declaration:
table name 1|main capable
table name 2
Extern domain definition name variable 1
The above is a program variable declaration section example including declarations of table variables, domain variables.
form.1:
init.form:
execute(first.set)
before.form:
The above is a FORM segment part example.
main.table.io:
skipIO("")
read.view:
execute(first.view)
The above is a main table IO segment example, where main.table.io is the main segment of the main table IO and read.view is the sub-segment of the main table IO. Based on the above pre-compiling process, the main process flow of the standard program pre-processor is as follows:
(1) And constructing a key word table required by initializing 4GL compiling processing.
And initializing a keyword table, wherein the keyword table comprises all keywords used in the information 4GL application script, is constructed in a hash table mode, and can be subjected to query and search processing by a hash search algorithm.
(2) And reading a 4GL application script, searching keywords based on the Lex and Bison/Yacc lexical and grammatical analysis, and performing compiling inspection of the script.
When the 4GL script is compiled, the content of the 4GL application script is read in a streaming mode, and then a memory space is allocated for processing form object information, field object information and selection object information acquired by an incoming stream. Based on the Lex lexical analysis, searching keywords, carrying out compiling and checking processing of the script according to the keywords, if grammar errors exist, giving error prompts.
(3) The standard program is read.
The standard program set is used as a common basic engine for running a dedicated reusable system, the compiling of 3GL and 4GL scripts can be referred to by the standard program set, the standard program is the most basic one in the standard program set, and other programs can depend on the standard program set. Before the intermediate 3GL object program is generated, the standard program needs to be read.
(4) And reading the content in the application script line by line, compiling the content by line searching the keyword table, and generating a compiled target result into the 3GL target file. The target file is generated by compiling line by line, the target file is read line by line from the application program script stream, and the compiling processing is carried out by searching the keyword table, so that the compiling result of the preprocessor is that the program information (code segment and script object) with the 3GL characteristic is written into the target file.
2. A target language compiler for a countersignature.
The compiling process of the target language of the private office is divided into three main stages, namely an initialization stage, a compiling control stage and a target object control stage.
First, the initialization phase mainly includes initializing the compiler structure, the key symbol hash table, the standard program set list, and the data dictionary.
And secondly, in the compiling control stage, analyzing, checking instructions and precompiling the target program generated by the precompiler based on the Lex and the Bison/Yacc. The compiling control stage is mainly used for carrying out analysis processing, instruction checking and precompiled on the target program generated by the precompiled device based on the Lex and the Bison/Yacc.
The analysis processing includes analysis of standard program, initializing target object and analysis of script program, and the target object including instruction, symbol information and calling function information is formed through compiling control stage.
Finally, the target object control stage, namely optimizing the target object, generates a target file which can be executed by the special virtual machine. The target object control stage mainly optimizes the target object, and writes the optimized target object into a target file (session program) which generates a similar assembly and can be executed by the special virtual machine.
3. With respect to virtual machine running mechanisms and execution.
An operational schematic of a target language virtual machine according to an embodiment of the application is shown in fig. 5.
As shown in fig. 5, when the virtual machine runs and executes, a program counter is used to read object information (including instructions, functions, symbol information, etc.) in the compiled session program file.
A virtual Central Processing Unit (CPU) is adopted, and a symbol stack (a symbol is mainly a variable in program running) and an address stack for storing the symbol are operated in a running period according to instruction information provided by a program counter in an effective virtual clock time slice allocated by a system.
According to instruction information of the program counter, address operation, stack operation, arithmetic operation and the like are completed by the basic operation unit, complex processing of function level is completed by the scheduling coprocessor, and the processing is generally carried out by other modules of the system, wherein the modules comprise a form processing module, an event processing module, a data dictionary processing module, a display service processing module and a debugger processing module.
The form processing module mainly completes processing of an application program form, the event processing module mainly completes event sending and request processing of a client program, and the data dictionary processing mainly completes processing of data dictionary information (table, index, column, session and the like). The display service processing mainly completes the processing of the user interface information.
The debugger process mainly completes system simulation operation in debugging, and comprises management of a program stack, breakpoint management and tracking of operation time variables. In the compiling stage, during the compiling process of the program script, the debugging information can be generated according to the compiling options, the debugging information is contained in the session program file, the debugging information is activated during the execution process of the application program, and the activated debugger comprises source code tracking, a debugging command and console message feedback.
In summary, by adopting the application program compiling method of the embodiment of the application, the processing program is precompiled according to the set target development language rule; preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode; generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler; when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
The embodiment of the application provides an application program development language and a compiler which are dedicated to the application program direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application program development language and the compiler which are used for learning a general development language in a large amount of time, the development time and the labor cost are greatly reduced.
Meanwhile, the embodiment of the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and can be divided into work and cooperation in the development process, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
Example 2
The present embodiment provides an application program compiling system, and for details not disclosed in the application program compiling system of the present embodiment, please refer to the specific implementation of the application program compiling method in other embodiments.
A schematic structural diagram of an application compiling system according to an embodiment of the application is shown in fig. 6.
As shown in fig. 6, the application compiling system includes a precompiled processing module 10, a standard program preprocessing module 20, a target language compiling module 30, and a program executing and debugging module 40.
In particular, the method comprises the steps of,
precompiled processing module 10: for precompiled handlers according to the set target development language rules.
When the method is implemented, when the method is applied to development, 4GL is used in a designated code segment, and a business processing logic is written in an event-oriented programming mode through a target development language rule; when the system tool is developed, the 3GL is used for writing a standard program set through the target development language rule, so that tool support is provided for the operation of a target system; the target development language rules have common specifications in terms of vocabulary conventions, keywords, pre-processing, macro definitions, constants, variables, expressions, operators, and flow control.
Standard program preprocessing module 20: the system comprises a standard program preprocessor, a system tool class code and an application program class code, wherein the standard program preprocessor is used for preprocessing the application program class code and the system tool class code of the precompiled program to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to the 4GL application script written in an event-oriented programming mode.
Target language compilation module 30: the target language compiler is used for generating a target program which can be interpretable and executed by the target language virtual machine according to the intermediate program.
The target language virtual machine is used for taking a session program in the target program as an execution unit, executing program instructions related to the session object, a standard program and dispatch processing related software to form a unit, and completing the execution of the application program and the system tool function module.
In specific implementation, the step of executing the target program by the target language virtual machine includes: 1) Reading object information of a session program file in a target program through a program counter, wherein the information comprises instructions, functions and symbol information; 2) The virtual central processing unit is used for completing address operation, stack operation and arithmetic operation by the basic operation unit according to the instruction information of the program counter; the complex processing of the function level is completed through the scheduling coprocessor, and the scheduling coprocessor comprises a form processing module, an event processing module, a data dictionary processing module, a display service processing module and a debugger processing module.
Program execution and debugging module 40: when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
By adopting the application program compiling system of the embodiment of the application, the precompiled processing module 10 precompiled the processing program according to the set target development language rule; the standard program preprocessing module 20 preprocesses the application program class code and the system tool class code of the precompiled program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode; the target language compiling module 30 generates a target program which can be interpretably executed by the target language virtual machine according to the intermediate program through a target language compiler; when the program execution and debugging module 40 executes the target program, a debugger having a target program debugging function is used for performing program trace debugging work.
The embodiment of the application provides an application program development language and a compiler which are dedicated to the application program direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application program development language and the compiler which are used for learning a general development language in a large amount of time, the development time and the labor cost are greatly reduced.
Meanwhile, the embodiment of the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and can be divided into work and cooperation in the development process, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
Example 3
The present embodiment provides a compiler, and for details not disclosed in the compiler of the present embodiment, please refer to specific implementation contents of the application program compiling method or system in other embodiments.
A schematic of the structure of a compiler 400 or image recognition device according to an embodiment of the present application is shown in fig. 7.
As shown in fig. 7, the compiler 400 or the image recognition apparatus includes:
memory 402: for storing executable instructions; and
the processor 401 is used for connecting with the memory 402 to execute executable instructions to complete an application compiling method or an image recognition method.
It will be appreciated by those skilled in the art that the schematic diagram 7 is merely an example of the compiler 400 or the image recognition device, and does not constitute a limitation of the compiler 400 or the image recognition device, and may include more or less components than illustrated, or may combine certain components, or different components, e.g., the compiler 400 may further include an input-output device, a network access device, a bus, etc.
The processor 401 (Central Processing Unit, CPU) may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor 401 may be any conventional processor or the like, the processor 401 being a control center of the compiler 400, and various interfaces and lines are used to connect various parts of the entire compiler 400.
Memory 402 may be used to store computer readable instructions, and processor 401 may implement various functions of compiler 400 by executing or executing computer readable instructions or modules stored in memory 402 and invoking data stored in memory 402. The memory 402 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the compiler 400, etc. In addition, the memory 402 may include a hard disk, memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), at least one disk storage device, a Flash memory device, a Read-only memory (ROM), a random access memory (RandomAccess Memory, RAM), or other non-volatile/volatile storage device.
The modules integrated by the compiler 400 may be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product. Based on such understanding, the present application may implement all or part of the flow of the method of the above-described embodiments, or may be implemented by means of computer readable instructions to instruct related hardware, where the computer readable instructions may be stored in a computer readable storage medium, where the computer readable instructions, when executed by a processor, implement the steps of the method embodiments described above.
Example 5
The present embodiment provides a computer-readable storage medium having a computer program stored thereon; the computer program is executed by the processor to implement the application compilation method in other embodiments.
The compiler and the storage medium of the embodiment of the application precompiled the processing program according to the set target development language rule; preprocessing application program class codes and system tool class codes of the preprocessed program by a standard program preprocessor to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode; generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler; when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
The embodiment of the application provides an application program development language and a compiler which are dedicated to the application program direction of enterprise resource management planning (ERP) and Supply Chain Management (SCM) in the field of industrial software operation management, and compared with the application program development language and the compiler which are used for learning a general development language in a large amount of time, the development time and the labor cost are greatly reduced.
Meanwhile, the embodiment of the application adopts a unified development method and a corresponding compiling tool to develop application programs and system tool programs, and can be divided into work and cooperation in the development process, so that developers in different fields concentrate on the fields, and the field adaptability, the software development efficiency and the software development quality are improved.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the invention. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. An application compiling method, comprising:
precompiled processing programs according to set target development language rules;
preprocessing application program class codes and system tool class codes in the precompiled programs by a standard program preprocessor to obtain intermediate programs; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode;
generating a target program which can be interpreted and executed by a target language virtual machine according to the intermediate program through a target language compiler;
And when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
2. The application compiling method according to claim 1, wherein the pre-compiling the processing program according to the set target development language rule comprises:
when the target development language rule is applied to development, 4GL is used in a designated code segment, and a service processing logic is written in an event-oriented programming mode;
when the system tool is developed, the 3GL is used for writing a standard program set through the target development language rule, so that tool support is provided for the operation of a target system;
the target development language rules have common specifications in terms of vocabulary conventions, keywords, pre-processing, macro definitions, constants, variables, expressions, operators, and flow control.
3. The method for compiling an application program according to claim 1, wherein the preprocessing the application program class code and the system tool class code of the target program after the precompiled processing according to the target development language rule respectively to obtain an intermediate program includes:
inputting the application program class code of the target program and the script corresponding to the system tool class code into a standard program preprocessor;
And the standard program preprocessor combines a standard program set according to the target development language rule to generate an intermediate program.
4. A method of compiling an application program according to claim 1 or 3, wherein the step of processing by the standard program preprocessor comprises:
constructing a keyword table required by initializing 4GL compiling processing; the keyword table comprises all keywords used in the 4GL application script, the keyword table is constructed in a hash table mode, and a hash search algorithm can be adopted to search and retrieve the keyword table;
acquiring information in a 4GL application script corresponding to the application program class code, wherein the information comprises form object information, field object information and selection object information, searching keywords based on lexical analysis and grammar analysis, and performing compiling inspection of the script;
reading standard programs in the standard program set; the standard program set is a public basic engine which can be multiplexed when the system runs;
and reading the content in the 4GL application script line by line, searching the keyword table line by line, compiling, and generating a compiled target result into a 3GL target file to obtain an intermediate program with the 3GL characteristic.
5. The application compiling method according to claim 1, wherein the generating, by the target language compiler, the target program interpretable by the target language virtual machine from the intermediate program includes:
initializing a compiler structure, a keyword symbol hash table, a standard program set list and a data dictionary;
analyzing, checking and precompiling the intermediate program based on lexical analysis and grammar analysis to obtain a target object containing instructions, symbol information and calling function information;
optimizing the target object to generate a plurality of session programs executable by the target virtual machine; the session program is the most basic operation unit in the operation period, and the plurality of session programs form a target program;
the target language virtual machine is used for executing program instructions, standard programs and dispatch processing related software composition units related to a session object by taking the session program in the target program as an execution unit, and completing the execution of application programs and system tool function modules.
6. The application compiling method of any one of claims 1 to 5, wherein the step of executing the target program by the target language virtual machine comprises:
Reading object information of a session program file in the target program through a program counter, wherein the information comprises instructions, functions and symbol information;
the basic operation unit completes address operation, stack operation and arithmetic operation according to the instruction information of the program counter through the virtual central processing unit; the complex processing of the function level is completed through a scheduling coprocessor which comprises a form processing module, an event processing module, a data dictionary processing module, a display service processing module and a debugger processing module.
7. The application compiling method according to any one of claims 1 to 5, wherein the performing the program trace debugging work by using a debugger having a target program debugging function comprises:
in the compiling process of the program script, generating debugging information according to compiling options;
the debug information is activated during execution of the target program, enabling the debugger to have functions including source code tracking, debug commands, and console message feedback.
8. An application compilation system, comprising:
and a precompiled processing module: the pre-compiling processing program is used for pre-compiling the processing program according to the set target development language rule;
Standard program preprocessing module: the system comprises a standard program preprocessor, a system tool class code and an application program class code, wherein the standard program preprocessor is used for preprocessing the application program class code and the system tool class code of the precompiled program to obtain an intermediate program; the standard program preprocessor is used for compiling and processing to obtain an intermediate program with 3GL characteristics according to a 4GL application script written in an event-oriented programming mode;
the target language compiling module: the target language compiler is used for generating a target program which can be interpretably executed by the target language virtual machine according to the intermediate program;
program execution and debugging module: and when the target program is executed, a debugger with a target program debugging function is adopted to carry out program tracking debugging work.
9. A compiler, comprising:
a memory for storing executable instructions; and
a processor coupled to the memory for executing executable instructions to perform the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon; computer program to be executed by a processor to implement the method of any of claims 1-7.
CN202310985086.7A 2023-08-07 2023-08-07 Application program compiling method, system, compiler and storage medium Active CN117075907B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310985086.7A CN117075907B (en) 2023-08-07 2023-08-07 Application program compiling method, system, compiler and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310985086.7A CN117075907B (en) 2023-08-07 2023-08-07 Application program compiling method, system, compiler and storage medium

Publications (2)

Publication Number Publication Date
CN117075907A true CN117075907A (en) 2023-11-17
CN117075907B CN117075907B (en) 2024-02-23

Family

ID=88712584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310985086.7A Active CN117075907B (en) 2023-08-07 2023-08-07 Application program compiling method, system, compiler and storage medium

Country Status (1)

Country Link
CN (1) CN117075907B (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9063719B1 (en) * 1995-10-02 2015-06-23 People Innovate For Economy Foundation, Inc. Table format programming
CN110134378B (en) * 2018-02-08 2022-02-22 腾讯科技(深圳)有限公司 Application program creating method and device, computer equipment and storage medium
CN116257248A (en) * 2023-01-12 2023-06-13 杭州指令集智能科技有限公司 Cross-language compiling method, system and readable storage medium

Also Published As

Publication number Publication date
CN117075907B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
Agrawal et al. TensorFlow Eager: A multi-stage, Python-embedded DSL for machine learning
KR102539041B1 (en) Impact analysis
Sellink et al. Restructuring of COBOL/CICS legacy systems
US6874140B1 (en) Debug annotations
Insa et al. An algorithmic debugger for Java
Fabry et al. Language-independent detection of object-oriented design patterns
Serrano et al. Type error diagnosis for embedded DSLs by two-stage specialized type rules
Van Deursen et al. Research issues in the renovation of legacy systems
US7747992B2 (en) Methods and apparatus for creating software basic block layouts
CN115639980A (en) Draggable front-end logic arrangement method and device for low-code platform
Marceau et al. The design and implementation of a dataflow language for scriptable debugging
US8683439B2 (en) System and process for debugging object-oriented programming code leveraging preprocessors
Hanus et al. A modular and generic analysis server system for functional logic programs
Alizadehsani et al. Modern integrated development environment (ides)
Consel From a program family to a domain-specific language
CN117075907B (en) Application program compiling method, system, compiler and storage medium
Liu et al. Towards understanding bugs in python interpreters
Hillerström et al. Effects for efficiency: Asymptotic speedup with first-class control
CN1661552B (en) Process language for microprocessors with finite resources
Su et al. TorchProbe: Fuzzing Dynamic Deep Learning Compilers
CN114153750B (en) Code checking method and device, code compiling method and electronic equipment
Maliavko et al. Functionally Imperative Programming Language El and its Implementation
Di Martino et al. Automatic dynamic data structures recognition to support the migration of applications to the cloud
Wąsowski et al. Building Modeling Languages
Omar et al. IR-Level Dynamic Data Dependence Using Abstract Interpretation Towards Speculative Parallelization

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant