Mixed language compilation method
By identifying and parsing language identifiers in source files, the integration of multiple programming language files is achieved, solving the problem of high difficulty in file integration in software development, and improving development efficiency and maintenance convenience.
Patent Information
- Application Number
- PCT/CN2025/074107
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-04
- Filing Date
- 2025-01-23
- Publication Date
- 2025-08-07
AI Technical Summary
In software development, the existence of multiple programming languages leads to increased difficulty in file integration, affecting development efficiency, and iterations on different platforms and different time periods lead to maintenance difficulties.
By identifying the language identifier in the source file, obtaining the fragment file and parsing it into an intermediate file using the corresponding language rules, and finally compiling it into a target file of the target language to achieve file integration and subsequent maintenance.
It realizes clear distinction and integration of different programming language files, simplifies the development process, improves the efficiency of software development and the convenience of subsequent maintenance.
Smart Images

Figure CN2025074107_07082025_PF_FP_ABST
Abstract
Description
Mixed language compilation method Technical Field
[0001] The present application relates to the field of computer software, and in particular to a mixed language compilation method. Background Art
[0002] In the world of software development, developers can choose to develop software using one or more of many different programming languages. At the time of writing, common modern programming languages used by developers include Java, C#, and C++. Generally speaking, each programming language has its own advantages and disadvantages.
[0003] First, developers can choose a suitable programming language based on the advantages and disadvantages of various programming languages and given applications; second, developers have their own proficiency or weakness in programming languages; third, during the software life cycle, with the iteration of programming languages, some early programming languages may become less used, no longer supported and / or obsolete, but the source code written in these programming languages remains in use; fourth, the same functions may need to be provided to users on different platforms and need to be developed using the programming language of the corresponding platform.
[0004] Software development requires multiple programming languages for different program functions, different developers, different time periods, and multiple target platforms. When integrating all development files (such as source code and configuration files), factors such as file dependencies, version control, and encryption and compression algorithms must be considered. Files compiled in different programming languages increase integration difficulties and hinder software development efficiency. Summary of the Invention
[0005] In order to facilitate the integration of development files based on multiple programming languages, this application provides a mixed language compilation method.
[0006] This application provides a mixed language compilation method, which adopts the following technical solutions:
[0007] A mixed language compilation method comprises the following steps:
[0008] Identify language identifiers in source files,
[0009] Get the fragment file from the source file based on the language identifier,
[0010] Use the corresponding language rules to parse the fragment file to obtain the intermediate file,
[0011] The intermediate file is compiled based on the language rules of the target language to obtain the target file.
[0012] By adopting the above technical solution, source files (all development files) are identified, and development files in various programming languages are compiled into target files in the target language, so that all development files can be integrated, thereby facilitating subsequent development and later maintenance.
[0013] The programming language corresponding to the target platform can be set as the target language in this solution to provide it to users of the target platform.
[0014] The source files may include one or more development files based on multiple programming languages, such as a first programming language, a second programming language, and a third programming language. The target language can be one of the multiple programming languages included in the source files (such as the first programming language, the second programming language, or the third programming language); the target language can also be a programming language not included in the source files.
[0015] Preferably, the language identifier includes a start identifier and an end identifier.
[0016] By adopting the above technical solution, the development files between the start marker and the end marker are based on only one programming language, so as to clearly distinguish development files of various programming languages.
[0017] Preferably, the language identifier is used to mark a programming language.
[0018] By adopting the above technical solution, the programming language used by the corresponding segment file can be known by identifying the language identifier, and then the segment file can be parsed using the corresponding language rules to obtain the intermediate file.
[0019] In summary, this application includes at least one of the following beneficial technical effects:
[0020] 1. Identify source files (all development files) and compile development files in various programming languages into target files in the target language to facilitate the integration of all development files and facilitate subsequent development and maintenance;
[0021] 2. The development files between the start and end tags are based on only one programming language to clearly distinguish development files of various programming languages;
[0022] 3. By identifying the language identifier, the programming language used by the corresponding fragment file can be obtained, and then the fragment file can be parsed using the corresponding language rules to obtain the intermediate file. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] FIG1 is a flow chart of a mixed-language compilation method.
[0024] Figure 2 is a schematic diagram of the mixed language compilation method DETAILED DESCRIPTION
[0025] The present application is further described in detail below with reference to the accompanying drawings.
[0026] 1 and 2 , the present invention discloses a mixed language compilation method, including the following steps:
[0027] S10, identifying the language identifier in the source file,
[0028] S20, obtaining a segment file from the source file based on the language identifier,
[0029] S30, using the corresponding language rules to parse the fragment file to obtain an intermediate file,
[0030] S40: compile the intermediate file based on the language rules of the target language to obtain a target file.
[0031] The language identifier includes a start identifier and an end identifier, and is used to mark the programming language.
[0032] The source files include one or more development files based on multiple programming languages such as a first programming language and a second programming language. A language identifier is added to the source files to mark them.
[0033] A start marker is added before the beginning of a development file based on a programming language, and an end marker is added after the end of the development file. The development file based on a programming language can be one or more files.
[0034] The process of adding the marker may be manual, for example, during software development (source code editing), the developer manually adds the start marker and / or the end marker.
[0035] The process of adding markers can also be automated, such as matching the development file with the language rules of various programming languages; if a match is successful, adding the start marker and / or end marker corresponding to the matching result to the development file.
[0036] Identify language identifiers in source files (all development files) and compile development files in various programming languages into target files in the target language.
[0037] The target language may be one of the multiple programming languages included in the source file (such as the first programming language or the second programming language); the target language may also be a programming language not included in the source file.
[0038] The implementation principle of a mixed language compilation method in an embodiment of the present application is: identifying source files (all development files) and compiling development files of various programming languages into target files of the target language, so as to facilitate the integration of all development files and facilitate subsequent development and later maintenance.
[0039] The above are all preferred embodiments of the present application, and are not intended to limit the scope of protection of the present application. Therefore, any equivalent changes made based on the structure, shape, and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A mixed language compilation method, characterized in that: The following steps are involved: Identify language tags in source files, Get the fragment file from the source file based on the language identifier, Use the corresponding language rules to parse the fragment file to obtain the intermediate file, The intermediate file is compiled based on the language rules of the target language to obtain the target file.
2. The mixed language compilation method according to claim 1, wherein: The language identifier includes a start identifier and an end identifier.
3. The mixed language compilation method according to claim 1, wherein: The language identifier is used to identify a programming language.
Citation Information
Patent Citations
Method and device for realizing cross-platform multi-language development, medium and electronic equipment
CN111381817A
Application developing device and application developing tool
JP2014048706A
Construction of a software application from a plurality of programming languages
US20030115571A1