Script code processing method and device and nonvolatile storage medium

By obtaining and comparing the abstract syntax trees of back-end and front-end programming languages, establishing syntax mapping relationships and automatically converting codes, the problem of low manual conversion efficiency in the existing technology is solved, and efficient and stable cross-language syntax conversion is achieved.

CN119576339APending Publication Date: 2025-03-07SUPCON TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411628788.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

In the prior art, it is necessary to manually convert the background interface syntax into script syntax, resulting in inefficient conversion and prone to syntax incorrectness, which can only be discovered during the system operation, which consumes time and labor costs.

Method used

By obtaining the script code of the target program, determining the abstract syntax tree of its backend and front-end programming languages, establishing a syntax mapping relationship between the two, automatically converting the back-end programming language into a target declaration file that conforms to the front-end programming language, and loading the file with the editor to achieve automated cross-language syntax conversion.

Benefits of technology

It improves the efficiency of cross-language syntax conversion, reduces the time and cost of manual conversion, ensures the logical consistency of the converted code, and improves the stability of system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119576339A_ABST
    Figure CN119576339A_ABST
Patent Text Reader

Abstract

The invention discloses a script code processing method and device and a nonvolatile storage medium. The method comprises the steps that script codes of a target program are obtained, and the script codes are based on a front-end programming language; determining a back-end programming language of the target program, and determining a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language; according to the first abstract syntax tree and the second abstract syntax tree, establishing a syntax mapping relation between the front-end programming language and the rear-end programming language; according to the grammar mapping relation, converting the back-end programming language into a target declaration file conforming to the front-end programming language; and loading the target declaration file by utilizing an editor. According to the method and the device, the technical problem of low conversion efficiency caused by the fact that one programming language needs to be manually converted into another programming language in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of code editing technology, and in particular, to a script code processing method and device, and a non-volatile storage medium. Background Art

[0002] When developing platforms applicable to specific fields, especially enterprise-level application development, most scenarios require providing domain-specific functional interfaces in the form of scripts to facilitate rapid writing of business codes.

[0003] Business script codes generally run in the system background, which generally uses back-end languages ​​such as JAVA, while script languages ​​often use the syntax of front-end languages. The syntaxes of the two are different, and it is often necessary to manually convert the background interface syntax into script syntax.

[0004] Manual cross-language syntax conversion takes a lot of time and is prone to situations where the backend interface syntax does not correspond to the script syntax. Scripting languages ​​are interpreted languages ​​and generally do not have a compilation process. Problems are often discovered only during system operation, which is time-consuming and labor-intensive.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present application provide a script code processing method and device, and a non-volatile storage medium, so as to at least solve the technical problem of low conversion efficiency caused by the need for manual conversion of one programming language into another programming language in the related technology.

[0007] According to one aspect of an embodiment of the present application, a method for processing a script code is provided, including: obtaining a script code of a target program, wherein the script code is based on a front-end programming language; determining a back-end programming language of the target program, and determining a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language; establishing a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree; converting the back-end programming language into a target declaration file that conforms to the front-end programming language according to the syntax mapping relationship; and loading the target declaration file using an editor.

[0008] Optionally, determining a first abstract syntax tree corresponding to a front-end programming language includes: obtaining a first source code string based on the front-end programming language, wherein the front-end programming language includes at least: TypeScript; using a first preset lexical rule, scanning the first source code string character by character to generate multiple first lexical units, wherein, in the first preset lexical rule, a lexical pattern in the front-end programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to a first predefined grammar rule, parsing each first lexical unit into a grammatical structure to construct a first initial syntax tree; performing a process of eliminating redundant nodes and merging consecutive operators on the first initial syntax tree, and performing an abstract process on the processed first initial syntax tree to obtain a first abstract syntax tree.

[0009] Optionally, determining a second abstract syntax tree corresponding to a backend programming language includes: obtaining a second source code string based on the backend programming language, wherein the backend programming language includes at least: Java; using a second preset lexical rule, scanning the second source code string character by character to generate multiple second lexical units, wherein, in the second preset lexical rule, a lexical pattern in the backend programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to a second predefined grammar rule, parsing each second lexical unit into a grammatical structure to construct a second initial syntax tree; performing a process of eliminating redundant nodes and merging consecutive operators on the second initial syntax tree, and performing an abstract process on the processed second initial syntax tree to obtain a second abstract syntax tree.

[0010] Optionally, according to the syntax mapping relationship, the back-end programming language is converted into a target declaration file that conforms to the front-end programming language, including: obtaining a syntax mapping relationship, wherein the syntax mapping relationship includes conversion rules for converting the syntax structure of the front-end programming language to the syntax structure of the back-end programming language; traversing each first node in the first abstract syntax tree and recording the node type of each first node; searching the syntax mapping relationship for conversion rules corresponding to the node type of each first node and the syntax element name of the target language; determining the target code template corresponding to each first node according to the conversion rules and the syntax element name of the target language, wherein the target code template includes: placeholders; extracting target information in each first node, and using the target information to replace the placeholders in the target code template to determine the code snippet corresponding to each first node; splicing the code snippets corresponding to each first node to obtain the target code, and writing the target code into a preset file to obtain the target declaration file that conforms to the front-end programming language.

