CN114895886B - Programming statement conversion method, electronic device, and storage medium - Google Patents
Programming statement conversion method, electronic device, and storage medium Download PDFInfo
- Publication number
- CN114895886B CN114895886B CN202210582936.4A CN202210582936A CN114895886B CN 114895886 B CN114895886 B CN 114895886B CN 202210582936 A CN202210582936 A CN 202210582936A CN 114895886 B CN114895886 B CN 114895886B
- Authority
- CN
- China
- Prior art keywords
- jump
- position information
- statement
- code
- sentence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/316—Aspect-oriented programming techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/425—Lexical analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/43—Checking; Contextual analysis
- G06F8/433—Dependency analysis; Data or control flow analysis
- G06F8/434—Pointers; Aliasing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/447—Target code generation
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The present invention relates to the field of code processing technologies, and in particular, to a program sentence conversion method, an electronic device, and a storage medium. According to the method, a target grammar tree is built according to an original code, first position information is acquired, a target jump label corresponding to a goto jump sentence is determined according to the first position information, and second position information is acquired. Further, according to the first position information and the second position information, starting point position information which is at the same level as the label definition statement is obtained from ancestor node positions of each level of the goto jump statement, then the first position information is used as end point position information, codes to be converted are obtained by dividing the original codes according to the starting point position information and the end point position information, the goto jump statement is finally replaced by a target jump statement, and converted result codes are obtained according to the target jump statement and the codes to be converted, so that conversion of the original codes is realized, and further the code compiling efficiency is improved.
Description
Technical Field
The present invention relates to the field of code processing technologies, and in particular, to a program sentence conversion method, an electronic device, and a storage medium.
Background
In the related art, goto jump sentences are widely used in a programming sentence system of a plurality of programming languages, such as a procedure structured query language (Procedural Structured Query Language, PL/SQL), a C language, a C++, a Golang and the like. The goto jump sentence is so widely applied because the goto jump sentence has the characteristic of jumping freedom, can jump arbitrarily in the grammar structure, and is similar to a jump sentence in assembly language. However, the free jump characteristic of the goto jump sentence brings harm to the optimization and execution of the code compiler, and the prefetching instruction flow of the central processing unit (Central Processing Unit, CPU) is easily broken in the application scene of the goto jump sentence, so that the running efficiency of the code is reduced.
Disclosure of Invention
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a programming sentence conversion method, electronic equipment and a storage medium, which can convert goto jump sentences in codes so as to improve the compiling efficiency of programs.
A programming sentence conversion method according to an embodiment of the first aspect of the present invention, the method comprising;
constructing a target grammar tree according to an original code, wherein the target grammar tree reflects a statement structure of the original code;
Acquiring first position information of a position where a goto jump sentence is located in the target grammar tree;
determining a destination jump label corresponding to the goto jump sentence according to the first position information;
acquiring second position information of a position of a label definition statement in the target grammar tree, wherein the label definition statement is used for defining the target jump label;
Acquiring starting point position information of the same level as the tag definition statement from ancestor node positions of each level of the goto jump statement according to the first position information and the second position information;
the first position information is used as end position information, and codes to be converted are obtained by dividing the original codes according to the start position information and the end position information;
and replacing the goto jump sentence with a target jump sentence, and obtaining a converted result code according to the target jump sentence and the code to be converted.
Optionally, according to some embodiments of the present invention, the obtaining, from each level of ancestor node positions of the goto jump sentence according to the first location information and the second location information, starting location information at the same level as the tag definition sentence includes:
Acquiring a first type node position of the goto jump sentence in the target grammar tree according to the first position information;
determining the ancestor node positions of each level of the goto jump sentence according to the first type node positions;
acquiring a second class node position of the tag definition statement in the target grammar tree according to the second position information;
And acquiring the starting point position information of the same level as the label definition statement according to the ancestor node positions of each level and the second class node positions.
Optionally, according to some embodiments of the present invention, the obtaining, according to the ancestor node positions of each level and the second class node positions, starting point position information of a level identical to that of the tag definition statement further includes:
When the original code comprises more than two goto jump sentences, determining hierarchical position arrangement of each stage of ancestor node positions of each goto jump sentence in the target grammar tree;
And based on the hierarchical position arrangement, acquiring a common ancestor node position of each goto jump sentence in the target grammar tree, and acquiring the starting point position information of the common ancestor node position, which is at the same level as the tag definition sentence.
Optionally, according to some embodiments of the present invention, the starting point position information includes a jump starting node position, the end point position information includes more than two jump end node positions, the first position information is used as end point position information, and the code to be converted is obtained by dividing from the original code according to the starting point position information and the end point position information, including:
Determining the common ancestor node location at the same level as the tag definition statement as the jump start node location;
Determining each first type node position in the first position information as the jump terminal node position;
and dividing the original code into the code to be converted based on the position of the jump starting node and the position of the jump ending node.
Optionally, according to some embodiments of the present invention, the dividing the original code into codes to be converted according to the first position information as end position information and the start position information and the end position information further includes:
acquiring a construction conversion relation between the original code and the target grammar tree;
Obtaining a conversion starting line corresponding to the starting point position information in the original code according to the starting point position information and the construction conversion relation;
Obtaining a conversion termination line corresponding to the end point position information in the original code according to the end point position information and the construction conversion relation;
and dividing the code to be converted according to the conversion starting line and the conversion ending line.
Optionally, according to some embodiments of the present invention, the replacing the goto jump sentence with a destination jump sentence, and obtaining a converted result code according to the destination jump sentence and the code to be converted includes:
incorporating the code to be converted into an execution part of the target jump sentence, wherein the conversion starting line corresponds to a starting code of the execution part, and the conversion ending line corresponds to a jump code of the execution part;
and setting the label execution statement of the target jump label as a jump result statement corresponding to the jump code, so that the code to be converted jumps to the label execution statement.
Optionally, according to some embodiments of the present invention, the setting the tag execution statement of the destination jump tag as a jump result statement corresponding to the jump code, so that the code to be translated jumps to the tag execution statement, further includes:
forming a statement jump name of the destination jump statement based on the label name of the destination jump label;
And linking the jump code to the statement jump name so as to jump the code to be converted to the tag execution statement.
Optionally, according to some embodiments of the invention, the method further comprises:
Judging whether a position relationship abnormality exists between the goto jump sentence and the tag definition sentence according to the first position information and the second position information;
and when the position relation between the goto jump sentence and the label definition sentence is abnormal, stopping sentence conversion of the original code and carrying out error reporting reminding.
In a second aspect, an embodiment of the present invention provides an electronic device, including a memory, and a processor, where the memory stores a computer program, and the processor implements a program sentence conversion method according to any one of the embodiments of the first aspect of the present invention when executing the computer program.
In a third aspect, an embodiment of the present invention provides a computer readable storage medium storing a program that is executed by a processor to implement the program sentence conversion method according to any one of the embodiments of the first aspect of the present invention.
According to the programming sentence conversion method, the electronic device and the storage medium provided by the embodiment of the invention, the method has at least the following beneficial effects:
According to the method, a target grammar tree is constructed according to an original code, first position information of the position of a goto jump sentence in the target grammar tree is obtained, a target jump label corresponding to the goto jump sentence is determined according to the first position information, and second position information of the position of a label definition sentence in the target grammar tree is obtained. Further, according to the first position information and the second position information, starting point position information which is at the same level as the label definition statement is obtained from ancestor node positions of each level of the goto jump statement, then the first position information is used as end point position information, according to the starting point position information and the end point position information, codes to be converted are obtained by dividing the original codes, the goto jump statement is finally replaced by a target jump statement, and a converted result code is obtained according to the target jump statement and the codes to be converted. According to the method, the first position information of the position of the goto jump sentence in the target grammar tree and the second position information of the position of the label definition sentence are used for determining the starting point position information and the end point position information, then the starting point position information and the end point position information are used for dividing to obtain the code to be converted, and finally the goto jump sentence is replaced by the target jump sentence, so that conversion of the original code is realized, and further the code compiling efficiency is improved.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the invention will become apparent and may be better understood from the following description of embodiments taken in conjunction with the accompanying drawings in which:
FIG. 1 is a schematic diagram of an execution flow of a program statement conversion method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 3 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 4 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 5 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 6 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 7 is a schematic diagram of another embodiment of a program sentence conversion method according to the present invention;
FIG. 8 is a schematic diagram illustrating another embodiment of a program sentence conversion method according to the present invention;
FIG. 9 is a schematic diagram illustrating a method for converting a programming sentence according to an embodiment of the present invention;
FIG. 10 is a schematic diagram illustrating another exemplary embodiment of a program statement transformation method;
FIG. 11 is a schematic diagram of an electronic device for performing a program sentence conversion method according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
In the description of the present invention, a number means one or more, a number means two or more, and greater than, less than, exceeding, etc. are understood to not include the present number, and above, below, within, etc. are understood to include the present number. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present invention, it should be understood that the direction or positional relationship indicated with respect to the description of the orientation, such as up, down, left, right, front, rear, etc., is based on the direction or positional relationship shown in the drawings, is merely for convenience of describing the present invention and simplifying the description, and does not indicate or imply that the apparatus or element to be referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
In the description of the present invention, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present invention can be determined reasonably by a person skilled in the art in combination with the specific content of the technical solution. In addition, the following identification of specific steps does not represent a limitation on the order of steps and execution logic, and the order of execution and logic between steps should be understood and inferred by reference to the corresponding illustrative expressions.
In the related art, goto jump sentences are widely used in a programming sentence system of a plurality of programming languages, such as a procedure structured query language (Procedural Structured Query Language, PL/SQL), a C language, a C++, a Golang and the like. The goto jump sentence is so widely applied because the goto jump sentence has the characteristic of jumping freedom, can jump arbitrarily in the grammar structure, and is similar to a jump sentence in assembly language. However, the free jump characteristic of the goto jump sentence brings harm to the optimization and execution of the code compiler, and the prefetching instruction flow of the central processing unit (Central Processing Unit, CPU) is easily broken in the application scene of the goto jump sentence, so that the running efficiency of the code is reduced.
In some program compilations, the process of translating a source program into a target program can be divided into five stages, lexical analysis, grammar analysis, semantic checking and intermediate code generation, code optimization, and target code generation. The most important links are lexical analysis and grammar analysis, also called source program analysis, and if grammar errors are found in the lexical analysis and grammar analysis processes, program compiling cannot be smoothly performed. The free jump characteristic of the goto jump sentence also brings harm to program compiling, and because a plurality of code compilers cannot be compatible with the using grammar of the goto jump sentence, the use of the goto jump sentence is often judged as grammar error in the processes of lexical analysis and grammar analysis, so that the program compiling cannot be carried out smoothly.
The programming sentence conversion method, the electronic device and the storage medium provided by the embodiment of the invention are suitable for a procedure-oriented program written by adopting a command type programming language. The imperative programming language is a motion-based computer language, in the context of von neumann computer architecture. The main structure of the process-oriented program written in the command programming language is composed of a plurality of functions, wherein the functions comprise input parameters, return values and a calculation process, and the calculation process is realized by a section of program statement. The programming language used to implement the program may be any of the existing imperative programming languages, such as a programming language of the C-language or C-like language.
Further description is made below on the basis of the accompanying drawings.
The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention provides a programming sentence conversion method, electronic equipment and a storage medium, which can convert goto jump sentences in codes so as to improve the compiling efficiency of programs.
Referring to fig. 1, a program sentence conversion method according to an embodiment of the first aspect of the present invention includes;
step S101, constructing a target grammar tree according to an original code, wherein the target grammar tree reflects a sentence structure of the original code;
It should be appreciated that a Syntax Tree (syncax Tree), otherwise known as abstract Syntax Tree (Abstract Syntax Tree, AST), is a concept in the compilation principle that functions to represent an abstract Syntax structure in Tree form, each non-leaf node on the Tree being an operator in the abstract Syntax, the leaf nodes representing concrete objects of the abstract Syntax Tree. The use of the syntax tree allows the machine to understand the intrinsic meaning of the abstract syntax and the execution order of the abstract syntax. Syntax tree is widely used, such as source code parsing of programming language, expression analysis, natural language processing, and machine translation techniques, and syntax tree techniques are required. According to some embodiments of the present invention, generating a syntax tree typically requires two processes, lexical analysis and syntax analysis. The task of lexical analysis is to read in a file character by character from left to right, i.e. to scan a character stream in the file and then to identify words according to word-forming rules. Syntax analysis is a logical stage of the compilation process. The task of the grammar analysis is to combine word sequences into various grammar phrases on the basis of lexical analysis. It is common practice for professional compiler programmers to write lexical analyzers and grammatical analyzers to parse the corresponding statements to generate a grammar tree.
According to some embodiments of the present invention, a program statement transformation method requires first constructing a target syntax tree from the original code. It should be noted that, the original code refers to the code that has not been converted before the processing of the programming sentence conversion method of the present invention, and the target syntax tree reflects the sentence structure of the original code. It should be understood that the statement structure of the original code consists of several branch parent statements and branch child statements. In some embodiments of the present invention, the branch native sentences that can generate the branch sub-sentences in the sentence structure include logic sentences such as if sentences, while sentences, for sentences, and the like, and also include tag definition sentences determined according to programming requirements. It should be understood that the branched mother sentence that can generate the branched child sentence in the sentence structure is not limited to the specific embodiment illustrated above. According to some embodiments of the present invention, in the process of constructing the target syntax tree according to the original code, it is required to obtain the construction conversion relationship between the original code and the target syntax tree from the sentence structure of the original code, for example, according to the positions of the logic sentences such as if sentences, while sentences, for sentences, etc., so as to determine the hierarchy and branches of the target syntax tree, thereby further constructing the target syntax tree based on the construction conversion relationship.
Step S102, obtaining first position information of a position where a goto jump sentence is located in a target grammar tree;
The first location information refers to information reflecting a location of the goto jump sentence in the target syntax tree. It should be understood that there may be only one goto jump sentence or a plurality of goto jump sentences in the original code, so that the corresponding first location information may include one or more than two goto jump sentence branch locations in the target syntax tree.
Step S103, determining a destination jump label corresponding to the goto jump sentence according to the first position information;
In some embodiments of the present invention, a destination jump tag is disposed at the rear end of the goto jump sentence, and the destination jump tag accepts the jump target of the goto jump sentence, so that the goto jump sentence can be linked to the tag execution sentence of the destination jump tag.
Step S104, obtaining second position information of the position of a label definition statement in a target grammar tree, wherein the label definition statement is used for defining a target jump label;
The second location information refers to information reflecting a location of the tag definition statement in the target syntax tree. It should be appreciated that the tag definition statements are used to define the destination jump tags, and in some embodiments the tag definition statements include tag execution statements for the destination jump tags. According to some embodiments of the invention, in the original code, the tag definition statement may precede the destination skip tag or follow the destination skip tag. When the goto jump sentence is executed, the goto jump sentence is linked into the tag definition sentence based on the destination jump tag, thereby further executing the tag execution sentence of the destination jump tag. According to some embodiments of the present invention, the position of the goto jump sentence in the target syntax tree may be determined according to the first position information, so that the destination jump label corresponding to the goto jump sentence may be determined, and further, the target syntax tree may be traversed according to the destination jump label, so as to lock the position of the label definition sentence.
Step S105, acquiring starting point position information of the same level as the label definition statement from ancestor node positions of each level of the goto jump statement according to the first position information and the second position information;
According to some embodiments provided by the invention, according to the first position information, the positions of all ancestor nodes of the target grammar tree of the goto jump sentence can be definitely determined, and then according to the positions of the label definition sentences locked in the second position information, the starting point position information of the same level as the label definition sentences is obtained from all levels of ancestor node positions of the goto jump sentence. The same level as the tag definition statement means that the same parent node as the tag definition statement is provided. Therefore, according to some embodiments provided by the invention, the step of acquiring the same-level starting point position information as the tag definition statement from the ancestor node positions of all levels of the goto jump statement refers to finding the father node of the tag definition statement from the ancestor node positions of all levels of the goto jump statement, and then extending one level to the branch direction in which the goto jump statement is located to determine the same-level position as the tag definition statement in the ancestor node positions of all levels of the goto jump statement. Thereby further acquiring the starting point position information. It should be clear that the starting point position information refers to position information corresponding to the starting point position of the code division range to be converted in the target syntax tree.
Step S106, the first position information is used as the end position information, and codes to be converted are obtained from the original codes in a dividing mode according to the start position information and the end position information;
It should be clear that the starting point position information refers to position information corresponding to the end point position of the code division range to be converted in the target grammar tree. The code to be converted refers to the part of the code which is directly related to the goto jump sentence and needs to be expressed by the destination jump sentence in the original code. It should be noted that, the reason why the position information of the same level as the tag definition statement in each level of ancestor node positions of the goto jump statement is determined, and the first position information is used as the end position information is to ensure that the normal conversion of the programming grammar is satisfied and the programming logic is not changed in the process of converting the goto jump statement into the target jump statement by the programming statement conversion method of the present invention.
Step S107, replacing the goto jump sentence with the destination jump sentence, and obtaining the converted result code according to the destination jump sentence and the code to be converted.
The target jump sentence is a program sentence which is different from the goto jump sentence and can also play a role in jumping. According to some preferred embodiments of the present invention, compared with the goto jump statement, the target jump statement has better compatibility, and can adapt to multiple types of code compilers, so that optimization and execution of the code compilers can be completed smoothly. In some more specific embodiments of the present invention, the selection scheme of the target jump sentence includes, but is not limited to, selecting a jump sentence such as a while-break sentence, a for-continuous sentence, a try-catch sentence, etc. as the target jump sentence in the program sentence conversion method of the present invention. It should be emphasized that the destination jump sentence in the program sentence conversion method of the present invention is not limited to the specific embodiments illustrated above.
Referring to FIG. 9, a target syntax tree 920, according to some more specific embodiments of the invention, includes:
a jump terminal node 921 corresponding to the goto jump sentence, wherein a TARGET corresponding to the jump terminal node 921 is a destination jump tag;
A tag definition node 922 corresponding to the tag definition statement, wherein "print ('goto here.,')" in the tag definition node 922 is a tag execution statement of the destination skip tag;
A hop-starting node 923 at the same level as the tag definition node 922 in each level of ancestor node positions of the hop-ending node 921;
the label defines the parent node 924 of node 922.
It should be understood that in the embodiment illustrated in fig. 9, the nodes corresponding to the sentences stmt1, sentence if (x= =2), sentence if (y= =3),..and sentence stmtn are at the same level as the tag definition node 922. It is emphasized that embodiments of the present invention include, but are not limited to, the programming statement transformation method illustrated in FIG. 9.
Based on fig. 9, further description is made of step S101 to step S107. The method constructs the TARGET grammar tree 920 according to the original code 910, acquires the first position information of the position of the jump terminal node 921 in the TARGET grammar tree 920, further determines a TARGET jump label TARGET corresponding to the jump terminal node 921 according to the first position information, and acquires the second position information of the position of the mark definition node 922 in the TARGET grammar tree 920. Further, according to the first position information and the second position information, starting position information of the same level as the label definition node 922 is obtained from the ancestor node positions of each level of the jump terminal node 921, then the first position information is used as end position information, according to the starting position information and the end position information, a code to be converted is obtained by dividing from the original code 910, finally, the goto jump sentence is replaced by the target jump sentence, and a converted result code 930 is obtained according to the target jump sentence and the code to be converted. In the embodiment shown in fig. 9, the destination jump sentence is a while-break sentence, it should be understood that those skilled in the art may make various equivalent modifications or substitutions under the sharing condition consistent with the spirit of the present invention, for example, when the destination jump sentence is a try-catch sentence, those skilled in the art may also implement the programming sentence conversion method expressed in steps S101 to S107, and only need to make corresponding adjustments to specific implementation details according to practical situations.
According to the method, a target grammar tree is constructed according to an original code, first position information of the position of a goto jump sentence in the target grammar tree is obtained, a target jump label corresponding to the goto jump sentence is determined according to the first position information, and second position information of the position of a label definition sentence in the target grammar tree is obtained. Further, according to the first position information and the second position information, starting point position information which is at the same level as the label definition statement is obtained from ancestor node positions of each level of the goto jump statement, then the first position information is used as end point position information, according to the starting point position information and the end point position information, codes to be converted are obtained by dividing the original codes, the goto jump statement is finally replaced by a target jump statement, and a converted result code is obtained according to the target jump statement and the codes to be converted. According to the method, the first position information of the position of the goto jump sentence in the target grammar tree and the second position information of the position of the label definition sentence are used for determining the starting point position information and the end point position information, then the starting point position information and the end point position information are used for dividing to obtain the code to be converted, and finally the goto jump sentence is replaced by the target jump sentence, so that conversion of the original code is realized, and further the code compiling efficiency is improved.
Referring to fig. 2, according to some embodiments of the present invention, acquiring starting point position information of the same level as a tag definition sentence from ancestor node positions of each level of a goto jump sentence according to first position information and second position information includes:
Step S201, according to the first position information, acquiring the first type node position of the goto jump sentence in the target grammar tree;
The first location information refers to information reflecting a location of the goto jump sentence in the target syntax tree. It should be understood that there may be only one goto jump sentence or a plurality of goto jump sentences in the original code, so that the corresponding first location information may include one or more than two branch locations of the goto jump sentence in the target syntax tree, i.e. the first type node locations. It should be clear that the first type of node location may include a branch location of one or more goto jump sentences.
Step S202, determining the positions of ancestor nodes of each level of the goto jump sentence according to the positions of the first type of nodes;
It should be noted that after each first-class node position in the target syntax tree is specified, each level of ancestor node positions of the first-class node position needs to be further determined. According to some embodiments of the present invention, since the target syntax tree itself carries hierarchy and relative positions, after confirming the first type node position, the positions of ancestor nodes of the goto jump sentence are confirmed to ancestor nodes of the father node, the grandfather node, and the like of the first type position information based on the first type position information.
Step S203, according to the second position information, the second class node position of the label definition statement in the target grammar tree is obtained;
The second location information refers to information reflecting a location of the tag definition statement in the target syntax tree. According to some embodiments of the invention, in the original code, the tag definition statement may precede the destination skip tag or follow the destination skip tag. When the goto jump sentence is executed, the goto jump sentence is linked into the tag definition sentence based on the destination jump tag, thereby further executing the tag execution sentence of the destination jump tag. According to some embodiments of the present invention, the position of the goto jump sentence in the target syntax tree may be determined according to the first position information, so that a destination jump label corresponding to the goto jump sentence may be determined, and further, after the destination jump label is obtained, the target syntax tree is traversed based on the destination jump label, so that the position of the label definition sentence, that is, the second class node position, is locked.
Step S204, acquiring the starting point position information of the same level as the label definition statement according to the ancestor node positions of each level and the second class node positions.
It should be clear that the starting point position information refers to position information corresponding to the starting point position of the code division range to be converted in the target syntax tree. According to some embodiments provided by the invention, after the positions of ancestor nodes and the positions of nodes of the second class of nodes of each level of the goto jump sentence are obtained, a jump starting node which is at the same level as the tag definition sentence is found from the ancestor nodes of each level of the goto jump sentence according to the positions of the ancestor nodes and the positions of the ancestor nodes of each level of the goto jump sentence, and starting point position information is obtained according to the positions of the jump starting node in the target grammar tree. The same level as the tag definition statement means that the same parent node as the tag definition statement is provided. Therefore, according to some embodiments provided by the invention, the step of acquiring the same-level starting point position information as the tag definition statement from the ancestor node positions of all levels of the goto jump statement refers to finding the father node of the tag definition statement from the ancestor node positions of all levels of the goto jump statement, and then extending one level to the branch direction in which the goto jump statement is located to determine the same-level position as the tag definition statement in the ancestor node positions of all levels of the goto jump statement. Thereby further acquiring the starting point position information.
Referring to FIG. 3, according to some embodiments of the invention, obtaining starting point location information of the same level as the tag definition statement according to the ancestor node locations of each level and the second class node locations, further comprises:
Step S301, when the original code comprises more than two goto jump sentences, determining hierarchical position arrangement of ancestor node positions of each goto jump sentence in a target grammar tree;
According to some embodiments of the present invention, there may be only one goto jump sentence or a plurality of goto jump sentences in the original code, so that the corresponding first location information may include one or more than two branch locations of the goto jump sentence in the target syntax tree. When the original code comprises more than two goto jump sentences, each first type node position of each goto jump sentence is required to be determined from the first position information, and then the hierarchical position arrangement of each level ancestor node position of each goto jump sentence in the target grammar tree is determined according to each first type node position. According to some embodiments provided by the present invention, the arrangement of the level ancestor node positions of each goto jump sentence in the level position in the target syntax tree refers to a set of the level ancestor node positions of each goto jump sentence in the original code, for example, when the original code includes three goto jump sentences, then the level ancestor node positions of each goto jump sentence include the parent node positions, grandparent node positions, and the like of the three goto jump sentences in the arrangement of the level position in the target syntax tree. It will be appreciated that the hierarchical position arrangement reflects the branching positions of the ancestor nodes of each level of each goto jump statement in the target syntax tree.
Step S302, based on the hierarchical position arrangement, the common ancestor node positions of all the goto jump sentences in the target grammar tree are obtained, and the starting point position information of the common ancestor node positions, which is at the same level as the label definition sentences, is obtained.
According to some embodiments of the present invention, after obtaining the hierarchical position arrangement of the ancestor node positions of each goto jump sentence in the target syntax tree, it is necessary to obtain the starting point position information further based on the hierarchical position arrangement. It should be emphasized that the starting point position information refers to position information corresponding to the starting point position of the code division range to be converted in the target syntax tree. Therefore, in order that all the goto jump sentences in the original code can be smoothly converted into the destination jump sentences when the original code comprises more than two goto jump sentences, in some preferred embodiments of the present invention, the common ancestor node positions of the goto jump sentences in the target grammar tree are obtained based on hierarchical position arrangement, the common ancestor node positions of the same level as the label definition sentences are obtained from the common ancestor node positions, and finally the starting point position information is obtained according to the common ancestor node positions of the same level as the label definition sentences. It should be understood that, by determining the position of the common ancestor node as the starting point position information, all goto jump sentences in the original code can be smoothly converted into target jump sentences as far as possible, so that the programming sentence conversion method of the invention is smoothly executed, and the original code is converted into the result code, thereby improving the compiling efficiency of the program.
Referring to fig. 4, according to some embodiments of the present invention, the start point position information includes a jump start node position, the end point position information includes more than two jump end node positions, the first position information is used as end point position information, and the code to be converted is obtained by dividing from an original code according to the start point position information and the end point position information, including:
step S401, determining the common ancestor node position at the same level as the label definition statement as the jump starting node position;
According to some more specific embodiments of the invention, the origin location information comprises a jump origin node location. In order that all the goto jump sentences in the original code can be successfully converted into the destination jump sentences when the original code comprises more than two goto jump sentences, in some preferred embodiments of the present invention, the common ancestor node positions of the goto jump sentences in the target grammar tree are acquired based on hierarchical position arrangement, common ancestor nodes in the same level as the label definition sentences are determined from the common ancestor node positions, and then the common ancestor nodes in the same level as the label definition sentences are used as jump start nodes, so that the jump start node positions are further determined according to the common ancestor node positions.
Step S402, determining each first type node position in the first position information as a jump terminal node position;
According to some more specific embodiments of the invention, the end point location information comprises more than two hop end point locations. In order to adapt the jump function of each goto jump sentence when the original code includes more than two goto jump sentences, in some preferred embodiments, each first type node position in the first position information needs to be determined as a jump end node position, so that in the process of dividing the original code into the code to be converted based on the jump start node position and the jump end node position, more than two sections of code to be converted can be obtained, which correspond to more than two goto jump sentences in the original code.
Step S403, dividing the original code into codes to be converted based on the position of the jump starting node and the position of the jump ending node.
According to some more specific embodiments of the present invention, after determining the position of the starting node and the position of the ending node, the code to be converted needs to be divided from the original code based on the position of the starting node and the position of the ending node. It should be noted that, in the process of constructing the target syntax tree according to the original code, the construction conversion relationship between the original code and the target syntax tree needs to be obtained from the sentence structure of the original code, so in some preferred embodiments, the process of dividing the original code into the codes to be converted based on the target syntax tree also needs to refer to the construction conversion relationship between the original code and the target syntax tree. According to some more specific embodiments of the present invention, referring to fig. 9, the TARGET syntax tree 920 includes a jump destination node 921 corresponding to a goto jump statement, where a TARGET corresponding to the jump destination node 921 is a destination jump label, a label definition node 922 corresponding to a label definition statement, where "print (' goto here..+ -.)" in the label definition node 922 is a label execution statement of the destination jump label, and a jump start node 923 at the same level as the label definition node 922 in each level of ancestor node positions of the jump destination node 921. It should be appreciated that the code to be converted is partitioned from the original code based on the location of the jump start node 923 and the location of the jump end node 921, and reference is made to the constructed conversion relationship between the original code and the target syntax tree.
In some more specific embodiments of the present invention, the code to be converted is partitioned from the original code based on the location of the jump starting node 923 and the location of the jump ending node 921. First, the position of the corresponding sentence if (x= =2) in the original code and the position of the goto jump sentence corresponding to the sentence if (x= =2) in the original code are confirmed in the jump start node 923, and the position of the corresponding sentence if (y= 3) in the original code and the position of the goto jump sentence corresponding to the sentence if (y= = 3) in the original code are confirmed. Then further, a first section of code to be converted is defined according to the position of the sentence if (x= = 2) in the original code and the position of the goto jump sentence corresponding to the sentence if (x= 2) in the original code, and a second section of code to be converted is defined according to the position of the sentence if (y= 3) in the original code and the position of the goto jump sentence corresponding to the sentence if (y= 3) in the original code. It should be understood that the first code segment to be converted and the second code segment, i.e., the code segment to be converted, are divided from the original code in the embodiment shown in fig. 9.
Referring to fig. 5, according to some embodiments of the present invention, the first position information is used as the end position information, and the code to be converted is obtained by dividing the original code according to the start position information and the end position information, and further includes:
step S501, a construction conversion relation between an original code and a target grammar tree is obtained;
According to some embodiments of the present invention, in the process of constructing the target syntax tree according to the original code, it is required to obtain the construction conversion relationship between the original code and the target syntax tree from the sentence structure of the original code, for example, according to the positions of the logic sentences such as if sentences, while sentences, for sentences, etc., so as to determine the hierarchy and branches of the target syntax tree, thereby further constructing the target syntax tree based on the construction conversion relationship. It should be understood that in some embodiments of the present invention, the code to be converted is obtained by dividing the original code according to the start position information and the end position information, and the conversion relation between the original code and the target syntax tree is also required to be constructed.
Step S502, according to the starting point position information and the construction conversion relation, obtaining a corresponding conversion starting line of the starting point position information in the original code;
step S503, according to the end position information and the construction conversion relation, obtaining a corresponding conversion termination line of the end position information in the original code;
Step S504, dividing the code to be converted according to the conversion starting line and the conversion ending line.
According to some more specific embodiments of the present invention, referring to fig. 9, the code to be converted is divided from the original code based on the location of the jump starting node 923 and the location of the jump ending node 921. First, the conversion start line corresponding to the jump start node 923, that is, the position of the sentence if (x= =2) in the original code and the position of the sentence if (y= =3) in the original code, is to be confirmed based on the start point position information and the construction conversion relation. Then, the conversion termination line corresponding to the conversion termination node 921, that is, the position of the goto jump sentence corresponding to the sentence if (x= =2) in the original code and the position of the goto jump sentence corresponding to the sentence if (x= =2) in the original code, is confirmed according to the start point position information and the construction conversion relation. Then further, a first section of code to be converted is defined according to a conversion starting line of a sentence if (x= = 2) in the original code and a conversion ending line of a goto jump sentence corresponding to the sentence if (x= 2) in the original code, and a second section of code to be converted is defined according to a conversion starting line of a sentence if (y= 3) in the original code and a conversion ending line of a goto jump sentence corresponding to the sentence if (y= = 3) in the original code. It should be understood that the first code segment to be converted and the second code segment, i.e., the code segment to be converted, are divided from the original code in the embodiment shown in fig. 9.
According to some more specific embodiments provided by the invention, the first position information is used as the end position information, the code to be converted is obtained by dividing the original code according to the start position information and the end position information, the level and the branches of the target grammar tree can be adjusted first, then the adjusted target grammar tree is converted into the sentence structure of the code again, and finally the result code is obtained. Referring to step S10, in some embodiments of the present invention, the adjusted target syntax tree is referred to as a result syntax tree 940, and it is intended to describe a sentence structure in which the result syntax tree 940 reflects a result code. In some embodiments of the present invention, the result syntax tree 940 includes:
The result terminal node 941, where the result terminal node 941 is converted by the hop terminal node 921, and the TARGET corresponding to the result terminal node 941 is the destination hop tag;
A label execution node 942 corresponding to a label execution statement, where "print ('goto here.,')" in the label execution node 942 is a label execution statement of a destination skip label;
a skip pilot node 944, the skip pilot node 944 being converted by the skip start node 923;
The jump guide node 944 corresponding to the destination jump sentence, it should be understood that the sentence TARGET in the jump guide node 944 is a combination of the while (1) and the sentence break TARGET in the result terminal node 941, which together serve as a whole as a destination jump sentence.
The position of parent node 924 of tag definition node 922 in result syntax tree 940 translates to parent node 945 of hop lead node 944.
It should be noted that, according to the programming sentence conversion method in some embodiments of the present invention, according to the embodiment shown in the step S10, the TARGET syntax tree 920 is constructed according to the original code 910, then the first location information of the location of the jump termination node 921 in the TARGET syntax tree 920 is obtained, further the destination jump tag TARGET corresponding to the jump termination node 921 is determined according to the first location information, and the second location information of the location of the mark defining node 922 in the TARGET syntax tree 920 is obtained. Further, according to the first location information and the second location information, the starting location information of the same level as the label definition node 922 is obtained from the ancestor node locations of each level of the jump terminal node 921, then the first location information is used as the end location information, the code to be converted is obtained by dividing from the original code 910 according to the starting location information and the end location information, the target grammar tree 920 is converted into the result grammar tree 940 based on the code to be converted, so as to define the sentence structure of the result code 930, and finally the goto jump sentence is replaced with the target jump sentence in the process of converting the structure grammar tree into the result code based on the result grammar tree 940. It should be understood that, in the embodiment shown in the step S10, the destination jump sentence is a while-break sentence, it should be understood that those skilled in the art may make various equivalent modifications or substitutions under the sharing condition consistent with the spirit of the present invention, for example, when the destination jump sentence is a try-catch sentence, those skilled in the art may also use the programming sentence conversion method shown in the step S10, and only need to make corresponding adjustments to specific implementation details according to practical situations.
Referring to FIG. 6, according to some embodiments of the invention, replacing a goto jump sentence with a destination jump sentence and obtaining a converted result code according to the destination jump sentence and the code to be converted includes:
step S601, incorporating the code to be converted into the execution part of the destination jump sentence, wherein the conversion start line corresponds to the start code of the execution part, and the conversion end line corresponds to the jump code of the execution part;
The execution portion of the destination jump sentence refers to the code content of the destination jump sentence excluding the jump code. For example, when white-break is the destination skip statement, the code "white (1) { if (x= =2) { break TARGET; } is the execution portion of white-break except for" break TARGET ". It should be appreciated that in order for the code execution logic in the result code to be consistent with the code execution logic in the original code, in some embodiments of the present invention, the translation start line corresponds to the start code of the execution portion and the translation end line corresponds to the jump code of the execution portion to ensure that the code execution logic in the original code does not change.
Step S602, the label execution statement of the target jump label is set as a jump result statement corresponding to the jump code, so that the code to be converted jumps to the label execution statement.
The tag execution statement corresponding to the destination jump tag is defined in the tag definition statement. For example, when the tag definition statement is "TARGET: print ('goto here.,')", the tag execution statement is "print ('goto here.,'). The jump code of the destination jump sentence refers to the code content playing a role in jumping in the destination jump sentence. For example, when white-break is the destination jump sentence, the code "TARGET: white (1) { if (x= =2) { break TARGET } }" is the jump code of white-break. And the jump result statement corresponding to the jump code is referred to as a jump result code statement. For example, when white-break is used as a destination jump sentence, the code "TARGET { if (x= =2) { break TARGET } } } print (' goto here.+ -.)" is a jump result sentence corresponding to the jump code. It should be noted that, the tag execution statement of the destination jump tag is set as a jump result statement corresponding to the jump code, so that the code to be converted jumps to the tag execution statement, so that the code execution logic in the result code is consistent with the code execution logic in the original code.
According to some more specific embodiments of the present invention, referring to fig. 9, specifically, step S601 includes the code to be converted into the execution portion of the destination jump sentence, the conversion start line corresponds to the start code of the execution portion, and the conversion end line corresponds to the jump code of the execution portion, which means that "if (x= =2) { goto TARGET } if (y= 3) { goto TARGET;" convert to "TARGET: while (1) { if (x= =2) { break TARGET; } if (y= =3) { break TARGET; }). In step S602, the tag execution statement of the destination jump tag is set as the jump result statement corresponding to the jump code, so that the code to be converted jumps to the tag execution statement, that is, "TARGET: while (1)" will jump to the jump result statement "print ('goto field.')", corresponding to the jump code "break TARGET", when the jump code "break TARGET" is executed, wherein the tag execution statement of the destination jump tag "TARGET" is "print ('goto field.')".
Referring to fig. 7, according to some embodiments of the present invention, a tag execution statement of a destination jump tag is set as a jump result statement corresponding to a jump code, so that a code to be converted jumps to the tag execution statement, and further including:
Step S701, forming a statement jump name of a destination jump statement based on a label name of the destination jump label;
in step S702, the jump code is linked to the statement jump name, so that the code to be converted jumps to the tag execution statement.
According to some more specific embodiments of the present invention, the tag name of the destination jump tag is called "TARGET" in some embodiments shown in fig. 9, and the tag name of the destination jump tag is called "goto" in the name of the destination jump tag extracted by the goto jump sentence. The term jump name of the destination jump term is formed based on the label name of the destination jump label, and "if (x= =2) { goto TARGET; } if (y= =3) { goto TARGET; } is converted into" TARGET: while (1) { if (x= =2) { break TARGET; } if (y= =3) { break TARGET; }. It should be noted that, linking the jump code to the statement jump name to jump the code to be converted to the tag execution statement means that the jump code "break TARGET" is linked to the statement jump name "TARGET: while (1)". It should be understood that, through steps S701 to S702, the program sentence conversion method of the present invention can implement sentence conversion while maintaining consistency of the code execution logic in the result code and the code execution logic in the original code.
Referring to fig. 8, the program sentence conversion method further includes:
step S801, judging whether a position relation abnormality exists between a goto jump sentence and a label definition sentence according to the first position information and the second position information;
Step S802, when the position relation between the goto jump sentence and the label definition sentence is abnormal, stopping the sentence conversion of the original code and carrying out error reporting reminding.
It should be noted that, the criterion for judging whether the position relationship between the goto jump sentence and the tag definition sentence is abnormal may be flexibly set according to the actual situation, which includes that the level position of the tag definition sentence in the target syntax tree is too low to be executed smoothly by the programming sentence conversion method, the definition of the tag definition sentence is not standard, and the tag definition sentence and some goto jump sentences are nested in the same sentence structure, but the sentence structure is not executed to be converted by the tag definition sentence. It should be appreciated that the criteria for whether there is an abnormality in the positional relationship between the meta-goto jump sentence and the tag definition sentence include, but are not limited to, the specific cases set forth above.
Fig. 11 shows an electronic device 1100 provided by an embodiment of the invention. The electronic device 1100 comprises a processor 1101, a memory 1102 and a computer program stored on the memory 1102 and executable on the processor 1101, the computer program being operative to perform the programming sentence conversion method as described above.
The processor 1101 and the memory 1102 may be connected by a bus or other means.
The memory 1102 is used as a non-transitory computer readable storage medium for storing non-transitory software programs and non-transitory computer executable programs, such as the programming sentence conversion method described in the embodiments of the present invention. The processor 1101 implements the programming sentence conversion method described above by running non-transitory software programs and instructions stored in the memory 1102.
Memory 1102 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area. The storage data area may store a program sentence conversion method as described above. In addition, the memory 1102 may include high-speed random access memory 1102, and may also include non-transitory memory 1102, such as at least one storage device memory device, flash memory device, or other non-transitory solid state memory device. In some implementations, the memory 1102 optionally includes memory 1102 remotely located relative to the processor 1101, the remote memory 1102 being connectable to the electronic device 1100 through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The non-transitory software programs and instructions required to implement the programming sentence conversion method described above are stored in the memory 1102 and when executed by the one or more processors 1101, perform the programming sentence conversion method described above, for example, perform method steps S101 through S107 in fig. 1, method steps S201 through S204 in fig. 2, method steps S301 through S302 in fig. 3, method steps S401 through S403 in fig. 4, method steps S501 through S504 in fig. 5, method steps S601 through S602 in fig. 6, method steps S701 through S702 in fig. 7, and method steps S801 through S802 in fig. 8.
The embodiment of the invention also provides a computer readable storage medium which stores computer executable instructions for executing the programming sentence conversion method.
In an embodiment, the computer-readable storage medium stores computer-executable instructions that are executed by one or more control processors, for example, to perform method steps S101 to S107 in fig. 1, method steps S201 to S204 in fig. 2, method steps S301 to S302 in fig. 3, method steps S401 to S403 in fig. 4, method steps S501 to S504 in fig. 5, method steps S601 to S602 in fig. 6, method steps S701 to S702 in fig. 7, and method steps S801 to S802 in fig. 8.
The above described apparatus embodiments are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, storage device storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically include computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and may include any information delivery media. It should also be appreciated that the various embodiments provided by the embodiments of the present invention may be arbitrarily combined to achieve different technical effects.
While the preferred embodiment of the present invention has been described in detail, the present invention is not limited to the above embodiments, and those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit and scope of the present invention, and these equivalent modifications or substitutions are included in the scope of the present invention as defined in the appended claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210582936.4A CN114895886B (en) | 2022-05-26 | 2022-05-26 | Programming statement conversion method, electronic device, and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210582936.4A CN114895886B (en) | 2022-05-26 | 2022-05-26 | Programming statement conversion method, electronic device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114895886A CN114895886A (en) | 2022-08-12 |
CN114895886B true CN114895886B (en) | 2025-04-15 |
Family
ID=82725089
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210582936.4A Active CN114895886B (en) | 2022-05-26 | 2022-05-26 | Programming statement conversion method, electronic device, and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114895886B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117389569B (en) * | 2023-10-26 | 2024-06-14 | 重庆猪哥亮科技有限责任公司 | Program interpretation execution method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978182A (en) * | 2014-10-15 | 2015-10-14 | 武汉安天信息技术有限责任公司 | Method and system for analyzing JAR (Java Archive) file into java |
CN112363727A (en) * | 2020-11-10 | 2021-02-12 | 中国平安人寿保险股份有限公司 | JAVA conversion method and device of SQL (structured query language) code, computer equipment and storage medium |
-
2022
- 2022-05-26 CN CN202210582936.4A patent/CN114895886B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104978182A (en) * | 2014-10-15 | 2015-10-14 | 武汉安天信息技术有限责任公司 | Method and system for analyzing JAR (Java Archive) file into java |
CN112363727A (en) * | 2020-11-10 | 2021-02-12 | 中国平安人寿保险股份有限公司 | JAVA conversion method and device of SQL (structured query language) code, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114895886A (en) | 2022-08-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9710243B2 (en) | Parser that uses a reflection technique to build a program semantic tree | |
US10698682B1 (en) | Computerized software development environment with a software database containing atomic expressions | |
CN108139891B (en) | Method and system for generating recommendations to correct undefined tag errors | |
US20070044066A1 (en) | Embedded multi-language programming | |
US8464234B2 (en) | Pre-parsed headers for compilation | |
US11294665B1 (en) | Computerized software version control with a software database and a human database | |
US20130152061A1 (en) | Full fidelity parse tree for programming language processing | |
CN115309451A (en) | Code clone detection method, device, equipment, storage medium and program product | |
Bour et al. | Merlin: a language server for OCaml (experience report) | |
US20230113783A1 (en) | Cross-platform code conversion method and device | |
KR102614967B1 (en) | Automation system and method for extracting intermediate representation based semantics of javascript | |
US9715375B1 (en) | Parallel compilation of software application | |
CN114647439A (en) | Code scanning method, code migration method and related device | |
CN114895886B (en) | Programming statement conversion method, electronic device, and storage medium | |
US20080141230A1 (en) | Scope-Constrained Specification Of Features In A Programming Language | |
US20090064092A1 (en) | Visual programming language optimization | |
KR20090011974A (en) | How to Extract Compile Target Files | |
CN118069142B (en) | Compilation optimization method, device, electronic equipment and storage medium | |
CN118838604A (en) | ST to C transcoding method, related apparatus and storage medium | |
US10545741B2 (en) | Information processing apparatus, method of compiling, and storage medium | |
CN113220303A (en) | Compiling method and system of kernel module | |
CN113971028B (en) | Data processing method, apparatus, device, storage medium and computer program product | |
CN114661341A (en) | A method and device for acquiring code auxiliary information | |
CN110018816B (en) | Virtual machine control system based on C/C + + compiling system and control method thereof | |
CN114416050B (en) | Swift code processing method, device, electronic device and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |