A mixed language recognition method and system

By generating a mixed abstract syntax tree and performing machine code compilation, the complexity problem faced by beginners of language compilation is solved, the program is simplified and efficiently compiled, and the program is improved readability and maintenance.

CN118550543BActive Publication Date: 2025-02-25GUANGZHOU YUNBIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410614947.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-02-25
Estimated Expiration
2044-05-17

Smart Images

  • Figure CN118550543B_ABST
    Figure CN118550543B_ABST
Patent Text Reader

Abstract

The present application relates to the field of language compilation technology, and discloses a method and system for identifying hybrid languages, the method comprising obtaining a micro-language obtained by a user writing keywords belonging to the user's business scope based on a preset programming language strategy, obtaining a domain-specific language corresponding to the micro-language, parsing the domain-specific language and the micro-language and obtaining a hybrid abstract syntax tree based on the parsing result, and using the hybrid abstract syntax tree to obtain a machine code corresponding to the micro-language, and the method corresponds to the system. The present application reduces the difficulty of programming, improves the readability of the program, and facilitates the maintenance of the program through the writing of the micro-language; by comparing the first syntax abstract tree with the second syntax abstract tree, and by comparing with historical data, the structure of the hybrid syntax abstract tree is optimized, accurate compilation from micro-language to machine code is achieved, and optimization of micro-language writing is also achieved. Finally, a concise language compilation environment is provided for beginners of language compilation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of language compilation technology, and in particular to a method and system for identifying mixed languages. Background Art

[0002] During the language compilation process, complex keywords and syntax are very obscure to language compilation beginners, which increases the difficulty of language compilation.

[0003] In the process of implementing different business functions, complex functional logic will make the writing of program codes more and more complicated, resulting in difficult to understand programs and reducing the user experience.

[0004] Chinese patent number CN113687833A discloses a hybrid compilation method, a hybrid compilation system, a compiler and a storage medium. The invention performs standard corrections on the source code, preprocesses the code to meet standard specifications, and meets the code execution requirements of different target platforms. After back-end analysis, hybrid compilation information is generated, and target machine code is generated based on the hybrid compilation information. No target platform auxiliary compilation is required, thereby realizing hybrid compilation that is adapted to multiple target platforms.

[0005] In summary, the prior art lacks a concise language compilation technical solution for beginners of language compilation. Summary of the invention

[0006] The purpose of this application is to provide a method and system for mixed language recognition to solve the technical problems raised in the above background technology.

[0007] To achieve the above objectives, this application discloses the following technical solutions:

[0008] In a first aspect, the present application discloses a method for mixed language recognition, the method comprising:

[0009] S1: Acquire a micro-language, where the micro-language is a programming language written by a user using keywords belonging to the user's business scope based on a preset programming language strategy;

[0010] S2: Perform language conversion using the micro-language to obtain a domain-specific language corresponding to the micro-language;

[0011] S3: Parsing the domain specific language and the micro language, and obtaining a hybrid abstract syntax tree based on the parsing results;

[0012] S4: Compile the machine code using the hybrid abstract syntax tree to obtain the machine code corresponding to the micro-language.

[0013] Based on the above, the writing of the micro-language simplifies the programming, and the accurate compilation of the micro-language is achieved through the hybrid syntax abstract tree.

[0014] Preferably, the user is based on a preset programming language strategy, specifically including:

[0015] The user writes the micro-language based on the keyword characteristics of the programming language.

[0016] Through the above, by writing micro-language based on the keyword characteristics of the programming language and the keywords of the business scope, the writing of the program is simplified and the readability of the program is improved.

[0017] Preferably, the parsing of the domain specific language and the micro-language specifically includes:

[0018] Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree;

[0019] Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree.

[0020] Through the above, the first abstract syntax tree and the second abstract syntax tree provide logical support for the machine code compilation of the micro language.