[0011] Optionally, the syntax mapping relationship is stored in a computer cache.

[0012] Optionally, a target declaration file is loaded using an editor, including: reading the target declaration file, performing syntax analysis on the target declaration file to obtain multiple syntax units; constructing a symbol table based on the multiple syntax units, wherein the symbol table includes at least one of the following: the definition, type and scope of the symbol; monitoring keyboard input events in the editor to obtain input characters; determining the type of the input character in the symbol table, and determining the code structure of the input character; determining multiple code suggestion information corresponding to the input character in the symbol table based on the type of the input character in the symbol table and the code structure of the input character; displaying the multiple code suggestion information in the editing interface of the editor, inserting the target code suggestion information selected from the multiple code suggestion information into the input position in the editing interface of the editor, and adding syntax elements corresponding to the target code suggestion information.

[0013] Optionally, the code suggestion information includes at least one of the following: function name, variable name, class name.

[0014] According to another aspect of the embodiment of the present application, a script code processing device is also provided, including: an acquisition module, used to acquire the script code of a target program, wherein the script code is based on a front-end programming language; a determination module, used to determine the back-end programming language of the target program, and determine a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language; an establishment module, used to establish a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree; a conversion module, used to convert the back-end programming language into a target declaration file that conforms to the front-end programming language according to the syntax mapping relationship; and a loading module, used to load the target declaration file using an editor.

[0015] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above script code processing method.

[0016] According to another aspect of the embodiments of the present application, there is further provided an electronic device, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above script code processing method is executed when the program is run.

[0017] According to yet another aspect of the embodiments of the present application, a computer program is further provided, wherein the computer program implements the above script code processing method when executed by a processor.

[0018] According to another aspect of the embodiments of the present application, a computer program product is provided, which includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above script code processing method is implemented.

[0019] In an embodiment of the present application, a script code of a target program is obtained, wherein the script code is based on a front-end programming language; a back-end programming language of the target program is determined, and a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language are determined; a syntax mapping relationship between the front-end programming language and the back-end programming language is established based on the first abstract syntax tree and the second abstract syntax tree; based on the syntax mapping relationship, the back-end programming language is converted into a target declaration file that conforms to the front-end programming language; a method of loading the target declaration file using an editor is used to achieve the purpose of automatically converting one programming language into another programming language, thereby achieving the technical effect of improving conversion efficiency, and further solving the technical problem of low conversion efficiency caused by the need for manual conversion of one programming language into another programming language in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0021] Figure 1 is a flowchart of a script code processing method according to an embodiment of the present application;

[0022] Figure 2 is a flowchart of another script code processing method according to an embodiment of the present application;

[0023] Figure 3 is a flow chart of converting a backend programming language into a target declaration file that conforms to a frontend programming language according to an embodiment of the present application;

[0024] Figure 4 is a flow chart of using an editor to load a target declaration file according to an embodiment of the present application;

[0025] Figure 5 is a structural diagram of a script code processing device according to an embodiment of the present application;

[0026] Figure 6 It is a hardware structure block diagram of a computer terminal according to a script code processing method of an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. 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 should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] According to an embodiment of the present application, a method embodiment of a script code processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] Figure 1 is a flowchart of a script code processing method according to an embodiment of the present application, such as Figure 1 As shown, the method comprises the following steps:

[0031] Step S101, obtaining script code of the target program, wherein the script code is based on a front-end programming language.

[0032] Use a code parser or editor plug-in to identify and extract all script codes written in the front-end programming language from the target program. The code parser or plug-in should be able to handle complex nested structures, such as class definitions, function calls, etc., to ensure that the extracted code is a complete functional unit. Use a code scanning tool to ensure that the extracted script code does not contain irrelevant code fragments, but only contains the part used for business logic.

[0033] Step S102, determining the backend programming language of the target program, and determining a first abstract syntax tree corresponding to the frontend programming language and a second abstract syntax tree corresponding to the backend programming language.

[0034] For example, by analyzing the file extension, comments, file path and other information of the target program, it is determined that the backend programming language is JAVA.

[0035] Use a syntax analyzer to generate an abstract syntax tree (AST) for JAVA and TypeScript. For JAVA, you can use libraries such as Eclipse JDT or ANTLR; for TypeScript, you can use tools such as Typescript's ESTree or Babel. Make sure the generated AST fully reflects the structure and semantics of the code, such as variable declarations, class definitions, method calls, loop structures, etc.

[0036] Step S103: establishing a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree.

[0037] Create a bidirectional syntax mapping table to record the various syntax structures of JAVA and the corresponding structures of TypeScript. For example, a public class in JAVA can be mapped to an exported class in TypeScript. The mapping table should include, but is not limited to, conversion rules for elements such as variables, data types, functions, classes, interfaces, and comments. The establishment of the mapping relationship needs to take into account language features, such as TypeScript type declarations, JAVA generics, etc., and ensure that the converted code logic is equivalent to the original code.

[0038] Step S104: converting the backend programming language into a target declaration file that complies with the frontend programming language according to the syntax mapping relationship.

