Conditional compiling statement code validity determination method, electronic equipment and medium

By obtaining the code validity data of the conditional compiled statement and matching the visual range, the problem of insufficient efficiency and accuracy of the code validity judgment of the conditional compiled statement in the prior art is solved, and fast and accurate validity judgment is achieved.

CN119645415AActive Publication Date: 2025-03-18SHANGHAI UNIVISTA IND SOFTWARE GRP CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411704755.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-18
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

It is difficult to quickly and accurately determine the effectiveness of conditional compilation statement code, especially when facing excessive files or languages ​​that support conditional compilation syntax.

Method used

The validity of the conditional compile statement code is determined by obtaining the code validity data corresponding to the conditional compile statement during the source code compilation process, and based on the overlapping parts of the pending continuous visual range and the conditional compile statement.

Benefits of technology

It improves the efficiency and accuracy of the code of conditional compiled statements, and can quickly and accurately determine the validity of the code of conditional compiled statements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645415A_ABST
    Figure CN119645415A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a conditional compiling statement code validity determination method, electronic equipment and a medium, and the method comprises the following steps: S1, obtaining code validity data {A1, A2,..., An,..., AN} corresponding to a conditional compiling statement in a source code compiling process; s2, acquiring a starting position SV and an ending position EV of the continuous visual range to be processed, sequentially performing position matching with An according to A1, A2,..., An,..., AN, and determining an overlapping part of the continuous visual range to be processed and the conditional compiling statement; and S3, determining the validity of the conditional compiling statement code in the continuous visual range to be processed based on the corresponding code validity information of the overlapped part in {A1, A2,..., An,..., AN}. According to the method, the validity of the conditional compiling statement code can be quickly and accurately determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method for determining the validity of conditional compilation statement code, electronic equipment and medium. Background Art

[0002] For common source code viewing and editing software, in order to display codes in different languages ​​in a personalized way, it is usually necessary to perform lexical analysis on the source code of different languages, so as to correctly identify the type and value of each word, as well as the approximate relationship between them, so as to correctly perform subsequent coloring, highlighting, and statement block recognition. In order to correctly parse the lexical meaning of a single file, traditional lexical analysis algorithms often need to traverse and analyze the entire file from the beginning. However, this algorithm often requires a long initial loading time when facing an extremely large file.

