CN117112730B - Target text searching method based on macro expansion text, electronic equipment and medium - Google Patents

Target text searching method based on macro expansion text, electronic equipment and medium Download PDF

Info

Publication number
CN117112730B
CN117112730B CN202311066633.8A CN202311066633A CN117112730B CN 117112730 B CN117112730 B CN 117112730B CN 202311066633 A CN202311066633 A CN 202311066633A CN 117112730 B CN117112730 B CN 117112730B
Authority
CN
China
Prior art keywords
macro
target
text
line
character string
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
Application number
CN202311066633.8A
Other languages
Chinese (zh)
Other versions
CN117112730A (en
Inventor
张邦全
赵建
杨胜康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Rongjian Software Technology Co ltd
Beijing Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group Co Ltd
Original Assignee
Chengdu Rongjian Software Technology Co ltd
Beijing Yunshu Innovation Software Technology Co ltd
Shanghai Hejian Industrial Software Group Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Rongjian Software Technology Co ltd, Beijing Yunshu Innovation Software Technology Co ltd, Shanghai Hejian Industrial Software Group Co Ltd filed Critical Chengdu Rongjian Software Technology Co ltd
Priority to CN202311066633.8A priority Critical patent/CN117112730B/en
Publication of CN117112730A publication Critical patent/CN117112730A/en
Application granted granted Critical
Publication of CN117112730B publication Critical patent/CN117112730B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/338Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/423Preprocessors
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of computers, in particular to a target text searching method, electronic equipment and medium based on macro expansion text, wherein the method comprises the following steps of S1, dynamically generating macro expansion text of macro use lines and storing the macro expansion text in a macro expansion text set; step S2, obtaining each G j A corresponding file name and a used row binary list; step S3, searching target character strings in the macro expansion text set, and enabling G containing the target character strings to be contained j Is determined as target G j The method comprises the steps of carrying out a first treatment on the surface of the S4, acquiring the target character string in the target G j OF offset OF in (b) j The method comprises the steps of carrying out a first treatment on the surface of the Step S5, based on the target G j Corresponding file name and use line binary list and offset OF j Generating a ternary result set containing macro expansion text; step S6, based on each (GF y j ,GL y j ,OF j ) And presenting the corresponding target text search results. The invention improves the searching efficiency and searching performance of the target text containing the macro expansion text.

Description

Target text searching method based on macro expansion text, electronic equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a target text search method, electronic device, and medium based on macro expansion text.
Background
The macro definition allows the user to define an alias for the text, and the partial programming language supports macro definition grammars, such as the System Verilog language. In the preprocessing stage before code semantic analysis, macro expansion text is needed to replace macro text, so that code semantic can be accurately analyzed and designed. While the replacement operation of the preprocessing stage changes the original code structure of the user, in code editing software or code debugging software, it is generally desirable to maintain the original code structure of the user, while some means may be employed to provide a way in which the macro-expanded text may be viewed. But before this the program must be able to expand the text of the macro.
When writing verification codes, searching and searching some texts are needed, the searching function is based on original design code files, when a user wants to find a result containing macro expanded texts, the searching function cannot be directly realized, and if texts of each macro used line are expanded one by one to search target texts one by one, the searching efficiency is low, and the searching performance is poor. Therefore, how to improve the searching efficiency and searching performance of the target text including the macro expansion text is a technical problem to be solved.
Disclosure of Invention
The invention aims to provide a target text searching method, electronic equipment and medium based on macro expansion text, which improve the searching efficiency and searching performance of the target text containing macro expansion text.
According to a first aspect of the present invention, there is provided a target text search method based on macro expansion text, including:
step S1, dynamically generating macro expansion text of macro use lines, and storing the macro expansion text of the dynamically generated macro use lines in a macro expansion text set { G } 1 ,G 2 ,…,G j ,…G J In }, G j Using macro expansion text of a row for the J-th macro, wherein the value range of J is 1 to J, and J is the total number of macro expansion texts which are generated currently;
step S2, obtaining each G j Corresponding filename and usage row binaryList { (GF) 1 j ,GL 1 j ),(GF 2 j ,GL 2 j ),…,(GF y j ,GL y j ),…,(GF g(j) j ,GL g(j) j ) } wherein GF y j Is G j The y-th file name, GL, of the corresponding macro usage line y j Is G j The corresponding macro uses the line number of the line in the y-th file, the value range of y is 1 to G (j), and G (j) is G j Corresponding file name and total number of used row binary values;
step S3, at { G ] 1 ,G 2 ,…,G j ,…G J Searching target character string in the sequence, G containing the target character string j Is determined as target G j
S4, acquiring the target character string in the target G j OF offset OF in (b) j
Step S5, based on the target G j Corresponding file name and use line binary list and offset OF j Generating a ternary result set containing macro-expanded text { (GF) 1 j ,GL 1 j ,OF j ),(GF 2 j ,GL 2 j ,OF j ),…,(GF y j ,GL y j ,OF j ),…,(GF g(j) j ,GL g(j) j ,OF j )};
Step S6, based on each (GF y j ,GL y j ,OF j ) And presenting the corresponding target text search results.
According to a second aspect of the present invention, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being arranged to perform the method according to the first aspect of the invention.
According to a third aspect of the present invention there is provided a computer readable storage medium storing computer executable instructions for performing the method of the first aspect of the present invention.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the target text searching method, the electronic equipment and the medium based on the macro expansion text can achieve quite technical progress and practicality, and have wide industrial utilization value, and the method has at least the following beneficial effects:
according to the method, the macro expansion text set is constructed, the file name corresponding to the macro expansion text of each macro using row and the using row binary list are searched for the same macro expansion text only once, the offset is determined, and all search results related to the macro expansion text in the source code can be obtained through the combination of the offset, the file name and the using row binary list, so that the target text search efficiency and search performance including the macro expansion text are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a target text searching method based on macro expansion text according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the invention provides a target text searching method based on macro expansion text, which is shown in fig. 1 and comprises the following steps:
step S1, dynamically generating macro expansion text of macro use lines, and storing the macro expansion text of the dynamically generated macro use lines in a macro expansion text set { G } 1 ,G 2 ,…,G j ,…G J In }, G j And (3) expanding the text for the macro of the J-th macro using the row, wherein the value range of J is 1 to J, and J is the total number of the currently generated macro expanded text.
In step S1, the macro expansion text of the macro use line may be dynamically generated by using a conventional method of generating the macro expansion text of the macro use line.
Step S2, obtaining each G j Corresponding filename and use line binary list { (GF) 1 j ,GL 1 j ),(GF 2 j ,GL 2 j ),…,(GF y j ,GL y j ),…,(GF g(j) j ,GL g(j) j ) } wherein GF y j Is G j The y-th file name, GL, of the corresponding macro usage line y j Is G j The corresponding macro uses the line number of the line in the y-th file, the value range of y is 1 to G (j), and G (j) is G j Corresponding filename and total number of used row binary.
It should be noted that the same macro usage line may occur once or multiple times in the source code, and thus g (j) may be equal to 1 or greater than 1. By obtaining each G j Corresponding file name and using line binary list to obtain G j The corresponding macro uses the distribution of the lines in the source code.
Step S3, at { G ] 1 ,G 2 ,…,G j ,…G J Searching target character string in the sequence, G containing the target character string j Is determined as target G j
Wherein by the method of { G ] 1 ,G 2 ,…,G j ,…G J Searching target character string in the sequence to determine all G containing the target character string j Is determined as target G j
S4, acquiring the target character string in the target G j Offset in (a)OF j
Step S5, based on the target G j Corresponding file name and use line binary list and offset OF j Generating a ternary result set containing macro-expanded text { (GF) 1 j ,GL 1 j ,OF j ),(GF 2 j ,GL 2 j ,OF j ),…,(GF y j ,GL y j ,OF j ),…,(GF g(j) j ,GL g(j) j ,OF j )}。
It should be noted that the same target G is only required j Calculating offset once, and then combining with G j And combining the corresponding file name with the binary list of the line to determine the distribution condition of all macro-contained expanded texts containing the target character strings in the source code.
Step S6, based on each (GF y j ,GL y j ,OF j ) And presenting the corresponding target text search results.
In one embodiment, in the step S1, when a macro expansion text is generated, it is first searched whether the current macro expansion text set includes the current macro expansion text, if so, the current macro expansion text is not stored in the macro expansion text set, and if not, the current macro expansion text is stored in the macro expansion text set. From this, the macro expands the text set { G ] 1 ,G 2 ,…,G j ,…G J Each G in } j Are unique and have no duplication.
As an embodiment, the step S2 includes:
step S21, based on each G j The corresponding original code line searches all files in the source code to obtain each G contained in the source code j Generating each G by the file name and line number corresponding to the corresponding original code line j Corresponding filename and use line binary list { (GF) 1 j ,GL 1 j ),(GF 2 j ,GL 2 j ),…,(GF y j ,GL y j ),…,(GF g(j) j ,GL g(j) j )}。
It should be noted that, the source code generally includes a plurality of files, and each line code in each file has a corresponding line number, so that the file name and the line number of the macro-usage line are combined to accurately locate the macro-usage line.
As an embodiment, the step S4 includes:
step S41, obtaining target G j The number of columns corresponding to each row preceding the target string.
It should be noted that the number of columns corresponding to different code lines may be different, so that the target G needs to be acquired j The number of columns corresponding to each row preceding the target string.
Step S42, obtaining target G j The number of columns preceding the target string in the row in which the target string is located.
Step S43, target G j The sum of the number of columns corresponding to each row located before the target character string and the number of columns before the target character string in the row where the target character string is located is determined as the target character string in the target G j OF offset OF in (b) j
By the target G j OF offset OF in (b) j Can be at target G j To the target string.
As an embodiment, the step S6 includes:
step S61, based on GF y j ,GL y j A target macro usage line is located in the source code.
And step S62, presenting the corresponding macro expansion text in an embedded mode at the position of the target macro using line.
In step S62, the corresponding macro expansion text may be presented at the position where the target macro usage line is located in a floating window or the like.
Step S63 based on OF j And positioning the position of the target character string in the displayed macro expansion text, and highlighting the target character string in the displayed corresponding macro expansion text.
Wherein, the target character string can be highlighted in the macro expansion text corresponding to the presentation in a form of highlighting or frame selection.
It should be noted that the above manner describes in detail how to expand the target string in the text in the search macro, but in some search requirements, the target string is also required to be searched for other locations in the source code. As an embodiment, the method further comprises:
step S10, searching target character strings in all files of the source code, and determining file names and code lines corresponding to the target character strings.
And step S20, presenting the corresponding target text search result based on the file name and the code line corresponding to the target character string.
It should be noted that, the steps S10 to S20 and the steps S1 to S6 may be executed in parallel, and the obtained target text search results may be presented to the user together.
According to the method and the device, the macro expansion text set is constructed, the file name corresponding to the macro expansion text of each macro using row and the using row binary list are searched for the same macro expansion text only once, the offset is determined, and then all search results related to the macro expansion text in the source code can be obtained through the combination of the offset and the file name and the using row binary list, so that the target text search efficiency and search performance including the macro expansion text are improved.
In addition to the conventional macro expansion text generating the macro use line, the macro expansion text of the macro use line may be dynamically generated in step S1, and specifically, in step S1, the macro expansion text of the macro use line may be dynamically generated by:
and step C1, initializing the macro to be empty by using the line expansion list.
It should be noted that, in the embodiment of the present invention, macro text using lines is dynamically expanded as required, so that the macro using line expansion list is initially empty.
And C2, judging whether a macro expansion text of the target macro use line is included in the current macro use line expansion list, if so, determining a macro definition expansion text corresponding to the target macro use line in the current macro use line expansion list as the target expansion text, ending the process, otherwise, acquiring an original code of the target macro use line, setting the original code in a code storage unit, and executing the step C3.
It should be noted that, by setting the macro-use line expansion list, the macro expansion text corresponding to the expanded macro-use line is stored, so that each macro-use line only needs to be expanded once.
And C3, determining a current macro to be unfolded based on a macro use list corresponding to the target macro use line, and unfolding the current macro to be unfolded in the code storage unit, wherein the macro use list comprises macro use information which is arranged in sequence.
Wherein the order of macro expansion in the target macro use line is determined based on the macro use list, and the macros in the target macro use line are noted in order in the storage unit.
And C4, judging whether macros of the target macro use line are all unfolded based on a macro use list corresponding to the target macro use line, if yes, determining codes stored in a current code storage unit as target macro unfolding text, storing the target macro use line and the target macro unfolding text into the macro unfolding list, ending the flow, otherwise, returning to the step C3.
The invention generates the macro full-expansion text in a dynamic mode based on the macro text expansion of the line, thereby greatly reducing the demands of storage space and computing resources.
As an embodiment, the target macro usage line may be determined by selecting a code line, and after the target macro expansion text corresponding to the target macro usage line is obtained through steps C1 to C4, the target macro expansion text may be displayed in an embedded or floating window form at the display position of the source code target macro usage line.
As an embodiment, the method further comprises:
step C10, outputting a macro use line identification appearing in the source code and generating a macro use list corresponding to the macro use line in the source code compiling stage, wherein the x-th macro use line identification is used for the macro use line identificationMacro usage line identification L x The corresponding macro usage list is (a 1 x ,A 2 x ,…,A i x ,…,A f(x) x ),A i x Is L x I macro usage information of (1), i having a value ranging from 1 to f (x), f (x) being L x The corresponding macro use number, the value range of X is 1 to X, X is the total number of macro use lines in the source code, A 1 x ,A 2 x ,…,A i x ,…,A f(x) x Arranged in order of appearance of macros, A i x ={B i x ,C i x ,D i x },B i x Is A i x The corresponding macro enters the beginning column, C i x Is A i x Corresponding macro original value, D i x Is A i x Corresponding macro first layer spreading values.
The source code compiling stage can output macro use line identification appearing in the source code and entry start columns, macro original values and macro first layer unfolding values corresponding to each macro in each macro use line through compiling software. It should be noted that, some macros may be nested with one or more layers of other macros, but the nested macros and the source code enter the beginning columns corresponding to the nested macros, which are the columns of the source code where the corresponding macros are located. The original value of the macro is the original value before macro expansion, and the expansion value of the first layer of macro is the expansion value of the macro expansion once. Some macros are expanded and then include other macros, but the requirement for a compiler is too high if multiple layers are directly expanded, so that only the first layer expansion value of the macro is set.
As one embodiment, the macro usage line identification is generated based on the file name and line number where the macro usage line is located. It should be noted that, the source code generally includes a plurality of files, and each line code in each file has a corresponding line number, so that the file name and the line number of the macro-usage line are combined to accurately locate the macro-usage line.
As an embodiment, the step C3 includes:
step C31, initially setting i=1.
It should be noted that, in the embodiment of the present invention, macros are expanded one by one according to the order in which macros appear in the macro use list corresponding to the target macro use line, so i is a value from 1.
Step C32, based on the target L x And target L x Corresponding target B i x Determining the current C corresponding to the current macro to be expanded i x And current D i x
Wherein, through the object L x Can determine the corresponding (A 1 x ,A 2 x ,…,A i x ,…,A f(x) x ) The target L can be determined by taking the value of the current i x Corresponding target B i x Then based on target B i x Further determining the current C i x And current D i x
Step C33, using the line L for the target macro in the current code storage unit x And B i x Current C at the corresponding position i x Replacement with current D i x
Wherein line L is used by the target macro in the current code storage unit x And B i x Current C at the corresponding position i x Replacement with current D i x And expanding the current macro to be expanded in the code storage unit.
The step C4 comprises the following steps:
in step C41, if i=f (x), it is determined that the target macro uses all the rows of the macro to expand, otherwise, i=i+1 is set, and step C32 is executed.
By the steps C31-C33 and C41, the macro texts are expanded one by one according to the appearance sequence of the target macro using the row macro.
As an embodiment, the step C32 further includes:
step C321, judging the current C i x If the macro is the preset macro without unfolding, executing the step C4 directly if the macro is the preset macro without unfolding, otherwise, executing the stepAnd step C33, wherein the preset macro without expanding is a macro arranged after the sentences of the 'ifdef', 'ifndef', 'elsif' sentences and the like.
The macro set after the sentences such as the "ifdef", "ifndef", "elsif" sentence is substantially the macro in the preprocessing stage, and is not actually used, and therefore, it can be determined in step C321, and if the current C is the current one i x If the macro is preset and does not need to be unfolded, the current C is not subjected to i x A macro expansion operation is performed.
As an embodiment, the step C4 includes:
and C42, judging whether the target macro expanded text is equal to the original code of the target macro using line, if so, determining the target macro using line as a non-macro code containing line, and if a macro using list corresponding to the target macro using line exists, deleting the macro using list corresponding to the target macro using line.
After the steps C1 to C3, if the target macro expanded text is equal to the original code of the target macro used line, the target macro expanded text is described and the macro is included, so that the target macro used line is determined to be a line containing no macro code. After determining that the target macro use line does not contain the macro code line, if a macro use list corresponding to the target macro use line exists, indicating that the macro use list corresponding to the target macro use line is wrong, deleting the macro use list corresponding to the target macro use line, which is equivalent to performing secondary verification on the macro use list corresponding to the target macro use line, and improving the accuracy of expanding the macro definition text based on the use line.
According to the embodiment of the invention, the macro using lines are dynamically unfolded through the macro using list, and the macro unfolding text of the unfolded macro using lines can be multiplexed through the macro using line unfolding list, so that the macro unfolding text can be dynamically generated, and the memory and the computing resource consumption for the macro text unfolding are saved.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
It should be noted that some exemplary embodiments are described as a process or a method depicted as a flowchart. Although a flowchart depicts steps as a sequential process, many of the steps may be implemented in parallel, concurrently, or with other steps. Furthermore, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
The embodiment of the invention also provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the methods of embodiments of the present invention.
The embodiment of the invention also provides a computer readable storage medium, which stores computer executable instructions for executing the method according to the embodiment of the invention.
The present invention is not limited to the above-mentioned embodiments, but is intended to be limited to the following embodiments, and any modifications, equivalents and modifications can be made to the above-mentioned embodiments without departing from the scope of the invention.

