CN109614106A - A kind of C++ program compiling method and device - Google Patents

A kind of C++ program compiling method and device Download PDF

Info

Publication number
CN109614106A
CN109614106A CN201811569117.6A CN201811569117A CN109614106A CN 109614106 A CN109614106 A CN 109614106A CN 201811569117 A CN201811569117 A CN 201811569117A CN 109614106 A CN109614106 A CN 109614106A
Authority
CN
China
Prior art keywords
file
cpp
cpp file
syntax tree
variable
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.)
Granted
Application number
CN201811569117.6A
Other languages
Chinese (zh)
Other versions
CN109614106B (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.)
Beijing Dragon Yue Network Technology Co Ltd
Original Assignee
Beijing Dragon Yue Network Technology 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 Beijing Dragon Yue Network Technology Co Ltd filed Critical Beijing Dragon Yue Network Technology Co Ltd
Priority to CN201811569117.6A priority Critical patent/CN109614106B/en
Publication of CN109614106A publication Critical patent/CN109614106A/en
Application granted granted Critical
Publication of CN109614106B publication Critical patent/CN109614106B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention provides a kind of C++ program compiling method, and this method includes obtaining multiple cpp files, and merge algorithm process to the multiple cpp file, generates target cpp file to be compiled, is finally compiled to the target cpp file.This method is avoided when compiling to a large amount of cpp file, need that each cpp file is individually pre-processed, compiles, collects and generated the compilation process of Object linking, unified compiling directly is carried out to the cpp file after merging, save various system resources and a large amount of time overhead and overhead, the compilation process for accelerating C++ program improves the performance of system.

Description