[0021] Preferably, obtaining a hybrid abstract syntax tree based on the parsing result specifically includes:

[0022] Comparing the first abstract syntax tree with the second abstract syntax tree, retaining the nodes that overlap between the first abstract syntax tree and the second abstract syntax tree to the mixed language abstract tree, and retaining the nodes in the second abstract syntax tree that do not overlap with those in the first abstract syntax tree to the mixed language abstract tree;

[0023] Analyzing each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analyzing step comprising:

[0024] Obtain historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and calculate the compilation accuracy P of each non-overlapping node, Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of correct compilations of the node k, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold, if yes, the node k is retained in the hybrid abstract syntax tree, otherwise the node k is discarded.

[0025] Through the above, by analyzing the nodes in the first abstract syntax tree that do not overlap with the second abstract syntax tree, the structure of the mixed abstract syntax tree is optimized, and the accurate compilation of the micro-language is guaranteed.

[0026] Preferably, the analysis step further comprises:

[0027] Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and the micro-language in the historical data corresponding to each node, the micro-language in the historical data corresponding to each node is defined as a historical micro-language;

[0028] NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

[0029] Through the above, by comparing the current compilation with historical data, the accuracy of the hybrid syntax abstract tree is improved, and the writing of the microlanguage is continuously optimized through the accumulation of historical data.

[0030] In a second aspect, the present application discloses a recognition system for mixed languages, the system comprising:

[0031] A micro-language acquisition module, wherein the micro-language acquisition module is configured to acquire a micro-language input by a user, wherein the micro-language is a programming language obtained by the user by writing keywords belonging to the user's business scope based on a preset programming language strategy;

[0032] A micro-language conversion module, wherein the micro-language conversion module is configured to perform language conversion using the micro-language to obtain a domain-specific language corresponding to the micro-language;

[0033] A hybrid abstract syntax tree generation module, wherein the hybrid abstract syntax tree generation module is configured to parse the domain specific language and the micro language and obtain a hybrid abstract syntax tree based on the parsing result;

[0034] A compiling module is configured to use the hybrid abstract syntax tree to perform machine code compiling to obtain machine code corresponding to the micro-language.

[0035] Preferably, the user is based on a preset programming language strategy, specifically including:

[0036] The user writes the micro-language based on the keyword characteristics of the programming language.

[0037] Preferably, the parsing of the domain specific language and the micro-language specifically includes:

[0038] Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree;

[0039] Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree.

[0040] Preferably, obtaining a hybrid abstract syntax tree based on the parsing result specifically includes:

[0041] Comparing the first abstract syntax tree with the second abstract syntax tree, retaining the nodes that overlap between the first abstract syntax tree and the second abstract syntax tree to the mixed language abstract tree, and retaining the nodes in the second abstract syntax tree that do not overlap with those in the first abstract syntax tree to the mixed language abstract tree;

[0042] Analyzing each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analyzing step comprising:

[0043] Obtain historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and calculate the compilation accuracy P of each non-overlapping node, Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of correct compilations of the node k, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold, if yes, the node k is retained in the hybrid abstract syntax tree, otherwise the node k is discarded.

[0044] Preferably, the analysis step further comprises:

[0045] Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and the micro-language in the historical data corresponding to each node, the micro-language in the historical data corresponding to each node is defined as a historical micro-language;

[0046] NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

[0047] Through the above, the recognition system for mixed languages ​​is used in conjunction with the recognition method for mixed languages, so that language compilers can write programs based on keywords within the business scope, which reduces the difficulty of program writing, improves program readability, and facilitates program maintenance.

[0048] Beneficial effects: The hybrid language recognition method and system of the present application reduces the difficulty of programming, improves the readability of the program, and facilitates program maintenance by writing in a micro-language; by comparing the first syntax abstract tree with the second syntax abstract tree and by comparing with historical data, the structure of the hybrid syntax abstract tree is optimized, accurate compilation from micro-language to machine code is achieved, and optimization of micro-language writing is also achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0050] Figure 1 A schematic block diagram of the process of a mixed language recognition method provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of a hybrid abstract syntax tree provided in an embodiment of the present application;