[0039] Use depth-first search or breadth-first search algorithm to traverse JAVA's AST, and convert each node into the corresponding TypeScript syntax element according to the rules in the mapping table. For complex class or method definitions, you can use code templates to fill in the mapped syntax elements into the template to generate complete TypeScript code. During the conversion process, you need to consider the special syntax of TypeScript, such as using .d.ts files to provide type information for external libraries, to ensure that the generated declaration file can be correctly recognized and used by the TypeScript editor. The generated .d.ts file should contain all key information of the backend interface, such as parameter types, return types, function signatures, etc., so that the editor can provide accurate code completion and type checking.

[0040] Step S105: Use an editor to load the target declaration file.

[0041] Integrate editor functions (such as based on monaco-editor) to enable it to recognize and load .d.ts files. When the editor starts or the user opens a project, all relevant .d.ts files in the project are automatically loaded. The editor should provide real-time code completion. When the user starts to enter code related to the backend interface, it can make completion suggestions based on the type information in the .d.ts file. At the same time, the editor should also have syntax checking capabilities, and be able to check whether the code entered by the user meets the expected type and structure based on the type declaration in the .d.ts file, and promptly detect and prompt errors.

[0042] According to the above steps, a script code of a target program is obtained, wherein the script code is based on a front-end programming language; a back-end programming language of the target program is determined, and a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language are determined; a syntax mapping relationship between the front-end programming language and the back-end programming language is established based on the first abstract syntax tree and the second abstract syntax tree; based on the syntax mapping relationship, the back-end programming language is converted into a target declaration file that conforms to the front-end programming language; and a method of loading the target declaration file using an editor is used to achieve the purpose of automatically converting one programming language into another programming language, thereby realizing the technical effect of improving conversion efficiency.

[0043] The following Figure 1 The steps shown are exemplary and explanatory.

[0044] According to some optional embodiments of the present application, determining a first abstract syntax tree corresponding to a front-end programming language can be achieved by the following method: obtaining a first source code string based on the front-end programming language, wherein the front-end programming language includes at least: TypeScript; using a first preset lexical rule, scanning the first source code string character by character to generate multiple first lexical units, wherein, in the first preset lexical rule, a lexical pattern in the front-end programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to a first predefined grammar rule, parsing each first lexical unit into a grammatical structure to construct a first initial syntax tree; performing a process of eliminating redundant nodes and merging consecutive operators on the first initial syntax tree, and performing an abstract process on the processed first initial syntax tree to obtain a first abstract syntax tree.

[0045] First, an input source is required, which can be the code entered by the user in the code editor or an existing TypeScript code file read from the file system. Make sure that the source code string obtained is complete and has no syntax errors so that subsequent processing can proceed smoothly. You can use the editor API or the file reading interface to implement this function. Design and implement a lexical analyzer whose rules are based on the lexical specification of TypeScript. Lexical rules can be defined using regular expressions to identify and classify lexical units such as keywords, identifiers, operators, numbers, and strings in the code. The lexical analyzer should be able to handle special characters and escape sequences to ensure the correct identification of lexical units. For example, var and function are keywords, _variableName123 is an identifier, and +, -, *, etc. are operators. Design a recursive descent parser or use an existing parsing library (such as typescript-estree or babylon) to parse the lexical units according to the grammar rules of TypeScript and build a syntax tree. The nodes of the syntax tree should contain information about lexical units and the relationships between them, such as function calls, loop structures, and conditional statements. Traverse the syntax tree, identify and delete redundant nodes that do not contribute to the understanding of the syntax structure (such as empty nodes or placeholders that are only used for syntax structure). For consecutive operators (such as a++--), they should be merged into a single operator or adjusted to a form that complies with the specification to avoid errors in subsequent syntax analysis and code generation stages. Further abstract the syntax tree and extract specific syntax details (such as keywords, specific names of identifiers) into more general syntax patterns, such as abstracting nodes related to the function keyword into function definition nodes, and abstracting keywords such as if and else into conditional statement nodes. The abstract syntax tree should only retain the structure and logic information of the code, while ignoring non-critical syntax details to facilitate cross-language syntax conversion.

[0046] According to some other optional embodiments of the present application, determining the second abstract syntax tree corresponding to the backend programming language can be achieved by the following method: obtaining a second source code string based on the backend programming language, wherein the backend programming language at least includes: Java; using a second preset lexical rule, scanning the second source code string character by character to generate multiple second lexical units, wherein, in the second preset lexical rule, a regular expression is used to express the lexical pattern in the backend programming language, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to the second predefined grammar rules, parsing each second lexical unit into a grammatical structure to construct a second initial syntax tree; performing redundant node elimination and continuous operator merging processing on the second initial syntax tree, and abstracting the processed second initial syntax tree to obtain a second abstract syntax tree.