A kind of C++ program compiling method and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of C++ program compiling method and device.
Background technique
C++ file is compiled usually using compiler, for example uses clang, the C++ compiler such as gcc is compiled it.? When compiling multiple C++ files, for example when more than 2000 even more file, existing compiler is compiled one by one to C++ file, The a large amount of time can be consumed in this way.C++ compiler when compiling file, one file of every compiling just will start one into Journey, a large amount of time overhead and overhead can be generated by loading various system resources.
Currently, being compiled to a large amount of C++ file, distributed compilation technology is mainly used, C++ file is sent to not Same machine is compiled, and it is integrated to finally return to result.This mode needs the support of third party's distributed software, and consumes big The hardware environment of amount, such as more than 2000 a files of compiling, at least need 10 machines, could improve compilation speed.
Therefore, under the premise of practicing every conceivable frugality hardware compilation environment and compilation time expense, the compiling speed of C++ file is improved Degree is current technical problem urgently to be solved.
Summary of the invention
In order to improve the compilation speed of C++ file, the present invention provides a kind of C++ programs to compile accelerated method, to solve Under the premise of practicing every conceivable frugality hardware compilation environment and compilation time expense, improve C++ file compilation speed the problem of.This method By using compiling mode is merged, by a large amount of C++ file mergencess at a file, then the file after merging is compiled, this Sample just only needs to load primary system resource, carries out concentration compiling to C++ file, can greatly shorten compilation time.
The specific technical solution of this method is as follows:
A kind of C++ program compiling method, which is characterized in that described method includes following steps:
Obtain multiple cpp files;
Algorithm process is merged to the multiple cpp file, generates target cpp file to be compiled;
The target cpp file is compiled.
Further, algorithm process is merged to the cpp file, before generating target cpp file to be compiled, packet Include following steps:
By each cpp file generated abstract syntax tree;
Judge between the abstract syntax tree whether to include identical built-in variable and/or function.
Further, if between the abstract syntax tree not including identical built-in variable and/or function, to described more A cpp file merges algorithm process, generates target cpp file to be compiled.
Further, the method also includes,
If between the abstract syntax tree including identical built-in variable and/or function, generation error information;
It modifies to the error message;
Wherein, the error message includes the file for having the abstract object tree of identical inner variable and/or function corresponding The line number of filename, built-in variable name and/or function name, the built-in variable name and/or function name place file.
Further, the merging algorithm process includes the following steps:
The cpp file is called using include dummy order;
The cpp file of calling is added to pre-set cpp file, generates target cpp file to be compiled.
Further, judge between the abstract syntax tree whether to include identical built-in variable and/or function, specific packet Include following steps:
Obtain the nodal information of abstract syntax tree;
It traverses the nodal information and judges whether it meets preset Rule of judgment;
If meeting preset Rule of judgment, determine to include identical built-in variable and/or function between the abstract syntax tree.
The present invention also provides a kind of C++ program compilation devices, which is characterized in that and the device includes,
Module is obtained, for obtaining multiple cpp files;
Merge algorithm processing module, for merging algorithm process to the multiple cpp file of acquisition, and generates to be compiled Target cpp file;
Collector, for being compiled to the target cpp file.
Further, the merging algorithm processing module further include:
Abstract syntax tree generation module, for each cpp file generated abstract syntax tree;
Judgment module, for judging between the abstract syntax tree whether to include identical built-in variable and/or function;
Error message generate, for judge between the abstract syntax tree include identical built-in variable and/or function when, Generation error information;
Bug patch module for modifying to the error message, and generates new abstract syntax tree.
Further, the merging algorithm processing module further includes,
Include dummy order calling module, for calling the cpp file obtained;
Cpp file adding module generates target to be compiled for the cpp file to be added to pre-set cpp file Cpp file.
Further, the judgment module further includes,
Nodal information obtains module, for obtaining the nodal information in the abstract syntax tree;
Nodal information judgment module, for traversing the nodal information and judging whether it meets preset Rule of judgment;If full The preset Rule of judgment of foot then determines to include identical built-in variable and/or function between the abstract syntax tree.
The present invention provides a kind of C++ program compiling method, and this method closes a large amount of cpp file by using ad hoc approach And at a target cpp file to be compiled, i.e., multiple cpp files are first obtained, then the multiple cpp file is merged Algorithm process generates target cpp file to be compiled, and the method being finally compiled to the target cpp file after merging avoids When compiling a large amount of cpp file, need that each cpp file is individually pre-processed, compiled, collected and generated The process of Object linking, and unified pretreatment, compiling, compilation directly are carried out to the cpp file after merging and generate object chain The process connect, completes the compilation process of C++ program, and system process becomes disposably completing C++ from multiple cpp file compilation process The compilation process of program saves various system resources and a large amount of time overhead and overhead, accelerates C++ program Compilation process improves system performance.
Further, method provided by the invention is merging algorithm process to the cpp file, generates to be compiled Before target cpp file, by each cpp file generated abstract syntax tree, which includes built-in variable, intrinsic function Etc. great deal of nodes information, in each abstract syntax tree built-in variable and the information such as intrinsic function judge that judgement is abstract It whether include identical built-in variable and/or function between syntax tree.Before generating target cpp file to be compiled, to big The built-in variable and function for including in the cpp file of amount are analyzed and determined, are reduced when to later generation target cpp file, Since there are identical built-in variable and functions between cpp file, there is grammer so that generating C++ in compilation process or compiling The problem of mistake needs that C++ program is modified and compiled repeatedly, and caused compiling efficiency reduces, side provided by the invention Method can reduce the time of process consuming, improve the efficiency of compiling.
Further, the present invention directlys adopt include dummy order and calls the cpp file, by the cpp text of calling Part is added to pre-set cpp file, generates target cpp file to be compiled, and program feature is optimized same well When, use dummy order call method the easiest, function easily realizes that program is simple, and is able to achieve better compared with the prior art Effect.
The present invention also provides a kind of C++ program compilation device, which includes obtaining module, for obtaining multiple cpp texts Part;Merge algorithm processing module, for merging algorithm process to the multiple cpp file of acquisition, and generates to be compiled Target cpp file;Collector, for being compiled to the target cpp file.The device is more by obtaining module acquisition A cpp file merges algorithm process by multiple cpp files of the merging algorithm processing module to acquisition, and generates to be compiled Target cpp file, be finally compiled, avoided to a large amount of cpp file by target cpp file of the collector to generation When compiling, need that each cpp file is individually pre-processed, compiles, collects and generated the process of Object linking, and it is straight It connects and a large amount of cpp file is merged, and unified pretreatment, compiling, compilation and production directly are carried out to the algorithm after merging The process of raw Object linking completes the compilation process of C++ program, save various system resources and a large amount of time overhead and Overhead accelerates the compilation process of C++ program, improves the performance of system.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations recorded in the present invention Example, for those of ordinary skill in the art, is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of C++ program compiling method of the present invention;
Fig. 2 is a kind of schematic diagram of a preferred embodiment of C++ program compiling method of the present invention;
Fig. 3 is a kind of structural schematic diagram of C++ program compilation device of the present invention;
Fig. 4 is an a kind of preferred structure schematic diagram of C++ program compilation device of the present invention.
Specific embodiment
With reference to the accompanying drawing, further specific detailed description is done to the present invention.
It is a kind of flow diagram of C++ program compiling method of the present invention referring to Fig. 1, which includes the following steps:
S1. multiple cpp files are obtained;
S2. algorithm process is merged to the multiple cpp file, generates target cpp file to be compiled;
S3. the target cpp file is compiled.
Above-mentioned steps S1, obtains multiple cpp files, and the present invention is opened by opening the C++ that compiling system loading pre-establishes Engineering is sent out, when compiling system runs program, using file traversal system function readdir, work is developed to the C++ pre-established Catalogue in journey carries out recursive traversal, searches using cpp as the file of suffix name, obtains the multiple cpp file, and will acquire , to indicate that the filename of the cpp file is deposited into pre-set variable, for example, the entitled filelists of variable, become The type of amount is vector<string>.
Merging algorithm process can be directly used to the multiple cpp files got in above-mentioned steps S2, generates to be compiled Target cpp file.It should be noted that merging algorithm process of the present invention can be multiple cpp Document Editings manually Into a pre-set file, and using this document as target cpp file to be compiled.Preferably, the present invention will acquire To the multiple cpp file called using dummy order include, then the cpp file of calling is added to and is set in advance The cpp file set generates target cpp file to be compiled.
Above-mentioned steps S3 is compiled the target cpp file.In the present invention, right on clang compiling platform The target cpp file of generation is compiled.
The present invention provides a kind of C++ program compiling method, and this method closes a large amount of cpp file by using ad hoc approach And at a target cpp file to be compiled, i.e., multiple cpp files are first obtained, then the multiple cpp file is merged Algorithm process generates target cpp file to be compiled, and the method being finally compiled to the target cpp file after merging avoids When compiling a large amount of cpp file, need that each cpp file is individually pre-processed, compiled, collected and generated The process of Object linking, and unified pretreatment, compiling, compilation directly are carried out to the cpp file after merging and generate object chain The process connect, completes the compilation process of C++ program, and system process becomes disposably completing C++ from multiple cpp file compilation process The compilation process of program saves various system resources and a large amount of time overhead and overhead, accelerates C++ program Compilation process improves system performance.
It referring to fig. 2, is an a kind of preferred embodiment of C++ program compiling method of the present invention.
This method comprises:
L1: multiple cpp files are obtained;
L2: by each cpp file generated abstract syntax tree, built-in variable and function are obtained;
L3: judge between the abstract syntax tree whether to include identical built-in variable and/or function;
L4: if between the abstract syntax tree not including identical built-in variable and/or function, to the multiple cpp file Algorithm process is merged, target cpp file to be compiled is generated;
L5: the target cpp file is compiled.
Step L1: the present invention is loaded into the C++ engineering pre-established by opening compiling system, when compiling system runs program When, using file traversal system function readdir, recursive traversal is carried out to the catalogue in the C++ Development Engineering pre-established, is looked into Look for the file using cpp as suffix name, obtain multiple cpp files, and will acquire, to indicate that the filename of this document is deposited into In pre-set variable, for example, the entitled filelists of variable, types of variables is vector<string>.
Step L2: after getting multiple cpp files, a global variable is constructed first, which becomes to store The name of amount or function;Then clang SDK is introduced, the abstract syntax tree function clang_ integrated in clang SDK is called ParseTranslationUnit carries out algorithm process to the cpp file of acquisition, generates abstract syntax tree.It should be noted that Abstract syntax tree is the tree-shaped form of expression of the abstract syntax structure of source code, there is numerous nodes on tree, and each node indicates One of source code structure includes built-in variable and intrinsic function.
Step L3: judge between the abstract syntax tree whether to include identical built-in variable and/or function;Traversal generates Multiple abstract syntax tree, search built-in variable and function therein, and record its name.Detailed process is as follows:
If being successfully generated after the abstract syntax tree of C++, clang_getTranslationUnitCursor method is called, is obtained Abstract syntax traversal of tree vernier cursor;Function clang_visitChildren is called to use cursor traversal syntax tree Each node calls clang_getCursorKind function to each node, obtains node type nodetype, recall Clang_getCursorLinkage obtains node link type nodelinktype;If nodetype is CXCursor_ FunctionDecl or CXCursor_VarDecl, and nodelinktype is this type of CXLinkage_Internal Type.It is considered that the node is built-in variable or intrinsic function.If being adjusted it was found that the node is built-in variable or intrinsic function The name of the node, i.e. variable or method name are obtained with method clang_getCursorSpelling, are called VariableOrMethodName recalls method clang_getCursorLocation method and obtains node location information, Then clang_getExpansionLocation and clang_getFileName method is used, the file where node is obtained Cpp filename CppFileName, line number Row, row number Column.We store these information to variable m_variables In, it is key with VariableOrMethodName, is value with line number and row number with cpp filename for sub- key, it may be assumed that
m_variables[VariableOrMethodName][CppFileName]=“Row Column”
M_variables is traversed, if the quantity of the sub-key of its each key-value pair variableElement is greater than 1, Then explanation has the variable repeated or function name.In the case where judging variableElement.size () > 1, just Illustrate identical built-in variable or function name occurred.If there is the case where being greater than 1, we traverse variableElement, Its each key assignments output is printed, key is cpp filename CppFileName, is worth for line number row and row number column。
In conclusion obtaining the nodal information of abstract syntax tree, the nodal information includes function, built-in variable;Time It goes through nodal information and judges whether nodal information meets above-mentioned default Rule of judgment, if meeting above-mentioned preset Rule of judgment, Then determine to include identical built-in variable and/or function between abstract syntax tree.
L4: if between above-mentioned abstract syntax tree not including identical built-in variable and/or function, to the multiple cpp File merges algorithm process, generates target cpp file to be compiled;
L5: the target cpp file is compiled.In the present invention, on clang compiling platform, to the target cpp of generation File is compiled.
It should be noted that the invention also includes step L4,If judging includes identical between the abstract syntax tree Built-in variable and/or function, then generation error information;And modify to error message, until again to the abstract syntax When built-in variable and/or function between tree carry out identical judgement, no longer there is identical built-in variable between abstract syntax tree And/or function, then using by multiple cpp files call include dummy order merging treatment into a cpp file, and by this Cpp file is finally again compiled the target cpp file after merging as target cpp file;Wherein, the error message Filename, built-in variable name including the corresponding file of the abstract object tree with identical inner variable and/or function and/or The line number of function name, the built-in variable name and/or file where function name.
The present invention provides a kind of C++ program compiling method, and this method closes a large amount of cpp file by using ad hoc approach And at a target cpp file to be compiled, i.e., multiple cpp files are first obtained, then by each cpp file generated abstract syntax Tree, which includes the great deal of nodes information such as built-in variable, intrinsic function, is become to the inside in each abstract syntax tree Whether the information such as amount and intrinsic function are judged, judge between abstract syntax tree to include identical built-in variable and/or function. If between the abstract syntax tree not including identical built-in variable and/or function, the multiple cpp file is merged Algorithm process generates target cpp file to be compiled;Processing finally is compiled to the target cpp file after merging, completes C+ The compiling of+program.Before generating target cpp file to be compiled, to the built-in variable and letter for including in a large amount of cpp file Number is analyzed and determined, is reduced when to later generation target cpp file, since there are identical inside to become between cpp file There is syntax error so that generating C++ in compilation process or compiling, need repeatedly to modify to C++ program in amount and function And compiling, caused compiling efficiency reduce the problem of, method provided by the invention can reduce the process consuming time, improve The efficiency of compiling.Meanwhile the present invention merges algorithm process to the multiple cpp file, generates target cpp text to be compiled Part, the method being finally compiled to the target cpp file after merging avoid needing pair when compiling a large amount of cpp file Each cpp file is individually pre-processed, is compiled, collected and is generated the process of Object linking, and directly to merging after Cpp file carry out unified pretreatment, compiling, compilation and generate Object linking process, complete C++ program it is compiled Journey, system process become the compilation process for disposably completing C++ program from multiple cpp file compilation process, save each germline Resource of uniting and a large amount of time overhead and overhead, accelerate the compilation process of C++ program, improve system performance.
Further, the present invention directlys adopt include dummy order and calls the cpp file, by the cpp text of calling Part is added to pre-set cpp file, generates target cpp file to be compiled, and program feature is optimized same well When, use dummy order call method the easiest, function easily realizes that program is simple, and is able to achieve better compared with the prior art Effect.
Referring to Fig. 3, the present invention also provides a kind of C++ program compilation device, which includes module being obtained, for obtaining Multiple cpp files;Merge algorithm processing module, for merging algorithm process to the multiple cpp file of acquisition, and it is raw At target cpp file to be compiled;Collector, for being compiled to the target cpp file.
The present invention, which should pass through, opens the C++ Development Engineering that compiling system loading pre-establishes, when compiling system runs program When, the acquisition module of the device obtains multiple cpp files, and calls file traversal system function readdir, to what is pre-established Catalogue in C++ Development Engineering carries out recursive traversal, searches using cpp as the file of suffix name, obtains the multiple cpp file, And will acquire, to indicate that the filename of the cpp file is deposited into pre-set variable, for example, variable is entitled Filelists, the type of variable are vector<string>.Merging algorithm processing module, can to the multiple cpp files got To directly adopt merging algorithm process, target cpp file to be compiled is generated.It should be noted that merging of the present invention Algorithm processing module can be manually by multiple cpp Document Editings into a pre-set file, and using this document as Target cpp file to be compiled.Preferably, the multiple cpp file that the present invention will acquire will using dummy order include It is called, and the cpp file of calling is then added to pre-set cpp file, generates file destination to be compiled.Finally exist Clang is compiled on platform, and the target cpp file of generation is compiled by collector.
It referring to fig. 4, is an a kind of preferred embodiment of C++ program compilation device of the present invention.The device includes obtaining mould Block, for obtaining multiple cpp files;Merge algorithm processing module, for merging calculation to the multiple cpp file of acquisition Method processing, and generate target cpp file to be compiled;Collector, for being compiled to the target cpp file.
The device obtains multiple cpp files by obtaining module, by merging algorithm processing module to multiple cpp text of acquisition Part merges algorithm process, and generates target cpp file to be compiled, finally by collector to the target cpp text of generation Part is compiled, and avoids needing individually to pre-process each cpp file, compiling when compiling a large amount of cpp file The process of Object linking is translated, collected and generated, and directly a large amount of cpp file is merged, and directly to the calculation after merging Method carries out unified pretreatment, compiling, compilation and the process for generating Object linking, completes the compilation process of C++ program, saves Various system resources and a large amount of time overhead and overhead, accelerate the compilation process of C++ program, improve system Performance.
Further, wherein merge algorithm processing module further include:
Abstract syntax tree generation module, for each cpp file generated abstract syntax tree;Judgment module, it is described for judging It whether include identical built-in variable and/or function between abstract syntax tree;Error message generates, for judging the pumping When as including identical built-in variable and/or function between syntax tree, generation error information;Bug patch module, for institute It states error message to modify, and generates new abstract syntax tree.Merging algorithm processing module further includes include dummy order Calling module, for calling the cpp file obtained;Cpp file adding module, it is pre- for the cpp file to be added to The cpp file being first arranged generates target cpp file to be compiled.The judgment module further includes,
Nodal information obtains module, for obtaining the nodal information in the abstract syntax tree;Nodal information judgment module, is used for The nodal information is judged.
As seen through the above description of the embodiments, those skilled in the art can be understood that above-mentioned implementation All or part of the steps in example method can add the mode of general hardware platform to realize by software.Based on this understanding, Technical solution of the present invention can be embodied in the form of software products, which can store is situated between in storage In matter, such as read-only memory (English: read-only memory, ROM)/RAM, magnetic disk, CD etc., including some instructions to So that a computer equipment (can be the network communication equipments such as personal computer, server, or router) executes Method described in certain parts of each embodiment of the present invention or embodiment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method Part explanation.Device system embodiment described above is only schematical, wherein as illustrated by the separation member Module may or may not be physically separated, and the component shown as module may or may not be object Manage module, it can it is in one place, or may be distributed over multiple network units.It can select according to the actual needs Some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying wound In the case that the property made is worked, it can understand and implement.
The above is only a preferred embodiment of the present invention, it is not intended to limit the scope of the present invention.It should refer to Out, for those skilled in the art, under the premise of not departing from the present invention, can also make several improvements And retouching, these modifications and embellishments should also be considered as the scope of protection of the present invention.