Claims (8)

1. A macro-expanded text-based target text search method, comprising:
step S1, dynamically generating macro expansion text of macro use lines, and dynamically generating macro use linesThe macro expansion text is stored in macro expansion text set { G } 1 ,G 2 ,…,G j ,…G J In }, G j Using macro expansion text of a row for the J-th macro, wherein the value range of J is 1 to J, and J is the total number of macro expansion texts which are generated currently;
step S2, obtaining each G j Corresponding filename and use line binary list { (GF) 1 j ,GL 1 j ),(GF 2 j ,GL 2 j ),…,(GF y j ,GL y j ),…,(GF g(j) j ,GL g(j) j ) } wherein GF y j Is G j The y-th file name, GL, of the corresponding macro usage line y j Is G j The corresponding macro uses the line number of the line in the y-th file, the value range of y is 1 to G (j), and G (j) is G j Corresponding file name and total number of used row binary values;
step S3, at { G ] 1 ,G 2 ,…,G j ,…G J Searching target character string in the sequence, G containing the target character string j Is determined as target G j
S4, acquiring the target character string in the target G j OF offset OF in (b) j
Step S5, based on the target G j Corresponding file name and use line binary list and offset OF j Generating a ternary result set containing macro-expanded text { (GF) 1 j ,GL 1 j ,OF j ),(GF 2 j ,GL 2 j ,OF j ),…,(GF y j ,GL y j ,OF j ),…,(GF g(j) j ,GL g(j) j ,OF j )};
Step S6, based on each (GF y j ,GL y j ,OF j ) And presenting the corresponding target text search results.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
in the step S1, when a macro expansion text is generated, whether the current macro expansion text set includes the current macro expansion text is firstly searched, if so, the current macro expansion text is not stored in the macro expansion text set, and if not, the current macro expansion text is stored in the macro expansion text set.
3. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the step S2 includes:
step S21, based on each G j The corresponding original code line searches all files in the source code to obtain each G contained in the source code j Generating each G by the file name and line number corresponding to the corresponding original code line j Corresponding filename and use line binary list { (GF) 1 j ,GL 1 j ),(GF 2 j ,GL 2 j ),…,(GF y j ,GL y j ),…,(GF g(j) j ,GL g(j) j )}。
4. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the step S4 includes:
step S41, obtaining target G j The column number corresponding to each row located before the target character string;
step S42, obtaining target G j The number of columns preceding the target character string in the row where the target character string is located;
step S43, target G j The sum of the number of columns corresponding to each row located before the target character string and the number of columns before the target character string in the row where the target character string is located is determined as the target character string in the target G j OF offset OF in (b) j
5. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the step S6 includes:
step S61, based on GF y j ,GL y j Locating a target macro usage line in source code;
step S62, presenting a corresponding macro expansion text in an embedded mode at the position of a target macro using line;
step S63 based on OF j And positioning the position of the target character string in the displayed macro expansion text, and highlighting the target character string in the displayed corresponding macro expansion text.
6. The method of claim 1, wherein the step of determining the position of the substrate comprises,
the method further comprises the steps of:
step S10, searching target character strings in all files of a source code, and determining file names and code lines corresponding to the target character strings;
and step S20, presenting the corresponding target text search result based on the file name and the code line corresponding to the target character string.
7. An electronic device, comprising:
at least one processor;
and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the instructions being arranged to perform the method of any of the preceding claims 1-6.
8. A computer readable storage medium, characterized in that computer executable instructions are stored for performing the method of any of the preceding claims 1-6.
CN202311066633.8A 2023-08-23 2023-08-23 Target text searching method based on macro expansion text, electronic equipment and medium Active CN117112730B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311066633.8A CN117112730B (en) 2023-08-23 2023-08-23 Target text searching method based on macro expansion text, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311066633.8A CN117112730B (en) 2023-08-23 2023-08-23 Target text searching method based on macro expansion text, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN117112730A CN117112730A (en) 2023-11-24
CN117112730B true CN117112730B (en) 2024-03-22