[0047] By reading the contents of the Java source code file in the file system or obtaining the Java code entered by the user from the code editor, ensure that the obtained source code string is complete and has no syntax errors. You can use the file reading method in the Java standard library or the editor's API to achieve source code acquisition. Design and implement a lexical analyzer whose rules are based on Java's lexical specifications. Lexical rules can be defined using regular expressions to identify and classify lexical units such as keywords, identifiers, operators, numbers, and strings in the code. For example, public, class, void, if, else, etc. are keywords, myVariable is an identifier, and +, -, *, / , etc. are operators. Design a recursive descent parser, or use an existing Java syntax analysis library (such as ANTLR or JavaCC) to parse the lexical units according to Java's grammar rules and build a syntax tree. The nodes of the syntax tree should contain information about the lexical units and the relationships between them, such as class definitions, method definitions, loop structures, and conditional statements. Traverse the syntax tree to identify and delete redundant nodes that exist for grammar rules but have no practical contribution to grammar understanding and code conversion. For consecutive operators (such as a++--b), they should be merged into a single operator or adjusted to a form that complies with the specification to ensure that the structure of the syntax tree is clear and convenient for subsequent abstract processing and cross-language conversion. The syntax tree is further abstracted to extract specific syntax details (such as keywords and specific names of identifiers) into more general syntax patterns, such as abstracting public class-related nodes into class definition nodes and abstracting keywords such as if and else into conditional statement nodes. The abstract syntax tree should only retain the structure and logic information of the code and ignore non-critical syntax details to facilitate subsequent mapping and conversion of cross-language syntax trees.

[0048] In some optional embodiments of the present application, according to the syntax mapping relationship, converting the backend programming language into a target declaration file that conforms to the frontend programming language can be achieved by the following method:

[0049] Obtain a syntax mapping relationship, wherein the syntax mapping relationship includes conversion rules for converting the syntax structure of the front-end programming language to the syntax structure of the back-end programming language; traverse each first node in the first abstract syntax tree and record the node type of each first node; search for the conversion rules corresponding to the node type of each first node and the syntax element name of the target language in the syntax mapping relationship; determine the target code template corresponding to each first node according to the conversion rules and the syntax element name of the target language, wherein the target code template includes: placeholders; extract target information from each first node, and use the target information to replace the placeholders in the target code template to determine the code fragment corresponding to each first node; splice the code fragments corresponding to each first node to obtain the target code, write the target code into a preset file, and obtain a target declaration file that conforms to the front-end programming language.

[0050] Create a syntax mapping table that contains the syntax structure conversion rules between the backend language (such as Java) and the frontend language (such as TypeScript). For example, Java's public class can be mapped to TypeScript's export class, Java's public static can be mapped to TypeScript's static method definition, etc. The mapping table should cover all important syntax structures exhaustively, including but not limited to classes, interfaces, properties, methods, comments, etc. Use a depth-first search or breadth-first search algorithm to traverse the first abstract syntax tree (Java's AST). For each node, record its type, such as class definition node, method definition node, parameter node, etc. According to the recorded node type, find the corresponding conversion rule in the syntax mapping table. For example, if the node type is a class definition, the mapping table should have rules on how to convert Java's class to TypeScript interface or class. At the same time, find the corresponding syntax element name in the target language (TypeScript), such as mapping Java's String type to TypeScript's string. Design a target code template for each type of node, and the template contains placeholders, which are used to represent specific information that needs to be determined during the conversion process, such as class name, method name, parameter type, etc. For example, for a Java class definition, the template can be export interface <classname> { <properties>}. Extract specific information from Java's AST nodes, such as class name, method signature, parameter type, etc., and then fill this information into the corresponding template placeholders to generate TypeScript code snippets. For example, if there is a public String getName() defined in Java, the template can be getName(): string. Concatenate all generated code snippets according to TypeScript's grammatical rules to form a complete .d.ts file. The file should include all necessary type definitions, interfaces, classes, methods, and properties. After concatenation, write the generated target code into a new .d.ts file to complete the creation of the target declaration file.

[0051] Preferably, the syntax mapping relationship is stored in a computer cache.

[0052] As some optional embodiments of the present application, using an editor to load a target declaration file can be implemented by the following method: reading the target declaration file, performing syntax analysis on the target declaration file, and obtaining multiple syntax units; constructing a symbol table based on the multiple syntax units, wherein the symbol table includes at least one of the following: the definition, type, and scope of the symbol; monitoring keyboard input events in the editor to obtain input characters; determining the type of the input character in the symbol table, and determining the code structure of the input character; determining multiple code suggestion information corresponding to the input character in the symbol table based on the type of the input character in the symbol table and the code structure of the input character; displaying the multiple code suggestion information in the editing interface of the editor, inserting the target code suggestion information selected from the multiple code suggestion information into the input position in the editing interface of the editor, and adding syntax elements corresponding to the target code suggestion information.

[0053] Use the TypeScript parser to read the .d.ts file and parse the file content into grammatical units (such as classes, interfaces, methods, properties, etc.). The parser should be able to recognize and understand the grammatical structure of TypeScript, such as type declarations, generics, namespaces, etc., to ensure that all key symbolic information is parsed correctly. During the parsing process, a symbol table is built that records the definition, type, and scope of all parsed grammatical units. For example, if an interface named User is defined in the .d.ts file, the symbol table should record the definition of User (the structure of the interface), type (interface), and scope (global or local). The symbol table can be implemented using a hash table or dictionary data structure to improve search efficiency.

[0054] Implement an event listener in the code editor. This listener is specifically used to capture keyboard input events. When the user starts or continues to input, the listener can capture the input characters or lexical units in real time. When listening to input events, determine the symbol type to which the input character may belong based on context information (such as the current file, the prefix of the code line, etc.). For example, if the user enters a character inside a class definition, the listener should be able to recognize that the character may belong to a method definition or an attribute definition. At the same time, the listener should be able to understand the code structure of the input character, that is, its role and position in the code.

[0055] Combined with the type of input characters and the code structure, the relevant code suggestion information is searched from the symbol table. For example, if the user enters a class name User, the editor should be able to find the type definition and method signature related to User from the symbol table and generate corresponding code suggestions. After the user enters, multiple code suggestion information is displayed in real time in the prompt box or pop-up menu of the editor interface. Each suggestion should clearly show its type and expected code structure. When the user selects a suggestion from the suggestion list, the editor should automatically insert the suggestion into the current input position, and add any necessary syntax elements such as type declarations, semicolons, etc. according to the syntax specifications of TypeScript to ensure the completeness and correctness of the code.

[0056] Preferably, the code suggestion information includes at least one of the following: function name, variable name, class name.

[0057] Through the above steps, the code editor can provide a more intelligent and efficient code completion function, significantly improve development efficiency and reduce coding errors.

[0058] Figure 2 is a flowchart of another script code processing method according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0059] Step S201, loading the JAVA source code file.

[0060] Write a file loader or use an existing Java file reading API, such as Java's FileInputStream or BufferedReader, to read the specified Java source code file. Make sure the loader can handle the file path, encoding format, and potential file reading errors. The loaded source code string should be used as input for subsequent steps.

[0061] Step S202, analyzing the source code and establishing an abstract syntax analysis tree (AST).

[0062] Use a Java syntax analysis library, such as Eclipse JDT or ANTLR, to parse the loaded source code string and generate a Java abstract syntax tree. The parser should be able to recognize Java language keywords, data types, classes, methods, variables, expressions and other syntax rules, and organize this information into a tree structure. AST will serve as the basis for syntax mapping in subsequent steps.

[0063] Step S203, establishing a JAVA and TS syntax mapping relationship table.

[0064] Design a mapping table to record the correspondence between Java syntax structures and TypeScript syntax structures. For example: public class is mapped to export class, public static is mapped to static (in TypeScript, static methods usually do not require additional modifiers), String is mapped to string, etc. The mapping table can be a CSV file, JSON file, or database table to ensure that it can be read and used by the code conversion tool.

[0065] Step S204, generating a TS declaration file.

[0066] Traverse the Java abstract syntax tree, and use the syntax mapping table defined in step S203 to convert each Java syntax structure into a corresponding TypeScript syntax structure. For example, convert the Java class definition into a TypeScript interface or class definition, and convert the method signature into a TypeScript function signature, while retaining all necessary type information. During the conversion process, a template engine can be used to generate the code of the .d.ts file, fill the mapped syntax structure into the template placeholder, and generate a complete TS declaration file.

[0067] Step S205, load the TS declaration file, generate syntax prompts and auto-completion.

[0068] In code editors, such as Visual Studio Code or WebStorm, the TypeScript declaration file loading function is integrated. When the editor starts or the user opens a TypeScript file, all .d.ts files in the project are automatically loaded. The editor should have a TypeScript syntax analyzer that can read and understand the type declarations in the .d.ts file and provide users with real-time syntax prompts and code completion suggestions. For example, if the user starts to enter a class name or method name related to the backend interface, the editor should be able to provide corresponding symbol suggestions, type information, and parameter lists based on the loaded .d.ts file to help users quickly and accurately complete code writing.

[0069] Throughout the entire process, ensuring accuracy and efficiency at each step is key. When loading and analyzing source code, file reading exceptions and syntax analysis errors need to be handled. During syntax mapping and code conversion, language features and syntax differences should be taken into account to ensure that the converted code structure is legal and meaningful in TypeScript. Finally, when integrating the loading and use functions of declaration files in the editor, ensure the performance of the editor to avoid delays in code parsing and suggestion generation. Through the above steps, the automated conversion from the Java backend interface to the TypeScript front-end declaration file can be achieved, thereby providing users with an efficient code editing experience.

[0070] Figure 3 is a flowchart of converting a backend programming language into a target declaration file that conforms to a frontend programming language according to an embodiment of the present application, such as Figure 3 As shown, the method comprises the following steps:

[0071] Step S301, receiving AST analysis results. Receive Java Abstract Syntax Tree (AST). Ensure that the receiver can process various types of AST nodes, including but not limited to class definitions, method definitions, variable declarations, expressions, etc. The received AST should be stored in JSON, XML or a custom data structure for subsequent processing.

[0072] Step S302, read the syntax mapping template. Read the predefined syntax mapping template. The template should be stored in JSON, YAML or similar configuration file format, recording the mapping rules from Java syntax structure to TypeScript syntax structure. For example, the template may have the following mapping rules:

[0073] "public class":"export class",

[0074] "static":"", / / Static methods in TypeScript do not require additional modifiers

[0075] "String":"string",

[0076] "int":"number",

[0077] The reader should be able to read the template file and parse it into an in-memory data structure that can be easily found and used in subsequent steps.

[0078] Step S303, read each element in the AST. Traverse the Java AST, and for each node, extract key information such as its type, name, parameters, return type, etc. You can use a depth-first search or breadth-first search algorithm to traverse the AST, and use a visitor pattern to process different types of nodes to ensure that all necessary information is read and processed correctly.

[0079] Step S304: Replace placeholders. In the read Java AST elements, for the parts that need to be converted to TypeScript syntax, replace the placeholders using the rules in the syntax mapping template. For example, if there is a class definition node in the AST, the corresponding template may be export class <classname>{...}, then use the class name to replace <classname>Placeholder. Similarly, for method signatures, variable types, etc., corresponding mapping rules are also applied for replacement.

[0080] Step S305, automatically select a code template. According to the type of AST node, automatically select and apply the corresponding TypeScript code template. For example, for class definition, use the class definition template; for method definition, use the method signature template. The selection of the template should be based on the rules defined in the syntax mapping table to ensure that each Java syntax structure is correctly converted to the corresponding TypeScript syntax structure.

[0081] Step S306, splicing TS complete code. After completing the conversion and template application of all nodes, all generated TypeScript code snippets are spliced ​​into a complete TypeScript file. When splicing, the logical order of the code structure and the syntax specifications of TypeScript should be considered, such as the need for an export statement before the class definition, and the method signature should be placed inside the class definition. The splicing process can use string operation functions, such as concat() or join(), to combine the code snippets in order.

[0082] Step S307, output TS file. Write the spliced ​​TypeScript code into a new .d.ts file (or .ts file). You can use Java's FileWriter or BufferedWriter class to implement file writing. Before writing a file, you should ensure the correctness of the file path and name, as well as the read and write permissions of the file. After the file is written, the file stream should be closed to release resources.

[0083] Figure 4 is a flow chart of using an editor to load a target declaration file according to an embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:

[0084] Step S401, read the TS declaration file. Use the TypeScript parser or the corresponding file reading API, such as the fs module in Node.js, to read the content of the .d.ts or .ts file. Convert the file content to a string to prepare for subsequent syntax analysis.

[0085] Step S402, syntax parsing, decomposition into tokens. Use TypeScript's lexical analyzer (or lexer) to decompose the read string into a series of tokens. Tokens usually include keywords (such as class, interface, function), identifiers (such as variable names, function names), strings, numbers, operators, etc. The lexical analyzer should be able to recognize and process all grammatical elements of TypeScript to ensure that each token is correctly parsed and classified.

[0086] Step S403, receiving the input characters of the developer. In the code editor, an event listener is implemented to capture the keyboard input events of the developer in real time. The listener should be able to handle continuous character input, deletion, cursor movement and other operations to ensure that the editor can respond to the developer's input in real time.

[0087] Step S404, context analysis: symbol table, type judgment. Traverse the parsed TypeScript code (or declaration file), build or update a symbol table, and record the names and type information of all defined classes, interfaces, functions, and variables. The symbol table can be a hash table or dictionary for quick search. Analyze the current input context, determine the grammatical structure to which the input characters may belong (such as class name, function parameter, variable assignment, etc.), and judge the possible type information based on the symbol table.

[0088] Step S405, provide code suggestions and prompt text. Based on the results of context analysis, the editor should be able to provide code suggestions and prompt text. For example, if the developer enters a class name or function name, the editor should search for related classes and functions from the symbol table and display a list of suggestions. The suggestion list should include complete function signatures, parameter types, return types and other information to help developers choose the correct syntax structure. The prompt text can be a brief description or document comment to provide additional help information.

[0089] In step S406, the user selects one of the suggestions. An interactive interface, such as a pop-up menu or a drop-down list, is provided in the editor to display the code suggestions generated in step S405. When the user selects an item from the suggestion list, the editor should be able to capture the user's input or selection behavior and prepare for code completion.

[0090] Step S407, automatically complete the code. When the user selects a code suggestion, the editor automatically inserts the selected code snippet at the current input position. The inserted code should contain all necessary syntax elements to ensure the integrity of type information and code structure. For example, if the user selects a function signature, the editor should automatically insert the function name, parameter list, brackets, and semicolons, etc. In addition, the editor should also handle formatting and indentation issues after the code snippet is inserted to keep the code neat and readable.

[0091] When implementing the above steps, the performance and user experience of the editor must be ensured to avoid delays or freezes when processing large amounts of code or complex syntax structures. At the same time, the generation of symbol tables and code suggestions should be as accurate as possible to reduce incorrect suggestions and improve the practicality and accuracy of code completion. Through the above implementation, the code editor can provide developers with real-time, intelligent syntax checking and code completion functions, greatly improving coding efficiency and code quality.

[0092] Figure 5 is a structural diagram of a script code processing device according to an embodiment of the present application, such as Figure 5 As shown, the device comprises:

[0093] The acquisition module 51 is used to acquire the script code of the target program, wherein the script code is based on the front-end programming language.

[0094] The determination module 52 is used to determine the backend programming language of the target program, and determine a first abstract syntax tree corresponding to the frontend programming language and a second abstract syntax tree corresponding to the backend programming language.

[0095] The establishing module 53 is used to establish a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree.

[0096] The conversion module 54 is used to convert the backend programming language into a target declaration file that conforms to the frontend programming language according to the syntax mapping relationship.

[0097] The loading module 55 is used to load the target declaration file using the editor.