[0003] In order to improve the speed of the first loading, the existing solution is to parse the source code content that needs to be displayed within the visible range first. However, this solution does not obtain the complete source code organization structure. When encountering SystemVerilog and other systems that support conditional compilation syntax (such as: `ifdef, `ifndef, `eles, `elsif, `endif), since the conditional compilation syntax is only truly effective when the condition is met, it is difficult for the prior art to correctly identify whether the text content in each conditional compilation module participates in the current compilation. It can be seen from this that how to quickly and accurately determine the validity of the conditional compilation statement code has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The object of the present invention is to provide a method, electronic device and medium for determining the validity of a conditional compilation statement code, which can quickly and accurately determine the validity of a conditional compilation statement code.

[0005] According to a first aspect of the present invention, a method for determining the validity of a conditional compilation statement code is provided, comprising:

[0006] Step S1: Obtain code validity data corresponding to the conditional compilation statement during source code compilation. 1 ,A 2 ,…,A n ,…,A N}, A n is the code validity data corresponding to the nth group of conditional compilation statements, where n ranges from 1 to N, and N is the total number of code validity data groups corresponding to conditional compilation statements. 1 ,A 2 ,…,A n ,…,A N Arrange in order of code position, A nIncluding the code location information and code validity information of the nth top-level conditional compilation statement and the code location information and code validity information of all descendant conditional compilation statements nested in the nth top-level conditional compilation statement;

[0007] Step S2: Obtain the starting position SV and the ending position EV of the continuous visible range to be processed, according to A 1 ,A 2 ,…,A n ,…,A N Sequentially with A n Perform position matching to determine the overlapping part between the continuous visible range to be processed and the conditional compilation statement;

[0008] Step S3: Based on the overlapped part, 1 ,A 2 ,…,A n ,…,A N The corresponding code validity information in} determines the validity of the conditional compilation statement code in the continuous visible range to be processed.

[0009] According to a second aspect of the present invention, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to execute the method described in the first aspect of the present invention.

[0010] According to a third aspect of the present invention, there is provided a computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the first aspect of the present invention.

[0011] Compared with the prior art, the present invention has obvious advantages and beneficial effects. By means of the above technical solution, the method for determining the validity of conditional compilation statement code, electronic device and medium provided by the present invention can achieve considerable technical advancement and practicality, and has wide industrial utilization value, and has at least the following beneficial effects:

[0012] The present invention first obtains the code validity data corresponding to the conditional compilation statement, and then determines the validity of the conditional compilation statement code in the continuous visible range to be processed based on the code validity data corresponding to the conditional compilation statement and the overlapping relationship between the continuous visible range to be processed and the conditional compilation statement, thereby improving the efficiency and accuracy of the conditional compilation statement code validity judgment. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A flow chart of a method for determining the validity of conditional compilation statement code provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0016] The embodiment of the present invention provides a method for determining the validity of conditional compilation statement code. Figure 1 As shown, including:

[0017] Step S1: Obtain code validity data corresponding to the conditional compilation statement during source code compilation. 1 ,A 2 ,…,A n ,…,A N}, A n is the code validity data corresponding to the nth group of conditional compilation statements, where n ranges from 1 to N, and N is the total number of code validity data groups corresponding to conditional compilation statements. 1 ,A 2 ,…,A n ,…,A N Arrange in order of code position, A n It includes the code location information and code validity information of the nth top-level conditional compilation statement and the code location information and code validity information of all descendant conditional compilation statements nested within the nth top-level conditional compilation statement.

[0018] Among them, conditional compilation statements include `ifdef statements, `ifndef statements, `eles statements, `elsif statements, `endif statements, etc. One or more layers of conditional compilation statements can be nested in a conditional compilation statement. During the compilation process, the compiler can obtain the corresponding code validity for each conditional compilation statement, and thus generates code validity data corresponding to the conditional compilation statement during the compilation process. It should be noted that the top-level conditional compilation statement refers to a conditional compilation statement that has no parent conditional compilation statement in the source code. The code validity data corresponding to each top-level conditional compilation statement and all descendant conditional compilation statements nested by the top-level conditional compilation statement constitute a set of code validity data corresponding to the conditional compilation statement.

[0019] Step S2: Obtain the starting position SV and the ending position EV of the continuous visible range to be processed, according to A 1 ,A 2 ,…,A n ,…,A N Sequentially with A n Perform position matching to determine the overlapping portion of the to-be-processed continuous visible range and the conditional compilation statement.

[0020] It should be noted that the continuous visible range refers to the visible range with continuous code line numbers, that is, the visible range without folded code, hidden code, etc.

[0021] Step S3: Based on the overlapped part, 1 ,A 2 ,…,A n ,…,A N The corresponding code validity information in} determines the validity of the conditional compilation statement code in the continuous visible range to be processed.

[0022] As an example, A n = {B 1 n ,B 2 n ,…,B x n ,…,B f(n) n ,U n}, where B x n A n The code validity data corresponding to the xth conditional compilation statement in , where the value of x ranges from 1 to f(n), and f(n) is A n The total number of conditional compilation statements in {B 1 n ,B 2 n ,…,B xn ,…,B f(n) n ,U n} There is a top-level conditional compilation statement corresponding to B x n , other B x n All B x n The corresponding conditional compilation statements are nested to form a top-level conditional compilation statement. n For B x n The parent-child relationship information between them, that is, U n It is clearly recorded in B x n The hierarchical relationship of each B x n The corresponding parent B x n and sub-B x n Available at U n It can be understood that the top-level conditional compilation statement corresponds to B x n Parent B does not exist x n , the leaf conditional compilation statement corresponds to B x n Sub B does not exist x n .