Family

ID=88807001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311066633.8A Active CN117112730B (en) 2023-08-23 2023-08-23 Target text searching method based on macro expansion text, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117112730B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011113148A (en) * 2009-11-24 2011-06-09 Nomura Research Institute Ltd Macro development method and preprocessor
CN110737466A (en) * 2019-10-16 2020-01-31 南京航空航天大学 Source code coding sequence representation method based on static program analysis
CN112181857A (en) * 2020-11-06 2021-01-05 无锡江南计算技术研究所 Cross-processor Linux software to be migrated positioning and evaluating method
CN115268879A (en) * 2022-06-27 2022-11-01 北京房多多信息技术有限公司 Code processing method and device, electronic equipment and storage medium
CN116400895A (en) * 2023-03-09 2023-07-07 广州南方卫星导航仪器有限公司 Dynamic link library reflection method and system based on C language preprocessor
CN116627429A (en) * 2023-07-20 2023-08-22 无锡沐创集成电路设计有限公司 Assembly code generation method and device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011113148A (en) * 2009-11-24 2011-06-09 Nomura Research Institute Ltd Macro development method and preprocessor
CN110737466A (en) * 2019-10-16 2020-01-31 南京航空航天大学 Source code coding sequence representation method based on static program analysis
CN112181857A (en) * 2020-11-06 2021-01-05 无锡江南计算技术研究所 Cross-processor Linux software to be migrated positioning and evaluating method
CN115268879A (en) * 2022-06-27 2022-11-01 北京房多多信息技术有限公司 Code processing method and device, electronic equipment and storage medium
CN116400895A (en) * 2023-03-09 2023-07-07 广州南方卫星导航仪器有限公司 Dynamic link library reflection method and system based on C language preprocessor
CN116627429A (en) * 2023-07-20 2023-08-22 无锡沐创集成电路设计有限公司 Assembly code generation method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宏应用遇到的问题及解决办法;韦丽霜;;网络安全技术与应用;20141215(第12期);全文 *