[0098] Optionally, the determination module 52 is also used to perform the following steps: obtaining a first source code string based on a front-end programming language, wherein the front-end programming language includes at least: TypeScript; using a first preset lexical rule, scanning the first source code string character by character to generate multiple first lexical units, wherein, in the first preset lexical rule, a lexical pattern in the front-end programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to a first predefined grammar rule, parsing each first lexical unit into a grammatical structure to construct a first initial syntax tree; performing redundant node elimination and continuous operator merging processing on the first initial syntax tree, and abstracting the processed first initial syntax tree to obtain a first abstract syntax tree.

[0099] Optionally, the determination module 52 is also used to perform the following steps: obtaining a second source code string based on a backend programming language, wherein the backend programming language includes at least: Java; using a second preset lexical rule, scanning the second source code string character by character to generate multiple second lexical units, wherein, in the second preset lexical rule, a lexical pattern in the backend programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: keywords, identifiers, operators, numbers, and strings; according to a second predefined grammar rule, parsing each second lexical unit into a grammatical structure to construct a second initial syntax tree; performing a process of eliminating redundant nodes and merging consecutive operators on the second initial syntax tree, and performing an abstract process on the processed second initial syntax tree to obtain a second abstract syntax tree.

[0100] Optionally, the conversion module 54 is also used to perform the following steps: obtaining a syntax mapping relationship, wherein the syntax mapping relationship includes conversion rules for converting the syntax structure of the front-end programming language to the syntax structure of the back-end programming language; traversing each first node in the first abstract syntax tree and recording the node type of each first node; searching for conversion rules corresponding to the node type of each first node and the syntax element name of the target language in the syntax mapping relationship; determining a target code template corresponding to each first node based on the conversion rules and the syntax element name of the target language, wherein the target code template includes: a placeholder; extracting target information from each first node, and using the target information to replace the placeholder in the target code template to determine the code snippet corresponding to each first node; splicing the code snippets corresponding to each first node to obtain the target code, and writing the target code into a preset file to obtain a target declaration file that conforms to the front-end programming language.

[0101] Optionally, the syntax mapping relationship is stored in a computer cache.

[0102] Optionally, the loading module 55 is also used to execute the following steps: read the target declaration file, perform syntax analysis on the target declaration file, and obtain multiple syntax units; construct a symbol table based on the multiple syntax units, wherein the symbol table includes at least one of the following: the definition, type and scope of the symbol; monitor keyboard input events in the editor to obtain input characters; determine the type of the input character in the symbol table, and determine the code structure of the input character; determine multiple code suggestion information corresponding to the input character in the symbol table based on the type of the input character in the symbol table and the code structure of the input character; display the multiple code suggestion information in the editing interface of the editor, insert the target code suggestion information selected from the multiple code suggestion information into the input position in the editing interface of the editor, and add the syntax elements corresponding to the target code suggestion information.

[0103] Optionally, the code suggestion information includes at least one of the following: function name, variable name, class name.

[0104] It should be noted that the above Figure 5 The modules in the embodiment may be program modules (e.g., a set of program instructions for implementing a specific function) or hardware modules. For the latter, they may be expressed in the following forms, but are not limited thereto: the expression form of the above modules is a processor, or the functions of the above modules are implemented by a processor.

[0105] It should be noted that Figure 5 The preferred implementation of the illustrated embodiment can be found in Figure 1 The relevant description of the illustrated embodiment will not be repeated here.

[0106] Figure 6 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a script code processing method. Figure 6 As shown, the computer terminal 60 may include one or more (602a, 602b, ..., 602n are used to illustrate) processors 602 (the processor 602 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 604 for storing data, and a transmission module 606 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 6 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 6 More or fewer components as shown, or with Figure 6 Different configurations are shown.

[0107] It should be noted that the one or more processors 602 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 60. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0108] The memory 604 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the script code processing method in the embodiment of the present application. The processor 602 executes various functional applications and data processing by running the software programs and modules stored in the memory 604, that is, the script code processing method described above is implemented. The memory 604 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 604 may further include a memory remotely arranged relative to the processor 602, and these remote memories may be connected to the computer terminal 60 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0109] The transmission module 606 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 60. In one example, the transmission module 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 606 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0110] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 60 .

[0111] It should be noted that, in some optional embodiments, the above Figure 6 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 6 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.

[0112] It should be noted that Figure 6 The computer terminal shown is used to execute Figure 1 The processing method of the script code shown, therefore the relevant explanations in the execution method of the above command are also applicable to the electronic device and will not be repeated here.

[0113] An embodiment of the present application further provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above script code processing method.

[0114] A program for executing the following functions on a non-volatile storage medium: obtaining script code of a target program, wherein the script code is based on a front-end programming language; determining a back-end programming language of the target program, and determining a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language; establishing a syntax mapping relationship between the front-end programming language and the back-end programming language based on the first abstract syntax tree and the second abstract syntax tree; converting the back-end programming language into a target declaration file that conforms to the front-end programming language based on the syntax mapping relationship; and loading the target declaration file using an editor.

[0115] An embodiment of the present application further provides an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the above script code processing method is executed when the program is run.

[0116] The processor is used to run a program that performs the following functions: obtain a script code of a target program, wherein the script code is based on a front-end programming language; determine a back-end programming language of the target program, and determine a first abstract syntax tree corresponding to the front-end programming language and a second abstract syntax tree corresponding to the back-end programming language; establish a syntax mapping relationship between the front-end programming language and the back-end programming language based on the first abstract syntax tree and the second abstract syntax tree; convert the back-end programming language into a target declaration file that conforms to the front-end programming language based on the syntax mapping relationship; and load the target declaration file using an editor.