[0023] B x n = {BF xn ,BL xn ,BV xn}, where BF xn A n The starting position corresponding to the xth conditional compilation statement, BL xn A n The length of the text corresponding to the xth conditional compilation statement, BV xn A n The compilation status corresponding to the xth conditional compilation statement in the compilation state includes two states: valid and invalid.

[0024] As an embodiment, step S2 includes:

[0025] Step S21, set n=1.

[0026] Step S22: Based on A n The starting position and text length of the top-level conditional compilation statement in A nThe corresponding SCn and end position ECn, where the end position is equal to the start position plus the text length.

[0027] It should be noted that the position information in the source code is determined based on the row and column positions. Given the start position and adding the text length, the end position can be obtained.

[0028] Step S23: If ECn < SV, then execute step S25; if SCn > EV, then execute step S3; otherwise, execute step S24.

[0029] It should be noted that if ECn < SV, it means that the current top-level conditional compilation statement in A n is before the continuous visible range to be processed, and there is no overlapping part between them. However, whether there is an overlapping part with the subsequent top-level conditional compilation statements needs to be further determined. Therefore, execute step S25. If SCn > EV, it means that the current top-level conditional compilation statement in A n is after the continuous visible range to be processed, and there is also no overlapping part between them, and it is impossible to have an overlapping part with the subsequent top-level conditional compilation statements. Therefore, directly execute step S3. If neither ECn < SV nor SCn > EV is satisfied, then the current top-level conditional compilation statement in A n must overlap with the continuous visible range to be processed.

