Hybrid language compiling method

By identifying and parsing language identifiers in source files, development files for multiple programming languages ​​are compiled into target language files, solving the problem of high difficulty in file integration in software development and achieving cross-platform development file adaptation and convenient maintenance.

CN121785597APending Publication Date: 2026-04-03TAIZHOU ASKPOWER ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

In the software development process, the existence of multiple programming languages ​​makes file integration difficult, affects development efficiency, and users on different platforms need the support of different programming languages.

Method used

By identifying the language identifiers in the source file, fragment files are obtained, and the corresponding language rules are used to parse them into intermediate files, which are then finally compiled into target files in the target language.

Benefits of technology

It integrates files from different programming languages ​​and adapts to target platforms, facilitating subsequent development and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121785597A_ABST
    Figure CN121785597A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer software, and discloses a mixed language compiling method which comprises the following steps: identifying a language identifier in a source file, acquiring a fragment file from the source file based on the language identifier, analyzing the fragment file by utilizing a corresponding language rule to obtain an intermediate file, and compiling the intermediate file. And compiling the intermediate file based on the language rule of the target language to obtain a target file. According to the method, the source file (all the development files) is identified, and the development files of various programming languages are compiled into the target file of the target language, so that all the development files are integrated, and subsequent development and later maintenance are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer software, and in particular to a mixed-language compilation method. Background Technology

[0002] In the field of software development, developers can choose to use one or more of many different programming languages ​​to develop software. At the time of writing, commonly used modern programming languages ​​include Java, C#, and C++. Generally, each programming language has its own advantages and disadvantages.

[0003] Firstly, developers can choose the appropriate programming language based on the advantages and disadvantages of various programming languages ​​and the given application. Secondly, developers have their own proficiency or lack thereof in programming languages. Thirdly, during the software lifecycle, programming languages ​​may iterate, and some earlier programming languages ​​may become less used, no longer supported, and / or obsolete, but the source code written in these programming languages ​​may still be used. Fourthly, the same functionality may need to be provided to users on different platforms, requiring development using the corresponding platform's programming language.

[0004] In software development, different program functions, different developers, different time periods, and users on multiple target platforms necessitate development using multiple programming languages. Integrating all development files (such as source code and configuration files) requires considering factors such as file dependencies, version control, encryption, and compression algorithms. Furthermore, files edited in different programming languages ​​increase the difficulty of integration and impact software development efficiency. Summary of the Invention

[0005] 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 solution: A mixed-language compilation method includes the following steps: Identify language identifiers in the source file. Based on language identifiers to obtain fragment files from source files, The fragment file is parsed using the corresponding language rules to obtain the intermediate file. The intermediate files are compiled based on the language rules of the target language to obtain the target file.

[0007] By adopting the above technical solution, the source files (all development files) are identified, and the development files of various programming languages ​​are compiled into target files of the target language, so as to facilitate the integration of all development files and facilitate subsequent development and later maintenance.

[0008] The programming language corresponding to the target platform can be set as the target language in this solution to provide it for users of the target platform.

[0009] The source files may contain 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 ​​contained 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 contained in the source files.

[0010] Preferably, the language identifier includes a start identifier and an end identifier.

[0011] By adopting the above technical solution, the development files between the start and end markers are based on only one programming language, thus clearly distinguishing the development files of various programming languages.

[0012] Preferably, the language identifier is used to mark a programming language.

[0013] By adopting the above technical solution, the programming language used by the corresponding fragment file can be determined by identifying the language identifier, and then the fragment file can be parsed using the corresponding language rules to obtain the intermediate file.

[0014] In summary, this application includes at least one of the following beneficial technical effects: 1. Identify the source files (all development files) and compile the 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; 2. The development files between the start and end markers are based on only one programming language to clearly distinguish the development files for various programming languages; 3. By recognizing the language identifier, the programming language used by the corresponding fragment file can be determined, and then the fragment file can be parsed using the corresponding language rules to obtain the intermediate file. Attached Figure Description

[0015] Figure 1 This is a flowchart of the mixed-language compilation method.

[0016] Figure 2 This is a schematic diagram of a mixed-language compilation method. Detailed Implementation The present application will be further described in detail below with reference to the accompanying drawings.

[0017] Reference Figure 1 and Figure 2 This application discloses a mixed-language compilation method, including the following steps: S10, identifies language identifiers in the source file. S20, obtain fragment files from source files based on language identifiers. S30 uses the corresponding language rules to parse the fragment file to obtain the intermediate file. S40 compiles the intermediate files based on the target language's language rules to obtain the target file.

[0018] Language identifiers include start and end identifiers, and are used to mark programming languages.

[0019] The source files contain one or more development files based on multiple programming languages, including a first programming language and a second programming language. Language identifiers are added to the source files for tagged use.

[0020] 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. A development file based on a programming language can be one or more files.

[0021] Adding markers can be done manually. For example, during software development (source code editing), developers can manually add start and / or end markers.

[0022] The process of adding identifiers can also be automated. For example, the development file can be matched against the language rules of various programming languages; if a match is successful, the start identifier and / or end identifier corresponding to the matching result can be added to the development file.

[0023] Identify language identifiers in source files (all development files) and compile development files for various programming languages ​​into target files for the target language.

[0024] The target language can be one of the multiple programming languages ​​contained in the source file (such as the first programming language or the second programming language); the target language can also be a programming language not contained in the source file.

[0025] The implementation principle of the hybrid language compilation method in this application embodiment is as follows: the source files (all development files) are identified, and the development files of various programming languages ​​are compiled into target files of the target language, so as to facilitate the integration of all development files and facilitate subsequent development and later maintenance.

[0026] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.

Claims

1. A mixed-language compilation method, characterized in that, Includes the following steps: Identify language identifiers in the source file. Based on language identifiers to obtain fragment files from source files, The fragment file is parsed using the corresponding language rules to obtain the intermediate file. The intermediate files are 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, characterized in that, The language identifier includes a start identifier and an end identifier.

3. The mixed-language compilation method according to claim 1, characterized in that, The language identifier is used to mark the programming language.