[0052] Figure 3 A schematic block diagram of a mixed language recognition system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0054] In this article, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0055] like Figure 1 As shown, the first aspect of this embodiment discloses a method for mixed language recognition, the method comprising:

[0056] S1: Obtain a micro-language, where the micro-language is a programming language written by a user using keywords belonging to the user's business scope based on a preset programming language strategy;

[0057] S2: Use the micro-language to perform language conversion and obtain the domain-specific language corresponding to the micro-language;

[0058] S3: Parse the domain-specific language and micro-language, and obtain a hybrid abstract syntax tree based on the parsing results;

[0059] S4: Use the hybrid abstract syntax tree to compile the machine code to obtain the machine code corresponding to the micro-language.

[0060] Program writing is simplified by writing micro-language, and accurate compilation of micro-language is achieved through hybrid syntax abstract tree.

[0061] Specifically, users are based on preset programming language strategies, including:

[0062] Users write micro-languages ​​based on the keyword features of programming languages.

[0063] Furthermore, by writing a micro-language based on the keyword characteristics of the programming language and the keywords of the business scope, the writing of the program is simplified and the readability of the program is improved.

[0064] It should be noted that the main goal of the micro-language is to facilitate users to implement business function logic and allow users to customize extended keywords. In a simple example, for example, based on the Codigger system, in the writing of ObjectSense's micro-language, it is necessary to write according to the keyword characteristics of ObjectSense. The micro-language is associated with business functions, which can make the code program logic concise and easy to maintain, and help users implement functional logic within their specific business scope.

[0065] In the definition of the programming language ObjectSense, the keywords and syntax itself are concise and clear, which is very friendly to language beginners and lowers the entry threshold.

[0066] In the process of implementing different business functions, the functional logic is complex and the program code writing is becoming more and more complicated. In order to make the programs written in OSE language clear and easy to use, micro language is defined.

[0067] Specifically, we analyze domain-specific languages ​​and micro-languages, including:

[0068] Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree;

[0069] Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree.

[0070] The first abstract syntax tree and the second abstract syntax tree provide logical support for the machine code compilation of the micro-language.

[0071] Specific, combined Figure 2 As shown in the figure, the triangles are nodes of the first syntax abstract tree, and the squares are nodes of the second syntax abstract tree. Only triangles or squares represent non-overlapping nodes, and both triangles and squares represent overlapping nodes. Figure 2 As shown, a hybrid abstract syntax tree is obtained based on the parsing result, specifically including:

[0072] Compare the first abstract syntax tree with the second abstract syntax tree, retain the nodes that overlap with the first abstract syntax tree in the mixed language abstract tree, and retain the nodes in the second abstract syntax tree that do not overlap with the first abstract syntax tree in the mixed language abstract tree;

[0073] Analyze each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analysis step comprising:

[0074] Obtain historical data corresponding to each node in the first grammar abstract tree that does not overlap with the second grammar abstract tree, and calculate the compilation accuracy P of each non-overlapping node. Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of times the node k is compiled correctly, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold. If yes, the node k is retained in the hybrid abstract syntax tree; otherwise, the node k is discarded.

[0075] By analyzing the nodes in the first abstract syntax tree that do not overlap with the second abstract syntax tree, the structure of the mixed abstract syntax tree is optimized, ensuring the accurate compilation of the micro-language.

[0076] Specifically, the analysis steps also include:

[0077] Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and the micro-language in the historical data corresponding to each node, the micro-language in the historical data corresponding to each node is defined as a historical micro-language;

[0078] NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