[0030] Step S24: Obtain the overlapping part AT n between the continuous visible range to be processed and A n = [STP n , ETP n , where STP n is the start position of AT n and ETP n is the end position of AT n , STP n = max(SV, SCn), and ETP n = min(EV, ECn).

[0031] Among them, max(SV, SCn) means obtaining the larger value between SV and SCn, and min(EV, ECn) means obtaining the smaller value between EV and ECn.

[0032] Step S25: If n < N, then set n = n + 1 and return to execute step S22; otherwise, execute step S3.

[0033] Through steps S21 - S25, all overlapping parts between the continuous visible range to be processed and A n can be obtained. There may be one, multiple, or no overlapping parts.

[0034] In step S3, all conditional compilation statement codes in the continuous visible range to be processed are default set to the valid state. When the continuous visible range to be processed and A n have one or more overlapping parts, for each A n overlapping part AT n execute:

[0035] Step S31: Initially set AT n as the overlapping part to be processed, initially set the level identifier t = 1, and initially set the conditional compilation statement serial number g(t) = 1 in the t-th level. In the same level, the smaller the value of g(t), the more forward the position of the code line corresponding to the conditional compilation statement in the source code.

[0036] Step S32: Based on the code validity data in A n obtain the g(t)-th conditional compilation statement B tg(t) in the t-th level and the overlapping part AT tg(t) =[STP tg(t) ,ETP tg(t) , where STP tg(t) is the starting position of AT tg(t) , and ETP tg(t) is the ending position of AT tg(t) .

[0037] It should be noted that B tg(t) is one of the conditional compilation statements corresponding to A n . By B n corresponding to B tg(t) in A x n the starting position and ending position of B tg(t) can be determined, and the compilation status of B tg(t) can also be obtained. Based on the starting position and ending position of B tg(t) the overlapping part of B tg(t) and the overlapping part to be processed can be determined.

[0038] Step S33: Based on the code validity data in A n obtain the compilation status corresponding to B tg(t) . If the compilation status corresponding to B tg(t) is the invalid state, then update the code corresponding to AT tg(t) to the invalid state, and update g(x) = g(x) + h(x), where the initial value of g(x) is 1, t < x ≤ T, T is the maximum level serial number in A n , and h(x) is the number of conditional compilation statements nested in B tg(t) and belonging to the x-th level. Execute step S36. If B tg(t)If the corresponding compilation status is the valid status, then execute step S34.

[0039] It should be noted that when the conditional compilation statement is in the invalid status, all the codes included in the conditional compilation statement must be in the invalid status. Therefore, the subsequent processing of the conditional compilation statement that has been determined to be in the invalid status can be skipped by updating g(x) = g(x) + h(x), improving the processing efficiency of the validity judgment of the conditional compilation statement codes. When the conditional compilation statement is in the valid status, its internally embedded descendant conditional compilation statements are not necessarily in the valid status and need to be further judged.

[0040] Step S34: Based on U n Judge B tg(t) Whether there is a sub-conditional compilation statement. If so, execute step S35; otherwise, execute step S36.

[0041] Step S35: First set t = t + 1, and then return to execute step S32.

[0042] Step S36: If ETP tg(t) = ETP n , then end the processing of the validity of the codes in AT n If ETP tg(t) < ETP n , then update [ETP tg(t) , ETP n as the overlapping part to be processed, and execute step S37.

[0043] It should be noted that if ETP tg(t) = ETP n , it means that the validity of all the codes in AT n has been completely judged. Therefore, end the processing of the validity of the codes in AT n in the codes.

[0044] Step S37: If g(t) < f(t), where f(t) is the total number of conditional compilation statements at the t-th level, then set g(t) = g(t) + 1 and return to execute step S32. If g(t) = f(t), then first set t = t - 1, then set g(t) = g(t) + 1, and return to execute step S32.

[0045] It should be noted that through steps S31 - S37, the validity of each overlapping part of the codes can be determined, thereby determining the validity of all the conditional compilation statement codes in the continuous visible range to be processed. After the determination is completed, the valid status and invalid status of all the conditional compilation statement codes in the continuous visible range to be processed can be marked in different display ways on the display interface. For example, different colors can be used for marking, etc.

[0046] As an embodiment, the step S3 further includes:

[0047] Step S100: marking the valid state and invalid state of all conditional compilation statement codes in the continuous visible range to be processed in different display modes on the display interface.

[0048] There may be code folding, code hiding, etc. in the visible scope to be processed, which makes the code in the visible scope to be processed discontinuous. Therefore, the code in the visible scope to be processed can be divided into multiple continuous visible scopes, and then the validity of the conditional compilation statement code can be judged for each visible scope.

[0049] As an embodiment, the method further includes:

[0050] Before step S2, the following steps are also included:

[0051] Step S01: Divide the visible range to be processed into M continuous visible ranges {G 1 ,G 2 ,…,G m ,…,G M},G m is the mth continuous visible range, where m ranges from 1 to M, G 1 ,G 2 ,…,G m ,…,G M Arrange in order of code location.

[0052] Specifically, dividing lines can be set at the code folding position and the code hiding position to divide the visible range to be processed into M continuous visible ranges. If the continuous visible range after division is too large, in order to make the continuous visible range after division as balanced as possible, the larger continuous visible range can be further divided to make the continuous visible range after division as balanced as possible.

[0053] Step S02: Initially set m=1, and set G m Set as the continuous visible range to be processed and execute step S2.

[0054] It should be noted that, in order to ensure that A is not omitted n judgment, and reduce the same A n Repeated judgment can set a preset pointer to record the judgment to A n location.

[0055] The step S2 comprises:

[0056] Step C21: Based on A n The starting position and text length of the top-level conditional compilation statement in A nThe corresponding starting position SCn and ending position ECn, where the ending position is equal to the starting position plus the text length.

[0057] Step C22: If ECn < SV, then execute step S24; if SCn > EV, then set the current preset pointer to point to A n-1 , execute step S3; otherwise, execute step C23, where SV is the starting position of G m and EV is the ending position of G m .

[0058] It should be noted that except for the case where SCn > EV in step C22, for the next consecutive visible range to be processed, directly judging the overlapping area starting from the current A n can ensure that no overlapping area is missed. Therefore, in step C24, after updating the value of n, directly set the current preset pointer to point to A n , and only when SCn > EV, is it necessary to set the current preset pointer to point to A n-1 . When n = N and ECn ≤ EV, it means that all A n have been judged, so set the current preset pointer to be empty. If n = N and ECn > EV, execute step S3, then the next consecutive visible range to be processed may overlap with A N , so further judgment is still required.

[0059] Step C23: Obtain the overlapping part AT n between the consecutive visible range to be processed and A n = [STP n , ETP n , where STP n is the starting position of AT n and ETP n is the ending position of AT n , STP n = max(SV, SCn), and ETP n = min(EV, ECn).

[0060] Among them, max(SV, SCn) means obtaining the larger value between SV and SCn, and min(EV, ECn) means obtaining the smaller value between EV and ECn.

[0061] Step C24: If n < N, then set n = n + 1, set the current preset pointer to point to A n , return to execute step C21; if n = N and ECn ≤ EV, set the current preset pointer to be empty and execute step S3; if n = N and ECn > EV, execute step S3.

[0062] After step S3, it also includes:

[0063] Step S4: If m < M, set m + 1 and return to execute Step C22. If m = M or the current preset pointer points to null, end the process.

[0064] As an embodiment, based on the code validity data corresponding to the conditional compilation statement, if the user wants to test the code validity in other cases, they can directly update at least one code validity information in the code validity data corresponding to the conditional compilation statement, and then re - execute Steps S1 - S3. Then, the code validity corresponding to the conditional compilation statement within the to - be - processed continuous visible range can be directly displayed without updating the code, which can greatly improve the test efficiency. The method further includes Step S10: Update at least one code validity information in the code validity data corresponding to the conditional compilation statement and re - execute Steps S1 - S3.

[0065] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts depict the steps as sequential processes, many of the steps can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operations are completed, but it can also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, sub - routine, sub - program, etc.

[0066] An embodiment of the present invention further provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.

[0067] An embodiment of the present invention further provides a computer - readable storage medium storing computer - executable instructions, and the computer instructions are used to execute the method described in the embodiment of the present invention.

[0068] The embodiment of the present invention first obtains the code validity data corresponding to the conditional compilation statement, and then determines the code validity of the conditional compilation statement in the to - be - processed continuous visible range based on the code validity data corresponding to the conditional compilation statement and the overlapping relationship between the to - be - processed continuous visible range and the conditional compilation statement, improving the efficiency and accuracy of judging the code validity of the conditional compilation statement.

[0069] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still falls within the scope of the technical solution of the present invention.

Claims

1. A method for determining the validity of conditional compilation statement code, characterized in that: Comprising: Step S1: Obtain code validity data {A1, A2, ..., A1, A2, ..., A2, A1, A2 ... n ,…,A N }, A n is the code validity data corresponding to the nth group of conditional compilation statements, where n ranges from 1 to N, and N is the total number of code validity data groups corresponding to conditional compilation statements, A1, A2, …, A n ,…,A N Arrange in order of code position, A n Including the code location information and code validity information of the nth top-level conditional compilation statement and the code location information and code validity information of all descendant conditional compilation statements nested in the nth top-level conditional compilation statement; Step S2, obtain the starting position SV and the ending position EV of the continuous visible range to be processed, according to A1, A2, ..., A n ,…,A N Sequentially with A n Perform position matching to determine the overlapping part between the continuous visible range to be processed and the conditional compilation statement; Step S3: Based on the overlapping part in {A1, A2, ..., A n ,…,A N The corresponding code validity information in} determines the validity of the conditional compilation statement code in the continuous visible range to be processed.

2. The method according to claim 1, wherein A n = {B1 n ,B2 n ,…,B x n ,…,B f(n) n ,U n }, where B x n A n The code validity data corresponding to the xth conditional compilation statement in , where the value of x ranges from 1 to f(n), and f(n) is A n The total number of conditional compilation statements in U n For B x n The parent-child relationship information between all B x n The corresponding conditional compilation statements are nested to form a top-level conditional compilation statement; B x n = {BF xn ,BL xn ,BV xn }, where BF xn A n The starting position corresponding to the xth conditional compilation statement, BL xn A n The length of the text corresponding to the xth conditional compilation statement, BV xn A n The compilation status corresponding to the xth conditional compilation statement in the compilation state includes two states: valid and invalid.

3. The method according to claim 2, wherein The step S2 comprises: Step S21, set n = 1; Step S22: Based on A n The starting position and text length of the top-level conditional compilation statement in A n The corresponding SCn and end position ECn, the end position is equal to the start position plus the text length; Step S23, if ECn < SV, then execute step S25, if SCn > EV, then execute step S3, otherwise, execute step S24; Step S24: Obtain the continuous visible range to be processed and A n The overlap of AT n =[STP n ,ETP n ],STP n AT n Starting position, ETP n AT n End position, STP n =max(SV,SCn),ETP n =min(EV,ECn); Step S25, if n < N, then set n = n + 1, return to execute step S22, otherwise, execute step S3.

4. The method according to claim 3, wherein In step S3, all conditional compilation statement codes in the continuous visible range to be processed are set to a valid state by default. n The overlap of AT n implement: Step S31: Initial AT settings n For the overlapped part to be processed, the level identifier t=1 is initially set, and the conditional compilation statement sequence number g(t) in the tth level is initially set to 1. In the same level, the smaller the g(t) value is, the closer the code line corresponding to the conditional compilation statement is in the source code. Step S32: Based on A n Get the g(t)th conditional compilation statement B at level t from the code validity data tg(t) The overlapped part AT with the overlapped part to be processed tg(t) =[STP tg(t) ,ETP tg(t) ],STP tg(t) AT tg(t) Starting position, ETP tg(t) AT tg(t) The end position of Step S33: Obtain the compilation status of B based on the code validity data in A n ; if the compilation status of B tg(t) corresponding is the invalid status, then update the code corresponding to A tg(t) to the invalid status, and update g(x) = g(x) + h(x), where the initial value of g(x) is 1, t < x ≤ T, and T is the maximum level serial number in A tg(t) ; h(x) is the number of conditional compilation statements nested in B n and belonging to the x-th level. Execute step S36. If the compilation status of B tg(t) corresponding is the valid status, then execute step S34; tg(t) ​ Step S34: Based on U n Judgment B tg(t) Whether there is a sub-conditional compilation statement, if yes, execute step S35, otherwise, execute step S36; Step S35, first set t = t + 1, return to execute step S32; Step S36: If ETP tg(t) =ETP n , then end AT n In the processing of the validity of the code, if ETP tg(t) <ETP n , then [ETP tg(t) ,ETP n ] is updated to the overlapping part to be processed, and step S37 is executed; Step S37, if g(t) < f(t), where f(t) is the total number of conditional compilation statements at the t-th level, then set g(t) = g(t) + 1, return to execute step S32, if g(t) = f(t), then first set t = t - 1, then set g(t) = g(t) + 1, return to execute step S32.

5. The method according to claim 4, wherein After the step S3, it further comprises: Step S100, mark the valid and invalid states of all the conditional compilation statement codes in the to-be-processed continuous visible range in different display manners on the display interface.

6. The method according to claim 1, wherein The method further comprises step S10, update at least one code validity information in the code validity data corresponding to the conditional compilation statements, and re-execute steps S1 - S3.

7. An electronic device, characterized in that: Comprising: At least one processor; And a memory communicatively connected to the at least one processor; Wherein, the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method according to any one of the foregoing claims 1 - 6.

8. A computer-readable storage medium, characterized in that: Stores computer-executable instructions for executing the method according to any one of the foregoing claims 1 - 6.

Citation Information

Patent Citations

  • Program compiling method and device

    CN113672232A

  • Compiling method, device and apparatus of operating system, and readable storage medium

    CN113721916A

  • Code scanning method, code migration method and related devices

    CN114647439A

  • Code analysis method and device, electronic equipment and readable storage medium

    CN115809066A

  • Condition compiling implementation method and device, medium and equipment

    CN115904393A