Claims (10)

1. a kind of C++ program compiling method, which is characterized in that described method includes following steps:
Obtain multiple cpp files;
Algorithm process is merged to the multiple cpp file, generates target cpp file to be compiled;
The target cpp file is compiled.
2. the method according to claim 1, wherein merge algorithm process to the cpp file, generate to Before the target cpp file of compiling, include the following steps:
By each cpp file generated abstract syntax tree;
Judge between the abstract syntax tree whether to include identical built-in variable and/or function.
3. according to the method described in claim 2, it is characterized in that, if between the abstract syntax tree not including identical inside Variable and/or function then merge algorithm process to the multiple cpp file, generate target cpp file to be compiled.
4. according to the method described in claim 2, it is characterized in that, the method also includes,
If between the abstract syntax tree including identical built-in variable and/or function, generation error information;
It modifies to the error message;
Wherein, the error message includes the file for having the abstract object tree of identical inner variable and/or function corresponding The line number of filename, built-in variable name and/or function name, the built-in variable name and/or function name place file.
5. method according to claim 1 to 4, which is characterized in that the merging algorithm process includes the following steps:
The cpp file is called using include dummy order;
The cpp file of calling is added to pre-set cpp file, generates target cpp file to be compiled.
6. according to the method described in claim 5, it is characterized in that, judging between the abstract syntax tree whether to include identical Built-in variable and/or function, specifically comprise the following steps:
Obtain the nodal information of abstract syntax tree;
It traverses the nodal information and judges whether it meets preset Rule of judgment;
If meeting preset Rule of judgment, determine to include identical built-in variable and/or function between the abstract syntax tree.
7. a kind of C++ program compilation device, which is characterized in that the device includes,
Module is obtained, for obtaining multiple cpp files;
Merge algorithm processing module, for merging algorithm process to the multiple cpp file of acquisition, and generates to be compiled Target cpp file;
Collector, for being compiled to the target cpp file.
8. device according to claim 7, which is characterized in that the merging algorithm processing module further include:
Abstract syntax tree generation module, for each cpp file generated abstract syntax tree;
Judgment module, for judging between the abstract syntax tree whether to include identical built-in variable and/or function;
Error message generate, for judge between the abstract syntax tree include identical built-in variable and/or function when, Generation error information;
Bug patch module for modifying to the error message, and generates new abstract syntax tree.
9. device according to claim 8, which is characterized in that the merging algorithm processing module further includes,
Include dummy order calling module, for calling the cpp file obtained;
Cpp file adding module generates target to be compiled for the cpp file to be added to pre-set cpp file Cpp file.
10. device according to claim 9, which is characterized in that the judgment module further includes,
Nodal information obtains module, for obtaining the nodal information in the abstract syntax tree;
Nodal information judgment module, for traversing the nodal information and judging whether it meets preset Rule of judgment;If full The preset Rule of judgment of foot then determines to include identical built-in variable and/or function between the abstract syntax tree.
CN201811569117.6A 2018-12-21 2018-12-21 C + + program compiling method and device Active CN109614106B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811569117.6A CN109614106B (en) 2018-12-21 2018-12-21 C + + program compiling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811569117.6A CN109614106B (en) 2018-12-21 2018-12-21 C + + program compiling method and device