[0079] Furthermore, by comparing this compilation with historical data, the accuracy of the hybrid syntax abstract tree is improved, and the compilation of the micro-language is continuously optimized through the accumulation of historical data. It should be noted that the abstract syntax tree parsed by the program is a mixture of the abstract syntax tree of the micro-language and the abstract syntax tree of the domain-specific language. This is different from the macro language definition of other languages. The macro language of other languages ​​is the abstract syntax tree of other languages.

[0080] like Figure 3 As shown, the second aspect of this embodiment discloses a recognition system for mixed languages, the system comprising:

[0081] A micro-language acquisition module, wherein the micro-language acquisition module is configured to acquire a micro-language input by a user, wherein the micro-language is a programming language obtained by the user by writing keywords belonging to the user's business scope based on a preset programming language strategy;

[0082] A micro-language conversion module, the micro-language conversion module is configured to perform language conversion using the micro-language to obtain a domain-specific language corresponding to the micro-language;

[0083] A hybrid syntax abstract tree generation module, the hybrid syntax abstract tree generation module is configured to parse the domain specific language and the micro language, and obtain a hybrid abstract syntax tree based on the parsing result;

[0084] The compilation module is configured to use the hybrid abstract syntax tree to perform machine code compilation to obtain machine code corresponding to the micro-language.

[0085] Specifically, users are based on preset programming language strategies, including:

[0086] Users write micro-languages ​​based on the keyword features of programming languages.

[0087] Specifically, we analyze domain-specific languages ​​and micro-languages, including:

[0088] Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree;

[0089] Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree.

[0090] Specifically, a hybrid abstract syntax tree is obtained based on the parsing results, including:

[0091] Compare the first abstract syntax tree with the second abstract syntax tree, retain the nodes that overlap with the first abstract syntax tree in the mixed language abstract tree, and retain the nodes in the second abstract syntax tree that do not overlap with the first abstract syntax tree in the mixed language abstract tree;

[0092] Analyze each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analysis step comprising:

[0093] Obtain historical data corresponding to each node in the first grammar abstract tree that does not overlap with the second grammar abstract tree, and calculate the compilation accuracy P of each non-overlapping node. Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of times the node k is compiled correctly, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold. If yes, the node k is retained in the hybrid abstract syntax tree; otherwise, the node k is discarded.

[0094] Specifically, the analysis steps also include:

[0095] Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and the micro-language in the historical data corresponding to each node, the micro-language in the historical data corresponding to each node is defined as a historical micro-language;

[0096] NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

[0097] Through the above, the recognition system for mixed languages ​​is used in conjunction with the recognition method for mixed languages, so that language compilers can write programs based on keywords within the business scope, which reduces the difficulty of program writing, improves program readability, and facilitates program maintenance.

[0098] In summary, the hybrid language recognition method and system of the present embodiment reduces the difficulty of programming, improves the readability of the program, and facilitates program maintenance by writing in a micro-language; by comparing the first syntax abstract tree with the second syntax abstract tree and by comparing with historical data, the structure of the hybrid syntax abstract tree is optimized, accurate compilation from the micro-language to the machine code is achieved, and optimization of the micro-language writing is also achieved.

[0099] In the embodiments provided in the present application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein or their combination. For software implementation, part or all of the flow of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a computer can access. The computer-readable storage medium can include but is not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer.

[0100] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for mixed language recognition, characterized in that: The method includes: S1: Acquire a micro-language, where the micro-language is a programming language written by a user using keywords belonging to the user's business scope based on a preset programming language strategy; S2: Perform language conversion using the micro-language to obtain a domain-specific language corresponding to the micro-language; S3: Parsing the domain specific language and the micro language, and obtaining a hybrid abstract syntax tree based on the parsing results; S4: Compile the machine code using the hybrid abstract syntax tree to obtain the machine code corresponding to the micro-language; The parsing of the domain specific language and the micro language specifically includes: Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree; Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree; The hybrid abstract syntax tree is obtained based on the parsing result, specifically including: Compare the first syntax abstract tree with the second syntax abstract tree, retain the nodes that overlap between the first syntax abstract tree and the second syntax abstract tree to the mixed language abstract tree, and retain the nodes in the second syntax abstract tree that do not overlap with those in the first syntax abstract tree to the mixed language abstract tree; Analyzing each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analyzing step comprising: Obtain historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and calculate the compilation accuracy P of each non-overlapping node, Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of correct compilations of the node k, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold, if yes, the node k is retained in the hybrid abstract syntax tree, otherwise the node k is discarded.