[0117] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0118] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0119] In the above-mentioned embodiments of the present application, the collected information is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0124] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.< / classname> < / classname> < / properties> < / classname>

Claims

1. A script code processing method, characterized in that: include: Obtaining script code of a target program, wherein the script code is based on a front-end programming language; Determine the backend programming language of the target program, and determine a first abstract syntax tree corresponding to the frontend programming language and a second abstract syntax tree corresponding to the backend programming language; Establishing a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree; According to the syntax mapping relationship, converting the backend programming language into a target declaration file that conforms to the frontend programming language; Use an editor to load the target declaration file.

2. The method according to claim 1, characterized in that Determining a first abstract syntax tree corresponding to the front-end programming language includes: Obtaining a first source code string based on the front-end programming language, wherein the front-end programming language at least includes: TypeScript; Using a first preset lexical rule, scanning the first source code string character by character to generate a plurality of first lexical units, wherein in the first preset lexical rule, a lexical pattern in the front-end programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: a keyword, an identifier, an operator, a number, and a character string; According to a first predefined grammar rule, each of the first lexical units is parsed into a grammatical structure to construct a first initial grammar tree; The first initial syntax tree is processed by eliminating redundant nodes and merging continuous operators, and the processed first initial syntax tree is abstracted to obtain the first abstract syntax tree.

3. The method according to claim 1, characterized in that Determining a second abstract syntax tree corresponding to the backend programming language includes: Acquire a second source code string based on the backend programming language, wherein the backend programming language at least includes: Java; Using a second preset lexical rule, scanning the second source code string character by character to generate a plurality of second lexical units, wherein in the second preset lexical rule, a lexical pattern in the backend programming language is expressed using a regular expression, and the lexical pattern includes at least one of the following: a keyword, an identifier, an operator, a number, and a character string; According to a second predefined grammar rule, each of the second lexical units is parsed into a grammatical structure to construct a second initial grammar tree; The second initial syntax tree is processed by eliminating redundant nodes and merging continuous operators, and the processed second initial syntax tree is abstracted to obtain the second abstract syntax tree.

4. The method according to claim 1, characterized in that: According to the syntax mapping relationship, converting the backend programming language into a target declaration file that conforms to the frontend programming language includes: Acquire the grammatical mapping relationship, wherein the grammatical mapping relationship includes a conversion rule for converting a grammatical structure of the front-end programming language to a grammatical structure of the back-end programming language; Traversing each first node in the first abstract syntax tree, and recording the node type of each first node; Searching for a conversion rule corresponding to the node type of each first node and a grammatical element name of a target language in the grammatical mapping relationship; Determine, according to the conversion rule and the name of the grammatical element of the target language, a target code template corresponding to each of the first nodes, wherein the target code template includes: a placeholder; Extracting target information in each of the first nodes, and replacing a placeholder in the target code template with the target information to determine a code snippet corresponding to each of the first nodes; The code fragments corresponding to each of the first nodes are spliced ​​to obtain the target code, and the target code is written into a preset file to obtain the target declaration file that conforms to the front-end programming language.

5. The method according to claim 4, characterized in that The grammar mapping relationship is stored in a computer cache.

6. The method according to claim 1, characterized in that Use the editor to load the target declaration file, including: Read the target declaration file, perform syntax analysis on the target declaration file, and obtain multiple syntax units; Constructing a symbol table according to the plurality of grammatical units, wherein the symbol table includes at least one of the following: a definition, a type and a scope of a symbol; Monitor keyboard input events in the editor to obtain input characters; determine the type of the input characters in the symbol table, and determine the code structure of the input characters; Determining, in the symbol table, a plurality of code suggestion information corresponding to the input character according to the type to which the input character belongs in the symbol table and the code structure of the input character; The multiple code suggestion information are displayed in the editing interface of the editor, the target code suggestion information selected from the multiple code suggestion information is inserted into the input position in the editing interface of the editor, and the syntax elements corresponding to the target code suggestion information are added.

7. The method according to claim 6, characterized in that The code suggestion information includes at least one of the following: function name, variable name, and class name.

8. A script code processing device, characterized in that: include: An acquisition module, used for acquiring script code of a target program, wherein the script code is based on a front-end programming language; A determination module, configured to determine a backend programming language of the target program, and to determine a first abstract syntax tree corresponding to the frontend programming language and a second abstract syntax tree corresponding to the backend programming language; An establishing module, configured to establish a syntax mapping relationship between the front-end programming language and the back-end programming language according to the first abstract syntax tree and the second abstract syntax tree; A conversion module, used for converting the backend programming language into a target declaration file conforming to the frontend programming language according to the grammar mapping relationship; A loading module is used to load the target declaration file using an editor.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the script code processing method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the script code processing method described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Code file analysis method and device and nonvolatile storage medium

    CN120872406A

  • Cross-product transplantation method and device for secondary development codes, computer equipment and medium

    CN121116387A

  • Code editor cross-language function positioning method based on hierarchical context driving

    CN121209838A