Publications (2)

Publication Number Publication Date
CN109614106A true CN109614106A (en) 2019-04-12
CN109614106B CN109614106B (en) 2022-04-19

Family

ID=66011177

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811569117.6A Active CN109614106B (en) 2018-12-21 2018-12-21 C + + program compiling method and device

Country Status (1)

Country Link
CN (1) CN109614106B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471837A (en) * 2019-07-05 2019-11-19 平安证券股份有限公司 Program detecting method, device and computer readable storage medium
CN110704068A (en) * 2019-10-18 2020-01-17 安徽中科国创高可信软件有限公司 Processing method and system for cross-file collaborative program analysis based on database
CN111221519A (en) * 2019-11-12 2020-06-02 广州银汉科技有限公司 Python-based CLI automatic export method
CN111552466A (en) * 2020-05-12 2020-08-18 重庆科技学院 Project file generation method, system, computer equipment and storage medium
CN111880805A (en) * 2020-07-20 2020-11-03 腾讯科技(深圳)有限公司 Method, device and equipment for generating package file of software project and storage medium
CN113031961A (en) * 2021-03-23 2021-06-25 北京百度网讯科技有限公司 Compiling method, compiling apparatus, electronic device, storage medium, and program product
CN113031962A (en) * 2021-03-23 2021-06-25 北京百度网讯科技有限公司 Compiling method, compiling apparatus, electronic device, storage medium, and program product
CN113050952A (en) * 2021-04-19 2021-06-29 杭州至千哩科技有限公司 Pseudo instruction compiling method and device, computer equipment and storage medium
CN113495728A (en) * 2020-03-18 2021-10-12 腾讯科技(深圳)有限公司 Dependency relationship determination method, dependency relationship determination device, electronic equipment and medium
CN113050952B (en) * 2021-04-19 2024-07-05 杭州至千哩科技有限公司 Pseudo instruction compiling method, pseudo instruction compiling device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2330469A1 (en) * 2009-12-03 2011-06-08 dspace digital signal processing and control engineering GmbH Method and development environment for generating an executable total control program
CN107678748A (en) * 2017-09-21 2018-02-09 杭州迪普科技股份有限公司 A kind of source code file Compilation Method and device
CN108399318A (en) * 2018-01-31 2018-08-14 北京顶象技术有限公司 The generation method of executable file executes method and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2330469A1 (en) * 2009-12-03 2011-06-08 dspace digital signal processing and control engineering GmbH Method and development environment for generating an executable total control program
CN107678748A (en) * 2017-09-21 2018-02-09 杭州迪普科技股份有限公司 A kind of source code file Compilation Method and device
CN108399318A (en) * 2018-01-31 2018-08-14 北京顶象技术有限公司 The generation method of executable file executes method and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
GAMEWYD: "多cpp文件 重复定义", 《HTTPS://BLOG.CSDN.NET/GAMEWYD/ARTICLE/DETAILS/6792113》 *
JAMESHEROS: "关于如何将多个Cpp文件关联起来", 《CSDN博客,HTTPS://BLOG.CSDN.NET/U010167037/ARTICLE/DETAILS/19680877》 *
SHAHARMIKE: "Using libclang to Parse C++ (aka libclang 101)", 《HTTPS://SHAHARMIKE.COM/CPP/LIBCLANG/ 》 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110471837A (en) * 2019-07-05 2019-11-19 平安证券股份有限公司 Program detecting method, device and computer readable storage medium
CN110704068A (en) * 2019-10-18 2020-01-17 安徽中科国创高可信软件有限公司 Processing method and system for cross-file collaborative program analysis based on database
CN110704068B (en) * 2019-10-18 2023-02-17 安徽中科国创高可信软件有限公司 Processing method and system for cross-file collaborative program analysis based on database
CN111221519A (en) * 2019-11-12 2020-06-02 广州银汉科技有限公司 Python-based CLI automatic export method
CN113495728A (en) * 2020-03-18 2021-10-12 腾讯科技(深圳)有限公司 Dependency relationship determination method, dependency relationship determination device, electronic equipment and medium
CN111552466A (en) * 2020-05-12 2020-08-18 重庆科技学院 Project file generation method, system, computer equipment and storage medium
CN111552466B (en) * 2020-05-12 2023-03-31 重庆科技学院 Project file generation method, system, computer equipment and storage medium
CN111880805A (en) * 2020-07-20 2020-11-03 腾讯科技(深圳)有限公司 Method, device and equipment for generating package file of software project and storage medium
CN113031962A (en) * 2021-03-23 2021-06-25 北京百度网讯科技有限公司 Compiling method, compiling apparatus, electronic device, storage medium, and program product
JP2021192318A (en) * 2021-03-23 2021-12-16 北京百度網訊科技有限公司 Method and device for compiling, electronic device, storage medium, and program
CN113031962B (en) * 2021-03-23 2022-04-15 北京百度网讯科技有限公司 Compiling method, compiling apparatus, electronic device, storage medium, and program product
CN113031961A (en) * 2021-03-23 2021-06-25 北京百度网讯科技有限公司 Compiling method, compiling apparatus, electronic device, storage medium, and program product
JP7393404B2 (en) 2021-03-23 2023-12-06 ベイジン バイドゥ ネットコム サイエンス テクノロジー カンパニー リミテッド Compiling method, compiling device, electronic device, storage medium and program
CN113050952A (en) * 2021-04-19 2021-06-29 杭州至千哩科技有限公司 Pseudo instruction compiling method and device, computer equipment and storage medium
CN113050952B (en) * 2021-04-19 2024-07-05 杭州至千哩科技有限公司 Pseudo instruction compiling method, pseudo instruction compiling device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN109614106B (en) 2022-04-19