2. The mixed language recognition method according to claim 1, characterized in that: The user is based on a preset programming language strategy, specifically including: The user writes a micro-language based on the keyword characteristics of the programming language.

3. The mixed language recognition method according to claim 1, characterized in that: The analysis step also includes: Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, a micro-language in the historical data corresponding to each node is obtained, and the micro-language in the historical data corresponding to each node is defined as a historical micro-language; NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

4. A recognition system for mixed languages, characterized in that: The system includes: A micro-language acquisition module, wherein the micro-language acquisition module is configured to acquire a micro-language input by a user, wherein the micro-language is a programming language obtained by the user by writing keywords belonging to the user's business scope based on a preset programming language strategy; A micro-language conversion module, wherein the micro-language conversion module is configured to perform language conversion using the micro-language to obtain a domain-specific language corresponding to the micro-language; A hybrid abstract syntax tree generation module, wherein the hybrid abstract syntax tree generation module is configured to parse the domain specific language and the micro language, and obtain a hybrid abstract syntax tree based on the parsing result; A compiling module, wherein the compiling module is configured to compile machine code using the hybrid abstract syntax tree to obtain machine code corresponding to the micro-language; The parsing of the domain specific language and the micro language specifically includes: Based on the domain specific language, a syntax abstract tree of the domain specific language is obtained, and the domain specific language abstract tree is defined as a first syntax abstract tree; Based on the micro-language, a syntax abstract tree of the micro-language is obtained, and the syntax abstract tree of the micro-language is defined as a second syntax abstract tree; The hybrid abstract syntax tree is obtained based on the parsing result, specifically including: Compare the first syntax abstract tree with the second syntax abstract tree, retain the nodes that overlap between the first syntax abstract tree and the second syntax abstract tree to the mixed language abstract tree, and retain the nodes in the second syntax abstract tree that do not overlap with those in the first syntax abstract tree to the mixed language abstract tree; Analyzing each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, the analyzing step comprising: Obtain historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, and calculate the compilation accuracy P of each non-overlapping node, Among them, P k is the compilation accuracy rate corresponding to node k, N k is the number of times node k appears, n k In order to utilize the number of correct compilations of the node k, it is determined whether the compilation accuracy is greater than a preset compilation accuracy threshold, if yes, the node k is retained in the hybrid abstract syntax tree, otherwise the node k is discarded.

5. The mixed language recognition system according to claim 4, characterized in that: The user is based on a preset programming language strategy, specifically including: The user writes a micro-language based on the keyword characteristics of the programming language.

6. The mixed language recognition system according to claim 4, characterized in that: The analysis step also includes: Before calculating the compilation accuracy, based on the historical data corresponding to each node in the first syntax abstract tree that does not overlap with the second syntax abstract tree, a micro-language in the historical data corresponding to each node is obtained, and the micro-language in the historical data corresponding to each node is defined as a historical micro-language; NLP technology is used to analyze the industry meaning of the historical micro-language corresponding to node k and the micro-language corresponding to this compilation to determine whether the results of the industry meaning analysis are the same. If so, node k is retained and the compilation accuracy is calculated, otherwise node k is discarded.

Citation Information

Patent Citations

  • Hybrid compiling method, hybrid compiling system, compiler and storage medium

    CN113687833A

  • Cross-platform runnable program generation method and device, medium and electronic equipment

    CN111813381A