Also Published As

Publication number Publication date
CN117112730A (en) 2023-11-24

Similar Documents

Publication Publication Date Title
US8645812B1 (en) Methods and apparatus for automated redaction of content in a document
CN103026318B (en) Input method editor
US9400775B2 (en) Document data entry suggestions
US8612893B2 (en) Dynamic screentip language translation
JP2003223437A (en) Method of displaying candidate for correct word, method of checking spelling, computer device, and program
US20090240671A1 (en) Electronic bible
US20110144978A1 (en) System and method for advancement of vocabulary skills and for identifying subject matter of a document
JP2022047291A (en) Information processing apparatus, method, and program
JP2005107597A (en) Device and method for searching for similar sentence and program
CN116756103B (en) Macro definition text expansion method based on use line, electronic device and medium
CN117111951B (en) Method, electronic device and medium for expanding macro text based on using chain
CN117112730B (en) Target text searching method based on macro expansion text, electronic equipment and medium
JP2008052548A (en) Retrieval program, information retrieval device and information retrieval method
JP5285491B2 (en) Information retrieval system, method and program, index creation system, method and program,
CN114676155A (en) Code prompt information determining method, data set determining method and electronic equipment
JP2019133534A (en) Merging method, merging device, and merging program
CN117111950B (en) Macro text unfolding method based on constant macro definition, electronic equipment and medium
JP2008027340A (en) Web service design method and device
JP2004334690A (en) Character data inputting/outputting device and method, character data inputting/outputting program, and computer-readable recording medium
JP4847210B2 (en) Input conversion learning program, input conversion learning method, and input conversion learning device
CN118012763A (en) Method, electronic device and medium for expanding macro text layer by layer
JP2006039811A (en) Document management program, document management method and document management device
JP2008233952A (en) Document preparation support device and document preparation support program
US20060048126A1 (en) Method and a system thereof for generating a homepage content file capable of dynamically linking with a plurality of on-demand knowledge bases
JPH07281879A (en) Application program editing device

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