Similar Documents

Publication Publication Date Title
CN109614106A (en) A kind of C++ program compiling method and device
US8209703B2 (en) Apparatus and method for dataflow execution in a distributed environment using directed acyclic graph and prioritization of sub-dataflow tasks
Kulkarni et al. Correctness of component-based adaptation
CN106547527B (en) JavaScript file construction method and device
US20090150125A1 (en) Computer Method and Apparatus for Chaining of Model-To-Model Transformations
US11720532B2 (en) System and method for customized graphQL data-handling scripts
CN110543427B (en) Test case storage method and device, electronic equipment and storage medium
CN105204917B (en) The method and device of loading configuration file in application program launching
CN111722841A (en) Software componentization implementation method under IOS platform
CN108549535A (en) A kind of efficient procedure parsing method and system based on file dependence
CN113568604B (en) Method and device for updating wind control strategy and computer readable storage medium
CN107181747B (en) handle analytic system containing top-level node
CN111221888A (en) Big data analysis system and method
CN113360156B (en) IOS compiling method and related equipment
CN112817567B (en) Openwhisk no-service framework migration method for micro-service application
CN114594960A (en) Recursive function analysis execution method, device and storage medium
Bond et al. Eclipse feature logic analysis
Haller et al. A programming model and foundation for lineage-based distributed computation
Higashino et al. Attributed graph rewriting for complex event processing self-management
CN114860566A (en) Source code testing method and device, electronic equipment and storage medium
US20090199159A1 (en) Declarative execution context splitting
CN102866924B (en) Method and device for scheduling content integration engine
CN106156110A (en) text semantic understanding method and system
Khalfallah et al. Enhancing monitoring queries invoking composition of services
CN112306470B (en) Method for simplifying, converting and automatically verifying complex synchronous language program

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